an introduction to tex and latex

35

Upload: plusorminuszero

Post on 16-Apr-2017

602 views

Category:

Education


1 download

TRANSCRIPT

A computer programmecreated by 

Donald E Knuth

Donald E Knuth(born January 10, 1938)

Professor Emeritus of the Art of Computer Programming At Stanford University

Volume 1 - Fundamental Algorithms Chapter 1 - Basic concepts Chapter 2 - Information structures

Volume 2 - Seminumerical Algorithms Chapter 3 – Random NumbersChapter 4 - Arithmetic

Volume 3 - Sorting and Searching Chapter 5 – SortingChapter 6 - Searching

TeX is a typesetting system intended for the creation of beautiful documents. 

Type‐setting : some issues

Follow the conventions of the finest printers in the world.

Avoiding orphans and widows

An orphaned line, highlighted in yellow, appearing at the bottom of a page.

A widowed line, highlighted in yellow, appearing at the top of a page.

Writing guides, such as the Chicago Manual of Style, suggest that a manuscript should have no widows and orphans even when avoiding them results in additional space at the bottom of a page or column.

Type‐setting : some issuesInter‐letter spacingInter‐word spacingInter‐line spacing

Spacing in mathematics

Type‐setting : some issues

Hyphenation : For e.g. , consider the‐rapist for therapist.

Leslie Lamport, the creator of LaTeX

• LaTeX pronounced as  Lah‐tek, or Lay‐tek

• A typesetting program, not a word‐processor

• Current version : LaTeX2ε

• Designed for producing beautiful books, theses, papers, articles...

• De facto standard for writing academic papers

• Based on TeX

LaTeX is a document preparation system for high‐quality typesetting. 

It is most often used for medium‐to‐large technical or scientific documents.

It can be used for almost any form of publishing. 

LaTeX is not a word processor! LaTeX encourages authors not to worry about the appearanceof their documents but to worry about content.

A test document to learn LaTeXV N Krishnachandran19 February 2010

Hello world! 

To create a document like the one above …

\documentclass{article} \title{A test document to learn LaTeX} \author{V N Krishnachandran} \date{19 February 2010} \begin{document} \maketitleHello world! \end{document}

Create a text file like the one above and compile…

This document is an article.Its title is A test document to learn LaTeX.Its author is V N Krishnachandran.It was written in 19 February 2010.The document consists of a title followed by the text Hello world!

What the text file means …

How To Run LaTeX• Create a text file with extension  .tex, say

myfile.tex

• Compile myfile : latex myfile.tex

This makes a  file with extension .dvi

• View the dvi file :  xdvi myfile.dvi

: yap myfile

• Dvi ‐‐> PostScript : dvips myfile.dvi

This creates a file with extension .ps

• View PostScript : gv myfile (UNIX)

:  Use gsview

pdfLaTeX

An extension of TeX which can be configured to directly generate PDF documents instead of DVI. All current TeX distributions including TeX live, MacTeX and MiKTeX include pdfTeX(Plain TeX) and pdfLaTeX (LaTeX). 

FeaturesTypesetting journal articles, technical reports, books, and slide presentations.

Control over large documents containing sectioning, cross‐references, tables and figures.

Typesetting of complex mathematical formulas.

FeaturesAutomatic generation of bibliographies and indexes.

Multi‐lingual typesetting.

Inclusion of artwork, and process or spot colour.

Document Class

\documentclass[options]{class}

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

class  =  article, report, book,...

Sample commands

Start with  \begin{document}End with  \end{document}

Typesetting Text 

\\ or    \newline and   \newpageBold   \textbf{……………} or \bf Italics  \emph{…………} or  \textit{………} or \itUnderline  \underline{…………} or \ul

Sample commands

Sections

\section{…} = 1.  Latex is Great\subsection{…} = 1.1 Why Great\subsubsection{…} = 1.1.1 Reason One

\chapter{…} ‐ To be used with book and report

Titles, authors and footnotes

\title{…}\author{…}\footnote{…}

\maketitle Display Title and Author\tableofcontents Generates TOC

Sample commands

Numbered listing

\begin{enumerate}\item Apple\item Orange

\end{enumerate}

Sample commands

Font sizes\tiny \scriptsize \footnotesize

\small \normalsize \large

\Large \LARGE \huge

\Huge

Sample commands

Mathematical expressions ….

Sample commands

\begin{center}

$$ y=\frac{a^3+2c_{x}}{1+\sqrt{b_{x}}} $$ \\\vspace{0.2in}$$Q=\sum_{i=1}^{j}\int_{\mu}^{\infty}f(x_{j})dx$$ \\\vspace{0.2in}$$\Psi = \oint_{- \infty}^ {\infty}f_{xy} ({\frac{\partialQx}{\partial Qy}})^{\Im_{\pi}^ \prime} $$ \\

\end{center}Text in input file…

Sample commands

Happy TeXing …