Minor fixes

This commit is contained in:
Knoch 2021-09-10 10:39:12 +02:00
parent a89148f53a
commit 8984cb90da
18 changed files with 28 additions and 25 deletions

View File

@ -2,7 +2,7 @@
\label{sec:footnotes}
Whenever we want to include footnotes into our \LaTeX{} document, we can use
the command \mintinline{latex}{\footnote{text}}. At the position where we use
the command \replaced[id=F]{\mintinline{latex}{\footnote{<text>}}}{\mintinline{latex}{\footnote{text}}}. At the position where we use
the command, the correct number will be inserted automatically, and the text
within the curly braces will appear in the footer. In combination with the
package \mintinline{latex}{hyperref}, \acro{URL}s within footnotes become

View File

@ -1,7 +1,7 @@
\chapter{Graphics}
\label{sec:graphics}
Since in \LaTeX{} we work with plain text, we cannot simply embed graphics into our text as we may be used to from other text word processing programs.
Since in \LaTeX{} we work with plain text, we cannot simply embed graphics into our text as we may be used to from other \deleted[id=F]{text} word processing programs.
Instead, we reference external image files by a command. The figure is then embedded and positioned at compile time.
\section{Inserting graphics}
@ -15,7 +15,7 @@ In order to be able to reference graphics, the package \texttt{graphicx} has to
\end{figure}
\end{minted}
\noindent The command \mintinline{latex}{includegraphics} can be used to change the image size. The desired height and width of the figure can be indicated separately, like illustrated by the following example:
\noindent The command \mintinline{latex}{includegraphics} can be used to change the image size. The desired height and width of the figure can be indicated separately, \replaced[id=F]{as}{like} illustrated by the following example:
\begin{minted}{latex}
\includegraphics[width=0.5\textwidth,height=5cm]{<file path>}
@ -38,14 +38,15 @@ On top of that, we can limit the positioning of our image more or less rigorousl
\midrule
h & here, if possible \\
t & on top of the page \emph{(top)} \\
b & at the bottom of the bage \emph{(bottom)} \\
p & on its own apge\emph{(page)} \\
b & at the bottom of the page \emph{(bottom)} \\
p & on its own page \emph{(page)} \\
H & Definitely here! (requires package \texttt{float}) \\
\bottomrule
\end{tabular}
\caption{Shortcuts for Positioning Graphics}
\caption{Shortcuts for positioning graphics}
\label{tbl:placement-abbreviations}
\end{table}
\todo{Entweder alles als Satz oder nichts}
\begin{minted}[tabsize=4]{latex}
\begin{figure}[<position shortcut>]
@ -58,3 +59,4 @@ Besides the vertical positioning, also the horizontal orientation may be of impo
By default, graphics are left-justified.
The command \mintinline{latex}{\centering} centers all following objects in the current environment.
If we want the centering to affect only one object, we can alternatively wrap the figure with \mintinline{latex}{\begin{center}} and \mintinline{latex}{\end{center}}.
\todo{In Figures ist das ja eigentlich nicht notwendig, oder?}

View File

