fixed page breaking of code and exercises

This commit is contained in:
2020-12-11 23:22:40 +01:00
parent 0380b7a96f
commit 0e30a01a45
13 changed files with 362 additions and 538 deletions

View File

@@ -3,7 +3,7 @@
\input{../../header}
\lstset{inputpath=../code}
\graphicspath{{images/}}
\graphicspath{{figures/}}
\typein[\pagenumber]{Number of first page}
\typein[\chapternumber]{Chapter number}

View File

@@ -148,7 +148,7 @@ or the color. For additional options consult the help.
The following listing shows a simple line plot with axis labeling and a title
\lstinputlisting[caption={A simple plot showing a sinewave.},
\pageinputlisting[caption={A simple plot showing a sinewave.},
label=simpleplotlisting]{simple_plot.m}
@@ -162,10 +162,10 @@ chosen, and star marker symbols is used. Finally, the name of the
curve is set to \emph{plot 1} which will be displayed in a legend, if
chosen.
\begin{lstlisting}[label=settinglineprops, caption={Setting line properties when calling \varcode{plot}.}]
\begin{pagelisting}[label=settinglineprops, caption={Setting line properties when calling \varcode{plot}.}]
x = 0:0.1:2*pi; y = sin(x); plot( x, y, 'color', 'r', 'linestyle',
':', 'marker', '*', 'linewidth', 1.5, 'displayname', 'plot 1')
\end{lstlisting}
\end{pagelisting}
\begin{important}[Choosing the right color.]
Choosing the perfect color goes a little bit beyond personal
@@ -277,7 +277,7 @@ the last one defines the output format (box\,\ref{graphicsformatbox}).
listing\,\ref{niceplotlisting}.}\label{spikedetectionfig}
\end{figure}
\begin{ibox}[t]{\label{graphicsformatbox}File formats for digital artwork.}
\begin{ibox}[tp]{\label{graphicsformatbox}File formats for digital artwork.}
There are two fundamentally different types of formats for digital artwork:
\begin{enumerate}
\item \enterm[bitmap]{Bitmaps} (\determ{Rastergrafik})
@@ -322,7 +322,7 @@ the last one defines the output format (box\,\ref{graphicsformatbox}).
efficient.
\end{ibox}
\lstinputlisting[caption={Script for creating the plot shown in
\pageinputlisting[caption={Script for creating the plot shown in
\figref{spikedetectionfig}.},
label=niceplotlisting]{automatic_plot.m}
@@ -380,7 +380,7 @@ draw the data. In the example we also provide further arguments to set
the size, color of the dots and specify that they are filled
(listing\,\ref{scatterlisting1}).
\lstinputlisting[caption={Creating a scatter plot with red filled dots.},
\pageinputlisting[caption={Creating a scatter plot with red filled dots.},
label=scatterlisting1, firstline=9, lastline=9]{scatterplot.m}
We could have used plot for this purpose and set the marker to
@@ -395,8 +395,7 @@ manipulate the color we need to specify a length(x)-by-3 matrix. For
each dot we provide an individual color (i.e. the RGB triplet in each
row of the color matrix, lines 2-4 in listing\,\ref{scatterlisting2})
\lstinputlisting[caption={Creating a scatter plot with size and color
\pageinputlisting[caption={Creating a scatter plot with size and color
variations. The RGB triplets define the respective color intensity
in a range 0:1. Here, we modify only the red color channel.},
label=scatterlisting2, linerange={15-15, 21-23}]{scatterplot.m}
@@ -431,7 +430,7 @@ figures\,\ref{regularsubplotsfig}, \ref{irregularsubplotsfig}).
also below).}\label{regularsubplotsfig}
\end{figure}
\lstinputlisting[caption={Script for creating subplots in a regular
\pageinputlisting[caption={Script for creating subplots in a regular
grid \figref{regularsubplotsfig}.}, label=regularsubplotlisting,
basicstyle=\ttfamily\scriptsize]{regular_subplot.m}
@@ -458,7 +457,7 @@ create a grid with larger numbers of columns and rows, and specify the
used cells of the grid by passing a vector as the third argument to
\code{subplot()}.
\lstinputlisting[caption={Script for creating subplots of different
\pageinputlisting[caption={Script for creating subplots of different
sizes \figref{irregularsubplotsfig}.},
label=irregularsubplotslisting,
basicstyle=\ttfamily\scriptsize]{irregular_subplot.m}
@@ -516,7 +515,7 @@ its properties. See the \matlab{} help for more information.
listing\,\ref{errorbarlisting} for A and C and listing\,\ref{errorbarlisting2} }\label{errorbarplot}
\end{figure}
\lstinputlisting[caption={Illustrating estimation errors using error bars. Script that
\pageinputlisting[caption={Illustrating estimation errors using error bars. Script that
creates \figref{errorbarplot}. A, B},
label=errorbarlisting, firstline=13, lastline=31,
basicstyle=\ttfamily\scriptsize]{errorbarplot.m}
@@ -550,7 +549,7 @@ leading to invisibility and a value of one to complete
opaqueness. Finally, we use the normal plot command to draw a line
connecting the average values (line 12).
\lstinputlisting[caption={Illustrating estimation errors using a shaded area. Script that
\pageinputlisting[caption={Illustrating estimation errors using a shaded area. Script that
creates \figref{errorbarplot} C.}, label=errorbarlisting2,
firstline=33,
basicstyle=\ttfamily\scriptsize]{errorbarplot.m}
@@ -575,7 +574,7 @@ listing\,\ref{annotationsplotlisting}. For more options consult the
listing\,\ref{annotationsplotlisting}}\label{annotationsplot}
\end{figure}
\lstinputlisting[caption={Adding annotations to figures. Script that
\pageinputlisting[caption={Adding annotations to figures. Script that
creates \figref{annotationsplot}.},
label=annotationsplotlisting,
basicstyle=\ttfamily\scriptsize]{annotations.m}
@@ -632,7 +631,7 @@ Lissajous figure. The basic steps are:
\item Finally, close the file (line 31).
\end{enumerate}
\lstinputlisting[caption={Making animations and saving them as a
\pageinputlisting[caption={Making animations and saving them as a
movie.}, label=animationlisting, firstline=16, lastline=36,
basicstyle=\ttfamily\scriptsize]{movie_example.m}