Search code examples
latexdocxpandoc

Check if latex code is processed by Pandoc or *tex


When converting a latex file to word, I'd like to skip some sections which Pandoc does not handle well, or redefine commands which pandoc does not understand. Now I use the following highly unelegant mechanism:

\iffalse
    % code executed by pandoc only
    \def\SI#1#2{#1\,\mathrm{#2}}
\fi

What is the correct way make pandoc execute (or skip) some sections of code?


Solution

  • I guess it is not available now. There is another post open and not answered yet. And I found also an open issue for this behavior.