@ -70,9 +70,9 @@ Make sure to include the \mintinline{sh}{natbib} package for this purpose.
\label{tbl:bibtex-commands}
\end{table}
The \mintinline{latex}{<source>} of a citation is always a Bib\TeX key.
The \mintinline{latex}{<source>} of a citation is always a Bib\TeX{} key.
The list of available citation styles\footnote{Head to Overleaf for a rather complete list: \url{https://www.overleaf.com/learn/latex/Biblatex_citation_styles}} includes alpha, natdin, and apa.
The table of references will always appear where the \mintinline{latex}{\bibliography{}} command was put.
The \mintinline{latex}{\cite} command comes with many variants.\footnote{Cf. \url{https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM.}}
The \mintinline{latex}{\cite} command comes with many variants.\footnote{cf. \url{https://www.economics.utoronto.ca/osborne/latex/BIBTEX.HTM}}
\Example{lst:natdin-example}{literature/natdin-example}{literature/natdin-example_bib}{Examplery citations in the \mintinline{latex}{natdin} style.}
\Example{lst:natdin-example}{literature/natdin-example}{literature/natdin-example_bib}{Exemplary citations in the \mintinline{latex}{natdin} style.}

View File

@ -96,14 +96,14 @@ We already have presented a selection of packages. However, there are thousands
With the package, one can mark what they still \todo{Please do not change. This is an example.} have to change within their document.
\item[Pages of other \acro{PDF} files]
can be integrated into the source code with \texttt{pdfpages}.\footnote{\url{https://www.ctan.org/pkg/pdfpages}}
It comes in very handy whenever one needs the output of external programs in the document, for example, in within the appendix.
It comes in very handy whenever one needs the output of external programs in the document, for example, \deleted[id=F]{in} within the appendix.
Just compile the document one more time and the appendix is up-to-date again, if the external program has changed something.
\item[Nested graphics]
and the positioning of captions at almost any place are provided by
\texttt{subcaption}.\footnote{\url{https://www.ctan.org/pkg/subcaption}}
We also made extensive use of this package.
\item[Tables]
can be designed much more flexible than what we have shown here.
can be designed much more flexibly than what we have shown here.
The following packages can help you with that:
\texttt{colortbl},\footnote{\url{https://www.ctan.org/pkg/colortbl}}
\texttt{tabularx},\footnote{\url{https://www.ctan.org/pkg/tabularx}}

View File

@ -1,17 +1,17 @@
\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 as with the command \mintinline{latex}{\ref{label}}. No more adapting of the numbering for graphics, tables, etc. needed!
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 \replaced[id=F]{\mintinline{latex}{\ref{<label>}}}{\mintinline{latex}{\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 \texttt{cleverref}.\footnote{with only one \enquote{r}!}
It provides us with the command \mintinline{latex}{\cref{label}}, which can also handle multiple labels separated by commas.
A smarter package for references is \texttt{cleveref}.\footnote{with only one \enquote{r}!}
It provides us with the command \replaced[id=F]{\mintinline{latex}{\ref{<label>}}}{\mintinline{latex}{\ref{label}}}, which can also handle multiple labels separated by commas.
This automatically generates text like \enquote{sections 1 to 3, and 5}.\footnote{for the source code \mintinline{latex}{\cref{sec:section1,sec:section2,
sec:section3,sec:section5}}}
Furthermore \mintinline{latex}{\cref{label}} automatically inserts a suited abbreviaton, e.\,g., \enquote{fig.} for figures.
Furthermore, \replaced[id=F]{\mintinline{latex}{\ref{<label>}}}{\mintinline{latex}{\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.
@ -25,7 +25,7 @@ For this reason, it is common to insert a prefix before each label (\cref{lst:re
fig: & figures & tbl: & tables \\
sec: & sections & subsec: & subsections \\
ch: & chapters & itm: & items \\
eq: & equations & lst: & source Code Listings \\ \bottomrule
eq: & equations & lst: & source code listings \\ \bottomrule
\end{tabular}
\caption{Prefixes for labels}
\label{lst:reference-prefixes}

View File

@ -55,17 +55,17 @@ pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex
Other editors usually provide similar options to configure the compilation command.
We recommend you to have a look at the settings or to use of a search engine to figure it out.
\paragraph{An important note on the shell escape flag.} \mintinline{bash}{minted}'s syntax highlighting is done by a Python package, which adds the necessity to communicate between the compiler and the Python runtime.
The shell escape flag adds this communication path.
\paragraph{An important note on the shell-escape flag.} \mintinline{bash}{minted}'s syntax highlighting is done by a Python package, which adds the necessity to communicate between the compiler and the Python runtime.
The shell-escape flag adds this communication path.
When enabled, \LaTeX{} can execute any command in a terminal, which can be very useful.
Nonetheless, it would also be possible to execute malign code on your computer via \LaTeX{}, especially when you are compiling unknown documents from the Internet.
Therefore, do not compile downloaded documents with the shell escape flag if you do not trust the authors and did not check the packages and commands they include.
Therefore, do not compile downloaded documents with the shell-escape flag if you do not trust the authors and did not check the packages and commands they include.
\section{Defining listings}
We are finally ready to marvel at the aesthetic quality of the listings \mintinline{bash}{minted} produces.
You can define listings using a dedicated environment:
\example{lst:minted-environment}{source-code-listings/minted-environment}{Examplary source code listing}
\example{lst:minted-environment}{source-code-listings/minted-environment}{Exemplary source code listing}
\example{lst:minted-variants}{source-code-listings/minted-variants}{Shorthand and inline listing}

View File

@ -39,6 +39,7 @@ With it, you get the following basic structure:
\caption{<caption>}
\end{longtable}
\end{minted}
\todo{Sollte nicht durch das Bild getrennt werden.}
\paragraph{Excess width}
If you want to present a very wide table instead, it is preferable on pages in portrait orientation to turn the table by 90\textdegree{}.

View File

@ -18,7 +18,7 @@
\inputminted[
breaklines, % line breaks
linenos=true, % line numbers
bgcolor=ourBackgroundColor, % bbackground color
bgcolor=ourBackgroundColor, % background color
firstline=5, % first line to be included
lastline=7, % last line to be included
gobble=4 % remove leading spaces

View File

@ -1,7 +1,7 @@
\begin{figure}[H]
\includegraphics[width=%
\caption{Unser Maskottchen Fooboar}
\caption{Our mascot Fooboar}
\label{img:fooboar}
\end{figure}
Wie man in Abbildung \ref{img:fooboar} sieht, hat auch Fooboar bereits \LaTeX{} ergründet.
As you can see in Figure \ref{img:fooboar}, Fooboar has already undertaken a deep-dive into the \LaTeX{} ecosystem.

Binary file not shown.

View File

@ -10,9 +10,9 @@
\thispagestyle{empty}
\begin{figure}[H]
\includegraphics[width=\textwidth]{listings/references/fooboar.jpeg}
\caption{Unser Maskottchen Fooboar}
\caption{Our mascot Fooboar}
\label{img:fooboar}
\end{figure}
Wie man in Abbildung \ref{img:fooboar} sieht, hat auch Fooboar bereits \LaTeX{} ergründet.
As you can see in Figure \ref{img:fooboar}, Fooboar has already undertaken a deep-dive into the \LaTeX{} ecosystem.
\end{document}