The Document: Lists and  Multicolumn
Tags: latex, codenewbie
Published: 2021-02-10 16:02:41

Hello, before starting this new post I want to give you an advertisement:

> This is the last post with *general content*, this is, basic stuff. In the next post, I am going to start with **Tables**

I will not start with math yet because sometimes, or at least in my experience when you are doing maths in LaTeX you may need tables, so it is better to know before something about tables and figures before math stuff.

Said that let's begin :) 

# Lists

We need to know something important before beginning
* We just can nest to 4 levels in a list
* We declare a new element with `\item`

There are three kinds of lists in LaTeX
## Unordered List
The command for an unordered list is `itemize`, here is an example

![ul](https://dev-to-uploads.s3.amazonaws.com/i/2jh3britof436vt8q7yl.png)
 
The output is 
![Screenshot from 2021-02-09 21-05-20](https://dev-to-uploads.s3.amazonaws.com/i/d9q7rvej69bcgsh0uk1p.png)

## Ordered List 
The command for an ordered list is `enumerate`, here is an example

![ol](https://dev-to-uploads.s3.amazonaws.com/i/q34a56fhnh228zaa4mn0.png)
 
The output is
![Screenshot from 2021-02-09 21-19-50](https://dev-to-uploads.s3.amazonaws.com/i/gzgbdp0f6nh7au815qdw.png)
  
## Ordered and Unordered List

As I said at the beginning, we can mix ordered and unordered list but we just can nest to 4 levels, here is an example 
![ou](https://dev-to-uploads.s3.amazonaws.com/i/d13ccbh1hb3fvirqboe9.png)
 
The output is
![Screenshot from 2021-02-09 21-21-56](https://dev-to-uploads.s3.amazonaws.com/i/ak3bxu3907afb7mwwj5q.png)
 

> I encourage you to play with these environments :) 

## Description List
Sometimes we want to **stand out** some words, for example, when we are writing some definitions. We can reach this with the `description` environment, here is an example 
 
![des](https://dev-to-uploads.s3.amazonaws.com/i/z7zyctwa4mfvzlaic82z.png) 
The output is 
![Screenshot from 2021-02-09 21-24-03](https://dev-to-uploads.s3.amazonaws.com/i/zbpyiztbsmdy8rge7rgu.png)

# Multicolumn file
## Entire document
If we want a double-columned document we need to put 
```
\documentclass[twocolumn]{typeOfDocument}
```
At the beginning of the document, we can put the paper size and font size in the dame square brackets

## Some text
We need to import the `multicol` package and put the text that we want in the `multicols` environment, this has two arguments
```
\begin{multicols}{n}
```
Where *n* is the number of columns, we can add some options
* To set the spacing between columns `setlength{\columnsep}{Xmm}` this must be in the preamble
* To set a column separator (vertical line between columns) `\setlength{\columnseprule}{Xmm}` this must be in the preamble, *X* is the width of the line
* To move the content to a new column `\columnbreak`
    * Between the `\columnbreak` instruction and the text must be an *enter* in your code

Here is an example 

![mul](https://dev-to-uploads.s3.amazonaws.com/i/tcl0gbjmqbr81gcdd2ql.png)
The output is 
![Screenshot from 2021-02-09 21-47-21](https://dev-to-uploads.s3.amazonaws.com/i/hw88bs9kvmvekmc22fvv.png)
 
> Try `multicols*` instead of `multicols` and see what happens

That is all for today. Thank you :) 

Do not forget to follow me on Twitter `@latexteada`

See you