0

I am trying to include a Matlab code in a latex document. The package minted works well for this purpose despite one quirk: the variables and function containing underscore symbol "_" do not display correctly (but as "'" symbol). For example, following code:

\documentclass{article}
\usepackage{xcolor}
\definecolor{bg}{gray}{.9}
\usepackage{minted}
\begin{document}
\begin{minted}[linenos=false,tabsize=2,breaklines,bgcolor=bg]{matlab}
Test characters with underscore like this: word_underscore.
\end{minted}
\end{document}

results in: enter image description here

Is there a way out this of issue? Any help much appreciated!

David Carlisle
  • 757,742

0 Answers0