- Why LaTeX
- Writing a Document
- Tools to increase productivity
- Useful Packages
- Displaying Math
- Code Blocks
- This is why you need to learn Machine Learning
LaTeX is a markup language (or, as said in the official website, "a document preparation system for high-quality typesetting") used to create wonderful papers and presentations. Almost all papers you will read during your career are written using LaTeX. So, let's see how it works!
# Why LaTeX
For years now LaTeX has been the go-to tool whenever someone needs to create a document that will contain mathematical formulas. LaTeX is used a lot to write scientific papers and it is also used by bloggers and scientific content creators in the internet. You can even use LaTeX syntax on facebook messenger! (which only renders if you are on your computer)
There are several LaTeX distributios, you can see a complete list here.
Under Unix systems, you can install TeXLive. In particular, under Ubuntu you can type in the terminal
sudo apt-get install texlive-full.
Under Windows systems, you can install MiKTeX or also TexLive.
Under MacOs, MacTex.
After the installation, you need an editor to write your LaTeX document. You can use whatever editor you want (notepad, vim, nano, gedit and so on) but I recommend you to choose Texmaker which is free and cross platform. It is also worth saying that Visual Studio Code with some dedicated extensions (such as LaTeX Workshop) is pretty good to use.
# Writing a document
There are tons of on-line guides about LaTeX to get you started. Among them:
- A comprehensive guide can be found here.
- Another cool guide here.
- This one is perfect for beginners.
- Also here another guide.
It's also possible to write your LaTeX document on-line and share it with your collaborators using OverLeaf.
There are already lots of templates made. You can find some of them here.
To draw awesome graphs and charts, you can use the package TikZ.
Also a good site to keep in mind when facing a problem with LaTeX is StackOverflow with the LaTeX dedicated section.
# Tools to increase productivity
The LaTeX syntax can seem daunting at first, with plenty of new commands for all the mathematical symbols you know and need to use.
- This website allows one to write a formula online, and it also has plenty of symbols in which you can just click, generating the code you need. You can also preview your formula, so that it is easier for you to make sure everything is being properly written.
- Whenever you need a symbol but you don't know the command, use this site. All you have to do is draw the symbol and then suggestions will appear on the right.
- Creating tables in LaTeX can be particularly annoying. I usually do it here and then ask the site to generate the appropriate code.
- MathJax is one of the ways in which you can get LaTeX to render, say, in your blog! (example here, where the formulas are rendered with MathJax)
- Mathpix Snipping Tool helps you to convert images to LaTeX by just taking a screenshort of desired math formula. It can also recognize arrays and various math fonts.
# Useful Packages
Now that you know how to produce a (simple) LaTeX document, you may feel the need to write or draw particular content. To do so, you can use specific packages. All you need to do is to include them at the beginning of your document with the command
# Displaying Math
# Code Blocks
listings package allows to insert programming code in your LaTeX document. You can highlight code, or specify your language of choice and let the package automatically colour special words, comments, etc for you. Here a guide with examples.
If you find tedious manually writing truth tables, here you'll find an incredibly useful Pyhton script. It automatically generates the LaTeX code of a compiled truth table given one or more propositional logic formulas. (Note: remember that in Python you can write p → q as
not p or q as they are logically equivalent).
# This is why you need to learn Machine Learning
Oh damn, take a look at this.