Introduction to Latex A workshop by Dr. Ala Eshmawi
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
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
Example of Latex document \documentclass{article} \title{simple Example} \author{ahmed Ali} \date{november 2015} \begin{document} \maketitle Hello world! \end{document}
Example of Latex document
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
Latex File Structure Document Class Predefined Formats (article, report, book,..). Packages used Added Functionality (graphics, reference style,...). Main Body Text and Bibliography References.
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.
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
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.
Body of Text cont Using Multiple Files \input{filename.tex} \include{filename.tex} The.tex extension is optional 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 x Forces NewPage x Good for book chapters x Good for a long article with discrete sections x
Body of Text cont \input \include
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{ }
Lists Two types of lists itemize Bullets enumerate Numbering Lists can be recursive (nested) Formats \begin{itemize} \item \item \begin{enumerate} \item \item \end{itemize} \end{enumerate}
Lists
Example of Latex document
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}
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{ }
Bibliography example myref.bib 2 Example.tex
How to use Latex 1 Create new Latex document
How to use Latex 2 a new Latex document
How to use Latex 4 Save the file as (example.tex) 3 Type your Latex text
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
How to use Latex 6 The created PDF file for (example.tex) is then opened
How to create Bibtex files 1 Create a new document
How to create Bibtex files 2 a new document
How to create Bibtex files 3 Type your Bibtex
How to create Bibtex files 4 (Save As ) your Bibtex file
How to create Bibtex files 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 6 The file after saving as.bib
How to use Bibtex files 8 Now you can cite any refrence in that file 7 Specify your Bibtex file (myref)
How to use Bibtex files 9 Now run BibTex command (you might need to run PDFTeX BibTeX commands for several times for cross referencing
How to use Bibtex files The editor might prompt you to install needed packages. Just click Install to continue
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.
Useful Links 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