DEV Community

latexteada
latexteada

Posted on

The Document: Lists and Multicolumn

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

The output is
Screenshot from 2021-02-09 21-05-20

Ordered List

The command for an ordered list is enumerate, here is an example

ol

The output is
Screenshot from 2021-02-09 21-19-50

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

The output is
Screenshot from 2021-02-09 21-21-56

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
The output is
Screenshot from 2021-02-09 21-24-03

Multicolumn file

Entire document

If we want a double-columned document we need to put

\documentclass[twocolumn]{typeOfDocument}
Enter fullscreen mode Exit fullscreen mode

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}
Enter fullscreen mode Exit fullscreen mode

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
The output is
Screenshot from 2021-02-09 21-47-21

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

Top comments (0)