2
votes

Is there a way to set the default colour of inline verbatim snippets (`...`) in Pandoc markdown? For example, that all the verbatims in a document will be red instead of black?

I know, I can do, e.g.

Normal text `verbatim`{.bash} normal text

for syntax-highlighting the verbatim snippet. However, what I want is a simple default colour for all verbatim snippets.

I use pandoc for converting to PDF via LaTeX, and I use a LaTeX template. I can make any changes to the LaTeX template, if this allows to enable this behaviour.

1

1 Answers

6
votes

Pandoc converts verbatim content into \texttt{} in LaTeX. You could redefine this command to style it:

\usepackage[usenames, dvipsnames]{color}

% overwrite \texttt command to use coloring
\let\oldTexttt\texttt
\renewcommand{\texttt}[1]{\oldTexttt{\textcolor{red}{#1}}}

If you include the snippet above in your LaTeX template, your pdf will contain red verbatim content.