LaTex Verbatim 环境下使用数学符号

参考:

Write math and make a box with alltt environment

LaTex Verbatim 环境下使用数学符号

在 Verbatim 环境下使用数学符号,需要借助额外的宏包,fancyvrb 。例如:

documentclass{article}
usepackage{fancyvrb}

egin{document}

egin{Verbatim}[commandchars=\{},
codes={catcode`$=3catcode`^=7catcode`_=8},frame=single]
some code test
$sum a_i$
end{Verbatim}

end{document}

2018.10

原文地址:https://www.cnblogs.com/qq952693358/p/9737319.html