This is a feature request to add a Markdown extension markdown_in_tex_blocks like markdown_in_html_blocks according to the discussion in the mailing list: https://groups.google.com/forum/#!msg/pandoc-discuss/ggcrRN-ja-s/lNeILZdlBwAJ Thanks!
+1
That is a feature I really would like to see.
I am trying to put two separate tables next to each other on the same line.
\begin(minipage}[b]{8mm}
end{minipage}
\begin(minipage}[b]{8mm}
end{minipage}
Workaround for this issue was proposed here
You can also add it in YAML header, on top of markdown file:
header-includes:
- \newcommand{\hideFromPandoc}[1]{#1}
\hideFromPandoc{
\let\Begin\begin
\let\End\end
}
---
and use \Begin{whatever} and \End{whatever} instead \begin{whatever} and \end{whatever}
So @andreatta tables would look like this:
\Begin(minipage}[b]{8mm}
#table 1
\End{minipage}
\Begin(minipage}[b]{8mm}
#table 2
\End{minipage}
@jakkubu Sounds like an interesting idea. Thanks!
Why not officialize the Begin/End workaround by including it as a default header for tex and documenting it as a "parsed environment"?
That would be great, but it is not important to me now. I have added \let\Begin\begin in the preamble automatically in my use cases, and got some pretty environments in both HTML and PDF output, e.g. https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html
Thanks for the link @yihui, it looks really nice.
Btw, I've suggested adding a fake tex command that instructs pandoc to parse its contents as markdown https://github.com/jgm/pandoc/issues/3145, thus allowing reentering the parser in a more official and clean fashion. Do you think we should merge both issues?
@memeplex I definitely agree with you. It is just that I could wait any longer. My implementation details are totally hidden from users, so if some day what you envisioned becomes true, I can easily switch to the official approach without changing my top-level API.
I read your https://bookdown.org/yihui/bookdown/markdown-extensions-by-bookdown.html and sees some amsthm def. Have you tried my pandoc-amsthm mentioned in #1608?
And just to cross-reference what I mentioned in #3368:
I think the much better and stable way to do is via filter. There's a few mentioned in Pandoc Filters 路 jgm/pandoc Wiki, e.g.
Some comments on the hacks mentioned in this thread:
The way to circumvent the pandoc's parsing of LaTeX environment is very "MultiMarkdown"-like. What I mean is it is very similar to the idea of MultiMarkdown's toggling of raw LaTeX commands. In the past (when I was from MultiMarkdown and not using pandoc yet), I have some success writing documents this way to target dual output (LaTeX and HTML). But ultimately I abandoned that approach because the source looks very ugly and hacky and difficult to maintain. (For example, a lot of text expansion might be needed to deal with the ugly syntaxes and glues and hacks.)
The forte of pandoc not only lies in multiple input and output formats, but also about the filter system (allowed by the internal AST design). It takes some learning curve at the beginning, but ultimately really worth it. If some are new to filters, I suggest @sergiocorreia's panflute. It has a very mild learning curve and things can get done very quickly. Not to mention the ease in maintaining the code. i.e. clean source in markdown and python, clean output in any formats. Win-win.
Most helpful comment
Workaround for this issue was proposed here
You can also add it in YAML header, on top of markdown file:
and use
\Begin{whatever}and\End{whatever}instead\begin{whatever}and\end{whatever}So @andreatta tables would look like this: