This document provides an overview of a workshop on technical writing using LaTeX. It introduces LaTeX and covers topics like installation, basics of LaTeX, creating documents, inserting tables, figures, equations, algorithms, references, abbreviations, indexes and creating a final document. The document includes example code and screenshots to illustrate different LaTeX features.
Streamlining Your Application Builds with Cloud Native Buildpacks
Technical writing using LaTeX
1. Workshop on Technical Writing using LATEX
Introduction to LATEX
Partha Sarathi Chakraborty
Assistant Professor
Department of Computer Science and Engineering
SRM University, NCR Campus
April 17, 2017
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 1 / 34
2. Table of Contents
Introduction
LATEX Installation in Windows
Basics of Latex
My First Dcoument using LATEX
Table
Figure
Equations
Algorithm
References
List of Abbreviations
Make Index
My Final Document
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 2 / 34
3. Introduction
LATEX (pronounced either “Lay-tech” or “Lah-tech”) is a portable
document formatting system based on TEX.
TEX1 (pronounced “tech”), a typesetting language originally
designed especially for math and science around 1980 by Donald
Knuth.
It is also a programming language, which means you can create
your own commands to simplify and customize it.
TEX and LATEX use by default a font family called “Computer
Modern”, which includes a variety of styles such as serif, sans
serif, typewriter, and a particularly rich set of mathematical
symbols.
1
TEX
https://en.wikipedia.org/wiki/TeX
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 3 / 34
4. Introduction (2)
Figure 1: Comparison between MS-Word and LATEX2
2
Why would someone use LaTeX instead of Word in the first place?
http://www.pinteric.com/miktex.html
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 4 / 34
5. LATEX Installation in Windows
1 Download LATEXfrom https://miktex.org/download
2 Install the Basic MikTEX into your computer.
https://miktex.org/howto/install-miktex
Figure 2: MikTEX License Page Figure 3: MikTEX Settings
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 5 / 34
6. LATEX Installation in Windows (2)
Figure 4: MikTEX Installation Directory Figure 5: MikTEX File Copy
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 6 / 34
7. LATEX Installation in Windows (3)
1 Goto TEXMaker Website
http://www.xm1math.net/texmaker/
2 Download TEXMaker from
http://www.xm1math.net/texmaker/download.html
Figure 6: TEXMaker Software
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 7 / 34
8. Basics of Latex
How it Works?
Figure 7: LATEX File Flow3
3
Choosing a LaTeX Compiler
https://www.sharelatex.com/learn/Choosing_a_LaTeX_Compiler
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 8 / 34
9. My First Dcoument using LATEX
Creating a document in LaTeX
documentclass{article}
begin{document}
%Your statement goes here
end{document}
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 9 / 34
10. My First Dcoument using LATEX (2)
documentclass[12pt,a4paper]{article}
usepackage[utf8]{inputenc}
usepackage[english]{babel}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usepackage{makeidx}
usepackage{graphicx}
usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
author{Partha Sarathi Chakraborty}
begin{document}
%Your statement goes here
end{document}
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 10 / 34
11. My First Dcoument using LATEX (3) - Typesetting Text
Font Effects
textit{text in italics}
textsl{text slanted}
textsc{text in smallcaps}
textbf{text in bold}
texttt{text in teletype}
textsf{sans serif text}
textrm{roman text}
emph{emphasized text}
underline{underlined text}
textnormal{normal text}
Modal Commands
it, sl, sc, bf, tt, sf, rm, em
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 11 / 34
12. My First Dcoument using LATEX (3) - Typesetting Text (2)
Font Sizes
{tiny tiny text}
{scriptsize scriptsize text}
{footnotesize footnotesize text}
{small small text}
{normalsize normalsize text}
{large large text}
{Large Large text}
{LARGE LARGE text}
{huge huge text}
{Huge Huge text}
Special Characters
The following symbols are reserved characters which have a special
meaning in LATEX:
# $ % ^ & _ { } ~
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 12 / 34
13. My First Dcoument using LATEX (3) - Typesetting Text (3)
Lists4
begin{enumerate}
item First
item Second
item Third
end{enumerate}
begin{itemize}
item One
item Two
end{itemize}
Comments, Newline, and Spacing
Comments are created using % in LATEX.
Two backslashes can be used to start a new line.
vspace{12pt} %Vertical space
hspace{12pt} %Horizontal space
4
Further Reading: https://www.sharelatex.com/learn/Lists
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 13 / 34
14. Table in LATEX
begin{table}[h] % h - here, t - top , b - bottom, c - center
centering
begin{tabular}{ |c|c|c| }
hline
cell1 & cell2 & cell3
hline
cell4 & cell5 & cell6
hline
cell7 & cell8 & cell9
hline
end{tabular}
caption{Table to test captions and labels}
label{table:1}
end{table}
Cell Information is shown
in the above table ref{table:1}.
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 14 / 34
15. Table in LATEX (2)
cell1 cell2 cell3
cell4 cell5 cell6
cell7 cell8 cell9
Table 1: Table to test captions and labels
Cell Information is shown
in the above Table5 1.
5
Further Reading: https://www.sharelatex.com/learn/Tables
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 15 / 34
17. Figure in LATEX (2)
Figure 8: Emoji Face
Emoji Image is shown in the above Figure 8.
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 17 / 34
18. Figure in LATEX (3)
begin{figure}
minipage{0.39textwidth}
includegraphics[width=linewidth]{emoji}
caption{scriptsize{{miktex} Emoji Face}}
label{fig:3a}
endminipagehfill
minipage{0.59textwidth}
includegraphics[width=linewidth]{3dfrog}
caption{scriptsize{{miktex} 3D Frog}}
label{fig:3b}
endminipage
end{figure}
Emoji and Frog images is shown in the above
Figure ref{fig:3a} and Figure ref{fig:3b} respectively.
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 18 / 34
19. Figure in LATEX (3)
Figure 9: MikTEX Emoji Face Figure 10: MikTEX 3D Frog
Emoji and Frog images is shown in the above
Figure 9 and Figure 10 respectively.
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 19 / 34
20. Equations in LATEX
Math Mode
To put simple equations like a = b + c into the middle of a sentence,
just put dollar signs around it: the answer is $ a = b + c $ .
To insert an entire equation, centered on its own line, use the
equation environment:
begin{equation}
ax^2 + bx + c = 0
end{equation}
Basic Math Formatting
y25
y^{25}
z0 z_0
x+2
y+1 frac{x+2}{y+1}
10
x=1 sum_{x=1}^{10}
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 20 / 34
21. Multicolumn in LATEX
sc{Looking for the Best Profile Pic? Ask a Stranger}
begin{multicols}{2}
justifying
textnormal{
rm{
Most profile photos that ...
... a new study finds.
But there is hope for ...
... the researchers said.
"Strangers consistently...
... New South Wales in Sydney.}}
end{multicols}
Use multicol package for Multicolumn in LATEX. Write following
statement at the top of your .tex file.
usepackage{multicol}
setlength{columnsep}{1cm}
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 21 / 34
22. Multicolumn in LATEX (2)
Looking for the Best Profile Pic? Ask a Stranger6
Most profile photos that
people choose for themselves
— whether it’s on Facebook,
a dating hub or a career-
building site — are not flat-
tering, a new study finds.
But there is hope for profile-
picture glory. Simply ask a
stranger to look at a few pho-
tos of yourself, and ask him or
her to select the best one, the
researchers said.
”Strangers consistently se-
lected more flattering pic-
tures than people chose of
themselves,” said lead study
researcher David White, a
postdoctoral research fellow
of psychology at the Univer-
sity of New South Wales in
Sydney.
6
http://www.livescience.com/58685-strangers-pick-better-profile-pictures.html
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 22 / 34
23. Algorithm in LATEX
begin{algorithm}[H]
SetAlgoLined
KwResult{Write here the result }
initialization;
While{While condition}{
instructions;
eIf{condition}{
instructions1;
instructions2;
}{
instructions3;
}
}
caption{How to write algorithms}
end{algorithm}
Use algorithm2e package for Algorithm in LATEX. Write following
statement at the top of your .tex file.
usepackage{algorithm2e}
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 23 / 34
24. Algorithm in LATEX (2)
Algorithm 2nd Edition
Result: Write here the result
initialization;
while While condition do
instructions;
if condition then
instructions1;
instructions2;
else
instructions3;
end
end
Algorithm 1: How to write algorithms
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 24 / 34
25. Bibliography in LATEX
LATEX includes features that allow you to easily cite references
and create bibliographies in your document.
It is done by using a separate BibTeX file to store the details
of your references.
Example: .bib file
%Springer
@Inbook{Mamoulis:2003,
author="Mamoulis, Nikos and Kalnis, Panos and Bakiras,
Spiridon and Li, Xiaochen",
title="Optimization of Spatial Joins on Mobile Devices",
bookTitle="Advances in Spatial and Temporal Databases:
8th International Symposium, SSTD 2003, Santorini
Island, Greece, July 2003. Proceedings",
year="2003",
publisher="Springer Berlin Heidelberg",
address="Berlin, Heidelberg",
pages="233--251",
isbn="978-3-540-45072-6",
doi="10.1007/978-3-540-45072-6_14",
url="http://dx.doi.org/10.1007/978-3-540-45072-6_14"
}
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 25 / 34
26. Bibliography in LATEX (2)
Type the following where you want the bibliography to appear
in your document (usually at the end):
bibliography{bib file name}
bibliographystyle{bibliography style name}
Bibliography Style Name
alpha The same as plain except the citation is an alphanumeric abbreviation
based on the author(s) surname(s) and year of publication, surrounded by
square brackets (e.g. [Kop10]).
ieeetr IEEE reference format
acm ACM reference format
abbrv The same as plain except the authors’ first names are abbreviated to
an initial.
plain The citation is a number in square brackets (e.g. [1]). The bibliography
is ordered alphabetically by first author surname.All of the authors’ names
are written in full.
unsrt The same as plain except the references in the bibliography appear in
the order that the citations appear in the document.
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 26 / 34
27. Bibliography in LATEX (3)
begin{document}
Random {it{Springer}}cite{Mamoulis:2003} citation {it{ACM}}
cite{Becker:1993} embeddeed in text {it{ACM}}cite{Jacox:2007}.
I love {it{IEEE}}cite{5968119} to work with latex {it{Elsevier}}
cite{Khan201767} and its awesome.
newpage
bibliography{654814}
bibliographystyle{alpha}
end{document}
Output File
Figure 11: Paragraph with Citation
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 27 / 34
28. Bibliography in LATEX (4)
Output File - Reference Page
Figure 12: Reference Page
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 28 / 34
29. List of Abbreviations
usepackage[intoc]{nomencl}
makenomenclature
%% This removes the main title:
renewcommand{nomname}{List of Abbreviation}
%% this modifies item separation:
setlength{nomitemsep}{10pt}
begin{document}
begin{center}
printnomenclature[1in]
end{center}
newpage
nomenclature{PDF}{Portable Document Format}
nomenclature{YAP}{Yet Another Previewer}
end{document}
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 29 / 34
30. List of Abbreviations (2)
Figure 13: Ouput screen of list of Abbreviations
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 30 / 34
31. Back Index in Latex
usepackage{imakeidx}
makeindex[columns=2, title=Alphabetical Index, intoc]
begin{document}
Most profile photos that people choose for themselves -
whether it’s on index{Facebook}, a dating hub or a
career-building site - are not flattering, a new
study finds.
printindex
end{document}
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 31 / 34
32. Final Document in LATEX
Figure 14: Content Page
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 32 / 34
33. Final Document in LATEX (2)
Figure 15: Alphabetical Index Page
Partha Sarathi Chakraborty Workshop on Technical Writing using LATEX 33 / 34