create beautiful cvs, reports and books - with latexelankumaran/createcvandreports.pdf ·...

75
Create beautiful CVs, Reports and books With L A T E X Elankumaran.K The proper title (that may not pique your interest) is A Quickstart to typesetting with L A T E X March 4, 2012

Upload: others

Post on 24-Mar-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Create beautiful CVs, Reports and booksWith LATEX

Elankumaran.K

The proper title (that may not pique your interest) isA Quickstart to typesetting with LATEX

March 4, 2012

Page 2: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Foreword

“Don’t worry about people stealing your ideas. If your ideas are anygood, you’ll have to ram them down people’s throats.” - Howard Aiken

Writing documents with LATEX is one such good idea that has startedpicking up only of late, even in academic circles (non-CS, that is).

This presentation has been made with LATEX. I used the ubiquitousBeamer class for presentations. Warning: People do not use seriffonts for presentations. From a distance at which the letters are notindividually discernible, the differences in the thickness betweenvertical and horizontal strokes create hazy patterns (so they say).But you are going to read this on a monitor and Garamond is anelegant font that deserves all excuses.

Exercise: Find out what ‘serif’ is, if you are not aware of it yet.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 2/75

Page 3: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Content and Form

When you read an email, you do not care in which font it has beenwritten in, if it is left aligned, or justified, of if the letter sizes areuniform, or if the fonts are appealing. What interests you is thecontent.If you are a publisher, or newspaper editor, how the material lookson paper is of dire consequence to you. You care about the spacings,where the pictures are placed, how the columns are divided, whetherthe text sections look equally gray everywhere. Now the form of thetext is a principal concern of yours too.In printing business, both jobs are done by different persons. Theauthor provides the content, and the typesetter decides the form.Many a typesetter incur the wrath of the authors by moving aroundpictures, or actually introducing errors.Prospective authors: Renowned author of C++ books, ScottMeyers sheds light on the whole process of publishing, gives lot ofadvice, and clears some misconceptions.Scott Meyer’s advice to budding authors.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 3/75

Page 4: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Word processing and Typesetting

Composition of the content was done earlier on paper, then ontypewriter, now with word processors on computers. Typesettingwas done earlier by assembling mirrored letters on a page sizedblock, which was dabbed with ink and impressed on paper. Later,machines did the assembling, thereby making it faster. Now, as withmost other things, with computers. Here you see the essentialdifference: the fonts in typesetting have been handcrafted with careby a person, for every size used. There cannot be sizes and shapesthat have not been defined by the person. In a word processor, atemplate of the font is used, which can be resized in software to anysize the user wishes.The difference between the two distinct operations of writing andtypsetting has been obscured by the ‘Print’ button that comes with aword processor. (The page setup and print preview are no lessguilty). A word processor is WYSIWYG (what you see is what youget). What you see on the screen is to a large degree what you get onthe paper when you print it.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 4/75

Page 5: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Disadvantages of a word processor - lack of structure

A word processor (say MS Word) is only meant to help you gatheryour thoughts in a coherent fashion (if you are that kind of a writer)before you render a form to it. So it lacks extensive structuringfacilities. When a document is processed with OCR, it is just notenough to extract the text as ASCII characters, but to create a treestructure, with heading as root node, subheadings at the next levels,paragraphs in the next, etc. MS Word provides such structuring with‘Heading 1’, ‘Heading 2’... etc. But people rarely know them. Lackof structure means, if you wish to change the style of allsubheadings, you have to do it individually for every occurrenceyourself. If the software is aware of such structuring, it can effectchanges in the whole document at a stroke.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 5/75

Page 6: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Disadvantages of a word processor - ligatures, kerning

Traditionally, some letter combinations are promoted to separatesymbols themselves. When these letters are just put together, oneafter another, without regard for their form, as a word processordoes, the output is just not pretty. The whitespace between theletters are too big or too small. Morphing the combinations intoone symbol or pressing them together may result in a betterreadability. Some such combinations are called ligatures. Some areadjusted by a process called kerning.Exercise: Find out what ligatures are and what kerning is.Hint: It is all explained beautifully here.Why the word processors make no such efforts, I do not know.There must be some technical hurdle and not pure wantonnessbehind it, I hope.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 6/75

Page 7: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Disadvantages of a word processor - page break

You might have painstakingly put figures and text in a MS Worddocument, and later found that you have to edit a paragraph. If thisparagraph is in the beginning of the document, your small additionshifts the figures and text in an unpredictable manner, and thechapters that began at fresh pages are now somewhere in the middleof the pages. Had the software been structure aware, this nuisancewould not be there.Let me make it clear, this is not a place for Microsoft bashing: MSprovides structuring elements like page break and sections breaks toavoid this very exasperation. But just as with the ‘Heading’ feature,people rarely know anything about them. I have seen beautiful MSWord documents that uses all these features and therefore fits somedocumentation purposes very well.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75

Page 8: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Word processors - infamous proprietary binary formats - 1

