Formatting text

Latext provides commands for formatting text, creating lists and adding images.

Text highlighting

To make sections of text use the following:

1
2
3
4
5
\B{...}  - bold
\I{...} - italic
\T{...} - monospaced
\TB{...} - monospaced bold
\TB{...} - monospaced italic

To format paragraphs use the following:

1
2
3
4
\textbf{Road Runner} - bold
\textit{ACME} - italics
\emph{ACME} - italics
\underline{Tunnel Ahead} - underlined

Lists - Ordered and Unordered

When making an unordered list, you use itemize. When making an ordered list, you use enumerate.

Unordered lists

Use the following syntax to create an unordered list.

1
2
3
4
5
\begin{itemize}
\item \textbf{Body} - The thing that holds the fins in the right place.
\item \textbf{Fins} - The things that steer the tunafish in the sea.
\item
\end{itemize}

Ordered lists

Use the following syntax to create an ordered list,

1
2
3
4
5
6
7
8
\begin{enumerate}
\item Get a boat that you can use such as a rowboat or canoe.
\item Get a fishing rod.
\item Find where the tunafish are in the ocean.
\item Open can of tunafish that you remembered to bring with you and place it on the hook on the fishing rod.
\item Cast the line out into the sea and wait until a tunfish bites the hook.
\item Reel in the tunafish into the canoe.
\end{enumerate}

Nested Lists

Use the following syntax to create nested lists.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
A Fish contains these parts:

\begin{enumerate}
\item \textbf{Body} - The thing that holds the fins in the right place.
     \begin{itemize}
     \item The fish body is the yummy part that you can eat.
     \item it also has lots of bones and stuff that you cannot eat.
     \item \textbf{Fins} - The things that steer the tunafish in the sea.
        \begin{itemize}
        \item The fins are sometimes sharp so be careful when cutting them off the fish.
        \item Do not eat them. Its all bone and skin.
        \end{itemize}
     \end{itemize}
\end{enumerate}

Resuming an interrupted list

I found it rather annoying that LaTeX didn’t have an easy way of dealing with interrupted lists, until I learned this tip on StackOverflow.

Use the package \enumitem and the [resume]` option on an enumarate scope to cause the LaTeX typesetter to continue numbering from the previous list.

Add this package to the stylesheet for resuming enumeration after intervening text element.

1
\usepackage{enumitem}

Here is an example.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\documentclass{article}
\usepackage{enumitem}
\begin{document}

\begin{enumerate}
    \item List item
    \item Another list item
\end{enumerate}

A randomly inserted paragraph.

\begin{enumerate}[resume]
    \item Further item
    \item Final item
\end{enumerate}

Paragraph of comments on list items 1 and 2.

\begin{enumerate}[resume]
\item Further item
\item Final item
\end{enumerate}
\end{document}

Images

The graphicx pack­age pro­vid­es a key-value in­ter­face for op­tional ar­gu­ments to the \in­clude­graph­ics com­mand.

Note: Do not use the older graphics package when using graphicx.

First, add the following command to the stylesheet.

1
\usepackage{graphicx}

Next, insert the image using the following syntax.

1
\includegraphics[width=10.91cm, height=2.33cm]{images/logo.png}\\[-1em]

You can resize the image or scale the image.

1
2
[width=10.91cm, height=2.33cm] % Resizing images
[scale=1.75]  % Scaling images

The [-1em] is a positioning element, which moves the image 1em to the left of the defined left margin. This is a page design issue.

The file extension can be omitted, but I prefer to keep the entire filename, including the extension.

You can optionally use the \graphicspath command, but I had no need for it.

1
\graphicspath{ {images/} }