crazyc4t's blog

LaTeX for humans

Intro

This post is going to help you learn \(\LaTeX\) and convert you into a intellectual and scientific professional and by far superior with anyone that shares their report made in word!

But before anything…

What is all this \(\TeX\) thingy?

In summary \(\LaTeX\) is the form of creating a document with the highest quality of typesetting possible, being made with commands you will have to compile it each time to see the result so \(\LaTeX\) isn’t a WYSIWYG(what you see is what you get) editor, but don’t worry! \(\LaTeX\) is so awesome now that a quick CTRL+S will compile your result and let you see how you are going on time! so no worries there. The story goes back to 1977 when Donald Knuth understood the need for a high quality typesetting program, and \(\LaTeX\) being still used today shows that is the best tool for it’s purpose, although many useful additions have been made and \(\LaTeX\) has evolutionated since then.

What is \(\TeX\)?

The original system made by Donald Knuth was called \(\TeX\), what \(\TeX\) do is to take a document in plain text and convert it to a beutifully typeset document with the highest quality possible, with a lot of in-built commands available for writing beutiful math equations, writing with the right fonts specific words and so on, but \(\TeX\) was still quite basic, until \(\LaTeX\) came by…

\(\LaTeX\)

The purpose of Leslie Lamport, the creator of \(\LaTeX\) in the 80’s was to provide a higher level language for everyone to work on, since creating a document in \(\TeX\) was in fact a bit complicated for doing simple things, making \(\LaTeX\) a \(\TeX\) but more friendly and easier to use, creating a package system that made the community to grow huge, being available thousands of packages to typeset whatever you want, code, images, you name it since \(\LaTeX\) was document classes that let you typeset books, lab reports, articles, letters, math-focused documents, awesome presentations, PhD thesis, you name it, \(\LaTeX\) got you covered with the highest quality available.

pdf\(\TeX\) & pdf\(\LaTeX\)

The original \(\TeX\) converted the .\(\TeX\) files into a .dvi (DeVice Independent format) later on pdf\(\TeX\) being created by Hàn Thế Thành for his PhD thesis which converted .\(\TeX\) to .pdf being a great upgrade since pdf allowed things like hyperlinks, metadata, modern image formats, etc…

Why learn \(\LaTeX\)?

Because \(\LaTeX\) is used all over the world! apart of creating beutifully typeset documents, it allows users to tacke complicated things like inputting math, code, bibliography, table of contents, and so much more with a breeze, and with the huge amount of open source packages for \(\LaTeX\) the possibilities are endless, and one of the most important reasons is that is easy and highly customizable since it separates the content from the style of the document, so you can style your document without ever needing to touch the content! and you can create your own style for the whole document very easily, that enables that creators share \(\LaTeX\) templates, being pre-made layouts serving a specific purpose, like a CV/resume or a template for a math book, or just your english homework of school, you name it, there is a template that can help you!

Installing \(\LaTeX\)

This could be a bit complex since \(\LaTeX\) comes with a lot of built-in packages but don’t worry! am going to explain step by step so it will be a breeze!

Disclamer!

At this day and age is not longer necessary to install \(\LaTeX\), although recommended, you can use a online web editor like overleaf and you will be ready to rock! no caveats involved.

\(\LaTeX\) for Linux

This is pretty straight forward, just install the texlive package for your distro! There are a lot of packages for \(\LaTeX\) so they are grouped into size of the package (minimal, basic, small, medium, full) Like so:

======================= Name Matched: texlive-scheme ========================
texlive-scheme-basic.noarch : basic scheme (plain and latex)
texlive-scheme-context.noarch : ConTeXt scheme
texlive-scheme-full.noarch : full scheme (everything)
texlive-scheme-gust.noarch : GUST TeX Live scheme
texlive-scheme-medium.noarch : medium scheme (small + more packages and
                             : languages)
texlive-scheme-minimal.noarch : minimal scheme (plain only)
texlive-scheme-small.noarch : small scheme (basic + xetex, metapost, a few
                            : languages)
texlive-scheme-tetex.noarch : teTeX scheme (more than medium, but nowhere
                            : near full)

The best package for beginners is the medium one, I use it myself! And also you can install a \(\LaTeX\) editor, my personal favourite is Kile is the best editor out there really, but it’s from KDE, so you will need QT/KDE libraries so could be a bit heavy but if you are using GTK (gnome, cinnamon, xfce) I would recommend gummi or gnome-\(\LaTeX\) but is descontinued, so if you are using gnome 40-41 better go with gummi, although if you read my other post about vim you can use the vim\(\LaTeX\) plugin and a document viewer like okular or evince, if you want to explore another alternatives to a \(\LaTeX\) IDE you can read here

Fedora/RHEL

1sudo dnf in texlive-scheme-medium

Debian/Ubuntu

1sudo apt in texlive-latex-extra

Arch BTW

1sudo pacman -S texlive-most

\(\LaTeX\) for Windows

Really straight forward with the MiKTeX distribution of \(\LaTeX\)!

\(\LaTeX\) for Mac

The same applies with the MacTeX distribution of \(\LaTeX\)!

\(\LaTeX\)ing

Let’s start \(\LaTeX\)ing baby!

 1% This is a comment
 2% We specify what type of document we are creating in this case, an article
 3\documentclass[a4paper,10pt]{article}
 4% UTF-8 encoding
 5\usepackage[utf8]{inputenc}
 6% We start the document
 7\begin{document}
 8% We use \LaTeX so it can look cool
 9% we specify a \ after the \LaTeX function since it eats an space
10Isn't that hard to \LaTeX \ as I thought!
11\end{document}
12% Here the document ends, anything below this command will not be considered.

The end result would be:

LaTeX example

You see! is not that hard isn’t it? spaces in \(\LaTeX\) are specified with a blank line between each line of text, just as in markdown!

Now let’s create a nice formated document!

Adding title, author and date

 1\documentclass[a4paper,10pt]{article}
 2\usepackage[utf8]{inputenc}
 3
 4% Document opening with title, author and date
 5\title{My first \LaTeX \ document}
 6\author{crazyc4t}
 7\date{\today}
 8
 9\begin{document}
10% Spawning the title
11\maketitle
12
13Oh yea!
14
15\end{document}

The end result would be:

LaTeX opening

That was great and a breeze right? Now let’s create some sections and a table of contents with underlined, bold and italic text!

Table of contents, sections and special text

 1\documentclass[a4paper,10pt]{article}
 2\usepackage[utf8]{inputenc}
 3
 4%opening
 5\title{My first \LaTeX \ document}
 6\author{crazyc4t}
 7
 8\begin{document}
 9% Table of contents and title
10\maketitle
11\tableofcontents
12
13\section{My first section}
14My first section of my \LaTeX \ document!
15
16\section{My second section}
17%Bold, then underline, and finally italic
18% \textbf = bold
19% \textit = italic
20\textbf{My} \underline{second} \textit{section!}
21
22\end{document}

The end result would be:

latexing

You are getting the hang of it! now you know the basics of \(\LaTeX\), and you will be able to write a simple document without struggling!

Outro

\(\LaTeX\) is a endless world to discover and I have just showed you a tiny bit of it! the rest of your journey with \(\LaTeX\) is decided by you, I recommend to learn more about \(\LaTeX\) that what I just showed you, and after that try to write a great document for your homework, or an article just like this one! (although this one was written with markdown) or to update your CV and then learn \(\LaTeX\) beamer, the best way to create presentations! I will leave you lots of documentation to read and start LaTeXing in no time!

Docs

\(\LaTeX\) in 30 minutes by overleaf

\(\LaTeX\) wiki, just search and you will have a result!

Luke Smith’s series of tutorials about \(\LaTeX\)

\(\LaTeX\) beamer tutorial by overleaf

Remember, THE WORLD IS YOURS!

#LaTeX