LaTeX Unlocked: A Powerful Blueprint for Beginners to Conquer Document Design! (Part 1)

Your Web Page LaTeX - Screenshot of LaTeX document

Table of Contents

Introduction

Welcome to the world of LaTeX, a sophisticated typesetting system that turns your writings into polished, professional works of art. LaTeX provides a versatile and fast way to write documents with precision and flair, whether you’re a student, scholar, or educator. In this comprehensive introduction, we will go over the fundamentals of LaTeX, breaking down each component to create a seamless learning experience for novices.

1. Understanding LaTeX

LaTeX, pronounced “LAY-tech” or “LAH-tech,” is a document preparation system that is commonly used to create publications such as research papers, articles, reports, and even presentations. LaTeX, unlike standard word processors, employs a markup language approach, allowing users to concentrate on content production while the system handles formatting.

2. Why LaTeX?

a. Quality Typography

LaTeX is very good at delivering high-quality typographic output. It automates document formatting to ensure consistency in typefaces, spacing, and overall layout.

b. Mathematical Typesetting

One of LaTeX’s most notable characteristics is its outstanding support for mathematical typesetting. LaTeX provides a stable environment for expressing mathematical material, whether you’re creating simple equations or sophisticated mathematical proofs.

c. Cross-Referencing and Citations

LaTeX simplifies the process of creating cross-references within your document and managing citations. It is particularly useful for academic writing where accurate referencing is crucial.

3. Target Audience

This guide is intended for those who are new to LaTeX and want to understand its essential ideas. Educators, students, and anyone else interested in creating professional-looking documents will find useful insights and practical recommendations along the way.

As we explore the world of LaTeX, keep in mind that the learning curve may appear steep at first, but the benefits in terms of document quality and efficiency are well worth the investment. Let’s go on this exciting journey together, unraveling the complexities of LaTeX and equipping you to create documents with finesse.

Getting Started with LaTeX

Now that you have a basic understanding of what LaTeX is and why it is such a useful tool, let’s get into the nuts and bolts of getting started with LaTeX. This section will walk you through installing LaTeX, configuring a LaTeX editor, and creating your first basic document.

1. Installing LaTeX

You must first install a LaTeX distribution on your computer before you can begin working with it. There are numerous distributions available, but two of the most popular are TeX Live and MiKTeX. Here’s a quick rundown:

a. TeX Live
  • TeX Live is a comprehensive distribution available for various operating systems, including Windows, macOS, and Linux.
  • Visit the TeX Live website and follow the installation instructions for your operating system.
b. MiKTeX
  • MiKTeX is another cross-platform LaTeX distribution with a focus on Windows users.
  • Download MiKTeX from the MiKTeX website and follow the installation instructions.

2. Setting up a LaTeX Editor

While a simple text editor can be used to create LaTeX documents, using a dedicated LaTeX editor improves the experience with features such as syntax highlighting and built-in compilation. Consider the following two popular LaTeX editors:

a. TeXworks
  • A user-friendly and cross-platform LaTeX editor.
  • Included in the TeX Live distribution.
  • Provides a straightforward interface for editing and compiling LaTeX documents.
b. Overleaf
  • An online LaTeX editor that requires no installation.
  • Ideal for collaborative work as it allows multiple users to edit the same document simultaneously.
  • Create an account on Overleaf and explore its user-friendly interface.

3. Basics of LaTeX Input File

Now that you have LaTeX installed and a preferred editor set up, let’s create your first LaTeX document. A basic LaTeX document consists of three main parts:

				
					\documentclass{article} % Document class declaration

\begin{document} % Document content begins

Hello, LaTeX! % Your content goes here.

\end{document} % Document content ends

				
			
  • The \documentclass{article} line specifies the document class (in this case, an article).
  • The document environment contains the main content of your document.
  • Text and commands go between \begin{document} and \end{document}.

The output of the above code is shown below:

Embedded PDF

Congratulations! You’ve successfully set up LaTeX and created your first document

Document Formatting

In this section, we will go over the essentials of the LaTeX preamble, including document class options, packages, and sectioning and displayed content structuring.

A. Preamble & Document Class Options

The preamble is the first section and serves as the foundation of your LaTeX document. It’s where you define the overall look and feel of your document by configuring various settings and loading packages. The following is a summary of what you’ll find in the preamble:

1. Document Class

The first line of your preamble begins with the \documentclass{} command, followed by the name of the document class. This specifies the general type of document you’re creating (for example, article, book, or report).  The most commonly used document classes include:

  • article: Suitable for short documents, articles, and reports.
  • report: Ideal for longer documents with chapters, such as a thesis or a multi-chapter report.
  • book: Designed for book-length documents, providing features like chapters and parts.
  • letter: Tailored for writing letters.

You can further customize your document by passing optional arguments to the documentclass command, such as font size and paper size.

2. Document Class Options:

Document classes frequently provide a variety of options for tailoring their behavior to specific needs. These options are enclosed in square brackets after the document class name.  For example, the article class includes options like

  • 11pt: Sets the font size to 11pt.
  • a4paper: Specifies the paper size as A4.
  • twoside: Enables double-sided printing.
  • openright: Starts each chapter on a right-hand page.
  • titlepage: Adds a title page automatically.

You can combine multiple options by separating them with commas as shown below.

				
					\documentclass[11pt,a4paper,twoside,openright]{article}

				
			

3. Packages:

  • LaTeX packages provide additional functionality beyond the core capabilities of the document class.
  • Packages are loaded using the \usepackage command followed by the package name.
  • Some commonly used packages include:
    • amsmath: For advanced mathematical typesetting.
    • graphicx: Enables including graphics in your document.
    • hyperref: Creates clickable hyperlinks within your document.
  • Many packages offer their own options to customize their behavior, similar to document class options.

4. Additional Settings:

The preamble can also include various settings like:

  • \title: Sets the title of your document.
  • \author: Specifies the author(s) and their affiliations.
  • \date: Inserts the current date automatically.
  • \maketitle: Prints the title, author, and date on a separate page.

5. Example Preamble:

				
					\documentclass[11pt,a4paper,twoside,openright]{article}

\usepackage{amsmath}
\usepackage{graphicx}

\title{My First LaTeX Document}
\author{John Doe}
\date{\today}

\begin{document}

\maketitle

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque consectetur massa nec felis congue, eu convallis elit interdum. Sed nec ex vel dui hendrerit consectetur. Nulla facilisi. Vivamus et cursus nulla. Sed feugiat ex vel nunc eleifend, sit amet bibendum ligula tincidunt. Duis vel eros ac quam gravida elementum. Suspendisse potenti. Integer cursus, neque nec vestibulum pellentesque, purus lectus congue nisl, non ullamcorper arcu justo ac erat.

\end{document}

				
			
Embedded PDF

Understanding and selecting the appropriate document class is a critical step in creating a well-formatted LaTeX document. As we progress through this guide, we’ll look at more formatting options, such as sectioning, displaying material, and fine-tuning your document’s appearance. Let’s continue our exploration of the fascinating world of LaTeX document formatting!

B. Sectioning

The hierarchy and structure of your document are determined by sectioning commands. They define the various heading levels, such as chapters, sections, and subsections. Let’s look at the main sectioning commands and how they’re used.

1. Creating Sections

To create sections in your document, use the following commands:

				
					\section{Introduction}      % Creates a section titled "Introduction"
\subsection{Background}     % Creates a subsection titled "Background"
\subsubsection{Overview}    % Creates a subsubsection titled "Overview"

				
			

Consider the following example:

				
					\documentclass{article}

\begin{document}

\section{Introduction}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\subsection{Background}
In this section, we provide background information.

\subsubsection{Overview}
An overview of the main concepts is presented here.

\end{document}

				
			
Embedded PDF

2. Formatting Section Headings

LaTeX automatically formats section headings, but you can customize their appearance using various commands:

				
					\section*{Conclusion}       % Creates an unnumbered section titled "Conclusion"
\subsection*{Summary}       % Creates an unnumbered subsection titled "Summary"

				
			

The asterisk (*) suppresses the numbering of the section or subsection.

Consider the following example:

				
					\documentclass{article}

\begin{document}

\section*{Conclusion}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.

\subsection*{Summary}
A brief summary of the main points.

\end{document}

				
			
Embedded PDF

3. Cross-Referencing Sections

LaTeX allows you to cross-reference sections within your document:

				
					\section{Methodology}
\label{sec:methodology}      % Labels the section for reference

In Section \ref{sec:methodology}, we discuss the methodology.

				
			

The \label command assigns a label to the section, and \ref is used to refer to that label elsewhere in the document.

Consider the following example:

				
					\documentclass{article}

\begin{document}

\section{Introduction}

The term "methodology" is associated with a variety of meanings. In its most common usage, it refers either to a method, to the field of inquiry studying methods, or to philosophical discussions of background assumptions involved in these processes.

\section{Methodology}
\label{sec:methodology}

In its most common sense, methodology is the study of research methods.

\section{Overview}
In Section \ref{sec:methodology}, we discuss the methodology.

\end{document}
				
			
Embedded PDF

4. Adding Section Summaries

You can add a summary or description to a section using the \paragraph and \subparagraph commands:

Consider the following example:

				
					\documentclass{article}

\begin{document}

\section{Results}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam.

\subsection{Data Analysis}

In this subsection, we analyze the collected data to draw meaningful conclusions.

\paragraph{Key Findings:}
Significant improvement in performance after implementing the new algorithm. Correlation between variables A and B, indicating a potential relationship.

\subparagraph{Implications:}
The implications of these findings are crucial for future research and application. Consideration of the new algorithm in real-world scenarios for enhanced performance. Further investigation into the relationship between variables A and B to uncover underlying mechanisms.

\end{document}

				
			
Embedded PDF

5. Table of Contents

LaTeX automatically generates a table of contents based on your sectioning commands. To include it in your document, add:

				
					\tableofcontents

				
			

Consider the following example:

				
					\documentclass{article}

\begin{document}

\tableofcontents

\section{Introduction}
This is the introduction section.

\subsection{Background}
Some background information.

\subsubsection{Examples}

\section{Overview}
This is the overview section.

\subsection{Conclusion}
This is the conclusion.

\end{document}

				
			
Embedded PDF

6. Numbering and Depth

To control the numbering and depth of sections, use the following commands in the preamble:

				
					\setcounter{secnumdepth}{3}   % Numbers up to subsubsections
\setcounter{tocdepth}{3}      % Includes subsubsections in the table of contents

				
			

Adjust the values to control the level of sectioning you want to include in your document.

Let’s explore two examples to illustrate the impact of changing numbering and depth in LaTeX:

Example 1: Default Numbering and Depth

				
					\documentclass{article}

\begin{document}

\tableofcontents

\section{Introduction}
This is the introduction section.

\subsection{Background}
Some background information.

\subsubsection{Details}
Detailed information about the background.

\end{document}

				
			
Embedded PDF

In this example, the default numbering and depth are maintained. All sections (up to subsubsection) are numbered, and they are included in the table of contents

Example 2: Adjusted Numbering and Depth

				
					\documentclass{article}

\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}

\begin{document}

\tableofcontents

\section{Introduction}
This is the introduction section.

\subsection{Background}
Some background information.

\subsubsection{Details}
Detailed information about the background.

\end{document}

				
			
Embedded PDF

In this example, the numbering and depth are adjusted using the \setcounter commands in the preamble. Only sections and subsections are now numbered, and they are included in the table of contents. The \subsubsection is not numbered or included in the table of contents.

7. Using Paragraphs and Line Breaks

The use of proper paragraph and line breaks is critical in creating a clear and visually appealing document structure. LaTeX provides a number of tools to help with this.

