latex

Document classes

Syntax#

  • \documentclass{…}

Remarks#

This topic aims to explain the different types of document and their specificities.

A good way to organize it would be 1 example per type

Article

\documentclass{article}

When to use the article class ?

For articles in scientific journals, presentations, short reports, program documentation, invitations, … 1

What are the specificities of this class ?

An article doesn’t contain chapters or parts. It can be divided in sections, subsections and paragraphs etc.

By default, the title is shown at the top of the first page, and not on a separate title page.

Simple example

\documentclass{article}

\title{Hello world}
\author{Me    }
\date{\today}

\begin{document}

\maketitle

Hello, World!
\end{document}

Beamer

\documentclass{beamer}

When to use the beamer class ?

For presentation slides.

What are the specificities of this class ?

The output is landscape-oriented. The document is separated in “frames” (slides).

Simple example

Following example was adapted from : sharelatex.com/learn/Beamer

\documentclass{beamer}
 
\usepackage[utf8]{inputenc}
 
\title{Sample title}
\author{Me}
\date{\today}
 
\begin{document}
     
\frame{\titlepage}
 
\begin{frame}
\frametitle{Sample frame title}
This is a text in first frame. This is a text in first frame. This is a text in first frame.
\end{frame}
 
\end{document}

Defining the document class

The very first line in each of your LaTeX programs should do this. It should follow the form \documentclass{...}. What you put within the curly braces is very important. Some document classes give you extra commands to use, others use a different format, and all have specific parameters you can input (described in the parameters section).


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow