latex-wochenende/slides/chapter-05.en.md

7.7 KiB
Raw Blame History

@slide(layout=chapter-slide)

@number 5

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

@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

Name Use Code
- Hyphen compound-forming hyphen `-`
En dash *(Halbgeviert­strich)* a dash or a range: 122 p.m. `--`
Em dash *(Geviertstrich)* a dashmostly in American English `---`

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

@preview

@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.}

@preview

@slide(layout=content-only)

@title Special characters & symbols

@content

Detexify to the rescue! ⛑️

@slide(layout=task)

@task-number 5

@title Insert special characters

@content

From now on, compile the file `main.tex` to see your changes appear in the script itself (in this task, see section “Übung 5”).
  • 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 quotation marks around the words Studi-Ticket and Studi-Karte using the \enquote command.

@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, but most of the time its the same characters, only 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 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.