174 lines
3.7 KiB
Markdown
174 lines
3.7 KiB
Markdown
@slide(layout=chapter-slide)
|
||
|
||
@number
|
||
5
|
||
|
||
@title
|
||
Text Markup
|
||
|
||
|
||
@slide(layout=content-and-preview)
|
||
|
||
@title
|
||
Emphases
|
||
|
||
@content
|
||
+ semantical emphasis with `\emph{}`
|
||
+ optical highlighting options:
|
||
|
||
<table>
|
||
<tr><th>Name</th><th>Command</th></tr>
|
||
<tr><td>bold</td><td>`\textbf{important}`</td></tr>
|
||
<tr><td>italics</td><td>`\textit{important}`</td></tr>
|
||
<tr><td>small caps</td><td>`\textsc{important}`</td></tr>
|
||
<tr><td>non-proportional (teletype)</td><td>`\texttt{important}`</td></tr>
|
||
<tr><td>underlined</td><td>`\underline{important}`</td></tr>
|
||
</table>
|
||
|
||
@preview
|
||
<img class="thin-padding" src="svg/text-markup/emphases-crop.svg" style="margin-bottom: 0;"/>
|
||
<img class="thin-padding fragment" src="svg/text-markup/optical-highlighting-crop.svg"/>
|
||
|
||
|
||
@slide(layout=content-and-preview)
|
||
|
||
@title
|
||
URLs
|
||
|
||
@content
|
||
The `hyperref` package provides an `\url{}` command that reproduces URLs
|
||
|
||
* letter by letter
|
||
* using line breaks without hyphens
|
||
* using a font with well-distinguishable characters
|
||
* as a clickable link in the PDF.
|
||
|
||
``` {.lang-tex .hljs}
|
||
\url{https://www.latex-project.org/}
|
||
```
|
||
|
||
++ With `\href{}{}`, the URL is hidden in an interactive link.
|
||
|
||
```{.lang-tex .hljs .fragment}
|
||
\href{https://latex-project.org/news/}{blog}
|
||
```
|
||
|
||
@preview
|
||

|
||
|
||
|
||
@slide(layout=task)
|
||
|
||
@task-number
|
||
5
|
||
|
||
@title
|
||
Emphasising text
|
||
|
||
@content
|
||
* **Emphasise** the words *Recursion* and *recursive* in `exercises/text-markup/markup.tex` using `\emph{…}`.
|
||
* Make the **URL** in the text clickable.
|
||
* Find a proper way to display the whole **paragraph as a quote**. Have a look at the `csquotes` package.
|
||
* Of course, you can also experiment with the other **text markup** possibilities. However, remove them afterwards if you want to have a clean document.
|
||
|
||
|
||
@slide(layout=extra-content-and-preview)
|
||
|
||
@title
|
||
Font size
|
||
|
||
@content
|
||
### Preset font sizes
|
||
|
||
``` {.hljs .lang-tex}
|
||
{\<fontsize> some text}
|
||
```
|
||
|
||
Font sizes relative to `normalsize`:
|
||
|
||
``` {.hljs .lang-tex}
|
||
{\tiny If}
|
||
{\footnotesize you}
|
||
{\small can}
|
||
{\normalsize read}
|
||
{\large this,}
|
||
{\Large you}
|
||
{\LARGE don’t}
|
||
{\huge need}
|
||
{\Huge glasses.}
|
||
```
|
||
|
||
@preview
|
||
{.thin-padding}
|
||
|
||
|
||
@slide(layout=extra-content-only)
|
||
|
||
@title
|
||
Better Call LaTeX!
|
||
|
||
@content
|
||
:::{.box .warning}
|
||
**Some well-meaning advice**
|
||
|
||
You want the entire document to look consistent?
|
||
|
||
Trust LaTeX’s defaults (font sizes of title, paragraphs, footnotes, etc.)!
|
||
|
||
This conversely means: Avoid fiddling around with font sizes manually.
|
||
:::
|
||
|
||
|
||
@slide(layout=extra-content-and-preview)
|
||
|
||
@title
|
||
Ragged alignment
|
||
|
||
@content
|
||
By default, LaTeX sets text in full justification, but it is possible to activate ragged alignment.
|
||
|
||
``` {.lang-tex .hljs}
|
||
\raggedright … \raggedleft …
|
||
\centering …
|
||
```
|
||
|
||
Alternatively, we can use dedicated environments:
|
||
|
||
``` {.lang-tex .hljs}
|
||
\begin{flushleft} Text \end{flushleft}
|
||
\begin{flushright} Text \end{flushright}
|
||
\begin{center} Text \end{center}
|
||
```
|
||
|
||
<p data-category="Caution!">Proper ragged alignment is even more difficult than good justification, so better avoid it.</p>
|
||
|
||
@preview
|
||

|
||
|
||
|
||
@slide(layout=extra-content-and-preview)
|
||
|
||
@title
|
||
Indentation and spacing
|
||
|
||
@content
|
||
* paragraphs are usually indicated by first-line indentation (`\parindent`)
|
||
* we can decide to use paragraph spacing (`\parskip`) instead (!)
|
||
* both parameters are customisable:
|
||
|
||
``` {.lang-tex .hljs}
|
||
\setlength{\parindent}{0pt}
|
||
\setlength{\parskip}{1em
|
||
plus .5em % permitted stretch
|
||
minus .5em % permitted compression
|
||
}
|
||
```
|
||
|
||
* `\noindent` allows us to disable first-line indentation for a given paragraph
|
||
|
||
@preview
|
||

|
||
|
||
|
||
|