latex
latex
latex
The Latex is the markup language used for the typesetting of the technical
documents. To learn Latex, you must have a great idea of MS Word and the way or
method in which you want to design your document. It also needs an understanding
of mathematics and related commands.
The Latex is mostly used by scientists, mathematicians, authors, etc. It is also
designed to help beginners as well as the professional to concise and make their
documents look more attractive. It is a fast and time-saving procedure for writing
documents.
Features of Latex
o Latex is a markup language and free license software. It includes a set of built-
in commands.
o It is a mode of mathematical and special symbols.
o LaTeX is generally distributed along with plain TEX, i.e., it provides a set of
macros for TEX to interpret. The other macros for TEX are Plain TEX, GNU
Texinfo, etc.
o LaTeX is not compatible with the GNU (General Public License). It is
available on most of the operating systems like UNIX, BSD, Linux, Windows,
DOS, etc.
Installation of Latex
For LaTeX, you need to download MiKTeX and Texstudio. MiKTeX is a Latex
distribution, a vast collection of files, and is essential for Latex. Texstudio is called
a specialized editor and helps in the Latex workflow. Installing the editor is optional
but it makes the Latex easier. The process will take some time. Below are the steps
for the download and installation of Latex:
o Search for MiKTeX in any browser.
o As the page opens, click on MiKTeX.org and select the 'Download' option
given at the top.
o Now, click on the 'All downloads' option. You will see the window appear
like the image shown below:
o Select the 'Net Installer' and choose the 64 or 32-bit according to your system
configuration and click on the download option. The download will start.
o After that, close the browser. The MiKTeX download is a two-step process in
this.
o In first step, with the help of Net Installer, we download the files, and in the
second step, we install these downloaded files.
o Now, open this file and accept the conditions.
o Select the option 'Download MiKTeX.' Click on Next and then select
'Complete MiKTeX' and again click next.
o Then select the FTP as a download source. Click on the browse option, and
under downloads category, make a new folder by any name and click 'OK'
and then click on next. You can also select any other folder as per your
requirements.
o Click on the 'Start' option, and the downloading process will start, which will
take a while. Wait for the process to download. The downloading dialogue
box will look like the image shown below:
After this, again, go to the MiKTeX and then select 'Install MiKTeX.' It will still
take some time, and now, the process is complete.
If there is an error, then close the window and restart the downloading process by
selecting another server from the list.
o If you select the option 'Basic Installer', then after the download, you can start
the process. The download will complete within very less time. After the
download is completed, open the software.
o Now you have to download the Texmaker. For this, search for it in the browser
or any other search engine. Click on it and install the software. It will appear
on the desktop after the installation.
MIKTEX Overview
After the process is completed, the MiKTeX will appear as 'MiKTeX console.' When
you open this file, it will look like the image given below:
MiKTeX console is our main maintenance interface for all activities related to
MiKTeX.
Under the "Updates" section, you can update all the already installed packages.
Under "Packages," you can manage the individual packages. But make sure to click
on 'Update DB' first, before you add or remove any single package. You can also
click on the '-'and '+' sign to add or remove any package. The Update DB stands for
Update Database. The term 'package repository' is often used in this context as the
synonym for Update DB. This 'Update DB' synchronizes your local database on your
computer, which is outdated to an up-to-date database on the internet. This option is
shown below in the image:
In the above image, the column 'Packaged on' indicates the date when the packet
was added to the internet. The column 'Installed on' shows the date when the packet
was added to your local destination.
TEXSTUDIO Overview
It is termed as the Latex editor, which eases the work. With this, we do not need to
use 'command prompt' in the future. You can also make the folder to place all the
latex files at one place.
The right upper side portion shows the text or writing window, and the left side
shows the structure window. It contains a link to chapters, sections, tables,
equations, etc.
You can click on the File menu and select New file. You can now start your
programming or writing the code on the screen.
o Let's understand the Latex programming or code by an example. We will be
writing code on the screen, and the corresponding output will be printed, after
the compilation of the code. If there are errors, then at the white bottom
window, as shown above, the errors will be displayed with the line number.
o The example is to print a 'thought of the day.' The same code is written on the
Texstudio screen.
The code is given below:
\documentclass[a4paper]{article}
\begin{document}
\begin{center}
\begin{large}
\textbf{\LaTeX\ Thought of the day}\\
\end{large}
\end{center}
Explanation:
{center} is used to align the text to the center.
\textbf is used to display the text in bold.
{large} is a type of font size.
The same code on the Texstudio screen will look like the image provided below:
After writing the code, save the file and then click on the Quick Build option at the
top to view the output.
The output of this code is shown in the image below:
Similarly, you can write as much data and commands to format your document.
It depends on the user, which type and style he/she wants to use in the particular
document. Another example to write a paragraph is shown below:
\documentclass[a4paper]{article}
\begin{document}
\begin{center}
\begin{huge}
\textit{\LaTeX\ Overview}\\
%'\\' is used to display the text in the new line
\end{huge}
\end{center}
\LaTeX\ uses more iteration and floating elements such as tables and the figures
to make the document more refined and polished.%\ In between is used for the
spacing
% here % command is used to write the comments which are ignored by the Lat
ex and hence are not reflected in the output
It is a document typesetting system used for the publication of technical docum
ents. Latex software not only saves time but also makes the text more attractive
and refined. It is used by scientists, authors for the subjects such as mathematic
s, economics, psychology, engineering, etc. there are two types of editors availa
ble for the Latex, which are online and offline editors. It depends on the conven
ience and ease of the user to choose any particular editor for the Latex. The pro
cedure to write the cost makes the user concentrate on the content instead of the
format. It also has the feature of spell checking.
\end{document}.
The same code on the Texstudio screen will look like the image provided below:
LATEX SYMBOLS
The Latex symbols are widely used in different subjects over hundreds of categories.
For every symbol, which is used either in mathematics or other subjects, a
corresponding command is used. This topic will give you a detail idea and
explanation of the symbols, and in which way, all the symbols can be used.
With the use of standard text, you can use any symbol. This method not only saves
the efforts or time but also gives the convenience to focus more on the content
without wasting much time on finding the symbols and then proceeding with the
content.
Below is the list of the commands divided into the particular categories. The
essential commands used all over are:
o \ it is called backslash, used as the starting command. The line following it
gets printed.
o {} it is called curly brackets, which is used to group and separate commands
from its surroundings and must appear in pairs.
o \\ terminates a line.
o \\* it also terminates the line, but disallows the page break.
o [] it is used to write the optional parameters that can be passed to a command
to change its behavior.
o % The Latex ignores the rest of the line or commands after %.
SYMBOLS List:
The symbol following the \ will be printed. The commands used for the symbol and
special characters are given below:
symbol input Explanation
# \# A parameter in macro
~ \~ Makes a tilde ᾶ
yy \yy Is used as ẙ
b \b Is a "bar under" as ẕ
◊ \diamond ⋈ \bowtie
⋆ \star ⨝ \Join
٧ \vee ≐ \doteq
٨ \wedge ≻ \succ
П \sqcap ≺ \prec
ϵ \in ≽ \succeq
϶ \ni ≼ \preceq
⊔ \sqcup ▷ \rhd
∝ \propto ◁ \lhd
ᴖ \frown ⧐ \unrhd
ᴗ \smile ⧏ \unlhd
⊏ \sqsubset ∀ \forall
⊐ \squpset ꭥ \ohm
⊒ \squpseteq ꓱ \exists
⊑ \sqsubseteq ℓ \all
The miscellaneous symbols used are as follows:
Symbols Commands
à \grave{a}
á \acute{a}
ã \tilde{a}
â \hat{a}
ä \ddot{a}
ā \dot{a}
ȧ \bar{a}
NEGATION SYMBOLS
The negations are formed by putting either \not before the symbol or \n before the
command or word. The table for such commands is given below:
Symbols Commands
ł \nmid
≁ \nsim
≉ \not\approx
∦ \not\parallel
∥ \nparallel
≮ \nless
≰ \nleq
⪇ \lneq
⪈ \gneq
≱ \ngeq
≯ \ngtr
≠ \neq
≢ \not\equiv
≇ \ncong
≩ \gneqq
≨ \lneqq
ARROW SYMBOLS
There are various arrows used for different purposes. The commands to use these
common arrows are listed below:
Arrow Command
← \leftarrow
↑ \uparrow
→ \rightarrow
↓ \downarrow
↔ \leftrightarrow
↙ \swarrow
↕ \updownarrow
↖ \nwarrow
↗ \nearrow
↘ \searrow
LATEX LISTS
The Latex lists are used to add any additional packages. There are three types of
lists. One is the enumerate list, which produces the numbered list. The second
is itemize, which is used for the bulleted lists. The third one is the description list,
which is neither bulleted nor numbered. In Latex, each list is defined by the \item.
Through this method, sub-lists can also be created.
The example for the lists is shown below:
\begin{enumerate}
\item first point
\item second point
\begin{itemize}
\item first sub-point
\item second sub-point
\end{itemize}
\item third point
\end{enumerate}
The output of this is shown in the image below:
1. Enumerate
It is used to create numbered lists.
The simple code for the enumerate list is given below:
\documentclass{article}
\begin{document}
\begin{enumerate}
\item this is the first point
\item this is the second point
\end{enumerate}
\end{document}
The output is shown in below image:
2. Itemize
It is used to create the unnumbered list. The example is given below:
\documentclass{article}
\begin{document}
\begin{itemize}
\item this is the first point
\item this is the second point
\end{itemize}
\end{document}
The output is shown in the image given below:
3. Description
The description list is least known. It is used when you need to explain terms or
notations. The program or code for the Description list is given below:
\documentclass{article}
\begin{document}
\begin{description}
\item[Chemistry] the study of behavior of elements and compounds
\item[History] the study of past
\item[Geology] the study of the solid Earth
\end{description}
\end{document}
The output is shown in the below image:
Nested Lists
For all the above lists, Nested Lists are used to create different environments. It also
means that it is possible to have a sub-list for an item of a list. The maximum depth
for the number of levels is four. The example for the nested list is given below:
\documentclass[12pt]{article}
\begin{document}
\begin{enumerate}
\item One
\begin{enumerate}
\item First
\item Second
\item Third
\end{enumerate}
\item Two
\item Three
\end{enumerate}
\end{document}
The output is shown in the below image:
The numbering styles of the nested lists depends on the depth of the lists. Let-s
consider another example:
\documentclass[17pt]{article}
\begin{document}
\begin{enumerate}
\item first is entered
\item another item of first
\begin{enumerate}
\item Second one
\item another item of second
\begin{enumerate}
\item third is entered
\item another item of third
\begin{enumerate}
\item Fourth one
\item another item of fourth
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{document}
After writing the above code in Texstudio, the screen will look like the image
given below:
Latex lists are also categorized depending on the order, namely, ordered
list and unordered lists. The example of both these lists is given below:
1. Ordered Lists
Latex provides the enumerate environment for the ordered lists. Let us consider an
example. The code written here is used in the Texstudio to produce the output. The
example for the ordered list is given below:
\documentclass[12pt]{article}
\begin{document}
\begin{enumerate}
\item First
\item Second
\item Third
\end{enumerate}
\end{document}
The output is shown in the below image:
2. Unordered Lists
For Unordered lists, Latex provides the itemize environment. It also works without
any additional packages. In the example given below, the code is the same as that of
an ordered list, just in place of enumerate, itemize is used.
\documentclass[12pt]{article}
\begin{document}
\begin{itemize}
\item First
\item Second
\item Third
\end{itemize}
\end{document}
The output is shown in the below image:
Changing the bullet and numbering pattern/format of Latex Lists
Sometimes, it becomes necessary to change the bullets and numbering of the lists
to use a different format. As we know, for the input of a special character, $ sign
is used at the beginning and at the end. The method for both the ordered and
unordered list is given below:
Unordered lists
If you change the format from bullets to dash, then the following command is
used:
\item[--] or \item[$-$]
If you change the format from bullets to asterisk, then the following command is
used:
\item[$\ast$]
If you change the format from bullets to particular character, then the following
command is used:
\item[$ \Any character$]
The program to change the bullets is given below:
\documentclass[14pt]{article}
\begin{document}
\begin{itemize}
\item[--] Dash
\item[$-$] Dash
\item[$\ast$] Asterisk
\item[$\#$] hash character used
\end{itemize}
\end{document}
The output of the above code in the Texstudio is given below:
Ordered lists
It is a tricky process if you want to change the environment. The easiest step is
to use the enumitem environment. This is used with the usepackage command
like usepackage{enumitem}.
The code for the following lists is given below:
\documentclass[12pt]{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=(\alph*)]
\item one item
\item two item
\begin{enumerate}[label=(\arabic*)]
\item third item
\item fourth item
\begin{enumerate}[label=(\roman*)]
\item fifth item
\item sixth item
\end{enumerate}
\end{enumerate}
\end{enumerate}
\end{document}
After writing the above program, the Texstudio screen will look like the below
image:
Itemize
In this type of lists, the renewcommand is used to change the bullets size at
different levels. Let-s understand this by an example. The commands can be used
for the formats to replace the bullet points. The example is given below:
\documentclass{article}
\begin{document}
\renewcommand{\labelitemi}{$\ast$}
\renewcommand{\labelitemii}{$\cdot$}
\renewcommand{\labelitemiii}{$\diamond$}
\begin{itemize}
\item this is the first point
\begin{itemize}
\item this is the second point
\begin{itemize}
\item this is the third point
\end{itemize}
\end{itemize}
\end{itemize}
\end{document}
The output is shown in the below image:
Spacing arguments
These commands are used to change the spacing parameters of the list. Depending
on the document styles and option, the null{} command commonly used here, will
select the default spacings.
The spacing commands, which can be used here, are mentioned below:
o \itemsep: used for extra vertical spaces between the items
o \rightmargin: horizontal distance between the right margin and the lists of
the environment
o \leftmargin: horizontal distance between the left margin and the lists of the
environment
o \topsep: extra vertical spaces at the top of the list
o \labelsep: the separation between the first line of an item and the end of the
box containing a label.
o \labelwidth: the normal width of the box, which contains the label
o \parsep: the vertical spaces between the paragraphs within the items.
o \makelabel{label}: used to generate the label, printed by the \item command
Latex Fonts Size and Styles
Latex Fonts:
Latex Paper size and font size
We usually define the paper size and the font size inside the square brackets [].
The point size can be described in the way [10pt]. The other font sizes are 8pt, 9pt,
10pt, 11pt, 12pt, 14pt, 17pt, 20pt.
The default font size for Latex is 10pt.
The paper types with their dimensions are given below:
o letterpaper (11 x 8.5 in)
o legalpaper (14 x 8.5 in)
o a5paper (5.8 x 8.3 in)
o a4paper (8.3 x 11.7 in)
o executivepaper (10.5 x 7.25 in)
o b5paper (25 x 17.6 cm)
LATEX TYPE SIZE
The default font size or type size that Tex produces is 10pt. There are some of the
declarations which are used for changing the type size. The table for all the type
sizes along with commands is shown below:
In the above sequence, \tiny is the smallest while \Huge is the largest. To
understand, let's consider an example shown below:
\documentclass[a4paper]{letter}
\begin{document}
\begin{center}
\begin{huge}
\textbf{The \LaTeX\ Technical Institute}\\
\end{huge}
\begin{LARGE}
\textsc{\\Certification}
\end{LARGE}
\end{center}
\noindent This to certify that Mr. R.P Sharma has undergone a course in this ins
titute and is qualified to be Technical Expert.
\begin{flushright}
\textsf{The Director}\\
The \LaTeX\ Technical Institute
\end{flushright} %used for aligning to the right
\end{document}
The output of this code is shown in the image below:
LATEX STYLES
The styles are categorized into family, series, and shape. The typestyle in the output
is composed of these three characteristics.
Style command
Roman \textrm{roman}
Typewriter \texttt{typewriter}
Style command
boldface \textbf{boldface}
medium \textmd{medium}
Style command
italic \textit{italic}
slanted \textsl{slanted}
upright \textup{upright}
\documentclass{article}
\begin{document}
\textit{\textbf{ the topic discussed is Latex.}}
\textrm{\textsl{ it contains the process and characteristics}}
\end{document}
If you want to display the above text in separate lines, \newline command is used as
shown below:
\documentclass{article}
\begin{document}
\textit{\textbf{ the topic discussed is Latex.}\newline}
\textrm{\textsl{ it contains the process and characteristics}}
\end{document}
Output:
The other commands commonly used are given below, which will be implemented
further in this project.
Latex Colors
The xcolor package supports adding colors to your text. Using this, you can set the
background, font color, and the page background. You can choose colors from the
predefined colors or can create your color using RGB. The formulas of mathematics
can also be colored.
1. \usepackage{xcolor}
The commands used to access different numbers of colors are listed below:
1. \documentclass[dvipsnames, usenames]{beamer}
The commands for entering the colored text are listed below:
There are two ways of typing the colored text. One is by using
the \textcolorcommand, and another is by using the \color command.
The textcolor command is used for all in one paragraph, while the color command
is used for the text to run over other tex environments and the multiple lines.
To change the background color, you can use the command \pagecolor{mentioned-
color}. This command colors the background of a whole page.
To color the background of the text, you can use the \colorbox{mentioned-
color}{text} command.
If you want to change both the background and the text color, you can use the
command in a way as mentioned below:
1. \colorbox{mentioned-color}{text}{\color{mentioned-color}text}
The primary colors used everywhere or which are the root of all the colors
are red, yellow, and blue(RYB). The three secondary colors are orange, purple, and
green, which is formed by mixing two primary colors. There are six tertiary colors,
which are formed by the mixing of primary and secondary colors.
The predefined colors available on all the systems are listed below:
The other predefined colors are listed below:
Let's consider a simple example to color the text. The code is given below:
1. \documentclass[12pt]{article}
2. \usepackage[dvipsnames]{xcolor} % declaring the package is necessary to i
mplement colors
3.
4. \begin{document}
5. The text is written here.\\
6. \textcolor{red}{the purpose of learning \LaTeX\ is great.}\\ %this \LaTeX\
pattern is used to print the default layout of the work Latex.
7. This is also the text
8. \end{document}
Output:
\documentclass[12pt]{article}
\usepackage[dvipsnames]{xcolor}
\begin{document}
\textcolor{red}{This the text} \\
\textcolor{magenta}{the purpose of learning \LaTeX\ is great.} \\
\textcolor{yellow}{the lines of different colors}\\
\textcolor{pink}{the text is written above} \\
\textcolor{green}{The software used is Texmaker.} \\
\textcolor{orange}{the text is a combination of words and sentences.}
\end{document}
Output:
Text Highlight
There are commands used to highlight the text. You can choose any color to
highlight your text, depending on your requirements. You need a soul package with
the xcolor package to implement the highlighted text.
\documentclass[12pt]{article}
\usepackage[dvipsnames]{xcolor}
\usepackage{soul}
\begin{document}
\begin{center}
\textbf{\color{red}The highlighted text below :}
\end{center}
The text given here is the \hl{highlighted text.}
\end{document}
You can see in the above example, we have used the bold command, color, and the
highlight command.
To specify the color highlight, you need to use the \sethlcolor{color name}
command. You can also use many color highlights in a single program.
\documentclass[12pt]{article}
\usepackage{xcolor, soul}% you can also write both the packages in this format
\begin{document}
\begin{center}
\textbf{\color{blue}The color highlighted text below :}
\end{center}
\sethlcolor{pink}
The text given here is the \hl{highlighted text in pink.}\\
\sethlcolor{orange}
The text given here is the \hl{highlighted text in orange.}
\end{document}
Output:
Latex Images
The images are used to enhance the information in a document or in any file. In most
of the scientific documents, pictures are essential. In Latex, you can enlarge, shrink,
rotate, and can set the reference of the image in your document.
Let's consider a simple example to insert an image. The code is written below:
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
The lion is the king of jungle.\\
\includegraphics[scale=0.1]{lion}
\end{document}
Output:
You can insert many pictures in your document, depending on the requirements.
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
Some stars are visible with the naked \\ eye in the night while some are not.\\
\includegraphics[scale=0.5]{star}\\ % star and star1 are the images saved with t
hese names.
The group of stars is called cluster.\\
\includegraphics[scale=0.25]{star1}
\end{document}
Output:
Path Specification
Sometimes, there are a large number of images present on your computer in different
folders. To insert those images directly in your Latex document, you can specify the
path using the \graphicspath{{ path}} command.
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\graphicspath{ {images/} }
\includegraphics[scale=0.65]{cloud}\\
The image of the cloud is given above.
\end{document}
We have first created the images folder in the location where the Latex files are
present. You can save several images in that folder and can access those directly.
Output:
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\graphicspath{ {images/} }
\includegraphics[width=6cm, height=4cm]{smiley}\\
The image of a smiley is given above.
\end{document}
Output:
Here, you can use any path and dimensions according to the requirements.
Rotation of Image
\documentclass[12pt]{article}
\usepackage{graphicx}
\begin{document}
\graphicspath{ {images/} }
\includegraphics[scale=0.2, angle=50]{butterfly}\\
The rotated image is shown above.
\end{document}
Output:
Image alignment
In the image alignment, two commands are used. The first command
is \baselineskip, which is used to generate vertical line spacing. The second
command is the \quad, which is used to maintain the horizontal space. It has only a
width.
If you want to align the images in the matrix form, then make sure that the width
mentioned of all the photos is equal.
The code to arrange the six images in matrix form is given below:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\begin{center}
\graphicspath{ {images/} }
\includegraphics[width=.2\linewidth]{smiley}\quad
\includegraphics[width=.2\linewidth]{smiley}\quad
\includegraphics[width=.2\linewidth]{smiley}
\\[\baselineskip]% adds vertical line spacing
\includegraphics[width=.2\linewidth]{cloud}\quad
\includegraphics[width=.2\linewidth]{smiley}\quad
\includegraphics[width=.2\linewidth]{cloud}
\end{center}
\end{document}
The math or mathematical symbol are those symbols, which are used as an
intermediate to perform the mathematical functions. The variables and functions in
mathematics are used for various purposes.
The command $ is recommended as the math mode. The input commands mentioned
below are inserted between the $ to produce the corresponding output.
\| ǁ \leq ≤
\alpha α \lnot ¬
\ast * \mid |
\bigodot ʘ \mu µ
\approx ≈ \pm ±
\bullet ● \P ¶
\copyright © \div ÷
\Box □ \prod ∏
\downarrow ↓ \perp ꓕ
\delta ∆ \sqrt √
\geq ≥ \int ∫
\gets ← \oe œ
\gg » \mho Ʊ
± \pm
∞ \infty
≠ \neq
= \eq
~ \sim
× \times
÷ \div
∝ \propto
< \less
≤ \leq
≪ \ll
> \gtr
≫ \gg
∂ \partial
∓ \mp
≅ \cong
≈ \approx
≡ \equiv
∀ \forall
∁ \complement
+ \plus
√ \surd
θ \theta
∪ \cup
∩ \cap
∅ \phi
∆ \traingle
∇ \nabla
∃ \exists
∄ \nexists
∈ \in
∋ \ni
← \leftarrow
↑ \uparrow
¬ \neq
∴ \therefore
↔ \leftrightarrow
∎ \blacksquare
⋱ \ddots
⋯ \cdots
⋮ \vdots
\ \diagdown
/ \diagup
ꭥ \ohm
ℵ \aleph
℘ \wp
∠ \angle
♣ \clubsuit
♠ \spadesuit
♦ \blacklozenge
⊕ \oplus
ln \ln
log \log
ϴ \ominus
ʃ \int
ℓ \ell
℗ \circledP
ℵ \aleph
ℶ \beth
ℏ \hslash
ℜ \Re
ℕ \N
ℝ \R
ℚ \Q
ℤ \Z
↺ \circlearrowleft
↻ \circlearrowright
↶ \curvearrowleft
↷ \curvearrowright
⇊ \downdownarrows
↩ \hookleftarrow
↪ \hookrightarrow
↫ \looparrowleft
Some other commonly used symbols are listed in the below table:
Symbol Commands
∮ \oint
∬ \iint
∭ \iiint
∩ \cap
∪ \cup
≑ \doteqdot
≖ \eqcirc
≗ \circeq
≍ \asymp
≲ \lesssim
≳ \gtrsim
⊂ \subset
⊃ \supset
≒ \fallingdotseq
≎ \Bumpeq
⊆ \subseteq
⊇ \supseteq
⊈ \nsubseteq
⊉ \nsupseteq
⊏ \sqsubset
⊐ \sqsupset
⊑ \sqsubseteq
⊒ \sqsupseteq
⊓ \sqcap
⊔ \sqcup
⊗ \otimes
⊖ \ominus
⊘ \oslash
⊠ \boxtimes
⊡ \boxdot
⋬ \ntrainglelefteq
⦾ \circledcirc
⨄ \uplus
⊛ \circledast
Greek Symbols
α \alpha
β \beta
γ \gamma
δ \delta
ε \varepsilon
ϵ \epsilon
ϑ \vartheta
μ \mu
π \pi
ρ \rho
σ \sigma
τ \tau
φ \varphi
ω \omega
χ \chi
Π \prod
Σ \sum
Λ \wedge
V \vee
η \eta
ς \varsigma
ζ \zeta
λ \lambda
ϒ \Upsilon
ϖ \varpi
Trigonometric functions
cos \cos
sin \sin
tan \tan
cot \cot
sec \sec
cosec \cosec
csc \csc
arcsin \arcsin
arccos \arccos
arctan \arctan
arcsec \arcsec
arccot \arccot
sinh \sinh
cosh \cosh
tanh \tanh
Brackets The brackets in your document are used for various purposes. Let’s
consider an alphabet a, to understand the format of brackets. The brackets are
listed in the below table:
Brackets Input commands
⟨a \langle
a⟩ \rangle
{ \lbrace
} \rbrace
| \lvert
| \rvert
ǁa \lVert
aǁ \rVert
⌊a \lfloor
a⌋ \rfloor
⌈a \lceil
4⌉ \rceil
The equations are used in the document, either in Microsoft Word or in the Latex.
In Latex, you can easily write the equations using the commands. You can quickly
insert such commands to write the equations between or anywhere in your document
with the use of simple text. You need not to search for the equations or symbols on
the menu bar as compared to the others.
1. \begin{equation}
2. ...........
3. \end{equation}
The package used to implement the mathematical command and equations is given
below:
1. \usepackage{amsmath}
Or
1. \usepackage{mathtools}
The mathtools package also loads the amsmath package. Hence, from the above
two packages, either one can be used.
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
x + y = 4 % there should be no gap between any of the two rows
\end{equation}
\end{document}
Output:
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
x^2 +2x+ 6 = 0
\end{equation}
\end{document}
Output:
Let's consider another example to write the equations. The code is given below:
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
x^3 - y^2 = 23
\end{equation}
\end{document}
Output:
If you're going to write the numbers, etc. in the infinite or finite series format, then
you can use the command given in the below code:
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
1, 2, 3, 4, 5, 6........... \infty
\end{equation}
\end{document}
Output:
You can also write a simple equation in different formats. The code for such an
example is given below:
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
10 \text{oranges} \times 2 \text{dozens of oranges} = 120 \text{oranges}
\end{equation}
\end{document}
Output:
You can also write several equations in your document, depending on the
requirements. The equation number will be adjusted automatically according to the
equations. But you need to use a separate environment for every equation.
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation} % to implement equations more than one, you need to use a se
parate equation environment for every equation.
x^3 + y^3 = 9
\end{equation}
\begin{equation}
x^2 + 2x + 4 = 0
\end{equation}
\begin{equation}
y^2 + 4y = 5
\end{equation}
\end{document}
Output:
You can also perform the derivation anywhere in your document using the
commands discussed so far.
Let's understand the concept of derivation with a simple example.
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{center}
The three equations of motion are: \\
\end{center}
\begin{equation} % to insert extra space between equations, you can leave spac
e between the equation environments. But you should not leave space inside an
y environment.
v = u + at
\end{equation}
\begin{equation}
v^2 = u^2 + 2as
\end{equation}
\begin{equation}
s = ut + 1/2at^2
\end{equation} \\
where,\\
s = displacement; \\
u = initial velocity; \\
v = final velocity; \\
a = acceleration; \\
t = time of motion
\end{document}
Output:
Operators
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\cos^2 \theta + \sin^2 \theta = 1
\end{equation}
\end{document}
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
cos2 \theta = 1 - 2sin^2\theta % you can specify any equation according to the r
equirements.
\end{equation}
\end{document}
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\lim\limits_{x \to n-1} \exp(x) = 0
\end{equation}
\end{document}
Output:
The code for the second example is given below:
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
\lim\limits_{x \to \infty} \Sigma f(x) = 0
\end{equation}
\centering
where,
\begin{equation}
f(x) = 3x^3 + 2x^2 - 4ax +2 = 0
\end{equation}
\end{document}
Here, you can also combine different forms and types of mathematical equations
depending on the requirements.
Output:
Power and Indices
The power and indices are considered similar to the superscripts and subscripts in
the standard text.
The curly brackets {} are used to enclose the power of more than one digit.
The subscript notation is mentioned in Latex using the underscore symbol (_).
You can also insert the vertical bar in the equations using the | symbol.
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{equation}
k_n = k_{n-1} + k_{n-2}
\end{equation}
\end{document}
Output:
The code for the second example is given below:
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{center}
\begin{equation}
a^{12} \times a^{22} = a^{34}
\end{equation}
where,\\
12 + 22 = 34 \\
equation 1 signifies that the powers are added when multiplied.
\begin{equation}
b^9 \div b^4 = b^5
\end{equation}
where,\\
9 - 4 = 5 \\
equation 2 signifies that the powers are subtracted when divided.
\end{center}
\end{document}
Output:
The code for the third example is given below:
\documentclass[12pt]{article}
\usepackage{mathtools}
\begin{document}
\begin{center}
\begin{equation}
f(x) = x^3 + 2x^2 + 4x + 2 |_{x = -2}
\end{equation}
\end{center}
\end{document}
Output: