Script-first workflow for updating LuaLaTeX cheatsheets from Markdown while preserving compact multi-column layout.
- Script-first conversion + mandatory manual tightening after the first compile.
- UTF-8 Chinese preserved; prefer short inline formulas in multi-column layout.
SKILL.md: workflow and rules used by the skill.scripts/md_to_cheatsheet_tex.py: convert a chapter Markdown file into\topic/\subtopic/\parblocks and insert/replace them.scripts/init_cheatsheet.py: initialize a new cheatsheet from templates.assets/cheatsheet-template-empty.tex: blank template with layout settings.assets/cheatsheet-template.tex: full template example.
- (Optional) Initialize a new cheatsheet:
python scripts/init_cheatsheet.py output.tex --columns 7 --font-size 5 --line-height 5
- Update a chapter from Markdown:
python scripts/md_to_cheatsheet_tex.py chapter.md output.tex
- Compile once with LuaLaTeX to catch compatibility errors:
latexmk -lualatex -synctex=1 -interaction=nonstopmode -file-line-error -outdir=out output.tex
- Manually tighten layout, then recompile.
- Avoid display math (
\[...\]); use inline$...$unless a very short display is clearer. - Split long formulas into two
\parlines (break at=or+) to prevent column overflow. - Merge adjacent
\parlines when readability is still OK.
- Remove Markdown blockquotes (
>); convert$$...$$to inline$...$or two-line\parformulas. - Escape
#inside text or\text{...}as\#/\text{\# ...}. - Replace emoji/Unicode math symbols with LaTeX commands (e.g.,
\Rightarrow,\lceil...\rceil,\cdot). - If the .tex is locked, stop
latexmk/lualatexbefore editing.
- Verify Chinese in the editor (terminal output can be mojibake).
- Prefer ASCII paths or quoted absolute paths in PowerShell when non-ASCII paths cause issues.
