7.9 KiB
@slide(layout=chapter-slide)
@title Special characters
@slide(layout=content-and-preview)
@title Spaces
@content
- normal space dividing words: space bar
- non-breaking space:
~ - thin space:
\, - many other widths available
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.
@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:
\@.␣
@slide(layout=content-and-preview)
@title Hyphens and dashes
@content
| Name | Use | Code | |
|---|---|---|---|
| - | Hyphen | compound-forming hyphen | `-` |
| – | En dash *(Halbgeviertstrich)* | a dash – or a range: 12 – 2 p.m. | `--` |
| — | Em dash *(Geviertstrich)* | a dash — mostly in American English | `---` |
@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:
| Exclusive hyphenation | `\-` |
| Additional hyphenation | `"-` |
| Hyphen (suppressing other hyphenation) | `-` |
| Hyphen (allowing other hyphenation) | `"=` |
| Possible separation without hyphen | `""` |
| Non-breaking hyphen | `"~` |
Some of the codes only work when you use the `babel` package.
@slide(layout=content-only)
@title Quotation marks
@content
| Language | Command | Result |
|---|---|---|
| English (B. E.) | \`…\' |
‘ … ’ |
| 2nd Level | \`\`…\'\' |
“ … ” |
| English (A. E.) | \`\`…\'\' |
“ … ” |
| 2nd Level | \`…\' |
‘ … ’ |
| German | `\glqq … \grqq` | „ … “ |
| 2nd Level | ` \glq … \grq ` | ‚ … ‘ |
| German altern. | `\frqq … \flqq` | » … « |
| 2nd Level | ` \frq … \flq ` | › … ‹ |
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.
\enquote{A \enquote{nested}
quote.}
When included with autostyle=true, foreign-language quotes use the according quotation marks:
\foreignquote{ngerman}{Ein deutsches
Zitat.}
@slide(layout=content-only)
@title Diacritics
@content Letters with diacritics can either by typed directly on the keyboard or via escape codes:
\\\`{o} | ò | `\c{c}` | ç | `\d{u}` | ụ |
| `\'{o}` | ó | `\k{a}` | ą | `\r{a}` | å |
| `\^{o}` | ô | `\l{}` | ł | `\u{o}` | ŏ |
| `\"{o}` | ö | `\={o}` | ō | `\v{s}` | š |
| `\H{o}` | ő | `\b{o}` | o | `\t{oo}` | o͡o |
| `\~{o}` | õ | `\.{o}` | ȯ | `\o` | ø |
@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:
| ¿ | ?\` |
¡ | !\` |
| ^ | `\textasciicircum` | ~ | `\textasciitilde` |
| * | `\textasteriskcentered` | \\ | `\textbackslash` |
| | | `\textbar` | ∙ | `\textbullet` |
| ⓒ | `\textcopyright` | † | `\textdagger` |
| ‡ | `\textdaggerdbl` | … | `\textellipsis` |
| < | `\textless` | > | `\textgreater` |
| ‰ | `\textperthousand` | § | `\textsection` |
… 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:
% greek letters (π Σ δ)
$\pi \Sigma \delta$
% dagger/obelisk/obelus (†)
$\dagger$
@slide(layout=content-only)
@title Special characters & symbols
@content
Detexify to the rescue! ⛑️
- Draw symbols and have them recognised: Detexify
- A long list of symbols to use: PDF on the CTAN website
@slide(layout=task)
@task-number 5
@title Insert special characters
@content
- Replace the spaces in
exercises/special-characters.texwithin 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-.