Created
May 10, 2018 09:35
-
-
Save wusunlab/9c85fcb7472308a474e7c3fb443639ee to your computer and use it in GitHub Desktop.
Use background color for inline code (\texttt) in pandoc converted LaTeX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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