Well, this is the right section for some Microsoft bashing.ASCII is an encoding standard for computer characters. All textsoftwares support it. Which means you can read it on any computer,any day. It uses 7 bits, means 128 characters could be represented.The upper case, lower case, punctuation marks are all in it. Whenyou create a .txt file in notepad, you have it.The .doc file has to indicate numerous other stuff: if some text is insome combination of italic, bold, underline, striked through,subscripted, superscripted, indented, different size/font, carries alink etc. Let us call these indicators markup (same markup as inHTML). The 7 bits of ASCII definitely do not have enough roomfor the myriad of possibilities! So word processors need to havedevelop some coding system to represent the markup. So far, fine.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 8/75

Page 9: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Word processors - infamous proprietary binary formats - 2

But this coding system, is proprietary to “persistently predatorymonopoly” MS. They may reveal some important ones, so thatother softwares like OpenOffice could support MS Worddocuments, but keep secret some encoding like input box or radiobuttons. Still worse, they partially release information so thatOpenOffice produces chaos opening a .doc file and you curseOpenOffice and buy MS Office. They can also change encodingbetween versions, for a simple notation like italics, and you have tobuy their every new version. If you are a developer in this field, youare at the mercy of MS, for you have to support all their versionsbefore you can enter the market.More Info.Moreover, any proprietary format will make you vendor dependent.What if the vendor vanishes from the face of earth? You might bestuck like the neurobiologist who wanted to access the Viking probedata.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 9/75

Page 10: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Where Typesetters (here, LATEX) excel

That is, apart from the above mentioned points.

Quality. Could be measured by exporting the documents toimages and comparing them side by side. But you can see it inpdf form already. Most lecture notes, free pdf ebooks you see inthe net have been made with LATEX.Portability. The latex file you write has only ASCII characters,even for markups. So opening with another software will notmess it up.Interoperability. For example, there is an applicationlatex2html that will let you put up your publication on yourhomepage without loss of format.Math and other special applications. No word processor hasever matched the capabilities of LATEX in producing mathexpressions, special symbols, etc. For an array ofaccomplishments with TEX, have a look at the TEX showcaseYou get all of what you need for free.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 10/75

Page 11: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

TEXTEX (Pronunciation: for European languages :‘tech’; for English speakers, between ‘tech’ and‘tesh’) is a typesetting system created by DonaldKnuth, for his classic books in computerscience, ‘The Art of Computer Programming.’TEX is a language by itself, the design of whichbegan in 1978 and was frozen in 1989.

“Art is never finished, only abandoned.” - Leonardo da Vinci.

To ensure the same output at any point of time, not evenimprovements are made to TEX. New releases are bug fixes. The2008 version is 3.1415926. With every version, a digit in the decimalrepresentation of π is added to the version number. However, TEXis opensource and the improvements spinoffs/extensions will beartheir own names. E.g. XeTeX, teTex, TeX live, PDFtex.Observe how TEX is written. When you cannot typeset, it is writtenTeX. TEX in greek means ‘art’.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 11/75

Page 12: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

LATEX

Leslie Lamport created in 1980s a macroextension for TEX. If TEX is like an assemblylanguage, LATEX is like a high level language.LATEX comes with prebuilt structures,templates, formats, without which we will haveto learn TEX as a language. Lamport put the Lain LATEX. The current version is LATEX 2ε.

The macros come as packages (like libraries in a programmingenvironment). You will have to ‘include’ them in your document tobe able to use them.The TEX spinoffs have their own LATEX extensions. E.g., XeTeX hasXeLaTeX.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 12/75

Page 13: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

If you think LaTeX is not for you ...

At any point of this presentation, if you feel that LATEX is irrelevantto you, for the kind of tasks you undertake, jump to the section 9, asection on the document processor LyX. It lets you producedocuments with qualities and advantages of LATEX, without havingto learn LATEX.Do not be intimidated by the size of this presentation, either. If youare not a student writing his/her thesis, you will not use half of thefeatures here and you can skim through the relevant slides. But theremaining half can help you leave lasting impressions on people whoread your documents.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 13/75

Page 14: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Installation

Like Linux, LATEX comes in different distributions. Install the latestversion of MikTeX. This is the backend. You can write yourdocument in notepad, build it on command line. The output of TEXis the device independent format .dvi. A dvi viewer comes withMikTeX.

But let us make our life easier with freely available tools. There areprograms that can convert the .dvi into other formats that describe apage, like postscript, pdf. All of these are binary formats. But theyare open standards. Moreover, you still have your ASCII ‘source’code, and you can compile it any time with any other program.For .pdf, install Adobe Acrobat reader. You can also install otherpdf readers like Nitro. Some of them let you edit pdf files, whichAdobe lets you only if you buy their Writer.For .ps, install ghostscript and gsview.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 14/75

Page 15: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Front end

The front end is a text editor, which is aware of LATEX. Choices are:Winedt - great UI on Windows. Syntax highlighting,suggestions. But not free. Use the trial version.TeXworks - good. But the lack of syntax highlighting makes itdreary. Comes with preview pane.TeXnicCenter - good. you can configure it to open/closeoutput files when you compile. UI similar to visual studio.TeXmaker - good. Has syntax highlighting, autocompletionand preview pane.

