答案1
breaklines
是minted
从fvextra
包(其依赖项之一)继承的一个选项。您可以breaklines
在多个地方使用:
\setminted{<options>}
,\setmintedinline{<options>}
,\begin{minted}[<options>]{<language>}
\inputminted[<options>]{<language>}{<file>}
查看其包装手册以获取更多信息:http://mirrors.ctan.org/macros/latex/contrib/minted/minted.pdf
\begin{filecontents}[noheader, force]{test.m}
function [x] = test(a)
x = a + 2 % Here is a very very very long comment which is going to cause me a lot of trouble
endfunctin
\end{filecontents}
\documentclass{article}
\usepackage{minted}
\setminted{breaklines}
\begin{document}
\inputminted{matlab}{test.m}
\end{document}