adjust exercise numbers to presentation
This commit is contained in:
parent
7338bb65e5
commit
5a93acbeaa
@ -1,5 +1,6 @@
|
||||
\chapter{Footnotes}
|
||||
\label{sec:footnotes}
|
||||
\chapter{References and Footnotes}
|
||||
\section{Footnotes}\label{sec:footnotes}
|
||||
|
||||
|
||||
Whenever we want to include footnotes into our \LaTeX{} document, we can use
|
||||
the command \code{latex}{\textbackslash footnote{<text>}}. At the position where we use
|
||||
@ -16,3 +17,62 @@ The package \pkg{footmisc} provides us with additional options for how to displa
|
||||
\item \code{latex}{\textbackslash usepackage[symbol]\{footmisc\}} causes a numbering with symbols (e.\,g., \textdagger, \textdaggerdbl) instead of numbers.
|
||||
\end{itemize}
|
||||
|
||||
|
||||
\section{References}\label{sec:references}
|
||||
|
||||
If we want to make references, like \enquote{\textellipsis , which you can see
|
||||
in figure 21, \textellipsis}, \LaTeX{} by default provides us with the command
|
||||
\code{latex}{\textbackslash ref\{<label>\}}. No more adapting of the numbering
|
||||
for graphics, tables, etc. needed!
|
||||
The command expects a unique label as argument, that needs to be assigned to
|
||||
the referenced element. After that, wherever we call the command, the number of
|
||||
our referenced object appears in the text.
|
||||
\Example{lst:fooboar-learning-latex}{references/ref}{references/ref_crop}{Example
|
||||
for a reference}
|
||||
|
||||
A smarter package for references is \pkg{cleverref}.\footnote{with only one
|
||||
\enquote{r}!}
|
||||
It provides us with the command \code{latex}{\textbackslash cref\{<label>\}},
|
||||
which can also handle multiple labels separated by commas.
|
||||
This automatically generates elegant references like \enquote{sections 1 to 3,
|
||||
and 5.}\footnote{for the source code \code{latex}{\textbackslash
|
||||
cref\{sec:section1,sec:section2,
|
||||
sec:section3,sec:section5\}}}
|
||||
Furthermore, \code{latex}{\textbackslash ref\{<label>\}} automatically inserts
|
||||
a suited abbreviation, e.\,g., \enquote{fig.} for figures.
|
||||
|
||||
We can reference graphics, tables, sections, chapters, source code listings,
|
||||
and equations.
|
||||
Many packages use the label in order to find out the object type of the
|
||||
referenced element.
|
||||
For this reason, it is common to insert a prefix before each label
|
||||
(\cref{lst:reference-prefixes}).
|
||||
|
||||
\begin{table}[H]
|
||||
\centering
|
||||
\begin{tabular}{@{}llll@{}}
|
||||
\toprule
|
||||
Prefix & Object type & Prefix & Object type \\ \midrule
|
||||
fig: & figures & tbl: & tables \\
|
||||
sec: & sections & subsec: & subsections \\
|
||||
ch: & chapters & itm: & items \\
|
||||
eq: & equations & lst: & source code listings \\ \bottomrule
|
||||
\end{tabular}
|
||||
\caption{Prefixes for labels}
|
||||
\label{lst:reference-prefixes}
|
||||
\end{table}
|
||||
|
||||
Note that if we use \code{latex}{\textbackslash cref\{<label>\}}\,---\,for some
|
||||
document classes\,---\,the generated passages only appear in the desired
|
||||
language (e.\,g., German) when the language is specified already within the
|
||||
document class command:
|
||||
|
||||
\codeblock{latex}{listings/references/set-language.tex}
|
||||
|
||||
\noindent Except for sections, captions\footnote{\code{latex}{\textbackslash
|
||||
caption\{…\}}} \emph{always need to be specified and positioned before the
|
||||
label}\textit{.} Otherwise, they cannot be referenced later on in the text.
|
||||
Labels for sections are inserted directly after the command:
|
||||
|
||||
\codeblock{latex}{listings/references/sections.tex}
|
||||
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
\chapter{References}
|
||||
\label{sec:references}
|
||||
|
||||
If we want to make references, like \enquote{\textellipsis , which you can see in figure 21, \textellipsis}, \LaTeX{} by default provides us with the command \code{latex}{\textbackslash ref\{<label>\}}. No more adapting of the numbering for graphics, tables, etc. needed!
|
||||
The command expects a unique label as argument, that needs to be assigned to
|
||||
the referenced element. After that, wherever we call the command, the number of
|
||||
our referenced object appears in the text.
|
||||
\Example{lst:fooboar-learning-latex}{references/ref}{references/ref_crop}{Example for a reference}
|
||||
|
||||
A smarter package for references is \pkg{cleverref}.\footnote{with only one \enquote{r}!}
|
||||
It provides us with the command \code{latex}{\textbackslash cref\{<label>\}}, which can also handle multiple labels separated by commas.
|
||||
This automatically generates elegant references like \enquote{sections 1 to 3, and 5.}\footnote{for the source code \code{latex}{\textbackslash cref\{sec:section1,sec:section2,
|
||||
sec:section3,sec:section5\}}}
|
||||
Furthermore, \code{latex}{\textbackslash ref\{<label>\}} automatically inserts a suited abbreviation, e.\,g., \enquote{fig.} for figures.
|
||||
|
||||
We can reference graphics, tables, sections, chapters, source code listings, and equations.
|
||||
Many packages use the label in order to find out the object type of the referenced element.
|
||||
For this reason, it is common to insert a prefix before each label (\cref{lst:reference-prefixes}).
|
||||
|
||||
\begin{table}[H]
|
||||
\centering
|
||||
\begin{tabular}{@{}llll@{}}
|
||||
\toprule
|
||||
Prefix & Object type & Prefix & Object type \\ \midrule
|
||||
fig: & figures & tbl: & tables \\
|
||||
sec: & sections & subsec: & subsections \\
|
||||
ch: & chapters & itm: & items \\
|
||||
eq: & equations & lst: & source code listings \\ \bottomrule
|
||||
\end{tabular}
|
||||
\caption{Prefixes for labels}
|
||||
\label{lst:reference-prefixes}
|
||||
\end{table}
|
||||
|
||||
Note that if we use \code{latex}{\textbackslash cref\{<label>\}}\,---\,for some document classes\,---\,the generated passages only appear in the desired language (e.\,g., German) when the language is specified already within the document class command:
|
||||
|
||||
\codeblock{latex}{listings/references/set-language.tex}
|
||||
|
||||
\noindent Except for sections, captions\footnote{\code{latex}{\textbackslash caption\{…\}}} \emph{always need to be specified and positioned before the label}\textit{.} Otherwise, they cannot be referenced later on in the text.
|
||||
Labels for sections are inserted directly after the command:
|
||||
|
||||
\codeblock{latex}{listings/references/sections.tex}
|
||||
@ -1,3 +1,4 @@
|
||||
\section*{Exercise \thechapter .1}
|
||||
Make the text \enquote{March 2021} of the file
|
||||
\file{exercises/footnotes/footnotes.tex} appear as a footnote instead of in
|
||||
parentheses. Additionally, insert a clickable URL to the Java Development Kit
|
||||
@ -6,3 +7,14 @@ as footnote.
|
||||
\texttt{https://www.oracle.com/java/technologies/javase-downloads.html}
|
||||
|
||||
\exercisematerial{exercises/footnotes/footnotes}
|
||||
|
||||
\section*{Exercise \thechapter .2}
|
||||
In file \file{exercises/references/references.tex}, replace \enquote{in the
|
||||
figure} and \enquote{the following source code listing} with suited references.
|
||||
Use the command \code{latex}{\textbackslash cref}. Do not forget to first
|
||||
introduce labels for the elements that you want to reference. To do so, first
|
||||
of all, wrap the source code listing in a \code{latex}{listing} environment.
|
||||
Also, insert a caption for the source code listing.
|
||||
Make sure to use suitable prefixes before the labels.
|
||||
|
||||
\exercisematerial{exercises/references/references}
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
In file \file{exercises/references/references.tex}, replace \enquote{in the figure} and \enquote{the following source code listing} with suited references.
|
||||
Use the command \code{latex}{\textbackslash cref}. Do not forget to first introduce labels for the elements that you want to reference. To do so, first of all, wrap the source code listing in a \code{latex}{listing} environment.
|
||||
Also, insert a caption for the source code listing.
|
||||
Make sure to use suitable prefixes before the labels.
|
||||
|
||||
\exercisematerial{exercises/references/references}
|
||||
Loading…
x
Reference in New Issue
Block a user