You can mostly configure the editor to have a preview pane, or openoutput data with one of the readers upon successful compilation.You can have the pleasure of searching for and trying out variouseditors and choose the one that suits you.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 15/75

Page 16: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Command structure

LATEX is more like programming. Everything you need is issued as acommand. A command starts with a \. The syntax is:

\command[optional arguments]arguments

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 16/75

Page 17: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

The skeleton

The simple template to give a complete document is

\documentclassarticle

\begindocument

...your text

\enddocument

Use any of the LATEX editors, write your file, save it as<filename>.tex. The editor has option to compile it with TEX orLATEX or many of the various spinoffs. Let us do it with PDFLaTeX.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 17/75

Page 18: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

In Winedt

Just click on TeX->PDF->PDFLaTeX. (For simple documents,PDFTeX is sufficient.) UI can be configured to open PDFautomatically. You find the pdf in the directory with the source file.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 18/75

Page 19: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

in Texmaker

Choose PDFLaTeX in the drop down menu above. Click on thearrow at the left. To view the output, choose the next drop downmenu to ‘View PDF’ and click on the arrow at its left.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 19/75

Page 20: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

First output

The pdf output for the following is on the next slide.

\documentclass[a4paper,11pt]article

\usepackage[T1]fontenc

% Look, I got a comment here.

\begindocument

Motivation is what gets you started.\\Habit

is what keeps you going! - Jim Ryun.

\enddocument

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 20/75

Page 21: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

First output

Motivation is what gets you started.Habit is what keeps you going! - Jim Ryun.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 21/75

Page 22: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Some explanations

The option a4paper gives the dimension of the document.11pt says you want the text size to be enlarged by 10%(110%).The other possibilities are 10pt for 100%, or 12pt for 120%.The default is 10pt.article is the class of the document. The often used optionsarebook, article, report, letter, beamer

fontenc dictates the encoding scheme. You need to tweak it ifyou want LATEXto recognize characters like ä, v etc (umlauts,diacritics, accent) from the keyboard.comments begin with a %. To print %, you have to use \%.Similarly, there are some special characters like #, & that havesome meaning for LATEX and so need a \to be prefixed to beprinted.Anything you write after \enddocument is a comment, willnot cause issues.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 22/75

Page 23: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

The distinctive feature

If you are a seasoned observer, you might have noticed that thesource code has lot of white spaces after the first two words of thetext, and that there is a new line after Habit, which are not reflectedin the compiled output.This is the single most important point to observe: your typesettingprogram is not WYSIWYG. It has no regard for the formatting youdo with spacebar or tab or newline keys. If you want anything, youhave to explicitly tell it. For example, a newline is created with adouble backslash, \\. To leave the rest of the page blank and begin afresh one, use \newpage.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 23/75

Page 24: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Text styles

Let us style the default font differently. To the left is the command,and to the right, the output.

\textbfbold bold\textititalic italic\textscsmall caps SMALL CAPS

\textsfsans (without) serif sans (without) serif

\textslslanted slanted\texttttypewriter style typewriter style

These are not the only styles available. Just as I write this, I gotcompilation errors that it could not find the fonts with these effects,since Garamond is not a default font. The error looks like ‘couldnot locate ugmmi8a.pfm’. (Other extensions are .afm and .pfb) Theright way is to install the font. One quick way to get things workingis to search for these files in the net, download them and copy themto your source directory.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 24/75

Page 25: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Text Sizes

\tinytiny tiny

\scriptsizescript size readable

\footnotesizefootnote size footnote size\smallsmall small\normalsizenormal size normal size\largelarge large\Largepretty large pretty large\LARGEfor headings for headings\hugeof larger of larger\Hugeand larger sizes and larger sizes

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 25/75

Page 26: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

combinations, creating scopes.

\textit\LARGECan I concatenate styles and sizes?\\

Can I concatenate styles and sizes?\textscCan I \emphemphasize or \underlineunderline?\\

CAN I emphasize OR UNDERLINE?

\footnotesize \itshape

What do I do, if I want to apply a style or size for big

blocks of text?\\ Easy, create scopes with curly braces.\\

What do I do, if I want to apply a style or size for big blocks of text?Easy, create scopes with curly braces.But style names are different for scoping, namely bfseries, itshape,scshape, sffamily, slshape and ttfamily respectively.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 26/75

Page 27: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Horizontal spacing

How can I produce increasingly longer vertical spaces,\\

overriding the\:default\quad spacing\qquad?\\

How can I produce increasingly longer vertical spaces,overriding the default spacing ?

Lesser than default?\\

Lesser\,than\,default?\\

Lesser than default?Lesser than default?

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 27/75

Page 28: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Vertical Spacing

The different\\\smallskip vertical\\\medskip\\

spacings\\\bigskip available are.\\

The differentvertical

spacings

available are.

Note that the skips work only for new lines. They are needed forparagraphs.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 28/75

