markdown-latex
is an executable app for converting markdown to latex.
Tips: the code for this project is mainly generated by neural network (but this readme is written by human).
$ markdown-latex foo.md
It will generate foo.tex
in the same path.
$ markdown-latex foo.md build/foo.tex
Use second argument to define the output path manually.
$ markdown-latex --help
Use --help
to get help message.
If you are prompted that you cannot open the program when using binaries from GitHub release, try the following steps:
- Right-click on the app.
- Hold down the Option key and click Open.
- The app will run and exit immediately. Then you can use this app normally.
Name | Markdown | Generated LaTeX | Tips |
---|---|---|---|
Chapter | # |
\chapter{} |
|
Section | ## |
\section{} |
|
Subsection | ### |
\subsection{} |
|
Sub-subsection | #### |
\subsubsection{} |
|
Sub-sub-subsection | ##### |
\paragraph{} |
|
Cite | [`<foo>`] |
\cite{<foo>} |
|
Hyperlink | [<foo>](<bar>) |
\href{<bar>}{<foo>} |
hyperref package needed |
Unordered list | - <foo> |
\begin{itemize} \item <foo> \end{itemize} |
|
Ordered list | 1. <foo> |
\begin{enumerate} \item <foo> \end{enumerate} |
|
Inline equation | $<foo>$ |
$<foo>$ |
|
Equation block | $$ {<label>} <foo> $$ |
\begin{equation} <foo> \label{eq:<label>} \end{equation} |
amsmath package needed |
Image |  |
\begin{figure}[h] \includegraphics{<path>} \caption{<caption>} \label{fig:<path>} \end{figure} |
graphicx package needed |
Bold | **<foo>** |
\textbf{<foo>} |
|
Italic | *<foo>* |
\textit{<foo>} |
|
Table | Markdown table | tabularx table |
tabularx package needed |
Code block | Markdown code block | listings code block |
listings package needed |
You can use markdown heading class .unnumbered
to make a heading unnumbered. It won't be in contents if a heading is unnumbered. Use .add-contents
to add the heading to contents manually.
### This is a unnumbered heading {.unnumbered .add-contents}
See file_test/test.md
and file_test/test.tex
.