von Gast » Di 30. Mai 2017, 10:51
Wenn Du nicht willst, dass die Abbildung gleitet, dann verwende keine figure-Umgebung. Sorge außerdem dafür, dass sie keine overfull oder underfull \hbox oder \vbox verursacht:
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}% utf8x bereitet mit diversen Paketen Probleme und
% ist selten sinnvoll
\usepackage{placeins}
\usepackage{mwe}
\usepackage{listings}
\lstset{numbers=left,
numberstyle=\tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
frame=l ,
xleftmargin=15pt,
xrightmargin=15pt,
basicstyle=\ttfamily\small,
stepnumber=1,
}
\begin{document}
\FloatBarrier
\section{Anhang}
\includegraphics[width=\textwidth,height=.92\textheight]{example-image}
%\lstinputlisting[language=Python]{Test.py}
\begin{lstlisting}
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
\end{lstlisting}
\end{document}
Natürlich ginge auch
\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}% utf8x bereitet mit diversen Paketen Probleme und
% ist selten sinnvoll
\usepackage{placeins}
\usepackage{mwe}
\usepackage{listings}
\lstset{numbers=left,
numberstyle=\tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
frame=l ,
xleftmargin=15pt,
xrightmargin=15pt,
basicstyle=\ttfamily\small,
stepnumber=1,
}
\begin{document}
\section{Anhang}
\begin{figure}[!htp]
\includegraphics[width=\textwidth,height=.92\textheight]{example-image}
\end{figure}
\FloatBarrier
%\lstinputlisting[language=Python]{Test.py}
\begin{lstlisting}
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
\end{lstlisting}
\end{document}
wäre aber ein wenig von hinten durch die Brust ins Knie.
Wenn Du nicht willst, dass die Abbildung gleitet, dann verwende keine [tt]figure[/tt]-Umgebung. Sorge außerdem dafür, dass sie keine overfull oder underfull [tt]\hbox[/tt] oder [tt]\vbox[/tt] verursacht: [code]\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}% utf8x bereitet mit diversen Paketen Probleme und
% ist selten sinnvoll
\usepackage{placeins}
\usepackage{mwe}
\usepackage{listings}
\lstset{numbers=left,
numberstyle=\tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
frame=l ,
xleftmargin=15pt,
xrightmargin=15pt,
basicstyle=\ttfamily\small,
stepnumber=1,
}
\begin{document}
\FloatBarrier
\section{Anhang}
\includegraphics[width=\textwidth,height=.92\textheight]{example-image}
%\lstinputlisting[language=Python]{Test.py}
\begin{lstlisting}
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
\end{lstlisting}
\end{document}[/code]
Natürlich ginge auch [code]\documentclass[12pt]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}% utf8x bereitet mit diversen Paketen Probleme und
% ist selten sinnvoll
\usepackage{placeins}
\usepackage{mwe}
\usepackage{listings}
\lstset{numbers=left,
numberstyle=\tiny,
numbersep=5pt,
breaklines=true,
showstringspaces=false,
frame=l ,
xleftmargin=15pt,
xrightmargin=15pt,
basicstyle=\ttfamily\small,
stepnumber=1,
}
\begin{document}
\section{Anhang}
\begin{figure}[!htp]
\includegraphics[width=\textwidth,height=.92\textheight]{example-image}
\end{figure}
\FloatBarrier
%\lstinputlisting[language=Python]{Test.py}
\begin{lstlisting}
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
print("This line will be printed.")
\end{lstlisting}
\end{document}[/code] wäre aber ein wenig von hinten durch die Brust ins Knie.