LaTeX (LAY-tek or LAH-tek)
Typesets documents — Document content and document styles are kept separated
As the content and styling guidelines are kept separated, you can change any one independently of the other.
Commands → TeX engine → PDF file
Ref: Overleaf, freeCodeCamp
Installation on Windows
winget install MiKTeX.MiKTeX
On VSCode, install LaTeX Workshop extension. Install perl for free. Now,restart VSCode and write down your latex commands in a .tex file and Click the Run button on the top-right to build.
Update all MiKTeX packages
miktex-console
on CMD and update from the GUI
Install a package
MiKTeX console → Update the package datebase → filter by typing the name e.g. tabularx
Commands to compile LaTeX (assuming the .tex file is sample.tex
)
pdflatex sample.tex # generates .pdf file and some more files
biber sample # generates .bbl file
pdflatex sample.tex # make use of .bbl file and correctly cites refs
pdflatex sample.tex # ensures that cross-references are updated
Options appear inside []
while arguments appear inside {}
\documentclass | selects a template
argument to \documentclass specifies the template choosing from article, report, beamer, book, letter etc. You may give options if you like.
\documentclass[twocolumn, a4paper,10pt]{article}
\usepackage | loads external package for extending functionalities
e.g. \usepackage{graphicx}
\usepackage{amsmath}
\usepackage{graphics, amsmath}
Paragraph vs new line and spaces
A single space = new paragraph; \\
or \newline
for just a line break maintaining the current paragraph. You can also explicitly specify the distance with option. {}
for spacing between words. \
for a single space. \quad
for 4 spaces. \hspace{1in}
for measured spacing
This is my first line. \\[6pt]
This is my second \LaTeX {} line.