354 lines
7.9 KiB
Markdown
354 lines
7.9 KiB
Markdown
@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
|
||

|
||
|
||
|
||
@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­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 — 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. 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
|
||

|
||
|
||
|
||
@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
|
||
### 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. 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.**
|
||
|