# Md2tex

> >-

- **Type:** Skill
- **Install:** `agentstack add skill-phanghonghao-thu-awesome-skills-md2tex`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [phanghonghao](https://agentstack.voostack.com/s/phanghonghao)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [phanghonghao](https://github.com/phanghonghao)
- **Source:** https://github.com/phanghonghao/THU-Awesome-Skills/tree/main/skills/md2tex

## Install

```sh
agentstack add skill-phanghonghao-thu-awesome-skills-md2tex
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# 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

```bash
# Convert MD → TEX + PDF
python ~/.claude/skills/md2tex/md2tex.py ""

# Specify output directory
python ~/.claude/skills/md2tex/md2tex.py "" --output-dir 

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

## Features

| Feature | Support |
|---------|---------|
| Chinese text | ctex package (XeLaTeX) |
| Headings (#, ##, ###) | \section, \subsection, \subsubsection |
| Tables | tabular with \hline |
| Images  | \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

| | md2tex | latex-beamer |
|--|--------|-------------|
| Document type | Article/Report | Presentation slides |
| Class | `\documentclass{article}` | `\documentclass{beamer}` |
| Output | .tex + .pdf | .tex + .pdf + .pptx |
| Complexity | Simple conversion | Full sync + incremental updates |

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [phanghonghao](https://github.com/phanghonghao)
- **Source:** [phanghonghao/THU-Awesome-Skills](https://github.com/phanghonghao/THU-Awesome-Skills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-phanghonghao-thu-awesome-skills-md2tex
- Seller: https://agentstack.voostack.com/s/phanghonghao
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
