Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pandoc LaTex change ` backtick highlight

I am using pandoc along with LaTex to create pdf output.

I am highlighting some code using ` backticks.

The text within the backtick is just highlighted using a different font.

How can I change the color of the highlighted text along with the background color.

Note that this is for in-line highlighting.

like image 699
krv Avatar asked Nov 23 '25 16:11

krv


1 Answers

You could create a new file header.tex with this (from a tex.SE answer):

\usepackage{fancyvrb,newverbs,xcolor}

\definecolor{Light}{gray}{.90}

\let\oldtexttt\texttt
\renewcommand{\texttt}[1]{
  \colorbox{Light}{\oldtexttt{#1}}
}

And then compile your file with pandoc myfile.md -o myfile.pdf -H header.tex.

like image 67
scoa Avatar answered Nov 26 '25 23:11

scoa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!