347 lines
8.0 KiB
Markdown
347 lines
8.0 KiB
Markdown
@slide(layout=chapter-slide)
|
||
|
||
@title
|
||
5 Special characters
|
||
|
||
|
||
@slide(layout=content-and-preview)
|
||
|
||
@title
|
||
Spaces
|
||
|
||
@content
|
||
* normal space dividing words: <kbd>space bar</kbd>
|
||
* non-breaking space: `~`
|
||
* thin space: `\,`
|
||
* many other widths available
|
||
|
||
``` {.hljs .lang-tex}
|
||
Thin spaces are used in abbreviations
|
||
and before units, e.\,g., 10\,s.
|
||
Normal-width non-breaking spaces can help
|
||
keep honorary titles and names on one
|
||
line: Dr.~Fooboar.
|
||
```
|
||
|
||
@preview
|
||

|
||
|
||
|
||
@slide(layout=content-and-preview)
|
||
|
||
@title
|
||
English and French spacing
|
||
|
||
@content
|
||
In English, LaTeX uses the old-fashioned *English spacing,* i. e., double sentence spacing.
|
||
|
||
++ If you want to be more modern, you can use `\frenchspacing` above your first paragraph. `\nonfrenchspacing` goes back to default.
|
||
|
||
++ If you actually use *English spacing,* LaTeX will still try and put normal word spacing after abbreviations. However, you should check the results and intervene where needed by
|
||
|
||
* ++ forcing normal spaces: `.\␣`
|
||
* ++ manually ending sentences: `\@.␣`
|
||
|
||
@preview
|
||

|
||
|
||
|
||
@slide(layout=content-and-preview)
|
||
|
||
@title
|
||
Hyphens and dashes
|
||
|
||
@content
|
||
<table>
|
||
<tr>
|
||
<th></th>
|
||
<th>Name</th>
|
||
<th>Use</th>
|
||
<th>Code</th>
|
||
</tr>
|
||
<tr>
|
||
<td>-</td>
|
||
<td>Hyphen</td>
|
||
<td>compound-forming hyphen</td>
|
||
<td>`-`</td>
|
||
</tr>
|
||
<tr>
|
||
<td>–</td>
|
||
<td>En dash *(Halbgeviert­strich)*</td>
|
||
<td>a dash – or a range: 12 – 2 p.m.</td>
|
||
<td>`--`</td>
|
||
</tr>
|
||
<tr>
|
||
<td>—</td>
|
||
<td>Em dash *(Geviertstrich)*</td>
|
||
<td>a dash — mostly in American English</td>
|
||
<td>`---`</td>
|
||
</tr>
|
||
</table>
|
||
|
||
@preview
|
||

|
||
|
||
|
||
@slide(layout=content-and-preview)
|
||
|
||
@title
|
||
Hyphenation
|
||
|
||
@content
|
||
Most of the time, LaTeX hyphenates words correctly, if the correct language is configured.
|
||
Sometimes, however, manual intervention is necessary.
|
||
The different kinds of hyphens that LaTeX offers are described in our script.
|
||
|
||
<!--
|
||
<table>
|
||
<tr>
|
||
<td>Exclusive hyphenation</td>
|
||
<td>`\-`</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Additional hyphenation</td>
|
||
<td>`"-`</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Hyphen (suppressing other hyphenation)</td>
|
||
<td>`-`</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Hyphen (allowing other hyphenation)</td>
|
||
<td>`"=`</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Possible separation without hyphen</td>
|
||
<td>`""`</td>
|
||
</tr>
|
||
<tr>
|
||
<td>Non-breaking hyphen</td>
|
||
<td>`"~`</td>
|
||
</tr>
|
||
</table>
|
||
|
||
<p data-category="Caution!">Some of the codes only work when you use the `babel` package.</p>
|
||
-->
|
||
|
||
@preview
|
||

