LZN's Blog CodePlayer

Learning Latex on Overleaf

2020-06-20
LZN

Latex is something very useful that you only take 30 minute to learn and benefits from it through all your career. Here we hope to use Latex to replace MS word to create docs that need regular modifications, e.g. CV and bio.

Notes

Overleaf tutorial

Beginner example

\documentclass{article}

\begin{document}
First document. This is a simple example, with no 
extra parameters or packages included.
\end{document}

The first line of code declares the type of document, known as the class. The class controls the overall appearance of the document. Different types of documents will require different classes i.e. a CV/resume will require a different class than a scientific paper.

The preamble of a document

Everything in your .tex file before \begin{document} point is called the preamble. In the preamble you define the type of document you are writing, the language you are writing in, the packages you would like to use (more on this later) and several other elements.

\documentclass[12pt, letterpaper]{article}
\usepackage[utf8]{inputenc}

As for the paper size other possible values are a4paper and legalpaper. Encoding for the document, utf-8 is recommended.

Article Example

\documentclass{article}
\usepackage[utf8]{inputenc}
 
\title{Sections and Chapters}
\author{Gubert Farnsworth}
\date{ }
 
\begin{document}
 
\maketitle
 
\tableofcontents
 
\section{Introduction}
 
This is the first section.
 
Lorem  ipsum  dolor  sit  amet,  consectetuer  adipiscing  
elit.   Etiam  lobortisfacilisis sem.  Nullam nec mi et 
neque pharetra sollicitudin.  Praesent imperdietmi nec ante. 
Donec ullamcorper, felis non sodales...
 
\addcontentsline{toc}{section}{Unnumbered Section}
\section*{Unnumbered Section}
 
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  
Etiam lobortis facilisissem.  Nullam nec mi et neque pharetra 
sollicitudin.  Praesent imperdiet mi necante...
 
\section{Second Section}
 
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.  
Etiam lobortis facilisissem.  Nullam nec mi et neque pharetra 
sollicitudin.  Praesent imperdiet mi necante...
 
\end{document}

Updated 2020-06-20


Comments

Content