Tags:

Topics

This article is linked to the following topics:

development

LaTeX

LaTeX is a a text layout engine that allows you to use a, fairly esoteric, markup syntax to create fairly decent text layouts.

install

To install LaTeX

sudo pacman -S livetex-most

use

To create a pdf put of a .tex file run the following:

pdflatex file.tex

Commands to the latex compiler start with the "\" character.

\document{memoir}
\begin{document}
\end{document}

basic document structure

Abasic document has two sections.

The preamble is not rendered in your document and is mostly used for setting up the environment for when the compiler runs.

The document part is the main bulk of what will be rendered in your document. It is mandatory and starts with a \begin{document} and ends with an \end{document} command. The \begin{} and \end{} commands define an environment in your document but the document environment is, and should always be, the topmost one you use.

example

\documentclass{memoir}
\title{A title}
\date{} # No date will be printed if left blank
\author{James Chip}

\begin{document}
	\pagenumbering{gobble}
	\maketitle
	\newpage
	\pagenumbering{arabic}
	Hello World!
\end{document}

Sections

Similar to headings in markdown where you add more and more octothorpes to the first, in latex you kust keep adding the word "sub" to the word "section" to nest text sections.

\section{Section Title}
Text that goes in the section under the title.

\subsection{A Subtitle}
Text that goes in the subsection under the title.

\subsubsection{A Sub-subtitle}
Even more text to put in.

\Paragraph{}
Paragraph text. This will be indented while the others will not.

Sections have a default numbering scheme on them. If you wish to avoid numbering on your sections then use \section*{TITLE} instead.

paragraphs

To set paragraph indent and spacing use the following:

\setlength{\parindent}{0pt}
\setlength{\parskip}{2em}	

nth numbers

To have numbers with th, rd or st appended to them formatted properly you can use the nth package.

\documentclass[a5paper, openany]{memoir}
\usepackage[super]{nth}

\begin{document}

These are the \nth{1}, \nth{2} and \nth{3} number on this line.

\end{document}