According to Richard Johnson's Elements of MATLAB Style paragraph 6, it is a best practice to keep content to within 80 characters. Although matlab-prettifier wraps lines nicely, in my opinion, wrapping should not be necessary if the included .m-file adheres to this best-practice line length. Is it possible to rescale the matlab-prettifier environment, such that the first 80 characters will not wrap?
A minimum example (with default wide margins) is shown below:
codeExample.m
%% This is a comment spanning 80 characters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
L = +(1/3)*sqrt((2*sqrt(2)*sqrt(G^4*(2*R^2-5*R+2))+G^2*(4-5*R))/(R));
texExample.tex
\documentclass[a4paper]{article}
\usepackage{inputenc}
\usepackage[numbered,]{matlab-prettifier}
\usepackage{geometry}
\begin{document}
\lstinputlisting[style=Matlab-editor]{codeExample.m}
\end{document}
\usepackage{showframe}
. Try\usepackage{geometry} \geometry{ a4paper, total={170mm,257mm}, left=20mm, top=20mm, }
basicstyle
to use a smaller font (see section 8.2 of thematlab-prettifier
manual). But this would not improve readability …