0

I'm writing a seminar paper about a Client-Server Application and I try to include the code I implemented. I do so with

\begin{figure} [H]

\begin{lstlisting} 


\end{lstlisting}
\caption{Die Datei package.json}
\label{packagejson}
\end{figure}

, so that it is mentioned in listoffigures. The problem I have now is that the listing inside the figure has to be on one side an can't be splitted. I also cannot scale it to a certain size ( I tried using minipage ...) . Do I have to make two Listings if it does not fit on one page?

Thanks for your help!

  • Did you have a look at alternatives (e.g. not using list of figures, but an own list)? And what's about tcblisting (from tcolorbox) as a alternative allowing pagebreaks? BTW: It would be nice, if you could extend your code to be a MWE. – TeXnician Feb 21 '17 at 11:12
  • I just solved the problem. I did want to have the caption inside the listoffigures and therefore had to put them inside the figure environment. After a research I did find that there is a thing called \lstlistoflistings that does the same for listings. Thanks for your help :) – s kop Feb 21 '17 at 13:10
2

I just solved the problem. I did want to have the caption inside the listoffigures and therefore had to put them inside the figure environment. After a research I did find that there is a thing called

\lstlistoflistings 

that does the same for listings. Thanks for your help :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.