In pull request #1541, John MacFarlane floated the idea of having a Pandoc writer whose output could be “processed by plain tex (or perhaps eplain), without latex or context macros.” In their proof of concept, Dominik Rehák explores what this would look like in practice. 

Dominik’s proof of concept contains a custom Lua writer pandoc-to-markdown.lua that you can use as follows: 

$ cat > example.md
Under his pillow P'raps found  
~~A cake that weighed a half a pound.~~  
A plenty of space to roll around.

 $ pandoc -i example.md -f pandoc-to-markdown.lua -o example.tex
$ cat example.tex
\pandocDocumentBegin
Under\pandocSpace{}his\pandocSpace{}pillow\pandocSpace{}P’raps\pandocSpace{}found\pandocLineBreak
\pandocStrikeout{A\pandocSpace{}cake\pandocSpace{}that\pandocSpace{}weighed\pandocSpace{}a\pandocSpace{}half\pandocSpace{}a\pandocSpace{}pound.}\pandocLineBreak
A\pandocSpace{}plenty\pandocSpace{}of\pandocSpace{}space\pandocSpace{}to\pandocSpace{}roll\pandocSpace{}around.
\pandocDocumentEnd

To typeset the example document, you can use a macro package that defines how the various \pandoc... commands should be formatted. For LaTeX, the proof of concept contains the pandoc-to-markdown.sty style file that you can use as follows: 

$ cat > example.ltx
\documentclass{article}
\usepackage{pandoc-to-markdown}
\begin{document}
\input example.tex
\end{document} 

$ pdflatex example.ltx

Here is the output document example.pdf:

 example.png

The proof-of-concept contains many more examples for you to try out in the examples/ directory.

Dominik's work is part of their bachelor's thesis, which is to appear this fall. Dominik has already published two articles about their work in hobbyist journals: the CSTUG Bulletin 31:1–4 (in Slovak, see a machine translation to English) and in TUGboat 43:1 (see Section 2.3). The implementation rests on my Markdown package for TeX, which provides formatting for most elements of the Pandoc AST across different TeX formats such as plain TeX, LaTeX, and ConTeXt. 

Here are some limitations of the proof of concept:

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/51539828-c876-437b-bb1e-a5efcf752762n%40googlegroups.com.