# 1 LaTeX

## 1.1 One line, one idea

Recommended:

This LaTeX input

In LaTeX is possible to have ideas separated into lines so your writing process becomes easier.
In word processors, this is not possible since what you type is the same as what you see.

produces this output

In LaTeX is possible to have ideas separated in lines so your writing process becomes easier. In word processors, this is not possible since what you type is the same as what you see.

Discouraged:

Typing the full paragraph as you would normally do it in a word processor:

In LaTeX is possible to have ideas separated into lines so your writing process becomes easier. In word processors, this is not possible since what you type is the same as what you see.

It still produces the same output:

In LaTeX is possible to have ideas separated into lines so your writing process becomes easier. In MS Word, this is not possible since what you type is the same as what you see.

Here’s why: Writing one idea per line helps you in the mental process of composing the text. It also makes it easy to delete some parts of your text in the editing process.

## 1.2 Captions

For Figure and Table captions, create short and long versions

\caption[Short version]{Long version}

The short version automatically goes to the List of Figures/Tables, the long one is the normal caption. E.g.:

\caption
[Comparisons between normal, half-, and full-rectified audio]
{Intelligibility result of normal,'' Half-rectified,'' and Full-rectified'' audio.
[a] Changing filter order, [b] Changing cut-off frequency of the filter, [c] Changing overall gain,
[d] With and without compression.}
Here’s why: A caption has details explaining its corresponding figure or table (e.g., the meaning of error bars, the difference between columns, etc.). These details help the reader to better understand the figure or table but clutter the List of Figures, Tables, etc.

## 1.3 Apostrophe

The apostrophe is the character ' (usually, located next to the <enter> key) not ’. Some operative systems will automatically convert the former into the latter (be careful since they’re too similar).

Correct:

Mauchly's Test for Sphericity  

Incorrect:

Mauchly’s Test for Sphericity

## 1.4 Quotation marks

To put something between quotation marks use  to open and ' to close.

Correct:

Hello World'
Hello World''

Incorrect:

'Hello World'
'Hello World’
"Hello World"
Here’s why: Using " around text in LaTeX will generate closing quotation marks on both sides of the text which is not correct. However, if you use an editor that supports Unicode, you could add \usepackage[utf8]{inputenc} at the beginning of your manuscript and use curved quotation marks. In any case, the former method is recommended.

## 1.5 Dashes

There are three kind of dashes (-,–,—):

1. Hyphen (-)

Use hyphen for connecting words. This LaTeX input

Real-time, en-dash, etc.

produces this output

Real-time, en-dash, etc.

2. En-dash (--)

En-dashes usually have the same length of an n character and are commonly used for ranges.

1974--2021
pp.\ 10--15
13:40--14:10

produces

1974–2021

pp. 10–15

13:40–14:10

3. Em-dash (---)

Em-dashes usually have the same length of an m character and, among other things, are used for parenthetical information

The patient---same as before---was treated carefully.

produces

The patient—same as before—was treated carefully.

## 1.6 Paragraph separation

In running text, do not use \\ for a new paragraph, use double <enter> instead:

Correct:

But this is not a good idea. So, why we should not change the radiation level?

The reason is that a high level of radiation hurts the human body.

Incorrect:

But this is not a good idea. So, why we should not change the radiation level?  \\
The reason is that a high level of radiation hurts the human body.

Incorrect:

But this is not a good idea. So, why we should not change the radiation level?
The reason is that a high level of radiation hurts the human body.
Here’s why:

There are several reasons why the use of \\ is discouraged:

1. It causes wrong output in certain cases (an empty, maximally under-full box, for example). This is usually shown in the console as Underfull \hbox (badness 10000) in paragraph at lines x--y. Visually, this error causes a bit of extra vertical space at the end of the paragraph.

2. If your paragraphs are too long and your memory is low, this can cause LaTeX to run out of memory and crash. This is because it will continue adding text to memory until the end of a paragraph (which \\ is not).

See more

## 1.7 Number and units

Numbers with units should be written together:

Correct:

$80$\,dB

Acceptable:

80\,dB

Incorrect:

80 dB

## 1.8 Multiplication

In general, less is more. There’s no need to add a symbol for simple multiplications.

Correct:

$y = ax + b$

Discouraged:

$y = a \cdot x + b$

The following table shows the most common symbols used in simple multiplications and their actual intended use

LaTeX Result Intended use
a \ast b $$a\ast b$$ Convolution
a \star b $$a\star b$$ Cross-correlation
a \times b $$a\times b$$ Cross-product
a \cdot b $$a\cdot b$$ Dot product
a b $$ab$$ Simple multiplication

## 1.9 Punctuation after equation

Use comma, period, semicolon, etc. after an equation within the equation context:

Correct (using a ,):

The distance $y$ was computed as
$$y = ax + b,$$
where $a$ is the slope,
and $b$ a constant.

Incorrect:

The distance $y$ was computed as
$$y = ax + b$$
where $a$ is the slope,
and $b$ a constant.

Correct (using a .):

The final model was
$$y = ax + b.$$

The results of the simulation ...

Incorrect:

The final model was
$$y = ax + b$$

The results of the simulation ...

## 1.10 References

References in text must use the \cite{} command:

Correct:

The Earth is flat \cite{SomeStupidGuyInInternet:2021}

Incorrect:

The Earth is flat [1]
Here’s why: In editing your manuscript, it is often the case that you need to add, remove, or change the location of references within the text. These changes may alter the order of the references. LaTeX will automatically regenerate the Reference section if the \cite{} command has been used, otherwise, you have to do it manually.

## 1.11 References before punctuation marks

References should appear before punctuation marks (periods, commas, etc.)

Correct:

And so, they claimed that war was over [1].

Incorrect:

And so, they claimed that war was over. [1]

## 1.12 References with more than two authors

When naming the authors of a publication use “et al.” if they’re more than two.

• Imagine a reference with 4 authors (Villegas, King, Kong, and Orozco).

Correct:

Villegas et al.\ \cite{MSMV}

The \ after the period prevents LaTeX to increase the space as if it was the beginning of a new sentence.

Incorrect:

Villegas, King, Kong, and Orozco \cite{VKKO}
• Imagine a reference with only two authors (Villegas and Einstein).

Correct:

Villegas and Einstein\ \cite{VE2021}

Incorrect:

Villegas et al.\ \cite{VE2021}

## 1.13 Text with more than one reference

When several references are used for the same text, put them inside the same cite{} command.

Correct:

This was explored in previous research \cite{ref1, ref2, ref3}.

Incorrect:

This was explored in previous research \cite{ref1}, \cite{ref2}, \cite{ref3}.

## 1.14 Colon in ratios

Separation between parts of a ratio is somewhat large. There is no consensus on how to write this.

Recommended:

DE\mathbin{:}AB

## 1.15 Using PDF/PS images

If possible, use relative sizes such as 0.5\textwidth instead of 6.2cm. Finding the bounding box of a figure is useful for zooming and trimming your image. The bounding box can be found using Ghostscript, as explained in the next chapter. The bounding box comprises four margins in this order: left, bottom, right, and top. Adding clip=true to the includegraphics parameters lets crop or enlarge the image arbitrarily.

For PDFs use

\includegraphics[width=\textwidth,
viewport = left bottom right top, clip=true]{file.pdf}

For PS use

\includegraphics[width=\textwidth,
bb = left bottom right top, clip=true]{File.ps}

## 1.16 LaTeX Documentation

If you’re working offline and need to read the documentation of a LaTeX library, you can do it without connecting to internet using texdoc. For example, should you need to read the options of natbib you can do

texdoc natbib