4.5 KiB
@slide(layout=chapter-slide)
@title References and footnotes
@slide(layout=content-and-preview)
@title Footnotes 📎
@content
\usepackage{hyperref}
Footnotes are automatically numbered consecutively, independent of sections.
(Here, hyperref is used for the \url command, it is not necessary for footnotes per se.)
The wild boar (Sus scrofa), also known as
the wild swine, Common wild pig, or
simply wild pig, is a suid native to much
of the Palearctic, as well as introduced
numbers in the Americas and Southeast
Asia.
\footnote{\url{https://en.wikipedia.org/
wiki/Wild_boar}}
@slide(layout=content-and-preview)
@title Configuring footnotes
@content
The footmisc package provides additional options for the presentation of footnotes that can be activated by adding parameters to the \usepackage command.
% Reset the counter on each page:
\usepackage[perpage]{footmisc}
% Display footnotes in-line:
\usepackage[para]{footmisc}
% Use symbols instead of numbers:
\usepackage[symbol]{footmisc}
@slide(layout=content-and-preview)
@title Cross-references
@content Manually (just don’t!)
As you can see in figure 23, …
Using the \ref command:
\begin{figure}[H]
\includegraphics % …
\caption{Our mascot Fooboar}
\label{img:fooboar}
\end{figure}
As you can see in figure
\ref{img:fooboar}, …
@preview
@slide(layout=content-only)
@title Assigning labels
@content Both cross-reference commands work with sections, figures, tables, listings, and equations, as long as you use correct labels.
Labels have to be unambiguous. For clarity, certain prefixes are common, and some packages use them to derive information.
| `fig:` Figures | `tbl:` Tables |
| `sec:` Sections | `subsec:` Subsections |
| `ch:` Chapters | `itm:` Enumeration items |
| `eq:` Equations | `lst:` Source code listings |
@slide(layout=content-and-preview)
@title Cross-references
@content
Using the cleveref package (with one ‘r’!):
\begin{figure}[H]
\includegraphics % …
\caption{Our mascot Fooboar}
\label{img:fooboar}
\end{figure}
Fooboar is a young and highly engaged
boar (see \cref{img:fooboar}).
The \cref command automatically inserts suitable prefixes.
@slide(layout=content-only)
@title Things to consider
@content
-
Terms inserted by
\crefuse the language specified with the document class (orbabel):\documentclass[english]{article} -
Apart from sections, referenced elements need captions (
\caption{…}), and the captions have to be placed before the label. -
For sectioning commands, the label is inserted directly after the section command.
\section{Notes}\label{sec:notes}
@slide(layout=content-and-preview)
@title A few more things
@content
- It is recommended that you include the package
hyperrefbeforecleveref. \crefcan take multiple references at once, separated by commas.
\section{An introduction}
\label{sec:section1}
% …
Reference be made to
\cref{sec:section1,sec:section2,
sec:section3,sec:section5}.
slide(layout=task)
@task-number 13
@title Inserting footnotes
@content
- Make the text Stand März 2021 in file
exercies/footnotes/footnotes.texappear as a footnote. - ++ Additionally, insert a clickable URL that leads to the download page for the Java Development Kit (
https://www.oracle.com/java/technologies/javase-downloads.html).
@slide(layout=task)
@task-number 14
@title Inserting references
@content
- In file
exercises/references/references.tex, replace in der Abbildung and Das nachstehende Quelltext-Listing by references to the figure and to the source code listing. - ++ Use the command
\creffor the references. - ++ Make sure to add labels to the elements that you want to create a reference for.
- ++ To do so, wrap the source code listing in a
listingenvironment. - ++ Additionally, add a caption to the source code listing.