1. Paragraphs:
  • Automatic paragraph breaks:
    • LaTeX automatically starts a new paragraph when you leave an empty line between lines of text.
    • This is the most common and recommended way to create paragraphs.
  • Forced paragraph breaks:
    • Use the \par command to force a paragraph break even if no empty line follows.
    • Useful for controlling paragraph placement within environments or for specific formatting needs.
2. Line Breaks:
  • Hard line breaks:
    • Use the \\ command to force a line break within a paragraph.
    • The line will not stretch to fill the full line width.
  • Soft line breaks:
    • Use the \newline command to suggest a line break.
    • LaTeX will decide whether to break the line based on available space and hyphenation rules.
  • Break with stretching:
    • Use the \linebreak command to force a line break and stretch the remaining text to fill the line.
    • Use with caution as it can affect the readability of your text.
3. Formatting considerations:
  • Paragraph indentation:
    • LaTeX automatically indents the first line of each paragraph by a default amount.
    • You can adjust the indentation using the \setlength{\parindent}{<length>} command.
  • Line spacing:
    • LaTeX defines the spacing between lines in your document.
    • You can change the line spacing globally using packages like setspace or parskip.

The following example shows clear demonstration of the commands '\par', '\\', '\newline', '\linebreak', and '\noindent'.

				
					\documentclass{article}

\begin{document}

In \LaTeX, we can control the formatting of our text in various ways. The command \par is used to separate paragraphs. This is the first paragraph, and it ends here.\par Now, we start a new paragraph. The double backslash \\ and the command \newline both create a line break within a paragraph. This is a new line within the same paragraph. Moving on, \linebreak not only breaks the line but also attempts to justify the lines in the available space, like this: This is a longer line of text that will break across lines with \linebreak justification.\\
\noindent This paragraph starts with no indentation. Combining these commands allows for precise control over the structure and layout of our text in a \LaTeX document.

\end{document}

				
			
Embedded PDF

8. Aligning Text (Left, Center, Right)

Text alignment is essential for creating visually appealing and readable documents. LaTeX provides several methods for aligning text within paragraphs and sections to the left, center, or right.

Here are the two main methods for aligning text in LaTeX:

1. Environment commands:
  • \begin{flushleft} … \end{flushleft}: Aligns all text within the environment to the left margin.
  • \begin{center} … \end{center}: Centers all text within the environment.
  • \begin{flushright} … \end{flushright}: Aligns all text within the environment to the right margin.

Consider the following example:

				
					\documentclass{article}

\begin{document}

\begin{flushleft}
This paragraph is left-aligned.
\end{flushleft}

\begin{center}
This paragraph is centered.
\end{center}

\begin{flushright}
This paragraph is right-aligned.
\end{flushright}

\end{document}
				
			
Embedded PDF
2. Text-mode commands:
  • \hspace*{<length>}: Inserts horizontal space before the next character, useful for shifting text right.
  • \hspace*{-<length>}: Inserts horizontal space after the current character, useful for shifting text left.
  • \hphantom{<text>}: Inserts a space the same width as the provided text without actually displaying the text.

Consider the following example:

				
					\documentclass{article}

\begin{document}

This is some regular text. \hspace{1cm} This is a space of 1cm.

This is some regular text. \hspace*{-1cm} This is a negative space of 1cm.

This is some regular text with \hphantom{phantom}phantom text. The word "phantom" doesn't appear, but it still affects \hphantom{abcdefghijklmnopqrstuvwxyz}spacing.

\end{document}
				
			
Embedded PDF

C. Display Material

In this section, we will look at how to provide display material in LaTeX, such as lists and verbatim text. Display material improves the appearance and organization of your documents.

1. Lists

LaTeX supports three main types of lists: itemize, enumerate, and description.

a. Itemize

The itemize environment is used for creating bulleted lists:

				
					\begin{itemize}
    \item Item 1
    \item Item 2
    \item Item 3
\end{itemize}

				
			
b. Enumerate

The enumerate environment is used for creating numbered lists:

				
					\begin{enumerate}
    \item First item
    \item Second item
    \item Third item
\end{enumerate}

				
			
c. Description

The description environment is used for creating lists with descriptions:

				
					\begin{description}
    \item[Label 1] Description 1
    \item[Label 2] Description 2
    \item[Label 3] Description 3
\end{description}

				
			

Consider the following example:

				
					\documentclass{article}

\begin{document}

\section{Lists in LaTeX}

\subsection{Itemize}

\begin{itemize}
    \item First item
    \item Second item
    \item Third item
\end{itemize}

\subsection{Enumerate}

\begin{enumerate}
    \item First task
    \item Second task
    \item Third task
\end{enumerate}

\subsection{Description}

\begin{description}
    \item[LaTeX] A typesetting system
    \item[Itemize] Environment for bulleted lists
    \item[Enumerate] Environment for numbered lists
\end{description}

\end{document}

				
			
Embedded PDF

2. Verbatim Text

The verbatim environment is used for displaying text exactly as it is typed, without any formatting:

				
					\begin{verbatim}
This is verbatim text.
    It preserves      spaces and line breaks.
\end{verbatim}

				
			

Consider the following example:

				
					\documentclass{article}

\begin{document}

\section{Verbatim Text in LaTeX}

The \texttt{verbatim} environment is used for displaying text exactly as it is typed, without any formatting. It's commonly used for displaying code snippets, command-line outputs, or any text that should not undergo LaTeX processing.

\begin{verbatim}
This is verbatim text.
    It preserves      spaces and line breaks.
Special characters like $, %, and \ are also displayed as is.
\end{verbatim}

\end{document}

				
			
Embedded PDF

3. Customizing Lists

You can customize the appearance of lists using various commands, such as changing the bullet style or numbering format:

				
					\begin{itemize}
    \item[--] Item with a dash
    \item[$\ast$] Item with an asterisk
\end{itemize}

\begin{enumerate}
    \renewcommand{\labelenumii}{\roman{enumii}.}
    \item First item
    \item Second item
\end{enumerate}

				
			

Consider the following example:

				
					\documentclass{article}

\begin{document}

\section{Customizing Lists in LaTeX}

\subsection{Itemize with Custom Bullet Styles}

\begin{itemize}
    \item[$\rightarrow$] First item with an arrow
    \item[$\ast$] Second item with an asterisk
    \item[--] Third item with a dash
\end{itemize}

\subsection{Enumerate with Custom Numbering Format}

\begin{enumerate}
    \renewcommand{\labelenumi}{\roman{enumi}.}
    \item First task
    \item Second task
\end{enumerate}

\end{document}

				
			
Embedded PDF

4. Spacing in LaTeX

LaTeX provides several commands for controlling horizontal and vertical spacing within your document. These commands are useful for modifying the layout and appearance of your content.

Horizontal Spaces:
  • a. \hspace{<length>}: This command inserts a horizontal space of the specified length.
  • b. \hfill: The \hfill command inserts a stretchable space that fills the available horizontal space.
Vertical Spaces:
  • a. \vspace{<length>}: Similar to \hspace, \vspace adds a vertical space of the specified length.
  • b. \vfill: \vfill inserts a stretchable space that fills the available vertical space.
  • c. \smallskip, \medskip, \bigskip: These commands provide predefined vertical spaces for small, medium, and large skips, respectively.

Consider the following example which demonstrates all these spacing commands: 

				
					\documentclass{article}

\begin{document}

\section{Introduction}
This is an introduction to spacing in LaTeX.

\section{Document Formatting}

\subsection{Horizontal Spaces}

This is some text. \hspace{1in} This text has a 1 inch space.

Left \hfill Center \hfill Right

\subsection{Vertical Spaces}

This is some text. 

\vspace{1cm} 
This text is vertically spaced.

\vfill

This text is at the bottom of the page.

\smallskip

This is a small skip.

\medskip

This is a medium skip.

\bigskip

This is a big skip.

\end{document}

				
			
Embedded PDF

Typography in LaTeX

Typography is important in document presentation because it influences readability and visual appeal. LaTeX includes powerful facilities for manipulating type style, allowing you to change the font, size, and emphasis of your writings.

A. Changing Type Style

You can adjust the type style in LaTeX according to your preferences. Let’s look at some basic commands for changing the type style.

1. Font Family

LaTeX supports various font families, such as serif, sans-serif, and typewriter. You can change the font family using commands like \rmfamily, \sffamily, and \ttfamily, respectively.

				
					{\rmfamily This is a serif font.}
{\sffamily This is a sans-serif font.}
{\ttfamily This is a typewriter font.}

				
			

2. Font Size

Adjusting the font size is essential for emphasizing specific content. LaTeX provides commands like \tiny\scriptsize, \footnotesize, \small, \large, \Large,\LARGE, \huge and \Huge to change the font size.

Consider the following example:

				
					\documentclass{article}

\begin{document}

\tiny {This is tiny text.}

\scriptsize{This is scriptsize text}

\footnotesize {This is footnotesize text}

\small {This is small text.}

\large {This is large text.}

\Large {This is Large text.}

\LARGE {This is LARGE text.}

\huge {This is huge text.}

\Huge {This is Huge text.}

\end{document}
				
			
Embedded PDF

3. Font Series

The font series refers to the thickness or weight of the font. You can use \mdseries (or \textmd) for medium (normal) and \bfseries (or \textbf) for bold.

				
					\documentclass{article}

\begin{document}

This is text in the default font series.

\textmd{This is text in the medium (normal) font series.}

\textbf{This is text in the bold font series.}

\end{document}
				
			
Embedded PDF

4. Font Shape

Font shape refers to the slant or italicization of the text. Use \textup for upright, \textit for italic, \textsl for slanted and \textsc for small caps.  Consider the following example.

				
					\documentclass{article}

\begin{document}

\textup{This is upright text.}

\textit{This is italic text.}

\textsl{This is slanted text.}

\textsc{This is Small Caps Text.}

\end{document}
				
			
Embedded PDF

5. Emphasizing Text

The \emph{} command is used to emphasize text. The actual styling depends on the context. In an italicized context, it switches to upright, and vice versa.  Consider the following example:

				
					\documentclass{article}

\begin{document}

This is regular text. \emph{This text is emphasized.} Back to regular text.

\textit{This is italic text, and \emph{this part is emphasized within italics}.}

\end{document}
				
			
Embedded PDF

6. Text Color

To add color to your text, you can use the xcolor package and the \textcolor{color}{text} command.

				
					\documentclass{article}
\usepackage{xcolor}

\begin{document}

This is \textcolor{blue}{blue}, \textcolor{green}{green}, and \textcolor{red}{red} text.

\large{\textcolor{orange}{\textbf{\textit{This text is bold, italic, and orange with a large font size.}}}}

\end{document}

				
			
Embedded PDF

Customizing the type style in LaTeX gives you complete control over the look of your document. Experiment with these commands to achieve the desired look for different sections of your content.

B. Producing Mathematical Symbols and Formulae

LaTeX excels at mathematical content representation, allowing you to seamlessly integrate mathematical symbols and expressions into your documents. Let’s take a look at the fundamentals of mathematical typesetting in LaTeX.

1. Inline Mathematics

For inline mathematics—mathematics that is part of the text—you can write the mathematical expression using either the dollar sign $...$ or the \(...\) syntax.  Both methods are used to include mathematical expressions within the text of your document.  For example:

				
					The Pythagorean theorem is $a^2 + b^2 = c^2$ and the equation of a circle is given by \(x^2 + y^2 = r^2\).


				
			

This renders as: “The Pythagorean theorem is \( a^2+b^2=c^2\) and the equation of a circle is \(x^2 + y^2 = r^2\).

2. Displayed Mathematics

For displayed mathematics—mathematics that is centered on its line—you can use \[ and \] or the equation environment. For example:

				
					\[ E = mc^2 \]
or
\begin{equation}
E = mc^2
\end{equation}

				
			

The output of the above code is :

3. Mathematical Symbols

LaTeX provides a wide range of mathematical symbols. Here are some examples with their corresponding LaTeX command:

Greek Letters

\( \alpha \) (\alpha)
\( \beta \) (\beta)
\( \gamma \) (\gamma)
\( \delta \) (\delta)
\( \epsilon \) (\epsilon)
\( \zeta \) (\zeta)
\( \eta \) (\eta)
\( \theta \) (\theta)
\( \iota \) (\iota)
\( \kappa \) (\kappa)
\( \lambda \) (\lambda)
\( \mu \) (\mu)
\( \nu \) (\nu)
\( \xi \) (\xi)
\( \omicron \) (\omicron)
\( \pi \) (\pi)
\( \rho \) (\rho)
\( \sigma \) (\sigma)
\( \tau \) (\tau)
\( \upsilon \) (\upsilon)
\( \phi \) (\phi)
\( \chi \) (\chi)
\( \psi \) (\psi)
\( \omega \) (\omega)
\( \Gamma \) (\Gamma)
\( \Delta \) (\Delta)
\( \Theta \) (\Theta)
\( \Lambda \) (\Lambda)
\( \Xi \) (\Xi)
\( \Pi \) (\Pi)
\( \Sigma \) (\Sigma)
\( \Upsilon \) (\Upsilon)
\( \Phi \) (\Phi)
\( \Psi \) (\Psi)
\( \Omega \) (\Omega)

Mathematical Functions

\( \sin \) (\sin)
\( \cos \) (\cos)
\( \tan \) (\tan)
\( \cot \) (\cot)
\( \sec \) (\sec)
\( \csc \) (\csc)
\( \arcsin \) (\arcsin)
\( \arccos \) (\arccos)
\( \arctan \) (\arctan)
\( \sinh \) (\sinh)
\( \cosh \) (\cosh)
\( \tanh \) (\tanh)
\( \coth \) (\coth)
\( \ln \) (\ln)
\( \log \) (\log)
\( \liminf \) (\liminf)
\( \limsup \) (\limsup)
\( \max \) (\max)
\( \min \) (\min)
\( |x| \) (|x|)
\( \lceil x \rceil \) (\lceil x \rceil)
\( \lfloor x \rfloor \) (\lfloor x \rfloor)
\( \lim \) (\lim)

Binary operation, Relation and Set therory symbols

\( + \) (+)
\( – \) (-)
\( \times \) (\times)
\( \div \) (\div)
\( \cdot \) (\cdot)
\( \oplus \) (\oplus)
\( \otimes \) (\otimes)
\( \circ \) (\circ)
\( \pm \) (\pm)
\( = \) (=)
\( \neq \) (\neq)
\( < \) (<)
\( > \) (>)
\( \leq \) (\leq)
\( \geq \) (\geq)
\( \equiv \) (\equiv)
\( \approx \) (\approx)
\( \neg \) (\neg)
\( \land \) (\land)
\( \lor \) (\lor)
\( \rightarrow \) (\rightarrow)
\( \leftrightarrow \) (\leftrightarrow)
\( \exists \) (\exists)
\( \forall \) (\forall)
\( \vdash \) (\vdash)
\( \models \) (\models)
\( \emptyset \) (\emptyset)
\( \in \) (\in)
\( \notin \) (\notin)
\( \subset \) (\subset)
\( \subseteq \) (\subseteq)
\( \supset \) (\supset)
\( \supseteq \) (\supseteq)
\( \cup \) (\cup)
\( \cap \) (\cap)
\( \setminus \) (\setminus)
∴ (\therefore)
(\because)

Arrows

\( \leftarrow \) (\leftarrow)
\( \rightarrow \) (\rightarrow)
\( \leftrightarrow \) (\leftrightarrow)
\( \Leftarrow \) (\Leftarrow)
\( \Rightarrow \) (\Rightarrow)
\( \Leftrightarrow \) (\Leftrightarrow)
\( \uparrow \) (\uparrow)
\( \downarrow \) (\downarrow)
\( \updownarrow \) (\updownarrow)
\( \Uparrow \) (\Uparrow)
\( \Downarrow \) (\Downarrow)
\( \Updownarrow \) (\Updownarrow)
\( \nearrow \) (\nearrow)
\( \searrow \) (\searrow)
\( \nwarrow \) (\nwarrow)
\( \swarrow \) (\swarrow)
\( \mapsto \) (\mapsto)
\( \longleftarrow \) (\longleftarrow)
\( \longrightarrow \) (\longrightarrow)
\( \longleftrightarrow \) (\longleftrightarrow)
\( \Longleftarrow \) (\Longleftarrow)
\( \Longrightarrow \) (\Longrightarrow)
\( \Longleftrightarrow \) (\Longleftrightarrow)
\( \rightharpoonup \) (\rightharpoonup)
\( \rightharpoondown \) (\rightharpoondown)
\( \leftharpoonup \) (\leftharpoonup)
\( \leftharpoondown \) (\leftharpoondown)
\( \rightleftharpoons \) (\rightleftharpoons)

Math Accents

\( \overline{a} \) (\overline{a})
\( \underline{a} \) (\underline{a})
\( \bar{a} \) (\bar{a})
\( \widehat{a} \) (\widehat{a})
\( \widetilde{a} \) (\widetilde{a})
\( \vec{a} \) (\vec{a})
\( \dot{a} \) (\dot{a})
\( \ddot{a} \) (\ddot{a})
\( \overrightarrow{AB} \) (\overrightarrow{AB})
\( \overleftarrow{AB} \) (\overleftarrow{AB})
\( \overleftrightarrow{AB} \) (\overleftrightarrow{AB})

Miscellaneous symbols

\( \infty \) (\infty)
\( \Re \) (\Re)
\( \Im \) (\Im)
\( \nabla \) (\nabla)
\( \partial \) (\partial)
\( \neg \) (\neg)
\( \triangle \) (\triangle)
\( \cdots \) (\cdots)
\( \vdots \) (\vdots)
\( \ldots \) (\ldots)
\( \ddots \) (\ddots)
\( \angle \) (\angle)
\( \bigcup \) (\bigcup)
\( \bigcap \) (\bigcap)
\( \cong \) (\cong)

Superscript: ‘x^2’ produces \( x^2\) and ‘B^{a^{b}}’ produces \(B^{a^{b}}\)

Subscript: ‘y_1’ produces \( y_1 \) and ‘A_{i_{j}}’ produces \(A_{i_{j}}\)

Fractions: ‘\frac{a}{b}’ produces \( \frac{a}{b} \)

Square root: ‘\sqrt{3}’ produces \( \sqrt{3}\)

\(n^{\text{th}}\) root: ‘\sqrt[n]{3}’ produces \( \sqrt[n]{3} \)

Integral: ‘\int ‘ produces \( \int \), ‘\iint’ produces \( \iint \), ‘\oint’ produces \(\oint \) and ‘\int_a^b’ produces \( \int_a^b \)

Summation: ‘\sum’ produces \( \sum \) and  ‘\sum_{n=0}^{\infty}’ produces \( \sum_{n=0}^{\infty} \)

4. Mathmatical Packages

Mathematical packages in LaTeX extend the functionality, symbols, and formatting options available for mathematical typesetting. While LaTeX includes math features by default, these packages expand its capabilities, making it even more powerful for expressing mathematical content. Here are some examples of commonly used mathematical packages.

1. ‘amsmath’ Package:
				
					\usepackage{amsmath}

				
			

The 'amsmath' package is essential for advanced mathematical typesetting. It introduces numerous environments like  align,  align*, and more.

2. ‘amssymb’ Package:
				
					\usepackage{amssymb}

				
			

The 'amssymb' package provides additional mathematical symbols, such as \( \mathbb{R}\) for the set of real numbers.

3. ‘calrsfs’ Package: 
				
					\usepackage{calrsfs}

				
			

The 'calrsfs' package is a LaTeX package that provides a calligraphic font alternative for mathematical symbols. It is an abbreviation for “Calligraphic Raph Smith” and is intended to provide a distinct and aesthetically pleasing calligraphic script.

5. Mathematical Fonts (Math Mode)

LaTeX includes a number of mathematical fonts for various purposes, allowing you to express mathematical symbols and structures in a variety of styles. Here are some examples of commonly used mathematical fonts.

1. Double-Struck (Blackboard Bold) Letters:

The \mathbb{} command in LaTeX is used to produce double-struck letters, often referred to as Blackboard Bold. This is commonly used for denoting sets such as real numbers, integers, complex numbers, etc.

2. Calligraphic (Script) Letters:

The \mathcal{} command is used to produce calligraphic or script-like letters. It is often used for denoting special sets or script letters in mathematical notation.

3. Fraktur (Gothic) Letters:

The \mathfrak{} command is used to produce Fraktur or Gothic letters. Fraktur is a specific type of blackletter typeface that is often associated with mathematical symbols.

Consider the following example:

				
					\documentclass{article}
\usepackage{amssymb}  % for \mathbb
\usepackage{calrsfs}  % for \mathcal

\begin{document}

Blackboard Bold letters: \(\mathbb{R}\), \(\mathbb{Z}\), \(\mathbb{C}\), \(\mathbb{N}\), \(\mathbb{Q}\)

Calligraphic letters: \(\mathcal{A}\), \(\mathcal{B}\), \(\mathcal{L}\)

Fraktur letters: \(\mathfrak{A}\), \(\mathfrak{B}\), \(\mathfrak{C}\).

\end{document}
				
			

The output of the above code is shown below:

6. Spacing in Math Mode

In LaTeX, math mode spacing is critical for proper alignment and presentation of mathematical expressions. There are several commands available to control the spacing between mathematical elements.  Consider the following example in which the commands ‘ \, ‘, ‘ \: ‘, ‘ \; ‘, ‘ \quad ‘ and ‘ \qquad ‘ are used.

				
					\documentclass{article}
\usepackage{amsmath}
\begin{document}

\( a \, b \)

\( a \: b \)

\( a \; b \)

\( a \quad b \)

\( a \qquad b \)


\end{document}
				
			
Output

C. Mathematical Enviornments

LaTeX includes multiple mathematical environments for typesetting various mathematical content elements, ranging from simple equations to complicated structures such as matrices and alignments.

1. 'equation' Environment:

The 'equation' environment is used for displaying a single, centered equation with an equation number. It’s often used for important equations that you might want to refer to later.  Consider the example:

				
					\documentclass{article}

\begin{document}

The Pythogorean theorem is
\begin{equation}
    a^2 + b^2 = c^2
\end{equation}

The solution of the quadratic equation \( ax^2+bx+c\) is given by:
\begin{equation}
    x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}
\end{equation}

\end{document}

				
			

The output of the above code is shown below:

2. 'align' Environment:

The 'align' environment is used to align multiple equations at specific points on the screen. It’s a useful tool for aligning equations, especially when you have multiple equations with common alignment points.  Consider the following example: 

				
					\documentclass{article}
\usepackage{amsmath}

\begin{document}

Solve the following simultaneous equation:
\begin{align}
  x + y &= 5 \\
  2x - 3y &= 1
\end{align}

The approximate value of \( \pi\) and e are:
\begin{align}
  \pi &\approx 3.141593 \\
  e &\approx 2.718282
\end{align}

\end{document}
				
			

The output of the above code is shown below:

The '&' symbol in the 'align' environment in LaTeX is used as an alignment marker. It specifies the point at which the equations will be aligned.

3. ' align* ' Environment

In LaTeX, the 'align*'environment is a variant of the align environment. It is used to align multiple equations without assigning equation numbers to the equations.  Consider the previous example but with 'align*'environment :

				
					\documentclass{article}
\usepackage{amsmath} % Required for the cases environment

\begin{document}

Solve the following simultaneous equation:
\begin{align*}
  x + y &= 5 \\
  2x - 3y &= 1
\end{align*}

The approximate value of \( \pi\) and e are:
\begin{align*}
  \pi &\approx 3.141593 \\
  e &\approx 2.718282
\end{align*}

\end{document}
				
			

The output of the above code is shown below:

4. 'cases' Environment:

The 'cases' environment is used to define piecewise functions. It provides a convenient way to express functions with different definitions for different ranges of the variable.  Consider the following example: 

				
					\documentclass{article}
\usepackage{amsmath}  % Required for the cases environment

\begin{document}

Consider the function \( f(x) \) defined as follows:
\[ f(x) =
  \begin{cases}
    x^2, & \text{if } x \geq 0 \\
    -x, & \text{if } x < 0
  \end{cases}
\]

\end{document}

				
			

The output of the above code is shown below:

5. Matrix Environment:

LaTeX includes several matrix environments for typesetting matrices and other similar structures. For various matrix types, these environments provide a variety of styles and formatting options.   Each matrix environment is used in math mode and typically within an equation environment (‘\[ ... \]‘, '$ ... $'or \begin{equation} ... \end{equation}).  Elements in the matrix are separated by ‘&', and each row ends with ‘\\'.

Let’s look at some examples of matrix environments:

The 'matrix' environment is the basic matrix environment in LaTeX. It creates a matrix without any delimiters. The syntax is as follows:

				
					\documentclass{article}
\usepackage{amsmath}  % Required for matrix environments

\begin{document}

\[
\begin{matrix}
  a & b \\
  c & d \\
\end{matrix}
\]

\end{document}
				
			

The output of the above code is shown below:

The 'pmatrix' environment creates a matrix with parentheses as delimiters.  The syntax is as follows:

				
					\documentclass{article}
\usepackage{amsmath}  % Required for matrix environments

\begin{document}

\[
\begin{pmatrix}
  a & b & c\\
  d & e & f\\
\end{pmatrix}
\]

\end{document}
				
			

The output of the above code is shown below:

The bmatrix environment creates a matrix with square brackets as delimiters.  The syntax is as follows:

				
					\documentclass{article}
\usepackage{amsmath}  % Required for matrix environments

\begin{document}

\[
\begin{bmatrix}
  a & b \\
  c & d \\
  e & f \\
\end{bmatrix}
\]

\end{document}
				
			

The output of the above code is shown below:

The Bmatrix environment creates a matrix with curly braces as delimiters.  The syntax is as follows:

				
					\documentclass{article}
\usepackage{amsmath}  % Required for matrix environments

\begin{document}

\[
\begin{Bmatrix}
  a & b & c \\
  d & e & f \\
  g & h & i \\
\end{Bmatrix}
\]

\end{document}
				
			

The output of the above code is shown below:

The vmatrix environment creates a matrix with single vertical bars as delimiters.  The syntax is as follows:

				
					\documentclass{article}
\usepackage{amsmath}  % Required for matrix environments

\begin{document}

\[
\begin{vmatrix}
  a & b \\
  c & d \\
\end{vmatrix}
\]

\end{document}
				
			

The output of the above code is shown below:

 The Vmatrix environment creates a matrix with double vertical bars as delimiters.  The syntax is as follows:

				
					\documentclass{article}
\usepackage{amsmath}  % Required for matrix environments

\begin{document}

\[
\begin{Vmatrix}
  a & b \\
  c & d \\
\end{Vmatrix}
\]

\end{document}
				
			

The output of the above code is shown below:

6. 'theorem-like' Environment:

In mathematical typesetting, presenting theorems, definitions, lemmas, corollaries, and notes in a structured and methodical manner is crucial for efficient communication of mathematical concepts. The amsthm package in LaTeX provides a comprehensive range of tools for creating theorem-like settings that contribute to the clarity and structure of mathematical content. The following definitions introduce five separate environments: 'theorem', 'lemma', 'definition', 'corollary', and 'remark'.

Theorem Environment:
				
					\newtheorem{theorem}{Theorem}[section]
				
			

The 'theorem' environment is excellent for presenting important mathematical propositions. It is section-numbered, ensuring a structured enumeration that starts over in each section.

Lemma Environment:
				
					\newtheorem{lemma}[theorem]{Lemma}
				
			

The 'lemma'environment is used to state supporting results or lemmas that help to understand and prove overarching theorems. For an ordered enumeration, it shares numbering with the theorem context.

Definition Environment:
				
					\newtheorem{definition}[theorem]{Definition}
				
			

The 'definition' environment is intended for introducing and defining mathematical concepts.  Similar to lemmas, definitions share numbering with the underlying 'theorem' environment, promoting a unified enumeration of mathematical entities.

Corollary Environment:
				
					\newtheorem{corollary}[theorem]{Corollary}
				
			

The 'corollary' environment conveys immediate consequences or results derived from established theorems in a concise manner. Sharing numbering with the 'theorem' environment ensures a consistent and logical flow of corollary enumeration.

Remark Environment:
				
					\newtheorem{remark}[theorem]{Remark}
				
			

The 'remark'environment allows for insightful comments or observations about the presented theorems. Remarks are seamlessly integrated into the mathematical discourse by sharing numbering with the 'theorem' environment.

Consider the following example:

				
					\documentclass{article}
\usepackage{amsthm}

% Define theorem-like environments
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{remark}[theorem]{Remark}

\begin{document}

\section{Mathematical Content}

\begin{theorem}
  Pythagorean Theorem: In a right-angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.
\end{theorem}

\begin{proof}
  The proof is left as an exercise for the reader.
\end{proof}

\begin{corollary}
  Every right-angled triangle is a triangle.
\end{corollary}

\begin{corollary}
  In a right-angled triangle, the hypotenuse is always longer than each of the other two sides.
\end{corollary}

\begin{lemma}
  In any triangle, the sum of the interior angles is always 180 degrees.
\end{lemma}

\begin{definition}
  An acute angle is an angle that measures less than 90 degrees.
\end{definition}

\begin{remark}
  It's important to note that the Pythagorean Theorem holds true only for right-angled triangles.
\end{remark}

\end{document}

				
			
Embedded PDF

This example creates a section titled “Mathematical Content” and includes a theorem, its proof, two corollaries, a lemma, a definition, and a remark related to the Pythagorean Theorem.

D. Arrays and Delimiters

Arrays, which are essentially tables of mathematical expressions arranged in rows and columns, are created in LaTeX using the array environment. Delimiters, on the other hand, are symbols that are used to surround or enclose mathematical expressions and adjust their size dynamically to match the enclosed content. Let’s get into the fundamentals of arrays and delimiters in LaTeX.

1. Arrays

You can create arrays in math mode using the array environment. It is similar to the tabular environment used in text mode but is specifically designed for mathematical expressions. The following is the syntax:

				
					\begin{array}{column_specification}
  entry_11 & entry_12 & ... & entry_1n \\
  entry_21 & entry_22 & ... & entry_2n \\
                        ...            \\
  entry_m1 & entry_m2 & ... & entry_mn \\
\end{array}

				
			
  • 'column_specification' defines the alignment of each column (e.g., l for left, c for center, r for right and | for vertical line).
  • Entries are placed in rows, separated by &, and rows end with \\.
				
					\documentclass{article}
\usepackage{amsmath} 

\begin{document}
\[
\begin{array}{|l|r|c|}
\hline
\text{Left-aligned} & \text{Right-aligned} & \text{Centered} \\
\hline
12 & 345 & 67 \\
1234 & 5 & 89 \\
\hline
\end{array}
\]
\end{document}
				
			

In this example:

  • The first column is specified as left-aligned (l).
  • The second column is specified as right-aligned (r).
  • The third column is specified as centered (c).
  • Vertical lines (|) are used to separate columns.

The output of the above code is shown below:

				
					\documentclass{article}
\usepackage{amsmath} 

\begin{document}
\[
\begin{array}{ccc}
  1 & 2 & 3 \\
  4 & 5 & 6 \\
  7 & 8 & 9 \\
\end{array}
\]
\end{document}
				
			

The output of the above code is shown below:

				
					\documentclass{article}
\usepackage{amsmath} 

\begin{document}
\[
\begin{array}{|c|c|c|}
\hline
  1 & 2 & 3 \\
\hline  
  4 & 5 & 6 \\
\hline  
  7 & 8 & 9 \\
\hline 
\end{array}
\]
\end{document}
				
			

The output of the above code is shown below:

				
					\documentclass{article}
\usepackage{amsmath} 

\begin{document}
\[
\begin{array}{c|c|c}
  1 & 2 & 3 \\
\hline  
  4 & 5 & 6 \\
\hline  
  7 & 8 & 9 \\ 
\end{array}
\]
\end{document}
				
			

The output of the above code is shown below:

				
					\documentclass{article}
\usepackage{amsmath} 

\begin{document}
\[
\begin{array}{|ccc|}
  1 & 2 & 3 \\
  4 & 5 & 6 \\
  7 & 8 & 9 \\
\end{array}
\]
\end{document}
				
			

The output of the above code is shown below:

2. Delimiters

LaTeX includes a number of delimiters that adjust their size based on the enclosed content. Parentheses '()', brackets '[]', braces '{}', and the vertical bar '|'are all common delimiters. You can automatically adjust the size of these delimiters by using the '\left' and '\right' commands.  Consider the following examples:

				
					\documentclass{article}
\usepackage{amsmath} 

\begin{document}

\[
\left( \frac{a}{b} \right)
\]

\end{document}
				
			

The output of the above code is shown below:

				
					\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\left[ \frac{a}{b} \right]
\]

\end{document}
				
			

The output of the above code is shown below:

				
					\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\left\{ \frac{\frac{a}{b}}{c} \right\}
\]

\end{document}
				
			

The output of the above code is shown below:

				
					\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\left \langle \frac{3}{4}, \frac{5}{6}, \frac{7}{8} \right \rangle
\]

\end{document}
				
			

The output of the above code is shown below:

				
					\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\left. \frac{dy}{dx} \right|_{x=0}=\sqrt{\frac{3}{4}}
\]

\end{document}
				
			

Here '\left.' is an invisible left delimiter, and '\right|' is a right delimiter that represents a vertical bar  '|'.  The output of the above code is shown below:

Below is the list of Delimiters with their corresponding LaTeX command.

\( ( \) ( ( )
\( ) \) ( ) )
\( [ \) ( [ )
\( ] \) ( ] )
\( \{ \) ( \{ )
\( \} \) ( \} )
\( \| \) ( \| )
\( \langle \) ( \langle )
\( \rangle \) ( \rangle )
\( / \) ( / )
\( \backslash \) ( \backslash )
\( | \) ( |  )
\( \lfloor \) ( \lfloor )
\( \rfloor \) ( \rfloor )
\( \lceil \) ( \lceil )
\( \rceil \) ( \rceil )

The first part of our blog covered fundamental aspects of LaTeX for beginners and educators. We introduced the significance of LaTeX, steps to get started, and basics of LaTeX input files. We discussed document formatting, including document class selection, sectioning, and display materials. Typography in LaTeX, covering font styles and mathematical symbols, was also explored. In the second part, we’ll delve into advanced features like custom commands, graphics, figures, columns, tables of contents, and more. Click this link to explore advanced LaTeX features and expand your knowledge.

6 thoughts on “LaTeX Unlocked: A Powerful Blueprint for Beginners to Conquer Document Design! (Part 1)”

  1. Pingback: LaTeX Unlocked - mathonlinenotes.com

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top