latex-wochenende/slides/chapter-05.en.md
2020-06-12 16:00:05 +02:00

354 lines
7.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@slide(layout=chapter-slide)
@title
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
![](svg/chapter-05/spaces-crop.svg)
@slide(layout=content-only)
@title
French spacing
@todo
Folie zu french spacing im Englischen
@slide(layout=content-and-preview)
@title
Hyphens and dashes
@todo
* Für Silbentrennung muss bei Babel die Sprache angegeben werden. Hier erwähnen und überall überprüfen. (Wird auch auf der nächsten Seite angedeutet.)
* Überprüfen, ob die Trennung A.E./B.E. wirklich stimmt.
@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&shy;strich)*</td>
<td>a dash or a range: 12&hairsp;&hairsp;2 p.m.</td>
<td>`--`</td>
</tr>
<tr>
<td>—</td>
<td>Em dash *(Geviertstrich)*</td>
<td>A dash&hairsp;—&hairsp;in American English</td>
<td>`---`</td>
</tr>
</table>
@preview
![](svg/chapter-05/hyphens-and-dashes-crop.svg)
@slide(layout=content-and-preview)
@title
Hyphenation
@content
Most of the time, LaTeX hyphenates words correctly, if the correct language is configured. But you can also intervene manually:
<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
![](svg/chapter-05/hyphenation-crop.svg)
@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.&thinsp;E.)</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>English (A.&thinsp;E.)</td>
<td style="text-align: center;"><code>\`\`…\'\'</code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;"><code> \`…\' </code></td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>German</td>
<td style="text-align: center;">`\glqq … \grqq`</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;">` \glq … \grq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
<tr>
<td>German altern.</td>
<td style="text-align: center;">`\frqq … \flqq`</td>
<td style="text-align: center;">»&hairsp;&hairsp;«</td>
</tr>
<tr>
<td>&emsp;2nd Level</td>
<td style="text-align: center;">` \frq … \flq `</td>
<td style="text-align: center;">&hairsp;&hairsp;</td>
</tr>
</table>
Other rules my apply for other languages, but most of the time its 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
![](svg/chapter-05/quotes-crop.svg)
@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>ò&emsp;&emsp;</td>
<td>`\c{c}`</td> <td>ç&emsp;&emsp;</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;">&lt;</td> <td>`\textless`</td>
<td style="text-align: center;">&gt;</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
### Euro (€)
* `eurosym` package
* `\euro` command
``` {.lang-tex .hljs}
Using LaTeX costs 0 \euro.
```
@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
4
@title
Insert special characters
@content
* In section 1.1.1, replace the spaces before and after the name Knuth by **non-breaking spaces.**
* ++ In section 1.2.1, paragraph 2, insert a **thin space** between z. and B. of z.B. (= e.&thinsp;g.).
* ++ In section 1.2.2, there are several hypens misused as **dashes.** Replace them by en dashes (Halbgeviertstriche als Gedankenstriche).
* ++ In section 1.2.1, paragraph 2, a `"=` is used. What happens if you use a simple **hyphen** instead?
* ++ In section 1.1.1, “Tech” and “TeX” should be surrounded by **quotation marks.** Use `\enquote{…}` for that.
* ++ In section 1.2.1, paragraph 2, replace the three dots by a real **ellipsis.**