Skip to content

Instantly share code, notes, and snippets.

@wusunlab
Created May 10, 2018 09:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wusunlab/9c85fcb7472308a474e7c3fb443639ee to your computer and use it in GitHub Desktop.
Save wusunlab/9c85fcb7472308a474e7c3fb443639ee to your computer and use it in GitHub Desktop.
Use background color for inline code (\texttt) in pandoc converted LaTeX
% add this argument to pandoc when converting markdown to LaTeX
% --include-in-header="./pandoc-inline-code-bg.tex"
% Reference
% <https://tex.stackexchange.com/questions/411194/package-soul-error-reconstruction-failed>
\usepackage{xcolor}
\usepackage{soul}
\definecolor{inlineBG}{HTML}{F3F3F3} % same as GitHub Flavored Markdown
\sethlcolor{inlineBG}
\let\OldTexttt\texttt
\renewcommand{\texttt}[1]{\sethlcolor{inlineBG}{\ttfamily\hl{\mbox{#1}}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment