Link Search Menu Expand Document

Minimal LaTeX start-up document

Vincent Thorne · Posted 17 Jun 2021

A super minimal setup that will work for most LaTeX documents. Includes some examples on how to include figures and tables.

\documentclass[a4paper, 11pt]{article}
% Basic info about your document: a4 paper, 11pt font size, article style.
% Comments start with '%'.

\usepackage{graphicx} % Enables adding figures
\usepackage{subcaption} % Enables figures side-by-side
\usepackage{booktabs} % Makes nicer tables
\usepackage{geometry} % Let's you adjust the margins
\usepackage{setspace} % Let's you change the line spacing
\usepackage{hyperref} % Let's you add links (\url{<link>}) and clickable labels to naviguate through the document
\usepackage{microtype} % Improves the typesetting of your document by managing better the space between letters, hyphens etc.

\usepackage[T1]{fontenc} % Font encoding, don't worry about this too much.

% Tells LaTeX where all graphs and tables are so you don't need to
% write the full path when you want to integrate them.

\title{The Title}

\date{Month Year}

	\maketitle % Prints whatever is in the info

  \onehalfspacing % Sets line spacing to 1.5 after the title for the rest of the document

	\section{First section}
	Some content. Super to be here, thanks for inviting me.

	This section is about figures.

	A figure:

		\centering % makes sure it is centered
			\includegraphics[width=.6\textwidth]{a_figure.png} % notice the width adjustment
		\caption{A great figure}

	Two figures side-by-side: 
				\caption{First caption}
				\caption{Second caption}
		\caption{General caption} % the caption for both


	Directly in the document:
			Observations & $\alpha$ & $\beta$ \\ \midrule
			John         & 0.62     & 4.5     \\
			Mark         & 0.21     & 3.6     \\
			Paul         & 0.80     & 7.6     \\ \bottomrule

	Stored in another file (cleaner: the code doesn't clutter the content):

	{\small \input{path/to/a/table.tex}}
	% the \small command prints everything smaller between the outter {}
	% In fact, you can use \input to add any bit of LaTeX in another LaTeX file!
	% Pretty useful for big documents: you'll have a "master" that loads
	% all the packages and individual section files on one hand, and one 
	% LaTeX file per section (for example) that let's you focus on the content.

\end{document} % Don't forget this last one.