Introduction to LaTeX for Beginners
Introduction to LaTeX for Beginners
Aakash singh
[Link] (H) mathematics
Roll no. 22/6230
1 Latex 5
1.1 What is LaTeX ? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Benefits of LaTeX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Virtues of open source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Creating our first document online . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Creating Tables 9
2.1 How to start making a table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3
4 CONTENTS
Chapter 1
Latex
LaTeX is free, open source software for typesetting documents. In other words, it’s a document
preparation system. LaTeX is not a word processor, but it’s a document markup language. It was
initially written by Leslie Lamport and is based on the TeX typesetting engine by Donald Knuth.
People often refer to it as just TeX, meaning LaTeX It has a long history; you can read about it at
[Link] For now, let’s continue by looking at how we can make the most of La-
TeX.
LaTeX is especially well suited for scientific and technical documents. LaTeX’s superior typesetting
of mathematical formulas is legendary. Suppose you are a student or a scientist. In that case, LaTeX
is by far the best choice, and even if you don’t need its scientific capabilities, there are other uses—
it produces very high-quality output and is incredibly stable. It handles complex documents easily,
no matter how large they are. Some more remarkable strengths of LaTeX are its cross-referencing
capabilities, the ability for automatic numbering, and the generation of lists of contents, figures and
tables, indexes, glossaries, and bibliographies. It is multilingual with language-specific features, and
it can use PostScript and PDF features. Apart from being perfect for scientists, LaTeX is incredi-
bly flexible—there are templates for letters, presentations, bills, philosophy books, law texts, music
scores, and even chess game notation. Hundreds of LaTeX users have written thousands of templates,
styles, and valuable tools for every possible purpose. It is collected and categorized online on archiv-
ing servers. You could benefit from its impressive high quality by starting with its default styles and
relying on its intelligent formatting, but you are free to customize and modify everything. People of
the TeX community have already written a lot of extensions addressing nearly every formatting need.
5
6 CHAPTER 1. LATEX
1. Register for the service. Either click on Register on the Overleaf home page or go to [Link]
Enter your email address and choose a password.
3. Click the New Project button. A drop-down list will appear, where you can choose to have a
blank project or one based on a template, such as a book, presentation, CV, or thesis template.
For now, we just choose Blank Project.
1.4. CREATING OUR FIRST DOCUMENT ONLINE 7
4. Overleaf asks you for a name; choose one. That’s it! This is what you have now: It’s not entirely
blank as it contains a small code frame, so you got a quick start, and you can begin filling in
your text. Whenever you click the Recompile button or press Ctrl + Enter, the preview on the
right side will be refreshed. You can enable automatic typesetting if you open the Recompile
menu and choose Auto Compile in the drop-down menu, which is switched on in Figure 1.2.
The document refreshes frequently and automatically while you are typing:
Since Overleaf is so different from classic LaTeX editors, let’s have a closer look at it.
8 CHAPTER 1. LATEX
Chapter 2
Creating Tables
\documentclass{article}
\begin{document}
2. Begin a tabular environment. As a mandatory argument, provide ccc, standing for three centered
columns:
\begin{table}
\centering
\begin{tabular}{ccc}
3. Write the table head row, add & to separate column entries, and add \\ to end rows. Use \hline
to insert horizontal lines:
\hline
\head{Command} & \head{Declaration} & \head{Output}\\
\hline
4. When we write more then one line in a cell then we use the below command.
\makecell{A\\B}
5. When we have to use more than one column then we use below command
\multicolumn{2}{c}{}
9
10 CHAPTER 2. CREATING TABLES
\end{tabular}
\end{table}
\end{document}
\documentclass{article}
\begin{document}
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|}
\hline \makecell{Period\\ days} & \makecell{ I\\ 8:30-9:30} & \makecell{II\\ 9:30-10:30}
\hline Mon& \makecell{MH-IV-B\\SSF,OB-8}&\makecell{PS-IV-B\\GP-1\\SB-2}& & & &\makecell{
\hline Tue & &&&&&&\makecell{VAC-II\\SEM,VM-1\\SB-2}&\multicolumn{2}{C|}{\makecell{VAC-I
\hline Wed&\multicolumn{8}{C|}{OFF DAY}&\\
\hline Thur & && \multicolumn{2}{C|}{\makecell{MH-VI-A ,MT, LAB \\ CA}}& \makecell{MH-IV
\hline Fri& &&&& \makecell{MH-IV-B,\\SSF,\\N-10}& \makecell{MH-VI-A\\DSE3-MF\\GP-3,OB-8}
\hline Sat& &&&& \multicolumn{4}{C|}{\makecell{SEC-IV SEM , LATEX, MTLAB\\(1 PM TO 5PM )
\hline
\end{tabular}
\label{tab:my_label}
\end{table}
\end{document}
Output
2.1. HOW TO START MAKING A TABLE . 11
• Paragraph mode: The text is typeset as a sequence of words in lines, paragraphs, and pages.
That’s what we used in the previous chapters.
• Left-to-right mode: The text is a sequence of words, but LaTeX typesets it from left to right
without breaking the line. For instance, the argument of \mbox will be typeset in this mode; so
\mbox prevents hyphenation.
• Math mode: Here, LaTeX treats letters as math symbols. That’s why they’re typeset in italics,
which is common practice for variables. A lot of symbols can only be used in math mode. Such
symbols are roots, sum signs, relation signs, math accents, arrows, and various delimiters, such
as brackets and braces. LaTeX ignores space characters between letters and symbols. Instead,
the spacing depends on the type of symbols— spacing of relation signs is different from spacing
of opening or closing delimiters. All math expressions require this mode.
Now we shall enter the math mode for the first time. Our first math text shall deal with the solutions of
quadratic equations. We will typeset formulas with constants, variables, superscripts for the square,and
subscripts for the solutions. The solution itself needs a root symbol. Finally, we will use cross-
references to formulas. That’s quite a challenge, so let’s break it down into the following steps:
\documentclass{article}
\begin{document}
\section*{Quadratic equations}
2. State the quadratic equation with its conditions. Use an equation environment for it. Surround
small pieces of math within text using and:
13
14 CHAPTER 3. WRITING MATH FORMULAS
3. Use another equation for the solutions. The command for a square root is \sqrt. The command
for a fraction is \frac:
\begin{equation}
\label{root}
x_{1,2} = \frac{-b \pm \sqrt{b^2-4ac}}{2a}.
\end{equation}
4. Let’s introduce the discriminant and discuss case zero. To get an unnumbered displayed equa-
tion, we surround the formula with \[ and \]:
5. Click on Typeset to compile the document. The equation references are unresolved in the first
run and look like (?). Compile again to let LaTeX resolve them, and look at the result
3.1. WRITING BASIC FORMULAS 15
Quadratic equations
x2 + bx + c = 0, (3.1)
where a, b and c are constants and a ̸= 0, has two solutions for the variable x:
√
−b ± b2 − 4ac
x1,2 = . (3.2)
2a
∆ = b2 − 4ac
is zero, then the equation (3.1) has a double solution: (3.2) becomes
b
x=− .
2a
16 CHAPTER 3. WRITING MATH FORMULAS
{expression}_{subscript}
{expression}^{superscript}
As we see here, we use braces to define the relevant part of the expression. Subscripts and superscripts
may be nested. If you use both subscripts and superscripts in the same expression, the order of ^ and
_ doesn’t matter. In the case of single letters, numerals, or symbols, you can omit the braces. Let’s
look at an example:
\arccos, \arcsin, \arctan, \arg, \cos, \cosh, \cot, \coth, \scs, \deg, \det,
\dim, \exp, \gcd, \hom, \inf, \ker, \lg, \lim, \liminf, \limsup, \ln, \log, \max,
\min, \Pr, \sec, \sin, \sinh, \sup, \tan, \tanh
We can write the modulo function in two ways – either by using \bmod for a binary relation or by
using \pmod{argument} for a modulo expression in parentheses. Some operators support subscripts,
which are set in displayed formulas below the operator as follows:
lim an max x
n=1,2,... x<X
3.4. TAKING ROOTS 17
Our first example code in this chapter, contained a square root: \sqrt{value}. As there are higher-
order roots, this command accepts an optional argument for the order. The complete definition is as
follows: \sqrt[order]{value} Roots may be nested. We can see it in this example:
$$\sqrt[64]{x} = \sqrt{\sqrt{\sqrt{\sqrt{\sqrt{\sqrt{x}}}}}}$$
vv
uus
uu rq
√ ut √
64 t
x= x
LaTeX adjusts the size of the root symbol automatically to the height and the width of the value
expression. That’s why outer roots are bigger than inner roots.
Within text formulas, you may just write / to denote fractions, such as \((a+b)/2 \). For larger
fractions, there’s the \frac command: \frac{numerator}{denominator} Here is an example:
√
n(n + 1)
x+1
2
−x
2 y2
18 CHAPTER 3. WRITING MATH FORMULAS
\documentclass{article}
\usepackage{amsmath}
\begin{document}
$$
A = \begin{pmatrix}
a_{11} & a_{12} \\
a_{21} & a_{22}
\end{pmatrix}
$$
\end{document}
• matrix: no delimiters
• pmatrix: parentheses ( )
• Bmatrix: braces
• vmatrix: | |
• Vmatrix: || ||
• smallmatrix: no delimiters – can be added if needed, more compact The compact smallmatrix
environment is useful for matrices within regular text
3.6. TYPESETTING MATRICES 19
LaTeX का इ तहास
LaTeX को 1980 के दशक क शुरुआत में लेस्ली लैमपोटर् द्वारा बनाया गया था जब वह स्टैनफोडर् रसचर् इंस्टीट्यट ू
(SRI) में काम कर रहे थे।
उन्हें अपने स्वयं के उपयोग के लए TeX मैक्रोज़ लखने क आवश्यकता थी और उन्होंने सोचा िक थोड़े अ त रक्त
प्रयास के साथ, वह एक सामान्य पैकेज को दस ू रों के उपयोग योग्य बना सकते हैं। ए डसन-वेस्ले के संपादक पीटर
गॉडर् न ने उन्हें प्रकाशन के लए एक लाटेक्स उपयोगकतार् मैनुअल लखने के लए राजी िकया (लैम्पपोटर् को शुरू में
संदेह था िक कोई इसके लए पैसे देगा);
यह 1986 में प्रका शत हुआ और इसक सैकड़ों-हजारों प्र तयां िबक । इस बीच, लैमपोटर् ने 1984 और 1985 में
अपने लाटेक्स मैक्रोज़ के संस्करण जारी िकए। 21 अगस्त 1989 को, स्टैनफोडर् में एक टीएक्स उपयोगकतार् समूह
(टीयूजी) क बैठक में, लैम्पपोटर् ने लाटेक्स के रखरखाव और िवकास को फ्रैंक िमत्तेलबैक को सौंपने पर सहम त व्यक्त
क ।
फ्रैंक िमत्तेलबैक ने िक्रस रोवले और रेनर शॉफ़ के साथ िमलकर LaTeX3 टीम बनाई; 1994 में, उन्होंने वतर् मान मानक
संस्करण LaTeX2e जारी िकया। LaTeX3 को तब से रद्द कर िदया गया है और उस संस्करण के लए इ च्छत सुिवधाओं
को 2018 से LaTeX2e में वापस पोटर् िकया जा रहा है।
ओवरलीफ़
ओवरलीफ़ एक सहयोगी क्लाउड-आधा रत LaTeX संपादक है जसका उपयोग वैज्ञािनक दस्तावेज़ लखने, संपािदत
करने और प्रका शत करने के लए िकया जाता है। यह आ धका रक जनर् ल LaTeX टेम्प्लेट और सीधे सबिमशन लक
प्रदान करने के लए वैज्ञािनक प्रकाशकों क एक िवस्तृत श्रृख
ं ला के साथ साझेदारी करता है।
ओवरलीफ़ क कल्पना जॉन हैमरस्ले और जॉन लीज़-िमलर ने क थी, जन्होंने 2011 में इसे अपनी कंपनी
WriteLaTeX लिमटेड के माध्यम से WriteLaTeX के रूप में िवक सत करना शुरू िकया था । दोनों ग णतज्ञ हैं और
सहयोगात्मक वैज्ञािनक लेखन के लए बेहतर समाधान तैयार करने के लए अकादिमक क्षेत्र में अपने स्वयं के अनुभवों से
प्रे रत थे। उन्होंने 16 जनवरी 2014 को लंदन में िब्रिटश लाइब्रेरी में आयो जत पहले फ्यूचरपब कायर् क्रम में ओवरलीफ
का बीटा संस्करण लॉन्च िकया। 2017 में ShareLaTeX के साथ िवलय के बाद, उन्होंने Overleaf v2 जारी िकया,
जसमें दोनों क मूल िवशेषताओं को एक ही क्लाउड-आधा रत प्लेटफ़ॉमर् में संयो जत िकया गया।
20 CHAPTER 3. WRITING MATH FORMULAS
इ तहास
ओवरलीफ़ को उन दस टीमों में से एक के रूप में चुना गया था जन्होंने 2013 समर के बेथनल ग्रीन वेंचसर् (बीजीवी)
एक्सेलेरट
े र कायर् क्रम में भाग लया था। वह कायर् क्रम 1 जुलाई 2013 को शुरू हुआ और 3 महीने तक चला। उस
बीजीवी 2013 ग्रीष्मकालीन कायर् क्रम का डेमो िदवस 19 सतंबर 2013 को आयो जत िकया गया था।
कंपनी को 2014 में ड जटल साइंस से रणनी तक िनवेश प्राप्त हुआ । ओवरलीफ ने 2014 नॉिमनेट इंटरनेट
अवाड्सर् में इनोवेिटव इंटरनेट िबजनेस जीता , और स डकेटरूम क 2018 क िब्रटेन क शीषर् सूची में 99वें स्थान
पर रहा। 100 सबसे तेजी से बढ़ने वाला व्यवसाय।
ओवरलीफ क चचार् नेचर , साइंस , रेड हैट के ओपनसोसर् .कॉम और जमर् न आईटी पित्रका हेइज़ ऑनलाइन में
वैज्ञािनक प्रकाशन लखने के लए एक उपकरण के रूप में क गई है । "2017 में, स्वट्जरलैंड के जनेवा के पास
यूरोप क कण-भौ तक प्रयोगशाला CERN ने ओवरलीफ को अपने पसंदीदा सहयोगी लेखन मंच के रूप में अपनाया।"
ओवरलीफ वैज्ञािनक पित्रकाओं और सम्मेलनों में प्रस्तुत करने के लए टेम्पलेट प्रदान करता है। उदाहरण के लए,
आईईईई और स्प्रगर (नेचर सिहत ) ओवरलीफ़ का उपयोग करके प्रस्तुत करने क संभावना का उल्लेख करते हैं।