|
||
|
||
|
||
@slide(layout=content-only)
|
||
|
||
@title
|
||
Quotation marks
|
||
|
||
@content
|
||
<table>
|
||
<tr>
|
||
<th>Language</th>
|
||
<th style="text-align: center;">Command</th>
|
||
<th style="text-align: center;">Result</th>
|
||
</tr>
|
||
<tr>
|
||
<td>English (B. E.)</td>
|
||
<td style="text-align: center;"><code> \`…\' </code></td>
|
||
<td style="text-align: center;">‘ … ’</td>
|
||
</tr>
|
||
<tr>
|
||
<td> 2nd Level</td>
|
||
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
|
||
<td style="text-align: center;">“ … ”</td>
|
||
</tr>
|
||
<tr>
|
||
<td>English (A. E.)</td>
|
||
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
|
||
<td style="text-align: center;">“ … ”</td>
|
||
</tr>
|
||
<tr>
|
||
<td> 2nd Level</td>
|
||
<td style="text-align: center;"><code> \`…\' </code></td>
|
||
<td style="text-align: center;">‘ … ’</td>
|
||
</tr>
|
||
<tr>
|
||
<td>German</td>
|
||
<td style="text-align: center;">`\glqq … \grqq`</td>
|
||
<td style="text-align: center;">„ … “</td>
|
||
</tr>
|
||
<tr>
|
||
<td> 2nd Level</td>
|
||
<td style="text-align: center;">` \glq … \grq `</td>
|
||
<td style="text-align: center;">‚ … ‘</td>
|
||
</tr>
|
||
<tr>
|
||
<td>German altern.</td>
|
||
<td style="text-align: center;">`\frqq … \flqq`</td>
|
||
<td style="text-align: center;">» … «</td>
|
||
</tr>
|
||
<tr>
|
||
<td> 2nd Level</td>
|
||
<td style="text-align: center;">` \frq … \flq `</td>
|
||
<td style="text-align: center;">› … ‹</td>
|
||
</tr>
|
||
</table>
|
||
|
||
Other rules my apply for other languages, but most of the time it’s the same characters, only combined differently.
|
||
|
||
|
||
@slide(layout=content-and-preview)
|
||
|
||
@title
|
||
Quotes
|
||
|
||
@content
|
||
The `csquotes` package provides, amongst others, the command `\enquote`.
|
||
|
||
``` {.lang-tex .hljs}
|
||
\enquote{A \enquote{nested}
|
||
quote.}
|
||
```
|
||
|
||
When included with `autostyle=true`, foreign-language quotes use the according quotation marks:
|
||
|
||
``` {.lang-tex .hljs}
|
||
\foreignquote{ngerman}{Ein deutsches
|
||
Zitat.}
|
||
```
|
||
|
||
@preview
|
||

|
||
|
||
|
||
@slide(layout=content-only)
|
||
|
||
@title
|
||
Diacritics
|
||
|
||
@content
|
||
Letters with diacritics can either by typed directly on the keyboard or via escape codes:
|
||
|
||
<table>
|
||
<tr>
|
||
<td><code>\\\`{o}</code></td><td>ò  </td>
|
||
<td>`\c{c}`</td> <td>ç  </td>
|
||
<td>`\d{u}`</td> <td>ụ</td>
|
||
</tr>
|
||
<tr>
|
||
<td>`\'{o}`</td> <td>ó</td>
|
||
<td>`\k{a}`</td> <td>ą</td>
|
||
<td>`\r{a}`</td> <td>å</td>
|
||
</tr>
|
||
<tr>
|
||
<td>`\^{o}`</td> <td>ô</td>
|
||
<td>`\l{}`</td> <td>ł</td>
|
||
<td>`\u{o}`</td> <td>ŏ</td>
|
||
</tr>
|
||
<tr>
|
||
<td>`\"{o}`</td> <td>ö</td>
|
||
<td>`\={o}`</td> <td>ō</td>
|
||
<td>`\v{s}`</td> <td>š</td>
|
||
</tr>
|
||
<tr>
|
||
<td>`\H{o}`</td> <td>ő</td>
|
||
<td>`\b{o}`</td> <td>o</td>
|
||
<td>`\t{oo}`</td><td>o͡o</td>
|
||
</tr>
|
||
<tr>
|
||
<td>`\~{o}`</td> <td>õ</td>
|
||
<td>`\.{o}`</td> <td>ȯ</td>
|
||
<td>`\o`</td> <td>ø</td>
|
||
</tr>
|
||
</table>
|
||
|
||
|
||
@slide(layout=content-only)
|
||
|
||
@title
|
||
Special characters & symbols
|
||
|
||
@content
|
||
The same is true for special characters: They can either be typed directly or created via escape codes and commands:
|
||
|
||
<table>
|
||
<tr>
|
||
<td style="text-align: center;">¿</td> <td><code>?\`</code></td>
|
||
<td style="text-align: center;">¡</td> <td><code>!\`</code></td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: center;">^</td> <td>`\textasciicircum`</td>
|
||
<td style="text-align: center;">~</td> <td>`\textasciitilde`</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: center;">*</td> <td>`\textasteriskcentered`</td>
|
||
<td style="text-align: center;">\\</td> <td>`\textbackslash`</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: center;">|</td> <td>`\textbar`</td>
|
||
<td style="text-align: center;">∙</td> <td>`\textbullet`</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: center;">ⓒ</td> <td>`\textcopyright`</td>
|
||
<td style="text-align: center;">†</td> <td>`\textdagger`</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: center;">‡</td> <td>`\textdaggerdbl`</td>
|
||
<td style="text-align: center;">…</td> <td>`\textellipsis`</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: center;"><</td> <td>`\textless`</td>
|
||
<td style="text-align: center;">></td> <td>`\textgreater`</td>
|
||
</tr>
|
||
<tr>
|
||
<td style="text-align: center;">‰</td> <td>`\textperthousand`</td>
|
||
<td style="text-align: center;">§</td> <td>`\textsection`</td>
|
||
</tr>
|
||
</table>
|
||
|
||
… and pretty much anything else.
|
||
|
||
|
||
@slide(layout=content-only)
|
||
|
||
@title
|
||
Special characters & symbols
|
||
|
||
@content
|
||
### Math mode
|
||
|
||
Some special characters and symbols require a math environment:
|
||
|
||
``` {.lang-tex .hljs}
|
||
% greek letters (π Σ δ)
|
||
$\pi \Sigma \delta$
|
||
|
||
% dagger/obelisk/obelus (†)
|
||
$\dagger$
|
||
```
|
||
|
||
@slide(layout=content-only)
|
||
|
||
@title
|
||
Special characters & symbols
|
||
|
||
@content
|
||
### Detexify to the rescue! <span class="emoji">⛑️</span>
|
||
* Draw symbols and have them recognised:
|
||
[Detexify](http://detexify.kirelabs.org/classify.html)
|
||
* A long list of symbols to use:
|
||
[PDF on the CTAN website](http://tug.ctan.org/info/symbols/comprehensive/symbols-a4.pdf)
|
||
|
||
|
||
@slide(layout=task)
|
||
|
||
@task-number
|
||
5
|
||
|
||
@title
|
||
Insert special characters
|
||
|
||
@content
|
||
<div class="box warning">
|
||
From now on, compile the file `main.tex` to see your changes appear in the script itself (in this task, see section “Übung 5”).
|
||
</div>
|
||
|
||
* Replace the spaces in `exercises/special-characters.tex` within the abbreviations (“e. g.”, “i. a.”) by **thin spaces**.
|
||
* Replace the hyphens separating the opening hours by **en dashes** (`--`), optionally surrounded by thin spaces.
|
||
* Add an **exclusive hyphenation** in the word *Studierendenausweis* after *Studierenden-*.
|