I'm trying to build up a new documentation system using Markdown and LaTeX. After several hours most things are running smooth, but tables are a bit complicated.

Most of the text can be written with Markdown syntax, included by


But tables with defined cell-widths and multicolumns have to be done in LaTeX native code.

To make the document more easy to write down, I am planning to create a LaTeX macro creating these tables. So the writer only has to fill some macro variables and LaTeX is buliding the table.

Even this is almost working BUT

I have to stop the Markdown environment with \end{markdown} just before creating the table and entable Markdown with \begin{markdown}. This isn't working well within the document like:


    {parameter 1}
    {parameter 2}


But, when trying to put these commands to the macro like


\begin{longtable}{>{\columncolor[gray]{0.8}}p{2.5cm}|p{2.5cm} p{2.5cm} p{3.5cm} p{2.5cm}}
        Cell1&\multicolumn{2}{l}{S\{1\} #1}&\multicolumn{2}{r}{#2}\\\hline
        Cell x&cell y &\multicolumn{1}{c}{\textbf{cell w}}&cell z&\multicolumn{1}{c}{\textbf{6}}\\

an using the macro like


    {parameter 1}
    {parameter 2}


LaTeX complains about

\begin{document} ended by \end{markdown}.

Seems ending markdown within the makro is not working very well. And yes, ending markdown at the beginning of a macro and starting markdown at the ending of a macro maybe bad code, but I'd like to create a table with just a single command.

Any suggestions to a big LaTeX noop?

  • you have not provided any usable example so it is hard to answer but if the markdown environment changes catcodes then it is like verbatim and can not be used in the argument of any command. Mar 8, 2019 at 9:35
  • Since the release of version 2.8.0, the Markdown package supports tables.
    – Witiko
    Jun 4, 2019 at 1:30

1 Answer 1


I did find a solution.

Within the macro, I have to use \endmarkdown{} instead of \end{markdown}.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .