TransWikia.com

How can I patch mintinline to work with breaklines and mathmode?

TeX - LaTeX Asked on December 22, 2020

I’ve recently reported a bug in the minted package that this works:

documentclass{article}
usepackage{minted}
begin{document}
$mintinline{c}{void foo}$
end{document}

but

documentclass{article}
usepackage{minted}
setmintedinline{breaklines}
begin{document}
$mintinline{c}{void foo}$
end{document}

gets me LaTeX Error: Command ttfamily invalid in math mode. I know I can easily fix this by wrapping mintinline in text from amsmath on a location-by-location basis, but I’d like to fix it once and for all in my preamble. I thought I could do something with xpatchcmd, but the definition of mintinline is beyond my ability to patch. Is there a good way to fix this in the preamble of my document?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP