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

7.9 KiB
Raw Blame History

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

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

@preview

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

@preview

@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

Euro (€)

  • eurosym package
  • \euro command
Using LaTeX costs 0 \euro.

@slide(layout=content-only)

@title Special characters & symbols

@content

Detexify to the rescue! ⛑️

@slide(layout=task)

@task-number 5

@title Insert special characters

@content

  • Replace the spaces in special-characters.tex within the abbreviations by thin spaces. You can find the file in exercises/special-characters. On top of that, replace the space before the word Euro by a thin space.
  • ++ Replace the hyphens by a dash (--).
  • ++ Add an exclusive hyphenation in the word Studierendenausweis after Studierenden-.
  • ++ Replace Euro by a Euro sign.