agentleFS
phanghonghaophanghonghao/THU-Awesome-Skills/skills/md2tex/SKILL.md

md2tex

Skill8 starsChanged 3 months agoMITView on GitHub

Markdown to LaTeX + PDF converter. Converts .md to .tex (XeLaTeX + ctex) and compiles to .pdf. Supports Chinese, tables, images, math formulas, code blocks.

The file

Files
SKILL.md

md2tex — Markdown → LaTeX + PDF

将 Markdown 文件转换为 LaTeX 文档 (.tex),并用 MiKTeX 的 XeLaTeX 编译为 PDF。

When to Use

  • User says "md2tex", "md转tex", "转latex", "生成pdf", "转pdf"
  • User has a Markdown file and wants LaTeX source + compiled PDF
  • User needs a document/report (NOT presentation — use latex-beamer for that)

How to Use

# Convert MD → TEX + PDF
python ~/.claude/skills/md2tex/md2tex.py "<input.md>"

# Specify output directory
python ~/.claude/skills/md2tex/md2tex.py "<input.md>" --output-dir <dir>

# Only generate .tex, skip PDF compilation
python ~/.claude/skills/md2tex/md2tex.py "<input.md>" --no-compile

Features

FeatureSupport
Chinese textctex package (XeLaTeX)
Headings (#, ##, ###)\section, \subsection, \subsubsection
Tablestabular with \hline
Images Image: untitled\includegraphics with figure
Math (inline $...$, display $$...$$)amsmath
Code blocks (```)listings package
Bold/Italic\textbf, \textit
Horizontal rule (---)\rule

Output

For input report.md:

  • report.tex — LaTeX source (fully compilable with XeLaTeX)
  • report.pdf — Compiled PDF

Dependencies

  • MiKTeX with XeLaTeX: C:\MiKTeX\miktex\bin\x64\xelatex.exe
  • Python 3 (no extra packages needed for basic usage)

Differences from latex-beamer

md2texlatex-beamer
Document typeArticle/ReportPresentation slides
Class\documentclass{article}\documentclass{beamer}
Output.tex + .pdf.tex + .pdf + .pptx
ComplexitySimple conversionFull sync + incremental updates

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.