Top Banner
Introduction to Latex A workshop by Dr. Ala’ Eshmawi
37

Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ... Useful Links. Title: Introduction to Latex

May 14, 2018

Download

Documents

lethuy
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Introduction to Latex

A workshop by Dr. Ala’

Eshmawi

Page 2: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Introduction

TeX is essentially a Markup Language (like

HTML, XML and RTF)

TeX written by Donald Knuth in 70´s

A revolution in typesetting

Latex is an extension of TeX

Macro packages to make TeX easier to

use

Page 3: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Latex vs. Word Processors

High typeset quality

Easy to include math formulas

Easy to deal with formatting images and tables

inside text paragraphs.

Good for large documents

Source file format is not bounded to a particular OS

or platform

Latex implementations exists for all platforms

(Windows, Mac,..)

Latex is free

Page 4: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Example of Latex document

\documentclass{article}

\title{Simple Example}

\author{Ahmed Ali}

\date{November 2015}

\begin{document}

\maketitle

Hello world!

\end{document}

Page 5: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Example of Latex document

Page 6: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Downloading Latex

MiKTeX :

a complete LaTeX system for Windows.

http://www.miktex.org/

TexMaker:

Free cross-platform LaTeX editor since

2003 (Windows, MacOsX, Linux)

http://www.xm1math.net/texmaker/downl

oad.html

Page 7: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Latex File Structure

Document Class

Predefined Formats (article, report, book,..).

Packages used

Added Functionality (graphics, reference style,...).

Main Body

Text and Bibliography References.

Page 8: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

The Basics

Document Class

\documentclass[options]{class}

options = a4paper, 11pt, 12pt, 10pt, twocolumn, landscape,...

class = article, report, book,...

Packages

\usepackage{package name}

Package name : (examples)

epsfig = insert PS pictures into the document.

fancyhdr = easy definition of footer and header.

hyperref = manage links/URL within the document.

graphicx = insert graphic files within a document.

Page 9: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Body of Text

Start with \begin{document}

End with \end{document}

Typesetting Text \\ or \newline and \newpage

Bold \textbf{……………} or \bf

Italics \emph{…………} or \textit{………} or \it

Underline \underline{…………} or \ul

Page 10: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Format Contd.

\maketitle - Display Title and Author

\tableofcontents - generates TOC

\listoftables - generates LOT

\listoffigures - generates LOF

Labels \label{marker} - Marker in document.

\pageref{marker} - Displays page no. of marker.

\ref{marker} - Displays section location of marker.

Itemize Use either enumerate, itemize or description.

Page 11: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Body of Text cont…

Using Multiple Files \input{filename.tex}

\include{filename.tex}

This is a good idea to separate the formatting from the real writing and to split the large documents into small parts.

Main differences between \input and \include :

Feature \input \include

Allows calling a file that calls another √ xForces NewPage x √Good for book chapters x √Good for a long article with discrete sections √ x

The .tex extension is optional

Page 12: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Body of Text cont…

\input \include

Page 13: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Format

Sections and subsection \section{Latex is Great} 1. Latex is Great

\subsection{Why Latex is Great} 1.1 Why Latex is Great

\subsubsection{Reason one} 1.1.1 Reason one

Titles, Authors and others \title{…}

\author{…}

\date{…}

Page 14: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Lists

Two types of lists itemize Bullets

enumerate Numbering

Lists can be recursive (nested)

Formats

◦ \begin{itemize}

◦ \item ……

◦ \item ……

◦ \end{itemize}

◦ \begin{enumerate}

◦ \item ……

◦ \item ……

◦ \end{enumerate}

Page 15: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Lists

Page 16: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Example of Latex document

Page 17: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex
Page 18: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Bibliography using Bibtex

Bibliography information is stored in a *.bib file, in

Bibtex format.

Include chicago package

\usepackage{chicago}

Set referencing style

\bibliographystyle{chicago}

Create reference section by

\bibliography{bibfile with no extension}

Page 19: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Bibliography using Bibtex

You need a file (e.g. myref.bib) where you

have the Bibtex of your reference (e.g. a

book, an article, website..etc.)

Put the file in the same folder of your Latex

file.

Inside your text , cite a reference using :

\cite{……}

\citeN {……}

\shortcite{……}

Page 20: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Bibliography examplemyref.bib

Example.tex

2

Page 21: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

How to use Latex

1 Create new Latex document

Page 22: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

2a new Latex document

How to use Latex

Page 23: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

How to use Latex

3

Type your Latex text

4Save the file as (example.tex)

Page 24: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

How to use Latex

5

Build your file (example.tex)

Choose PDFLaTeX from the dropdown menu

If your text has no errors then the PDF file for this Latex will be created and opened

Page 25: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

How to use Latex

The created PDF file for (example.tex) is then opened

6

Page 26: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

1 Create a new document

How to create Bibtex files

Page 27: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

2a new document

How to create Bibtex files

Page 28: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

3Type your Bibtex

How to create Bibtex files

Page 29: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

4 (Save As ) your Bibtex file

How to create Bibtex files

Page 30: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

5 Type a name for the file and add extension (.bib) (e.g. myref.bib) and put it in the same folder where your Latex file is saved

How to create Bibtex files

Page 31: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

6The file after saving as .bib

How to create Bibtex files

Page 32: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

8Now you can cite any refrence in that file

How to use Bibtex files

Specify your Bibtex file (myref)

7

Page 33: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

9

Now run BibTex command (you might need to run PDFTeX – BibTeX commands for several times for cross referencing

How to use Bibtex files

Page 34: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

The editor might prompt you to install needed packages. Just click Install to continue

How to use Bibtex files

Page 35: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex
Page 36: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

Conclusions

Latex is phd thesis.

Latex is good for large documents, reports,

papers.

Mathematical formulas are easy.

Formatting figures and tables inside a large

document is easier.

Referencing is easier using Latex.

Page 37: Introduction to Latex - it496ksu.files.wordpress.com to Latex ... Latex is an extension of TeX ...  Useful Links. Title: Introduction to Latex

http://www.docs.is.ed.ac.uk/skills/documents/3722/3722-2014.pdf

https://www.tug.org/twg/mactex/tutorials/ltxprimer-1.0.pdf

https://en.wikibooks.org/wiki/LaTeX

Useful Links