Tom Kwok

LaTeX notes

This post presents my notes on using LaTeX and samples of my notes in LaTeX.

Ruby text annotation #

For my notes typeset in LaTeX there is a heavy use of ruby text annotation achieved with \underset and \overset originally intended for mathematical expressions in LaTeX. An example of text annotated with \underset that is a speech from movie V for Vendetta (2005) is made for fun.

V alliteration

SVG graphics from LaTeX expressions #

LaTeX expressions are prepared with the convenience of GUI document processor LyX that includes a mathematical expression editor. For presentation on this blog, rendered LaTeX expressions are saved in Scalable Vector Graphics (SVG) format, which is compatible with browsers currently used by over 99% of internet users.

Embedding rendered LaTeX expressions as graphics in SVG format avoids introducing dependency to JavaScript libraries for rendering of LaTeX mathematical expressions, such as MathJax, KaTeX or jqMath. This keeps the website free of JavaScript scripts.

Automation for the workflow of LyX to pdflatex to pdfcrop --margins 10 to pdf2svg to svgcleaner --multipass enables exporting of a rendered LyX document that is cropped with margins to losslessly optimized SVG files by simply selecting File -> Export -> More Formats & Options... -> SVG.

To introduce support for exporting to SVG file that is built on the support for exporting to PDF file in LyX, Converter Definitions in Preferences -> File Handling -> Converters are customized with reference to customization documentation as follows.

#!/usr/bin/env bash
pdf2svg $1 $1.tmp.%d.svg all
for f in $(ls -1 $1.tmp.*.svg); do
svgcleaner --multipass $f $2$(basename ${f/.pdf.tmp/})
rm $f

In addition, enable Show in export menu for Format SVG in Preferences -> File Handling -> File Formats to reduce the number of clicks needed to export an LyX document to SVG.

Other customizations in LyX #

Examples of my other customizations in LyX accumulated over the years include:

Examples of study notes typeset in LaTeX using editor LyX #

All of my electronic study notes since 2014 have been prepared using LyX as I read textbooks, lecture slides and internet resources and also work on exercises and past examination papers.

Most of my notes are packed in a condensed layout such that they work as cheat-sheets for examination although the philosophy of making a cheat-sheet is to learn a topic by taking notes for it. Most notes are structured hierarchically with multiple levels of bullet points. A non-exhaustive selection of my notes is as follows.

Computer Graphics (2019) course notes in PDF format ↓

Computer Graphics (2019) course notes

Some notes are structured in points implicitly without the bullet symbols. Some notes include diagrams drawn with LaTeX symbols. An example is as follows.

Software Engineering (2018) course notes in PDF format ↓

Software Engineering (2018) course notes

Some notes include annotated code snippets and tables for reference. An example is my own study notes for Linux terminal tools with a philosophy similar to that of tldr examples for man pages.

Programming Technologies and Tools (2017) course notes in PDF format ↓

Programming Technologies and Tools (2017) course notes

Other notes are a collection of worked problems in mathematics and computer science with emphasis on proofs and the use of algorithms demonstrated.

Data Structures and Algorithms (2018) worked problems in PDF format ↓

Data Structures and Algorithms (2018) worked problems

Resources on LyX and LaTeX #

More detailed LyX resources may be found in:

General LaTeX resources include:

Other notes #

For bibliography management in my LaTeX report writing work flow, cross-platform GUI application Zotero with Better BibTeX extension, which handles automatic exporting to BibTeX format, have better browser integration and better automatic PDF meta-data filling than Mac application BibDesk for BibTeX management.

My résumé or curriculum vitae is made LaTeX with moderncv document class in banking style with bullet points for entries.

An interesting further reading is the story of Donald Knuth, the creator of TeX typesetting system.