DEV Community

Cover image for Latex For Beginners Part 2
Mustafif
Mustafif

Posted on • Edited on

2 2

Latex For Beginners Part 2

This part will be dedicated to talking about Parts, Chapters, Sections and Paragraphs. The hierarchy being just that, so for those who don't click a lot in Microsoft Word to make sure everything is the right hierarchy, you're going to have to type it now! (Honestly I rather type than click a lot).

For those wondering what a section is, it's another word for header, but more general since latex serves different needs for documents.

Defining these are simple, just put \ in front of the word, like so:

\part{Part 1}
\chapter{Chapter 1}
\section{Section 1}
\paragraph{Paragraph 1}
\par Text % \par is for paragraph text, as it indents
Enter fullscreen mode Exit fullscreen mode

Except for \par, they all have alternate forms by putting * in front of the word, this is to not have the numbers and such
shown.

Let's make a new document and use a variety of these to really show how they work:

\documentclass[11pt, letterpaper, oneside]{book}
% To use chapter, it must be book class
\title{Latex For Beginners Part 2}
\author{Mustafif}
\date{\today}

\begin{document}
   \maketitle % create title page 
   \pagenumbering{arabic} %define page numbering
   \newpage
   \tableofcontents % set table of contents
   \newpage 
   \part{The first of the first}
   \chapter{I am chapter}
   \section{I am the section}
   \subsection{I am subsection}
   \subsubsection{I am subsubsection}
   \section*{I have no number and TOC won't see me}
\end{document}
Enter fullscreen mode Exit fullscreen mode

Run pdflatex part2.tex and you'll see something like this:
Image description

Image description

Image description

Image description

In the next part we will discuss Equations, the fun and the pain

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay