Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Latex Cheatsheet Updater Skill

Script-first workflow for updating LuaLaTeX cheatsheets from Markdown while preserving compact multi-column layout.

Example

Overview

  • Script-first conversion + mandatory manual tightening after the first compile.
  • UTF-8 Chinese preserved; prefer short inline formulas in multi-column layout.

Files

  • SKILL.md: workflow and rules used by the skill.
  • scripts/md_to_cheatsheet_tex.py: convert a chapter Markdown file into \topic/\subtopic/\par blocks 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.

Quick Start (Script-First)

  1. (Optional) Initialize a new cheatsheet:
    python scripts/init_cheatsheet.py output.tex --columns 7 --font-size 5 --line-height 5
  2. Update a chapter from Markdown:
    python scripts/md_to_cheatsheet_tex.py chapter.md output.tex
  3. Compile once with LuaLaTeX to catch compatibility errors:
    latexmk -lualatex -synctex=1 -interaction=nonstopmode -file-line-error -outdir=out output.tex
  4. Manually tighten layout, then recompile.

Manual Tightening (Required)

  • Avoid display math (\[...\]); use inline $...$ unless a very short display is clearer.
  • Split long formulas into two \par lines (break at = or +) to prevent column overflow.
  • Merge adjacent \par lines when readability is still OK.

Post-Script Cleanup (Common Errors)

  • Remove Markdown blockquotes (>); convert $$...$$ to inline $...$ or two-line \par formulas.
  • 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/lualatex before editing.

Notes

  • 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.

About

Script‑first workflow to sync LuaLaTeX cheatsheets from Markdown, preserving UTF‑8 Chinese, compact multi‑column layout, and short formulas.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages