You are on page 1of 26

Introduction Agenda Font Sizes Cross-referencing Other Goodies

Introductory Workshop to LATEX

Dr. Mohamed Abubakar Hagi Mohamed


0615090507
dr.mohamed@gmail.com

August 25, 2019


Introduction Agenda Font Sizes Cross-referencing Other Goodies

Introduction

LATEX, which is pronounced ‘Lah-tech’ or ’Lay-tech’, is a


document preparation system for high-quality typesetting. It is
most often used for medium-to-large technical or scientific
documents but it can be used for almost any form of publishing.
LATEXis not a word processor! Instead, LATEXencourages authors
not to worry too much about the appearance of their documents
but to concentrate on getting the right content.
LATEXis based on the idea that it is better to leave document
design to document designers, and to let authors get on with
writing documents.
In this workshop, participants will be introduced to the basics of
LATEXand will be able to prepare their Master or PhD thesis
with LATEX.
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Agenda

What is this LATEXand Why would I need it?


Basics
Typesetting Text
Structuring and Cross-referencing Text
Typesetting Mathematics
Graphics, Figures and Tables
Citations and References
Preparing Manuscripts for Conferences and Journals
Presentation Slides
Introduction Agenda Font Sizes Cross-referencing Other Goodies

What is LATEX

Donald Knuth created TEX= TeX in the year 1977 as a


typesetting system for preparing books.
Leslie Lamport developed LATEX(named as LATEX2.09) in
1985 for preparing documents by concentrating on the
structure of a document rather than on its formatting
details.
LATEXinstructions are interspersed with the input file of a
document, say myfile.tex, for obtaining the desired output
as myfile.dvi or directly as myfile.pdf. The myfile.dvi file
can be used to generate myfile.ps or even myfile.pdf file.
Introduction Agenda Font Sizes Cross-referencing Other Goodies

How to Prepare a LATEX Input File?


As shown in Figure 25, the main structure of a LATEX input file
can be divided into two parts preamble and body. The preamble
is the first part of an input file that contains the global
processing parameters for the entire document to be produced,
such as the type of the document, page formatting, header and
footer setting, inclusion of LATEX packages for supporting
additional instructions, and definitions of new
instructions.
Introduction Agenda Font Sizes Cross-referencing Other Goodies

%% helloworld.tex -First LaTeX document


\documentclass{article}
\begin{document}
Hello World!
\end{document}
Standard document classes:
1 article: for short reports, articles in proceedings or journals,
etc.
2 book: for real books.
3 report, letter, · · ·

Other document classes: beamer, memoir, recipe, resume,


leaflet, exam, beamerposter · · ·
Introduction Agenda Font Sizes Cross-referencing Other Goodies

%%%% document class declaration with options


\documentclass[a4paper,12pt]{article}
%%%% document preamble starts...
%% loading packages: for extra capabilities

\usepackage{marvosym}
%% "meta" information and other definitions
\author{M. A. Fiidow}

\title{Hello}

%%%% document preamble ends, document body starts

\begin{document}
\maketitle
Hello World! \Smiley
\end{document}
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Typesetting Text
Space and tab characters
1 White space does not (usually) matter
2 TEXdetermines inter-word spacing to ensure legibility
Paragraph breaking
1 Leave a blank line between text to break paragraph
2 Multiple blank lines won’t give more vertical spacing
3 TEXdetermines inter-line spacing to ensure legibility
Manual line- and page-breaking?
1 (are you sure?)
2 TEXdecides where to break lines, pages to ensure legibility
3 if you insist:
\\, \pagebreak
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Typesetting Text
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Special Characters
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Creating and Filling Blank Space


Introduction Agenda Font Sizes Cross-referencing Other Goodies

ctd
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Font Families and Effects


Introduction Agenda Font Sizes Cross-referencing Other Goodies

Font Sizes
Introduction Agenda Font Sizes Cross-referencing Other Goodies

List-like Environments
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Nested numbered listing through the enumerate


environment

\begin{enumerate}
\item Somalia\label{item:som}\begin{enumerate}
\item Mogadishu\label{item:mog}
\begin{enumerate}\item Banadir\label{item:ban}
\begin{enumerate}
\item Hargesa\label{item:Tez}
\item Kismaayo \item Marka
\end{enumerate}\item Jubbada 1 \item Jubbada 2
\end{enumerate}
\item Baraawe
\item Baardheere
\end{enumerate}
\item Galgaduud
\end{enumerate}
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Numbered listing under the enumerate environment


\documentclass[11pt,a4paper]{article}
\renewcommand{\labelenumi}{Q.\theenumi}
%The following questions..\\ Answer Q.\ref{must}
and any two from the rest.
\begin{document}
\begin{enumerate}
\item Whether the following statements are true or
false?\label{must}
\begin{enumerate}
\item Water is composed of oxygen and hydrogen.
\item Scientific symbol of iron is Hg.
\item The value of the gravitational acceleration is 10.
\end{enumerate}
\item What is photosynthesis?\item What do you mean by magne
\item State the Newton’s law of motion.
\end{enumerate}
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Worksheet Exercise 1
Introduction Agenda Font Sizes Cross-referencing Other Goodies

List-like Environments
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Cross-referencing
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Ctd

\documentclass{article}
\usepackage[utf8]{inputenc}

\pagenumbering{roman}

\begin{document}
\tableofcontents

\section{Testing section}
...

\end{document}
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Ctd

\documentclass{article}
\usepackage[utf8]{inputenc}

\pagenumbering{alph}

\begin{document}
\tableofcontents

\section{Testing section}
...

\end{document}
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Ctd

\documentclass{book}
\usepackage[utf8]{inputenc}
\begin{document}
\frontmatter

\addcontentsline{toc}{chapter}{Foreword}
\Some text...
\addcontentsline{toc}{chapter}{Dummy entry}
Some text...
\tableofcontents
\mainmatter
\chapter{First Chapter}
This will be an empty chapter...

\end{document}
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Ctd
If your document class is not book or you need more control
and the numbering style, see the next example:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\pagenumbering{roman}
\begin{document}
\tableofcontents
\section{First section}
\setcounter{page}{3}
Some text here...
\section{Second section}
Some more text here..
\section{Heading on Level 1 (section)}
\pagenumbering{arabic}
More text here...
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Other Goodies
Introduction Agenda Font Sizes Cross-referencing Other Goodies

Worksheet Exercise 2

You might also like