latex-to-md
1
总安装量
1
周安装量
#53466
全站排名
安装命令
npx skills add https://github.com/mearman/marketplace --skill latex-to-md
Agent 安装分布
claude-code
1
Skill 文档
LaTeX to Markdown Converter
Convert LaTeX documents to Markdown format with support for common LaTeX commands and environments.
Usage
npx tsx plugins/tex/scripts/latex-to-md.ts <text>
npx tsx plugins/tex/scripts/latex-to-md.ts --file <input.tex>
npx tsx plugins/tex/scripts/latex-to-md.ts --file <input.tex> --output <output.md>
Supported Conversions
Sections/Headers
\chapter{Title}â# Title\section{Title}â## Title\subsection{Title}â### Title\subsubsection{Title}â#### Title\paragraph{Title}â##### Title\subparagraph{Title}â###### Title
Text Formatting
\textbf{bold}â**bold**\textit{italic}â*italic*\emph{emphasis}â*emphasis*\texttt{code}â`code`\verb|code|â`code`
Code Blocks
\begin{verbatim}
code here
\end{verbatim}
â
```
code here
```
Also supports lstlisting environment.
Lists
Itemize (unordered):
\begin{itemize}
\item First item
\item Second item
\end{itemize}
â
- First item
- Second item
Enumerate (ordered):
\begin{enumerate}
\item First
\item Second
\end{enumerate}
â
1. First
2. Second
Links
\href{url}{text}â[text](url)\url{url}â<url>
Images
With caption (figure environment):
\begin{figure}
\includegraphics{image.png}
\caption{Description}
\end{figure}
â

Without caption:
\includegraphics{image.png}â\includegraphics[width=5cm]{image.png}â(options stripped)
Blockquotes
\begin{quote}
This is a quote
\end{quote}
â
> This is a quote
Horizontal Rules
\hrulefillâ---\hlineâ---
Unicode Character Decoding
LaTeX special characters are automatically decoded to Unicode:
\'{e}âé\"{a}âä\c{c}âç\aeâæ\oeâÅ\ssâÃ- And ~100 more LaTeX commands
See tex-decode skill for complete list of supported characters.
Math Preservation
LaTeX math notation is preserved as-is:
- Inline math:
$...$remains$...$ - Display math:
$$...$$remains$$...$$
Many Markdown renderers support this syntax natively.
Arguments
- Positional arguments: Text to convert (if no
--fileflag) --file: Read input from file--output <file>: Write output to file (default: stdout)
Examples
Convert inline text
npx tsx plugins/tex/scripts/latex-to-md.ts "\\section{Hello}\n\nThis is \\textbf{bold}."
Convert file
npx tsx plugins/tex/scripts/latex-to-md.ts --file paper.tex --output paper.md
Extract plain text from LaTeX
npx tsx plugins/tex/scripts/latex-to-md.ts --file document.tex | npx tsx plugins/tex/scripts/strip.ts
Limitations
- Does not handle complex LaTeX packages or custom commands
- Tables are not automatically converted (LaTeX tables vary widely in structure)
- Cross-references (
\ref,\cite) are not resolved - Bibliographies require separate handling
- Complex math environments may need manual adjustment
- Nested environments beyond simple cases may not convert perfectly
Related Skills
- md-to-latex: Convert Markdown to LaTeX
- tex-decode: Decode LaTeX commands to Unicode (used internally)
- tex-strip: Remove all LaTeX formatting for plain text
- tex-protect: Protect text from LaTeX interpretation