Page 29: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Arbitrary spacing

Arbitrary spaces, horizontally and vertically can be created with\vspace and \hspace

Creating\hspace1inlarge\hspace10mmhorizontal spaces.\\

Creating large horizontal spaces.

Similary, \vspace. The units recognized are (among others) mm,cm, inch, point (approx .35mm).The correct opening quote is produced with ` and closing with thefamiliar '.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 29/75

Page 30: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Alignment - plaintext (Tale of Two Cities)

\footnotesize

\begincenter

It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of

foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of

Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we

had everything before us, we had nothing before us, we were all going direct to Heaven, we were

all going direct the other wayin short, the period was so far like the present period, that some

of its noisiest authorities insisted on its being received, for good or for evil, in the

superlative degree of comparison only.

\endcenter

\medskip

\beginflushleft

There were a king with a large jaw and a queen with a plain face, on the throne of England; there

were a king with a large jaw and a queen with a fair face, on the throne of France. In both

countries it was clearer than crystal to the lords of the State preserves of loaves and fishes,

that things in general were settled for ever.

\endflushleft

\medskip

\beginflushright

It was the year of Our Lord one thousand seven hundred and seventy-five. Spiritual revelations

were conceded to England at that favoured period, as at this. Mrs. Southcott had recently

attained her five-and-twentieth blessed birthday, of whom a prophetic private in the Life Guards

had heralded the sublime appearance by announcing that arrangements were made for the swallowing

up of London and Westminster.

\endflushright

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 30/75

Page 31: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Alignment - output (Tale of Two Cities)

It was the best of times, it was the worst of times, it was the age of wisdom, it wasthe age of foolishness, it was the epoch of belief, it was the epoch of incredulity, itwas the season of Light, it was the season of Darkness, it was the spring of hope, itwas the winter of despair, we had everything before us, we had nothing before us,

we were all going direct to Heaven, we were all going direct the other way–in short,the period was so far like the present period, that some of its noisiest authorities

insisted on its being received, for good or for evil, in the superlative degree ofcomparison only.

There were a king with a large jaw and a queen with a plain face, on the throne ofEngland; there were a king with a large jaw and a queen with a fair face, on thethrone of France. In both countries it was clearer than crystal to the lords of theState preserves of loaves and fishes, that things in general were settled for ever.

It was the year of Our Lord one thousand seven hundred and seventy-five. Spiritualrevelations were conceded to England at that favoured period, as at this. Mrs.

Southcott had recently attained her five-and-twentieth blessed birthday, of whom aprophetic private in the Life Guards had heralded the sublime appearance by

announcing that arrangements were made for the swallowing up of London andWestminster.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 31/75

Page 32: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Lists and footnotes - typeset

\beginitemize

\item This is

\item how you

\item can list\footnoteThe style of bullets is

defined elsewhere.

\item with bullets.

\enditemize

\beginenumerate

\item This is

\item how you

\item can list\footnoteThe footnote numbering

is taken care of by \LaTeX.

\item with numbering.

\endenumerate

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 32/75

Page 33: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Lists and footnotes - output

This ishow youcan list1

with bullets.

1 This is2 how you3 can list2

4 with numbering.

1The style of bullets is defined elsewhere.2The footnote numbering is taken care of by LATEX.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 33/75

Page 34: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Creating Tables3 - source

\begincenter

\begintabular|| l | c || r |

\hline

Tom & 2 & Tom \\ \hline

and & 5 & bigcat \\ \hline

Jerry & 8 & largebigjunglecat \\

\hline

\endtabular

\endcenter

3I took the example from here, and modified it.Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 34/75

Page 35: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Creating Tables - output

Tom 2 Tomand 5 bigcatJerry 8 largebigjunglecat

The \begincenter puts the table in the center of the page. Theentities with \begin and \end are called environments. The tabularenvironment has an argument that symbolically indicates thestructure of the table. This table has three columns because there arethree letters. Each of them can be l or c or r.

l - left aligned contents,c - center aligned contents,r - right aligned contents.

The vertical | (pipe) symbols say what what kind of line shouldseparate the columns, a single vertical, or double vertical, or none.\hline produces the horizontal lines. The contents are listed like amatrix, each column separated by & and each row separated by\\(newline). (Try the table without | and \hline.)

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 35/75

Page 36: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

A word on Images

You must be familiar with pixel based images. They just hold someinformation for each pixel (RGB or HSV or equivalent). Bitmap is araw pixel data. JPG, PNG images are compressed bitmaps. MPEG,AVIs are streams of JPGs. There is the other kind of images, calledvector graphics. These do not describe pixels, but hold informationlike ‘straight line between coordinates so and so’, ‘cubic splinebetween these two points’. At runtime, your software portrays theseinformation as pixel data. This process is called rendering. This iswhat the graphic cards do for video games. The CS guys designsomething in Maya (create descriptions) and let it render for days(convert descriptions to MPEG.)Advantage of vector graphics: theoretically, you can enlarge them asmuch as you want, the geometry will be rendered by the software.PDF, PS formats encourage using vector graphics. So prefer them toJPG, PNG, GIF etc. Inkscape is a free software to generate vectorgraphics.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 36/75

Page 37: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Figures

Figures are embedded \includegraphics command. You needanother package too.

\usepackagegraphicx

...

\includegraphics[scale=0.35, trim = 10mm 35mm 0mm 0mm,

clip]myimage.jpg

\captionfinally some pictures.

When you embed the picture, you can make LATEX scale it,optionally. You can also crop the image. The amount to clip isprescribed in the order left, bottom, right, top. The optionclip is needed to actually effect the crop. For other options likeskew, rotate, look into documentation.Not all TEX derivatives support all image formats. E.g., TEX doesnot support .jpg. So look for error messages.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 37/75

Page 38: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Sectioning

Creating sections and subsections are quite easy. You see theadvantages when you compile them into a book or report. (Again,you need not indent them, I just did it here to show some order.)

\sectionAll the fruits in the world

General characteristics.

\subsectionTrue fruits

Definition of true fruits.

\subsubsectionCase study of some examples

oranges, papayas, figs...

\subsectionFalse fruits

What is a false fruit?

\subsubsectionCase study

apple, cashew etc.

Apart from these, \part,\paragraph,\subparagraph arealso available, among others.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 38/75

Page 39: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Pause

Now you know enough to start typesetting beautiful documents.You see that typesetting is not only not WYSIWYG, but clutteredwith markups that reading the source code does not make any senseas reading a document. You will have to compile it to produce adocument, and then read to see if you wrote anything sensible. Sofor composing novels and verses, typesetting right away may not bethe best way to inspire creativity. As seen later, LyX overcomes thisdisadvantage. (Don’t miss this thought provoking article! It alsotalks about how the medium could rework the very ways humansreceive and produce ideas.)So you typeset your own documents.This statement is true in many levels.

As author, you decided the content. With LATEX, you alsodictate the form.Instead of letting a word processor do the markup for you, youinsert them yourself. All your markups happen to be ASCII aswell!

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 39/75

Page 40: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Pause

To create your CV or Thesis or project report, search in the net for“latex CV / book templates”. Some nice guys have done good workfor themselves and offer their work also to others. You take thetemplate, keep the structuring, and fill up with your own data, andcompile. If you took a fancy template that has more than defaultfonts and styles, you will have lot of error messages. Search for theerror message and find solutions. They mostly use XeLaTeX (forunicode support) and fancy fonts and headers.They usually put all style related commands in a separate file withextension .styYou may have to install additional fonts, too.http://www.howtotex.com/ is a nice place for advanced templates. Irecommend practising with simpler, plain templates first.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 40/75

Page 41: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Introducing math text

Impressive as it may be, with the above text formatting capabilities,we have only scratched the surface of TEX as a typesetting system.You see the true power, that it is a language, when you deal withsymbols, especially mathematical ones.

If you want math inlined in text, you sandwich the mathbetween $ symbols.If you want math in a fresh line (numbered equation,derivations etc.), you need to use any of the environments likedisplaymath, align, equation, eqnarray

you need some packages, notably \usepackageamsmath or\usepackagemathdesign.

When you use templates from others, they usually come with manypackages included and styles defined. You problem will then be tomodify styles which you do not like.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 41/75

Page 42: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

First steps

The commands you use within math environments or between$ symbols will not work outside math mode.All alphabets are treated as symbols and are styled in italics. Ifyou want normal text within a math section, you can not justwrite them, but should put it in command, e.g.,\textSome text inside math mode.

Example inline mode:

We know that hypotenuse is $ h = \sqrta^2 + b^2 $

and that the area of a circle is $ \pi r^2$.

We know that hypotenuse is h=p

a2+ b2 and that the area of acircle is πr2.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 42/75

Page 43: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

align environment

Example align environment

Some of such beautiful equations are

\beginalign

e^i\pi + 1 = 0 \\

\mathcalF\x(t)\ = \int\limits_-\infty^\inftyx(t)\,\mathbfe^\,-\mathrmj\omega t\mathrmdt

\endalign

Some of such beautiful equations are

eiπ+ 1= 0 (1)

Fx(t)=∞∫

−∞

x(t)e−jωtdt (2)

Notice that the equations are automatically numbered. If you do notwant numbering, you need to use \beginalign* and\endalign*. This is true for any environment: a * afterenvironment name will suppress numbering of that section or figure.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 43/75

Page 44: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

eqnarray environment

What if you want the equation to be centered about the = sign? The& delimiter you have seen earlier helps to put something like tabswithin eqnarray environment.

\begineqnarray*

(a + b)^2 &=& (a + b)(a + b)\\

&=& a\times a + a \times b + b \times a + b \times b\\

&=& a^2 + 2ab + b^2 \\

&&\textsince multiplication of

real numbers is commutative.

\endeqnarray*

(a+ b)2 = (a+ b)(a+ b)= a× a+ a× b+ b× a+ b× b= a2+ 2ab+ b2

since multiplication of real numbers is commutative.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 44/75

Page 45: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

eqnarray environment - Contd.

Of course, I could have written the text outside.Note that since the first line has two &, each line has to have two ofthem. Say each of them mark a column, and that columns arealigned within the environment.That & is a delimiter horizontally, occurs often. The verticaldelimiters are of course newline \\. If you do not want any entry ina particular column, just write nothing in between the & symbols.

Now that we know how to write math text, let us see what we canwrite.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 45/75

Page 46: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

The often used ones

Superscripts and subscripts are made with ˆ and _ respectively.Remember that they work for only one of the characters that follow.If you have more, you have to enclose them in curly braces.

\beginalign*

S_ave^(i) = \frac\sqrtm_1 + m_2 + m_3M_i^3.

\endalign*

S(i)ave =

p

m1+m2+m3

M3i

.

With this example, you know the syntax for superscripting,subscripting, producing a fraction and square root. Fraction has twoarguments \fracnumeratordenominator.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 46/75

Page 47: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

The often used ones - Contd.

It also shows why TEX is a language: you have function argumentswho are function calls themselves! The inputs (arguments) forcommands (here \frac) can be some other commands (here \sqrt).This example also illustrates that LATEX blindly typesets anynonsense you care to type in. It does not check for mathematicalvalidity of your input, just to be clear.The \sqrt command has an optional arguments, that is useful toexpress this surprising result.

\beginalign*

\lim_x \to +\infty\sqrt[n]n=1.

\endalign*

limx→+∞

np

n= 1.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 47/75

Page 48: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Brackets

You have seen that the square root symbol grows in length toaccommodate the arguments. Same is true for brackets, in height. Somatrices can be created without worrying about the dimensions, ifyou use the command \left before the opening brace, and \right

before the closing brace. (Since LATEX blindly typesets, these bracesneed not even be the same on both sides, it can be a | symbol too.)

\beginalign*

\left(\frac1x\right)+\left[\frac1y\right|

= \left\\fracx+yxy\right\rangle

\endalign*

1

x

+

1

y

x+ y

xy

¸

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 48/75

Page 49: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Brackets - Contd.

[If you click the following link, remember to use the ‘back’ buttonin your pdf reader to return to this page. If ‘forward’ and ‘back’buttons are not visible, go to toolbar section and display them.]

(left and right are not commands whose argument is the fraction:arguments can only be specified within curly braces. Rememberslide 16. Also note that to print a curly brace, you need a \ beforethat, as for #, &, ˆ , _, $ etc.)

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 49/75

Page 50: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Math symbol styles

If you use function names as such, they appear italicised. So usecommands for function names too.

\sin(\theta) \text instead of sin(\theta)$\\

sin(θ) instead of sin(θ)amsmath comes with its own text styles: the equivalent of bold,italic etc., in math.\mathrmABCD ABCD \mathbbABCD ABCD\mathbfABCD ABCD \mathnormalABCD ABC D\mathcalABCD ABCD \mathscrABCD ABCD

Note: \mathcal is from package amsmath and \mathscr is frompackage mathdesign for the same style. Using both packagestogether will reduce the number of styles you can use. Recognizethis problem when the error is ‘Too many math alphabets used inversion normal....’.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 50/75

Page 51: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Some Examples

mathrm is math remove. mathcal is math calligraphic.

$\mathbfX^x^2_\mathrma_y^3_\mathrmb$

Xx2

a

y3b

Sum of first 10 natural numbers is $\sum_i=1^10 = 55$.

Note that the formula is inline.

Sum of first 10 natural numbers is∑1

i=1 0= 55. Note that theformula is inline.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 51/75

Page 52: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Some Examples - Contd.

Symbols with limit display.

\sum∑

\prod∏

\int∫

\iint∫∫

· · · · · · · · · · · ·\oint

\oiint

Two ways of displaying limits:

\int^x_1_x_2 gives∫ x1

x2

\int\limits^x_1_x_2 givesx1∫

x2

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 52/75

Page 53: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Some Examples - Contd.

Some handy symbols.

< < > >\le ≤ \ge ≥\ll ≤ \gg ≥\in ∈ \equiv ≡

Negations are done with \not.$x\in x$ gives x ∈ x$x\not\in x$ gives x 6∈ x

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 53/75

Page 54: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Beloved Greek letters.

Lower case.

\alpha α \beta β\gamma γ \delta δ\phi φ \psi ψ· · · · · · · · · · · ·· · · · · · \omega ω

Upper case.

\Gamma Γ \Delta ∆\Phi Φ \Psi Ψ· · · · · · · · · · · ·· · · · · · \Omega Ω

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 54/75

Page 55: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Some more symbols.

\pm ± \mp ∓\cdot · \cdots · · ·

\ddots. . . \vdots

...\times × \div ÷

\partial ∂ \nabla ∇\Re ℜ \Im ℑ

Upper case.

\leftarrow ←\Leftarrow ⇐\rightarrow →\Rightarrow ⇒

\Leftrightarrow ⇔\rightleftharpoons

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 55/75

Page 56: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Some more examples.

$\int^\infty_-\infty\sin(x^2)\mathrmdx

= \sqrt\frac\pi2$

∫∞−∞ sin(x2)dx=

Æ

π2

$\forall \epsilon > 0, \epsilon \in \mathbbR,

\exists \mathnormalN \in \mathbbN... $

∀ε > 0,ε ∈R,∃N ∈N...

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 56/75

Page 57: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Creating matrices.

Matrices are created exactly as tables are. But the environment iscalled array here, in math mode.

\[

\left(

\beginarrayc c c

1 & 2 & 2\\

3 & 4 & 5\\

6 & 7 & 8

\endarray

\right)

\]

1 2 23 4 56 7 8

Notice that \[ math formula \] puts the formula in a new line,without equation number.Both in tabular and array environments, the number of rows is notindicated explicitly.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 57/75

Page 58: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Creating tables.

\[

\beginarray|c | c | c|

\hline

\angle[^\circ] & \sin & \cos \\

\hline

0 & 0 & 1\\

\pi/6 & 1/2 & \sqrt3/2 \\

\pi/4 & \sqrt2/2 & \sqrt2/2 \\

\pi/3 & \sqrt3/2 & 1/2 \\

\pi/2 & 1 & 0 \\

\hline

\endarray

\]

∠[] sin cos0 0 1π/6 1/2

p3/2

π/4p

2/2p

2/2π/3

p3/2 1/2

π/2 1 0

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 58/75

Page 59: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Exercises.

Typeset the following...

~∇× ~H =~J +∂ ~D

∂ t⇔~H · d~l=

∫∫

~I +∂ ~D

∂ t

· d~A (3)

~∇×~E=−∂ ~B

∂ t(4)

S

~D · d~A=∫∫∫

VρdV (5)

Fx(t)=∞∫

−∞

x(t)e−jωtdt⇔F−1X(ω)=1

∞∫

−∞

X(ω)e jωtdω

(6)

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 59/75

Page 60: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Exercises.

and the following.

A=

a11 · · · a1n...

. . ....

an1 · · · ann

(7)

det(A) =

a11 · · · a1n...

. . ....

an1 · · · ann

=∑

σ∈Sn

sgn(σ) ·n∏

i=1

ai,σ(i)

!

(8)

Note that had you used

\usepackageamsmath

\usepackageamssymb

your output will look different from the above. To get the sameoutput, you need to use

\usepackage[garamond]mathdesignElankumaran.K Create beautiful CVs, Reports and books, With LATEX 60/75

Page 61: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Exercises.

Frankly, the amsmath version with its default fonts looks better formath, than this mathdesign-Garamond combination.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 61/75

Page 62: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Some important points not covered

Equations, figures, theorems, sections, every structure elementis numbered. You can refer to one such figure or equation witha label. You need not track these numbers, LATEX does it foryou. Refer to \label, \ref commands. This also creates alink within the document to the referred entity.Some templates can create a title page automatically, withauthor name, date etc. Refer to \maketitle.You can create table of contents, list of figures, list of tables etc.Refer to\tableofcontents, \listoffigures, \listoftables.You can create hyper-references (external links, links towebsites) with \href.There are tools for creating references (e.g., BibTeX), which isuseful in books in journal publications.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 62/75

Page 63: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Points to note

When you use the above mentioned options, that create links,table of contents etc., LATEX needs to index the contents of thedocument. This may take a few passes. So you will have tocompile again and again, till the number of warnings reduces toa minimum.Some packages may need a specific variant of TEX, likeXeLaTeX. Usually most of them are found in the UI.Some outputs are produced only in certain formats, e.g., TEXproduces only dvi. Then you use tools like dvi2pdf or ps2pdfetc., to get the format you want.If your pdf looks terrible (for pdf standards), enlarge the textand look if you can see pixels in the fonts. If yes, you are usingold bitmap fonts. Switch to the modern fonts.MikTeX installs missing packages on the fly. Internetconnection is desired, when you experiment with newtemplates and packages.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 63/75

Page 64: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Tips and tricks I

In books, the chapter titles may appear on, say top of the righthand side page. If they are too long, they will be truncated. Youcan specify short titles as optional argument. This argumentwill be used then in headers, footers. For e.g.,

\section[Modern typesetting and authors]

The role of modern typesetting systems in

the proliferation of authors

You can define your own commands. For e.g., if you want todefine unit vectors to be in bold letters and to have a hat, then

\newcommand\myuv[1]\mathbf\hat#1

is how you begin. (#1 is the argument. Look for \ensuremathand the order of bold and hat properties to implement theabove correctly.)

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 64/75

Page 65: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Tips and tricks II

You can redefine entire behaviours. E.g., if you have writtenyour whole thesis with vectors as~v (with \vec), but now youdecide that it looks better if the vectors are in bold, not witharrow above, you only need to redefine \vec at the top.\renewcommand\vec\mathbf

(Take care that the command has been already defined once.)You need not have all your contents in one .tex file: You cansplit into chapters or any other chunks, and put each one ofthem in separate file. Then use \includeFILE_NAME to createone document out of the many .tex files.Figures and tables are floating objects: TEX places them whereever it deems it to be fit. But you can force (most of the times)that an entity is anchored after a particular text with [h]option.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 65/75

Page 66: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Presentations I

To make presentations, you only need a different documentclass.

\documentclassbeamer

\usethemedefault

\begindocument

...

\enddocument

Each slide content is presented within a frame environment.

\sectionHistory of telephones

%----------- slide --------------------------------------------------%

\beginframe

\frametitleTimes before Graham Bell

Blah blah blah... was not possible except in person.

\endframe

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 66/75

Page 67: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Presentations II

Note that the section and subsections are created just before the slidebegin.Another document class for presentations is prosper. Prosperproduces only .dvi format. You then use dvips followed by ps2pdf tomake a pdf out.To create items that appear on mouseclick you will need to useoverlay. It is achieved with a simple \pause command.To make animations/effects, pstricks could be used with Beamer.A very good quickstart to making presentations with Beamer isfound in http://www.math.umbc.edu/~rouben/beamer/

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 67/75

Page 68: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

LyX

If you had thought, “If TEX is so great, why can’t they make aWYSIWYG (what you see is what you get) processor that has the lookof a word processor, but works with LATEX as the backend?”, kudos.Something in between the word processor and creating all themarkup yourself is LyX.

LyX calls itself a document processor. It is opensource, free in bothsenses. If you want to avoid all the hassles of markups and includepackages for memos, notes, small letters etc., then LyX is handy.Type stuff as you would type in a word processor, and File->Exportto pdf, or html or even Word, if it has to be.When you need structuring, like a section or a subsection, just selectit from the drop down menu on the left top.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 68/75

Page 69: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

LyX

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 69/75

Page 70: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

An alternative to...

It can be a very practical alternative to word processors you use dailybecause:

1 It is enough of a WYSIWYG for documents where onlycontent matters.

2 You can do formatting (italics, typewriter style, strike out) byselecting text with your mouse.

3 You can track changes. Useful in reviewing documents anddocuments prepared in collaboration.

4 You can insert figures, tables, references etc., in the UI, just asyou are used to in the word processors.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 70/75

Page 71: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Where it is better than word processors

Comes with lot of specialized templates (File->New fromTemplate) like IEEE transactions, beamer slides etc., apart fromthe standard book, letter.You can export to a variety of formats that will not require therecipient to buy the latest version of the word processor.When you know LATEX, you can decide to switch into LATEXmode and insert code segements for which no LyX support isavailable yet.You can create child documents which will be merged to givethe main documents.Structuring documents is not only for specialists, as in Wordprocessors.

Note: If your pdf text looks lousy, enlarge it. If it looks pixelated, itmeans the default old bitmap fonts are being used. Go toDocument->Settings->Fonts->Roman (and others) and change it.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 71/75

Page 72: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Some LyX quickstart

The environment is pretty intuitive, in comparison to a LATEX IDE.The tools you need most are

For italics, slanted or other styles and colours, use the button intoolbar or Edit->Text style->customized.Subscript, superscript in text mode: Insert->Formattingsection, paragraph etc., from toolbar drop down menu. Newpage in Insert->Formatting.The tutorials in LyX’s home page are so lucid and simple that Ican not any quicker Quickerstart.Inserting figures: Remember figures and tables are floats thatLATEX places where ever it deems right? SoInsert->Float->Figure, and then Insert->graphic. Screencastsin the tutorials mentioned above makes everything clearer.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 72/75

Page 73: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

Summary

TEX is an industrial strength typesetting system. When youhave mastered it, you have another profession in your hand.With LATEX, even people with limited computer experiencecould produce high quality documents.LyX is to LATEX what LATEX is to TEX: it increases the numberof people who can produce beautiful documents, and thenumber of occasions where TEX could be deployed.As long as there is ASCII, your documents live. As anentrepreneur, you decrease cost and increase quality anddurability just by switching to, say LyX.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 73/75

Page 74: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

References, acknowledgements

There are numerous marvellous LATEX tutorials on the net. The TEXUsers Group (TUG) is a major organisation. The Indian TEX UsersGroup receives a special mention there for their tutorials.TUG India itself has much more than just tutorials.

The more detailed and extensive the tutorials (not these) are, thedifficult the uninitiated find it to overcome the inertia and startproducing stuff. Hence this quickstart of mine. The guy who gavesuch a quickstart for me, in a one day LATEX workshop at TUM isMarkus Breunig. As a mark of gratitude, I have stolen some his nicemath examples.A very handy reference when I had learned LATEX was “A Guide toLATEX” by Helmut Kopka and Patrick W. Daly.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 74/75

Page 75: Create beautiful CVs, Reports and books - With LaTeXelankumaran/createCVandReports.pdf · Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 7/75 Word processors -

I am not going to recognize Nobel prizes

until they award one in Literature to Bill Watterson.

Elankumaran.K Create beautiful CVs, Reports and books, With LATEX 75/75