I need to put my code for a software I have written in my thesis appendix. There's about 4000 lines of code across multiple files, so I'd like to have 100 lines of code per page.
Using these settings, I get about 30 lines and the comments wrap which takes up extra space (even though in my matlab code I already wrapped comments).
%matlab stuff
\usepackage[framed, numbered]{matlab-prettifier}
\usepackage{listings, color}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}
\lstdefinestyle{mystyle}{
backgroundcolor=\color{white},
commentstyle=\color{codegreen},
keywordstyle=\color{magenta},
numberstyle=\fontsize{6}{5}\color{codegray},
stringstyle=\color{codepurple},
basicstyle=\fontsize{6}{5},
breakatwhitespace=false,
breaklines=true,
captionpos=b,
keepspaces=true,
numbers=left,
numbersep=5pt,
showspaces=false,
showstringspaces=false,
showtabs=false,
tabsize=2
}
\lstset{style=mystyle}
and in the appendix:
\lstinputlisting[style = Matlab-editor]{GINA_Analyser.m}
Using resizebox, I end up with the whole code attempting to fit on one page, like this. This code is within the appendix section:
\resizebox{\textwidth}{!}{\lstinputlisting[style = Matlab-editor]{FileValidator.m}}
Is there something I can do?