2

The following is an simple example, as you can see the code go beyond the page, how could I make it sits within the linewidth with pre-determined margin of the document? Thank you.

\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{python}
import numpy as np

def incmatrix(genl1,genl2, a, dddfdfd, gdgd, ddfds ,dd, dfdf, enl1,genl2, a, dddfdfd, gdgd, ddfds ,dd, dfdfdfggf, fdfd): m = len(genl1) n = len(genl2)

return 

\end{minted} \end{document}

G-09
  • 123
  • 4

1 Answers1

3

You could use the breaklines=true option to allow line breaks:

% !TeX program = txs:///arara
% arara: pdflatex: {synctex: on, interaction: nonstopmode, shell: yes}
\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}[breaklines=true]{python}
import numpy as np

def incmatrix(genl1,genl2, a, dddfdfd, gdgd, ddfds ,dd, dfdf, enl1,genl2, a, dddfdfd, gdgd, ddfds ,dd, dfdfdfggf, fdfd): m = len(genl1) n = len(genl2)

return 

\end{minted} \end{document}

enter image description here