\documentclass[11pt, a4paper]{article}
% LaTeX article/essay setup mini tutorial for BSc-ME students at the University of Twente.
%
% (C) Niels ter Meer <n.termeer@student.utwente.nl>
% CC-BY-SA 4.0
% January 2022
% v1.1
%
% File 1/2. This file is for smaller documents (think essays, small articles, letters),
% which usually do well a small set of packages. For more elaborate setups, see etex.tex.
% If you need some scientific features in your essay (think units or a proper
% bibliography), see the section MATH AND SCIENCY STUFF in that same document.
%
% Based on my personal latex templates. This of course doesn't include _everything_ you
% can do with latex, but this should cover ~90% of most use cases. Note that these files
% assume you know some basic latex.
%
% But some general LaTeX notes regardless:
%
%  0. Feel guilty when you change LaTeX from its defaults. It's the embodiment of 40+
%     years of typesetting knowledge and research; there's usually a good reason for why
%     LaTeX has those defaults.
%
%  1. Consider using XeTeX/XeLaTeX over "normal" LaTeX/PDFTex. XeTeX has built-in support
%     for utf-8, which is the post-2000 way of encoding text streams (that also means
%     that you don't need `\usepackage[utf8]{inputenc}` in files you compile with XeLaTeX).
%     This enables you to use multi-byte characters in your text, so German, Arabic,
%     Chinese, etc. should be within reach. Most of this document just uses the ASCII
%     subset (so one byte) of UTF-8, but here some multi-byte characters:
%       - ß  <- German Eszett (2 bytes)
%       - ẞ  <- Capital form of the above (3 bytes)
%       - ë  <- Dutch trema (2 bytes)
%       - 森 <- Japanese kanji for woods/forest (4 bytes)
%       - ¶  <- Pilcrow, the paragraph marker (2 bytes) (prefer `\P` in latex)
%       - §  <- Silcrow/section marker (2 bytes) (prefer `\S` in latex)
%
%     Furthermore, XeLaTeX also has great support for fonts! You can basically select any
%     font installed on your system, while with LaTeX this is a bit more
%     problematic/involved at times.
%
%  2. Don't end paragraphs with `\\`; just use two newlines (so enter/enter) instead. It
%     doesn't actually end the paragraph, and causes a host of other problems which you
%     probably don't want (See: <https://tex.stackexchange.com/questions/82664/when-to-use-par-and-when-newline-or-blank-lines>)
%
%  3. Don't force figures, let them flow free! In 99% of cases, it's better to let LaTeX
%     handle the layout; consider using no specifier or `[hbt]` over `[h]` or `[H]` (see
%     2/2 for the latter) in combination with a `\label{}` `\ref{}` pair (The `\label{}` goes
%     _after_ the caption).
%
%  4. Use math mode for math; please don't (ab)use them for other thinks (so, for
%     example, `\textsuperscript{blabla}` for super script, not `$^{blabla}$`. Note that
%     using math mode usually switches to a different font.
%
% Some other good resources besides my rants are:
%  1. CTAN (a link is provided with each package explained, it also has the manuals for
%     most of the packages referenced);
%  2. <https://tex.stackexchange.com>;
%  3. <https://practicaltypography.com>.  <-- especially this one, it's great.

%% TYPOGRAPHY AND TYPESETTING

% Allows you to select fonts. Works without any other packages and with almost all fonts
% in XeLaTex, but requires inputenc(?) with pdftex.
% CTAN: <https://ctan.org/pkg/fontspec>
\usepackage{fontspec}
% The actual font selection. You can select fonts per block/thing/whatever, but read
% fontspec's manual for that
\setmainfont{<some font's name>}

% LaTeX's default is fully justified text. This changes that to left-aligined, leaving a
% ragged edge on the right while still allowing some hyphenation.
% (<https://www.ctan.org/pkg/ragged2e>)
%
% Some argue that left-aligned is more readable, but it's just what you
% prefer (<https://practicaltypography.com/justified-text.html>)
\usepackage[document]{ragged2e}

% Handles language-specific hyphenation and other typographical rules
% CTAN: <https://www.ctan.org/pkg/babel>
\usepackage[english]{babel}

% Context specific quotations. It's really fancy; it automatically adjust the quoting
% delimiters depending on how you nest the quotes, and on the language of the document.
% In Dutch, the outer quote is "" and the inner quote ', while in french they use
% guillemets. Due to the localization features best used with babel.
% CTAN: <https://www.ctan.org/pkg/csquotes>
%
% But tbh usually I'm too lazy and just do this: ``some quote''. If you're not using it's
% features you can leave it out, but unless you're really worried about compilation times
% I'd just leave it in.
\usepackage{csquotes}

% Better list formatting. Allows the configuration of the spacing, numbering, bullets,
% what have you. Also nice for inline lists.
%
% CTAN: <https://www.ctan.org/pkg/enumitem>
\usepackage[inline]{enumitem}

% Removes the "paragraph skip". LaTeX' default is to separate paragraph by indenting
% their first line, but this irks many engineers.
%
% CTAN: <https://www.ctan.org/pkg/parskip>
% See also <https://tex.stackexchange.com/questions/40429/how-to-use-the-parskip-package-space-in-between-paragraphs>
\usepackage{parskip}

%% NICE-TO-HAVES

% This uses hyperref to have the footnote link back to where its source
% CTAN: <https://www.ctan.org/pkg/footnotebackref>
\usepackage{footnotebackref}

% Allows you to load in images; "enhanced graphics support"
%
% CTAN: <https://www.ctan.org/pkg/graphicx>
\usepackage{graphicx}

% Hyperref handles hyperlinks, (IIRC) both within the document itself (think to
% footnotes, the table of contents, links to figures, etc.), but also to external
% resource (think urls and such). I think it might also handle the TOC in the pdf.
%
% Hyperref must be the last package loaded, otherwise LaTeX requires extra compilation
% runs. But read the manual of course.
%
% CTAN: <https://ctan.org/pkg/hyperref>
\usepackage{hyperref}
% Hyperref's defaults are kind of shit (the red boxes around the links),
% so this setup sets them to the "web defaults" (blue underlined links)
%
% It also sets the page to which the pdf will open by default (so the first page),
% and the pdf author and title fields. IIRC, you can set more metadata fields but this is
% what I usually do
\hypersetup{
	colorlinks=true,
	urlcolor=blue,
	citecolor=blue,
	linkcolor=blue,
	pdfstartview={XYZ null null 1.00},
	pdftitle={},
	pdfauthor={}
}

% This is the setup for the `\maketitle` macro. It is really simplistic, so if you want
% more you probably have to roll it yourself. But for single-author documents/articles
% it's usually fine. For student stuff, the way I put my student number in the document
% is: `\author{<name>\\\small{<sno>}}`
\title{}
\author{}
% You can use `\date{\today}` for the current date, but consider writing the date yourself
% for repeatable compilations and control over the date's format (like `\date{22-03-2021}`).
\date{}

\begin{document}

% Prints the title block. Should be used before any text.
\maketitle

\end{document}
