changes to chapter 13

This commit is contained in:
Amma 2020-06-19 20:35:10 +02:00
parent beb9ead403
commit 8e98530a57

View File

@ -14,7 +14,9 @@ Footnotes <span class="emoji">📎</span>
\usepackage{hyperref} \usepackage{hyperref}
``` ```
The footnotes are automatically numbered consecutively, independent of sections. Footnotes are automatically numbered consecutively, independent of sections.
(Here, the package `hyperref` is used for the `\url` command, it is not necessary for footnotes per se.)
``` {.hljs .lang-tex} ``` {.hljs .lang-tex}
The wild boar (Sus scrofa), also known as The wild boar (Sus scrofa), also known as
@ -81,6 +83,35 @@ As you can see in figure
@preview @preview
![](svg/chapter-13/ref-example-crop.svg) ![](svg/chapter-13/ref-example-crop.svg)
@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.
<table>
<tr>
<td>`fig:` Figures</td>
<td>`tbl:` Tables</td>
</tr>
<tr>
<td>`sec:` Sections</td>
<td>`subsec:` Subsections</td>
</tr>
<tr>
<td>`ch:` Chapters</td>
<td>`itm:` Enumeration items</td>
</tr>
<tr>
<td>`eq:` Equations</td>
<td>`lst:` Source code listings</td>
</tr>
</table>
@slide(layout=content-and-preview) @slide(layout=content-and-preview)
@ -111,31 +142,20 @@ The `\cref` command automatically inserts suitable prefixes.
@slide(layout=content-only) @slide(layout=content-only)
@title @title
Assigning labels Using the `hyperref` package
@content @content
Both cross-reference commands work with **sections, figures, tables, listings and equations,** as long as you use correct labels. ``` {.hljs .lang-tex}
\usepackage{hyperref}
```
Labels have to be **unambiguous.** For clarity, certain prefixes are common, and some packages use them to derive information. Creates **clickable links** within the document itself (toc, tables/figures, index).
<table> The appearance of these links is customizable.
<tr>
<td>`fig:` Figures</td> The command `\autoref` creates a reference that states the target's type.
<td>`tbl:` Tables</td>
</tr> The command `\url` creates a monospaced external hyperlink that will open a browser and has special breaking properties.
<tr>
<td>`sec:` Sections</td>
<td>`subsec:` Subsections</td>
</tr>
<tr>
<td>`ch:` Chapters</td>
<td>`itm:` Enumeration items</td>
</tr>
<tr>
<td>`eq:` Equations</td>
<td>`lst:` Source code listings</td>
</tr>
</table>
@slide(layout=content-only) @slide(layout=content-only)
@ -144,15 +164,15 @@ Labels have to be **unambiguous.** For clarity, certain prefixes are common, and
Things to consider Things to consider
@content @content
* ++ Passages inserted via `\cref` use the language specified at the document class: * Terms inserted by `\cref` and `\autoref` use the language specified with the document class (or `babel`):
``` {.hljs .lang-tex} ``` {.hljs .lang-tex}
\documentclass[english]{article} \documentclass[english]{article}
``` ```
* ++ Apart from sections, referenced elements need captions (`\caption{…}`), and the **captions have to be placed before the label.** * Apart from sections, referenced elements need captions (`\caption{…}`), and the **captions have to be placed before the label.**
* ++ For sections, the label is inserted directly after the section command. * For sectioning commands, the label is inserted directly after the section command.
``` {.hljs .lang-tex} ``` {.hljs .lang-tex}
\section{Notes}\label{sec:notes} \section{Notes}\label{sec:notes}
@ -164,8 +184,8 @@ Things to consider
A few more things A few more things
@content @content
* ++ If the `hyperref` package is used before `cleveref`, cross-references appear as **clickable links** in the PDF document. * It is recommended that you include the package `hyperref` before `cleveref`.
* ++ `\cref` can take multiple references at once, separated by commas. * `\cref` can take multiple references at once, separated by commas.
``` {.hljs .lang-tex} ``` {.hljs .lang-tex}
\section{An introduction} \section{An introduction}