5

I write comprehensive documentation in LaTeX and use the markdown package for quick writing and to get easily readable source code.

Markdown simplifies writing. But how can I still use LaTeX macros within Markdown text?

\documentclass{article}
\usepackage[tightLists=false]{markdown}
\begin{document}
\begin{markdown}
# Workflows
Two options:

- Embedding Markdown in \LaTeX 
- Using Pandoc with \LaTeX\ inside Markdown
\end{markdown}
\end{document}

This gives:

LaTeX output

I did not yet find a way in the markdown manual or in markdown.lua to disable rendering the backslash and to let macros be expanded. Do you know a way?

4

Use the option hybrid=true:

\documentclass{article}
\usepackage[tightLists=false,hybrid=true]{markdown}

\begin{document}

\begin{markdown}
# Workflows
Two options:

- Embedding Markdown in \LaTeX
- Using Pandoc with \LaTeX\ inside Markdown
\end{markdown}
\end{document}

enter image description here

See page 10 in the manual:

enter image description here

  • Thanks! Looks obvious now, I just did not find this in the manual, neither by browsing nor by keyword search for "macro" or "backslash" with that phrasing in the manual. – Stefan Kottwitz Jun 14 '17 at 10:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.