I use Pandoc to generate an output from a Markdown file to many outputs: html, word (.docx), latex, pdf, etc.
I tried using the "fenced div" feature to style differently some parts of the text. For example:
blablabla.
:::: special
Some special text, with markdown formatting.
::::
To style that block with Html, it's fairly straight forward. I have a template.css
file that includes a .special {background-color: #aaaaaa;}
line and it's done (it's referenced in my command line arguments).
I also have a template.latex
file, but I'm less fluent in all things Latex. I've tried in many ways and couldn't find how to tweak it to apply a style to pandoc fenced divs. In the raw Latex file that it outputs, there's not even a command indicating that there was something there. It's just ignored.
I've searched a long time for this answer, and I can't find any clue. Thanks in advance.
Best Answer
You need a lua filter to process the fenced div:
This will transform the div to a latex environment:
You mustn't forget do define the environment in your template: