Latex Practicals
PRIYANSHU KUMAR YADAV ATAL SATISH
Sachin
May 9, 2025
Contents
1 practical 1
In this practical, we will cover the following topics:
1. Starting LaTeX and Preparing an input file
2. Sequences and paragraphs
3. Quotation marks and Dashes
4. Space after a period
5. Special symbols and Simple text- generating commands
6. Emphasizing text and Preventing line breaks
7. Footnotes and ignorable input
1. Starting LaTeX and Preparing an input file: Download editor (Tex-maker,
TeXnic- Center, Tex Shop, TeX-studio etc) and complier MikTeX to create
a LaTeX file. The commands are written in the editor and file needs to
be saved before the commands are executed.
2. Sequences and paragraphs: The end of words are marked by spaces. La-
TeX ignores most extra spaces in a file. Two or more spaces also create
one blank space.
A blank line (or lines) tells LaTeX to start a new paragraph.
+, -, ¡,¿, alphabets, and Sixteen punctuation characters namely . : ; , ? !
‘ ’ ( ) [ ] - / * @ are typed from keyboard directly.
3. Quotation marks and Dashes:
For single right quote we use ’ and for single left quote ‘.
Example: He said, ‘All is not well right now’.
1
For double quotes, use single quotes twice.
Example: He said, “I am a good boy”. Note: Typing a double quote
followed by single quote (or vice-versa) is problematic. Consider the fol-
lowing:
Example: “‘Mango’ or ‘Banana?”’ she asked. It is better to use \,
between two quotes which inserts a small space. Don’t leave any space
before or after the \, command. The correct example is:
Example: “ ‘Guava’ or ‘Watermelon?’ ” she asked.
Three different sizes of dash are produced by typing one, two, or three “-”
characters: An intra-word dash or hyphen, as in X-ray.
A medium dash for number ranges, like 1–2.
A punctuation dash—–like this.
There is usually no space before or after a dash. Minus signs are not
dashes;
they should appear only in mathematical formulas.
4. Space after a period
LaTeX simply assumes that a period ends a sentence unless it follows
an uppercase letter. This works most of the time, but not always as
abbreviations like “etc.” being the most common exception. We have to
inform LaTeX that a period doesn’t end a sentence by using a \ command
(a \ character followed by a space or the end of a line) to make the space
after the period.
Example: Tinker et al. made the double play.
Tinker et al. made the double play.
It doesn’t matter how many spaces is left after the \ character, but don’t
leave any space between the period and the backslash. The \ command
produces an ordinary interword space, which can also be useful in other
situations.
When sentence ending period follows an uppercase letter, we have to tell
LaTeX period ends sentence. This is done by preceding period with \@.
Example: The Romans wrote I+I= II. Really !
The Romans wrote I+I= II. Really !
If a sentence-ending period is followed by a right parenthesis or a right
quote then the period’s extra space goes after the parenthesis or quote.
Here too, LaTeX needs to be informed to adjust the space.
Example: “Beans (lima,etc.) have vitamin B.” It is good for health.
“Beans (lima,etc.) have vitamin B.”It is good for health.
Extra space is also added after a ?, !, : just as for a period—that is, unless
it follows an uppercase letter. The \ and \@ commands are used the same
way with each of these punctuation characters.
2
5. Special Symbols and Simple text- generating commands To get special
symbols as part of the document and not only in the commands, we type
them as
$, &, %, #, ,{}
To type logos in our document we use the command \TeX, \LaTeX. To
produce the current date we use \today.
Example: This page of the LATEXmanual is part of TEXmanual. This
document is created on May 9, 2025.
To have space after logo produced by the \LateX command , we use back-
slash \. Example: This page of the LATEX manual was produced on May
9, 2025.
May 9, 2025is an auspicious day.
May 9, 2025 is an auspicious day.
Another useful text-generating command is \ldots, which produces an el-
lipsis— the sequence of three dots used to denote omitted material. (Sim-
ply typing three periods doesn’t produce the right spacing between the
dots.)
Example: If nominated . . . , I will not serve.
If nominated ..., I will not serve.
6. Emphasizing text and Preventing line breaks
Emphasized text is usually underlined in a typewritten manuscript and
italicized in a printed [Link] \emph command tells LATEXthat text
is to be emphasized. In the \emph{emphasized text} command, \emph
is the command name and emphasized text is its argument. Spaces are
ignored between the arguments, and between the command name and its
first argument.
Example: Here is some emphasized text.
Commands like \emph can be nested within one another.
Example: You can have emphasized text within emphasized text too.
Line breaking should be prevented at certain interword spaces. For exam-
ple, the expression “Chapter 3” looks strange if the “Chapter” ends one
line and the “3” begins the next. Typing (a tilde character) produces an
ordinary interword space at which TEXwill never break a line.
Example: Mr . Jones, Figure 7, U. S. Grant, from 1 to 10 .
One should try to avoid splitting a name. The \mbox command tells
LATEXto print its entire argument on the same line.
Example: [Link] is in the class.
7. Footnotes and ignorable output
3
Footnotes are produced with a \footnote command having the text of
the footnote as its argument.
Example:Sheroo1 is sitting there.
There is no space between Bruno and the \footnote in this example;
adding space would have put an unwanted space between the text and the
footnote marker.
2
Example:Bruno is sitting there.
Ignorable output: When LATEXencounters a % character in the input,
it ignores the % and all characters following it on that line. LATEXalso
ignores spaces at the beginning of the next line. The % ends a line without
producing any space in the output and also helps to put a comment (a
note to yourself) in the input file.
Example: The Independence day is celebrated on 15 August every year.
1A doggy
2A puppy
4
2 Practical 2
2.1 Quotation
”The only limit to our realization of tomorrow is our doubts of to-
day.”
— Franklin D. Roosevelt
”Never stop learning because life never stop teaching. Never stop
learning because life never stop teaching. Never stop learning be-
cause life never stop teaching. Never stop learning because life never
stop teaching. Never stop learning because life never stop teaching.”
2.2 Lists
Numbered Lists can be made by using \begin{enumerate}
1. language Subjects
(a) HINDI
(b) ENGLISH
2. Commerce Subjects
(a) Economics
(b) bussines study
Bulleted Lists can be made using \begin{itemize}
physics
chemistry
biology
Description List can be made using \begin{description}
Dog Domesticated carnivous animal.
Cat Domesticated animal with fur.
2.3 Displayed Formula
Mathematical expression is written between $$.
Another way to write it would be to use \( \) or \[ \].
To write the math formula in the center use \beging{displaymath} \end{displaymath}
ax2 + by 2 + c = 0
To give the numbering to an equation use \begin{equation} \end{equation}.
For example - √
−b ± b2 − 4ac
x= (1)
2a
5
2.4 Declarations
Writing poetry is very time-consuming task.
2.5 poetry
”you too,Brutus?”
I am a boy
6
3 Practical 3
3.1 changing type style
upright shape
italic shape
Slanted shape
Boldface series
sans serif family
Typewriter family
Medium series
An example where multiple commands are used in a single line-
who on Earth is ever
3.2 Symbols from Other Languages
Commands to produce accents and symbols from other languages allow us to
put small pieces of non-English text in an English document
3.3 Accents
Ex:
el señor está bien , garçon , ı́
3.4 Symbols
Ex: ©, ¶,Œ,£
3.5 Superscript and Subscript
Ex:
x2y , xy1
The required commands can be combined to produce complicated superscript
and subscript expressions. Ex:
2
xy , xy1
X1Y , X1Y
3.6 fractions
The fractions denoted by the ”/” symbol are made in the obvious way.
Ex :
N/2 , (M+N)/N The frac command is used for large fractions in the displayed
7
formulas. Ex:
y + z/2
x=
y2 + 1
x+y
y
1 + z+1
3.7 roots
The Sqrt command produces the square root of its arguement. Ex:
√
x+y+z
√
n
2
3.8 ellipsis
The symbol (...) is called the ellipsis which idicates the continuation of pattern.
Ex:
x1 , . . . , x n .
a + · · · + z.
8
4 practical 4
4.1 Mathematical symbols
4.1.1 Greek Letters
Ex:
α, θ, kappa, Γ, Λ, O
4.1.2 Calligraphic letters
Ex: Choose F such that F(x)> 0
4.1.3 Variable Sized Symbols
Pn
To write i=1 an , use \sum_{i=1}^{n}a_n command.
R1
To write 0
f (x)dx, use \int_{0}^{1}f(x)dx command.
Qn
To write i=1 an , use \prod_{i=1}^{n}a_n command.
T
To write intersection between sets an , use \bigcap a_n command.
4.1.4 Log-like command
In order to write log x, we have to use \log x.
Other trignometric function -
cos x, sin x, tan x, sup x, inf x, gcd(a, b)
cos(x + y) = cos x cos y − sin x sin y
sin(x + y) = sin x cos y + cos x sin y
gcd(m, n) = a mod b
x ≡ y (mod a + b)
a ≡ b mod n, a ≡ b mod (n)
Writing limits
limn→∞ xn = 0
lim xn = 0
n→∞
Writing product in center with enclosing the code in double dollars.
k
Y
Ak
i=1
9
4.2 arrays
Array is defined by using the command \begin{array} inside $$ or \( \)
a b+x c 1
d e f +z 2
g+y h i 3
x if x ≥ 0
f (x) =
−x if x < 0
4.2.1 Vertical Alignment
a1
x− .. − u − v 10
.
an 36
u+v
333
4.3 Delimiters
In order to get bigger curly bracket { , use \{.
Similarly, for closing curly bracket } , use \}.
More examples -
⌊ - \lfoor ⌋ - \rfloor
⌈ - \lceil ⌉ - \rceil
a
b
c
1
2
4.4 MultilLine Formula
We can use \begin{eqnarray} to number multiple equation in an array.
x = 17 (2)
y > x2 + z (3)
z ≤ 4 (4)
Use \begin{eqnarray*} to not number the equation
x+y+z =
a + ··· + j +
k + ··· + p
10
5 Practical 5
5.1 Putting one thing above another
5.1.1 Over and underlining
Ex:
x+1
THE MARS- ALIENS
z }| {
a+b+c+d+e
| {z }
2
z }| {
a + 4x +o + 3y
| {z }
4
5.1.2 Accents
various accents can be produced in mathematics using Latex
â
ǎ
á
à
ă
EX:
− x = −y
1d c
⃗ı + ȷ̃
5.1.3 Stacking symbols
EX:
a′
A→B
def
⃗x = y
11
5.2 Spacing in math mode
Ex: √
2x
(the tight space between root2 and x) [ n /! log n (negative thin space)
ZZ
z dx dy
(two times negative thin space has been used)
The negative thin space is used to remove the same amount of space that a thin
sapce adds.
5.3 Changing style in math mode
5.3.1 Type Style
Latex provides the following commands for changing the type style in math
mode:
italics + 2 ft ϵ log[ψ]
roman + 2ft ϵ log[ψ]
boldface + 2ft ϵ log[ψ]
san serif + 2ft ϵ log[ψ]
typewriter + 2ft ϵ log[ψ]
CAL UPPERCASE LET T ERS ON LY
5.3.2 Math Style
TEX uses the following four math styles when typesetting formulas”:
Display: For normal symbols in a displayed formula.
text: For normal symbols in an in-text formula.
script: For subscripts, superscripts
scriptscripts:For further level of sub and super scripting.
EX:
Large type in ey(i)
Small type in ex(i)
12
6 Practical 6
6.1 Defining commands
If there’s a code that has been repeated several times in the document, then
you can use \newcommand{}{} to define it.
For example, we can use \newcommand{\gn}{$\beta_i$} and now we can use
\gn instead of \beta_i
\bn gives βi2 which is defined above.
6.1.1 Shorten code name
We can shorten the bigger commands like
\begin{enumerate} by using \newcommand{\be}{\begin{enumerate}
Similarly, we can define the following.
\end{enumerate} by using \newcommand{\ee}{\end{enumerate}}.
Ex-
1. One
2. two
See gnu(4; 5) and gnu(5x + y; y + x)
See gnu(x; y)
6.2 Defining Theorm
Conjecture 1 All the conjectures are interesting.
lemma 1 The proof is left as an exercise.
conjecture 1 (wiley) wiley
axiom 6.1 Descartes’ rule.
6.3 Define New Environment
Two new environments have already been created in the header for encoding
and bold quotations.
Ex:
meal
pen
Poetry requires decency.
13
7 practical 7
7.1 Creating tables
We will create tables using tabular environment.
blue pink 5
car cycle 10
bike 50
Table 1: Demo Table
item price
car (dozen) 324
Bike (each) 248
we will now write three mathematical equations in array format by using
eqnarray environment
x = y+z (5)
4 5
z = y (6)
z∗3 = x ∗ 45 (7)
we can show any text in an isolated position from the rest of the content by
using marginpar command:
Text is placed
here
Theorm 1 The order of the subgroup divides the order of the group
14
we can label any equation,statement,figure, theorm etc with any any name
and then refer to them at any slide by using ”ref” command.
?? (for referring to theorm 1)
?? (for referring to equation 7)
15
[Link]
Figure 1: Einstein
WE can insert images in our Latex file just like used to do in MS word or
MS ppt.
?? (for referring to inserted picture)
16
8 practical 8
8.1 Bibliography and citations
References
[1] Zenkerch
[2] D Ghosh
For further reading, see Zenkerch [?]
References
[1] Zenkerch
[2] D Ghosh
[valls,MIT] Perturbed Constraint
For further reading, see Zenkerch [?]
17