Search code examples
latexmediawikisyntax-highlightingpandoc

Converting code listings from mediawiki to latex using pandoc


Is there an easy way to say pandoc converter I wish to replace all my source codes in mediawiki article convert to an lstlisting environment on its Latex output?

At this moment, all my <source lang="c"> some code... </source> environments are converted into something like this

\begin{Shaded}\begin{Highlighting}[]
\NormalTok{         some code \textless{}\textless{} }\DecValTok{1}\NormalTok{ \CommentTok{// set... \end{Highlighting}
\end{Shaded}

Not only the code is completely unreadable but also my Latex distribution is not able to translate the code and is missing probably some packages.

I wish to have simply \begin{lstlisting} some code \end{lstlisting} at the output with no additional changes to the code itself.

And I don't speak Haskell, believing there should be an easier way...


Solution

  • Solution was very simple. There is a --listings command line option solving this problem as Sam Carter pointed out.