7.6 KiB
@slide(layout=chapter-slide)
@number 4
@title Special characters
@slide(layout=content-and-preview)
@title Spaces
@content
- Use thin spaces (
\,) and non-breaking spaces (~), where appropriate.
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.
- ++ Use french spacing (
\frenchspacing) to avoid giant gaps after full stops.
@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 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 Special characters & symbols
@content
Detexify to the rescue! ⛑️
- A long list of symbols to use:
PDF on the CTAN website - Draw symbols and have them recognised:
Detexify
@slide(layout=task)
@task-number 4
@title Insert special characters
@content
:::{.box .warning}
From now on, compile the file main-exercises.tex to see your changes appear in the exercise script (in this task, see exercise 5).
:::
- 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 quotation marks around the words Studi-Ticket and Studi-Karte using the
\enquotecommand.
@slide(layout=extra-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=extra-content-and-preview)
@title Hyphenation
@content Most of the time, LaTeX hyphenates words correctly if the correct language is configured. Sometimes, manual intervention is required.
| 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=extra-content-only)
@title Manual quotation
@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 (mostly: the same characters, but combined differently).
@slide(layout=extra-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=extra-content-only)
@title Special characters
@content Special characters can also 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.