static.wiai.de/latex-weekend/slides/text-markup.en.md
2023-11-18 01:26:09 +01:00

3.6 KiB
Raw Blame History

@slide(layout=chapter-slide)

@number 6

@title Text Markup

@slide(layout=content-and-preview)

@title Emphases

@content Continuous text can be emphasized with \emph{}:

\emph{Emphasize important 
\emph{and even more important} text}

Furthermore, optical highlighting can be used.

NameBefehl
Bold (bold face)`\textbf{important}`
Italics (italics)`\textit{important}`
Small caps`\textsc{important}`
non-proportional (teletype)`\texttt{important}`
underlined`\underline{important}`

@preview

@slide(layout=content-only)

@title Better Call LaTeX!

@content

**Some well-meaning advice**

You want the entire document to look consistent?

Trust LaTeXs defaults (font sizes of title, paragraphs, footnotes, etc.)!

This conversely means: Avoid fiddling around with font sizes manually.

@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
\url{https://www.latex-project.org/}

@preview

@slide(layout=task)

@task-number 6

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

{\<fontsize> some text}

Font sizes relative to normalsize:

{\tiny         If}
{\footnotesize you}
{\small        can}
{\normalsize   read}
{\large        this,}
{\Large        you}
{\LARGE        dont}
{\huge         need}
{\Huge         glasses.}

@preview {.thin-padding}

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

\raggedright … \raggedleft …
\centering …

Alternatively, we can use dedicated environments:

\begin{flushleft}  Text \end{flushleft}
\begin{flushright} Text \end{flushright}
\begin{center}     Text \end{center}

Proper ragged alignment is even more difficult than good justification, so better avoid it.

@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:
\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