tex, latex, bibtex and the graduate student

30
TeX, LaTeX, BibTeX TeX, LaTeX, BibTeX and the Graduate and the Graduate Student Student Scott Weaver Scott Weaver Pace University Pace University April 12, 2008 April 12, 2008

Upload: ava-bradshaw

Post on 31-Dec-2015

39 views

Category:

Documents


4 download

DESCRIPTION

TeX, LaTeX, BibTeX and the Graduate Student. Scott Weaver Pace University April 12, 2008. References. All the following slides are based on the following: http://www.ctan.org/tex-archive/info/lshort/english/lshort.pdf http://www.ctan.org http://www.andy-roberts.net/misc/latex/ - PowerPoint PPT Presentation

TRANSCRIPT

TeX, LaTeX, BibTeX and the TeX, LaTeX, BibTeX and the Graduate StudentGraduate Student

Scott WeaverScott Weaver

Pace UniversityPace University

April 12, 2008April 12, 2008

ReferencesReferences

All the following slides are based on the All the following slides are based on the following:following: http://www.ctan.org/tex-archive/info/lshort/englhttp://www.ctan.org/tex-archive/info/lshort/engl

ish/lshort.pdfish/lshort.pdf http://www.ctan.orghttp://www.ctan.org http://www.andy-roberts.net/misc/latex/http://www.andy-roberts.net/misc/latex/ http://dataninja.wordpress.com/2006/01/01/inthttp://dataninja.wordpress.com/2006/01/01/int

roduction-to-bibtex/roduction-to-bibtex/

TeXTeX

Created by Donald E. KnuthCreated by Donald E. Knuth

Purpose: Typeset text and mathematical Purpose: Typeset text and mathematical formulaeformulae

High typographical qualityHigh typographical quality

First released in 1982First released in 1982

TeX is the first syllable in the Greek word TeX is the first syllable in the Greek word texnologia (technology)texnologia (technology)

Pronounced “Tech” as in TechnologyPronounced “Tech” as in Technology

LaTeXLaTeX

Written by Leslie LamportWritten by Leslie Lamport

Interact at a Higher level Plain TeXInteract at a Higher level Plain TeX

Uses TeX as its typeset engineUses TeX as its typeset engine

What can it produce?What can it produce? Scientific and mathematical documentsScientific and mathematical documents Simple lettersSimple letters Complete booksComplete books

Pronounced “Lay-Tech” or “Lah-Tech”Pronounced “Lay-Tech” or “Lah-Tech”

LaTex vs. WYSIWYGLaTex vs. WYSIWYG

Not a WYSIWYG program like MS-Word Not a WYSIWYG program like MS-Word or Corel WordPerfect.or Corel WordPerfect.To preview the document, it must be To preview the document, it must be processed with LaTeXprocessed with LaTeXProblems with WYSIWYGProblems with WYSIWYG Documents generated aesthetically pleasing Documents generated aesthetically pleasing

with very little or inconsistent structurewith very little or inconsistent structure LaTeX forces the author to declare the logical LaTeX forces the author to declare the logical

structure of the documentstructure of the document

LaTeX Compared With WYSIWYGLaTeX Compared With WYSIWYG

WYSIWYG = “What You See Is What You Get”WYSIWYG = “What You See Is What You Get”WYSIWYG text is placed while it is typedWYSIWYG text is placed while it is typedTeX, a formatter, separates entering text and placing it on the pageTeX, a formatter, separates entering text and placing it on the pageExamples Entering a New SectionExamples Entering a New Section

Word Example:Word Example:Hit <Enter> twice to get two lines of vertical spaceHit <Enter> twice to get two lines of vertical spaceType "Section 1.2: New results“Type "Section 1.2: New results“highlight the text, clicking to select a larger type size, clicking to select a new type stylehighlight the text, clicking to select a larger type size, clicking to select a new type styleHit <Enter> two more times to get two more lines of vertical space. Hit <Enter> two more times to get two more lines of vertical space.

Tex ExampleTex ExampleType "\section{New results}“Type "\section{New results}“Format it later when it is “compiled”Format it later when it is “compiled”

Word processing a twenty page technical article is hardWord processing a twenty page technical article is hard keeping the vertical space between sections uniform is error-pronekeeping the vertical space between sections uniform is error-prone making sure that all of the bibliographic entries follow the required formatmaking sure that all of the bibliographic entries follow the required format correct equations lay outcorrect equations lay out

Advantages of LaTeX over Advantages of LaTeX over WYSIWYG Word ProcessorsWYSIWYG Word Processors

Best outputBest outputFastFastStable - Documents that run today will still run in ten years, Stable - Documents that run today will still run in ten years, or fifty. How is *.doc vs. *.docx?or fifty. How is *.doc vs. *.docx?FlexibleFlexibleInput: plain textInput: plain textOutput: anything – PS, PDF, HTML, or whatever will appear Output: anything – PS, PDF, HTML, or whatever will appear in the futurein the futureHighly portable and FREEHighly portable and FREEThe scientific standardThe scientific standardProfessionally crafted layouts availableProfessionally crafted layouts availableTypesetting mathematical formulae convenientTypesetting mathematical formulae convenientcomplex structures Generated easily ( i.e. footnotes, complex structures Generated easily ( i.e. footnotes, references, table of contents, bibliographies)references, table of contents, bibliographies)

See Examples: http://www.tug.org/texshowcase/

Disadvantages of LaTeX over Disadvantages of LaTeX over WYSIWYG Word ProcessorsWYSIWYG Word Processors

Does not work well for people who have sold Does not work well for people who have sold their souls to …their souls to …Although some parameters can be adjusted Although some parameters can be adjusted within a predefined document layout, the design within a predefined document layout, the design of a whole new layout is difficult and takes a lot of a whole new layout is difficult and takes a lot of time.of time.Very hard to write unstructured and disorganized Very hard to write unstructured and disorganized documents.documents.Your hamster might, despite some encouraging Your hamster might, despite some encouraging first steps, never be able to fully grasp the first steps, never be able to fully grasp the concept of Logical Markup.concept of Logical Markup.

LaTeX Input FilesLaTeX Input Files

Plain ASCII Text created with any text editor Plain ASCII Text created with any text editor (WinEdt suggested later)(WinEdt suggested later)

Contains the text and LaTeX layout commandsContains the text and LaTeX layout commands

Whitespace treated as HTML treats whitespaceWhitespace treated as HTML treats whitespace

Special Characters need “Escaped”Special Characters need “Escaped” # $ % ^ & _ { } ~ \# $ % ^ & _ { } ~ \ \# \$ \% \^{} \& \_ \{ \} \~{}\# \$ \% \^{} \& \_ \{ \} \~{} Note \ is not escaped using \\ since “\\” is used for line Note \ is not escaped using \\ since “\\” is used for line

breakingbreaking

LaTeX CommandsLaTeX Commands

\\commandNamecommandName[[optionsoptions]{]{argumentsarguments}} Case SensitiveCase Sensitive optionsoptions : optional : optional argumentsarguments : manditory : manditory Example: \includegraphics[width=2.5cm]Example: \includegraphics[width=2.5cm]

{chick.eps}{chick.eps}

LaTeX Command ExampleLaTeX Command Example

CommentsComments

Comment Comment Single Line CommentSingle Line Comment

Character: “%”Character: “%”

Ignores the rest of the line (and all whitespace at Ignores the rest of the line (and all whitespace at the beginning of the next line)the beginning of the next line)

Multi-line CommentMulti-line Comment\begin{comment} … \end{comment}\begin{comment} … \end{comment}

Must include \usepackage{verbatim} in the Must include \usepackage{verbatim} in the preamble of your documentpreamble of your document

Comment ExamplesComment Examples

Input File StructureInput File Structure

\documentclass[options]\documentclass[options]{class}{class}

……

\usepackage[options]\usepackage[options]{package}{package}

……\begin{document}\begin{document}……\end{document}\end{document}

Specifies the type of Specifies the type of document you intend to document you intend to writewriteInclude commands to Include commands to influence the style of the influence the style of the whole documentwhole documentLoad external packagesLoad external packagesStart the body of your Start the body of your documentdocumentEnd the document – End the document – anything that follows is anything that follows is ignoredignored

Input File StructureInput File Structure

\documentclass{article}\documentclass{article}\usepackage{babel}\usepackage{babel}

\begin{document}\begin{document}\title{An Example}\title{An Example}\maketitle\maketitle……contentscontents……\begin{bibliography}\begin{bibliography}……\end{bibliography}\end{bibliography}\end{document}\end{document}

PreamblePreamble

Front MatterFront Matter

BodyBody

Back MatterBack Matter

Basic Processing ExampleBasic Processing Example

Create the file (small.tex)Create the file (small.tex)\documentclass{article}\documentclass{article}\begin{document}\begin{document}Small is beautiful.Small is beautiful.\end{document}\end{document}

Run LaTeX on the file creating a dviRun LaTeX on the file creating a dvilatex small.texlatex small.tex

View dvi using yapView dvi using yap simply double-click on the dvi filesimply double-click on the dvi file

Ghostscript to change to a ps fileGhostscript to change to a ps filedvips -Pcmz small.dvi -o small.psdvips -Pcmz small.dvi -o small.ps

Or Use WinEdt…more on that laterOr Use WinEdt…more on that later

Basic Processing ArchitectureBasic Processing Architecture

Another ExampleAnother Example\documentclass[a4paper,11pt]{article}% define the title\author{H.~Partl}\title{Minimalism}\begin{document}

% generates the title\maketitle

% insert the table of contents\tableofcontents

\section{Some Interesting Words}Well, and here begins my lovely article.\section{Good Bye World}\ldots{} and here it ends.

\end{document}

Other PossibilitiesOther Possibilities

Making TablesMaking Tables

Adding ImagesAdding Images

Adding CaptionsAdding Captions

Labels and Cross-ReferencesLabels and Cross-References

BibTeXBibTeX

IntroductionIntroduction

BibTeX is…BibTeX is… A plain-text file format and a program A plain-text file format and a program

designed to work with LaTeXdesigned to work with LaTeX bibliographical information (author name, bibliographical information (author name,

journal title, date, etc) stored in the filejournal title, date, etc) stored in the file incorporates BibTeX file (.bib) into LaTeX incorporates BibTeX file (.bib) into LaTeX

documentsdocuments

Sample Bibliographic EntrySample Bibliographic Entry@article{ Hemmendinger07,@article{ Hemmendinger07, author = {David Hemmendinger},author = {David Hemmendinger}, title = {The ACM and IEEE-CS title = {The ACM and IEEE-CS

guidelines for undergraduate guidelines for undergraduate CS education},CS education},

journal = {Commun. ACM},journal = {Commun. ACM}, volume = {50},volume = {50}, number = {5},number = {5}, year = {2007},year = {2007}, issn = {0001-0782},issn = {0001-0782}, pages = {46--53},pages = {46--53}, doi = doi =

{http://doi.acm.org/10.1145/{http://doi.acm.org/10.1145/1230819.1230838},1230819.1230838},

publisher = {ACM},publisher = {ACM}, address = {New York, NY, USA},address = {New York, NY, USA}, }}

@article lets BibTeX know that the @article lets BibTeX know that the bibliographical entry is an article.bibliographical entry is an article.Other Types:Other Types:

bookbook phdthesisphdthesis unpublishedunpublished miscmisc and othersand others

Hemmendinger07 identifies the entry – Hemmendinger07 identifies the entry – used when citing it in a LaTeX used when citing it in a LaTeX document. document.

Using BibTeX in a LaTeX DocUsing BibTeX in a LaTeX Doc

1.1. Set the bibliography style.Set the bibliography style. The standard is plain: \bibliographystyle{plain}The standard is plain: \bibliographystyle{plain} Location: after \begin{document} Location: after \begin{document} Other Styles:Other Styles:

unsrt –same as plain except entries are numbered based on when they are unsrt –same as plain except entries are numbered based on when they are cited, not alphabetically by author. cited, not alphabetically by author. alpha – Similar to plain except instead of having numerical identifiers (e.g. alpha – Similar to plain except instead of having numerical identifiers (e.g. [1]), labels are created based on the year of publication and the name of the [1]), labels are created based on the year of publication and the name of the author(s). author(s). abbrv – Names and journal titles are abbreviated. abbrv – Names and journal titles are abbreviated.

2.2. Make citations.Make citations.To cite, insert \cite{To cite, insert \cite{identident}}

identident is the identifier (i.e. is the identifier (i.e. Hemmendinger07)Hemmendinger07)..3.3. Tell LaTeX to make the bibilography near the end of the document.Tell LaTeX to make the bibilography near the end of the document.

\bibliography{\bibliography{bibfilebibfile}} bibfilebibfile is your bibliography file bibfile.bib (without the .bib) is your bibliography file bibfile.bib (without the .bib)

Producing a Document with BibTeXProducing a Document with BibTeX

latex documentlatex document

bibtex documentbibtex document

latex documentlatex document

latex documentlatex document

Produces an .aux file that Produces an .aux file that lists all citations made lists all citations made within the documentwithin the document

Looks up .aux file for Looks up .aux file for citations, and generates a citations, and generates a .bbl according to style.bbl according to style

Allows latex to look up Allows latex to look up the .bbl file.the .bbl file.

Final run needed to Final run needed to resolve forward resolve forward references.references.

Basic Processing ArchitectureBasic Processing Architecture

Other Useful SoftwareOther Useful Software

WinEdtWinEdt

JabRefJabRef

WinEdtWinEdt

““A powerful and versatile ASCII editor and A powerful and versatile ASCII editor and shell for MS Windows with a strong shell for MS Windows with a strong predisposition towards the creation of predisposition towards the creation of [La]TeX documents.”[La]TeX documents.”

Eclipse is to Java as WinEdt is to LaTeXEclipse is to Java as WinEdt is to LaTeX

http://www.winedt.com/

WinEdt ScreenWinEdt Screen

JabRefJabRef

JabRef is an open source bibliography reference manager (FREE).JabRef is an open source bibliography reference manager (FREE).The native file format: BibTeXThe native file format: BibTeXRuns on the Java VM (version 1.5 or newer)Runs on the Java VM (version 1.5 or newer)FeaturesFeatures

Advanced BibTeX editor: Detailed editing of BibTeX entries.Advanced BibTeX editor: Detailed editing of BibTeX entries. Search functions: Search a pattern in the whole bibliography.Search functions: Search a pattern in the whole bibliography. Classification of entries - You can group entries explicitly, by keywords Classification of entries - You can group entries explicitly, by keywords

or any other fields.or any other fields. Import of various formatsImport of various formats Built-in and custom export formats (i.e. HTML, Docbook, BibTeXML, Built-in and custom export formats (i.e. HTML, Docbook, BibTeXML,

etc)etc) Customization of BibTeX fieldsCustomization of BibTeX fields Customizable InterfaceCustomizable Interface Integrates to your environment – Launch PDF/PS viewers, web Integrates to your environment – Launch PDF/PS viewers, web

browser, etc.browser, etc. Automatic Key generationAutomatic Key generation Search Medline, Citeseer, IEEEXplore and arXivSearch Medline, Citeseer, IEEEXplore and arXiv

http://jabref.sourceforge.net/

JabRef ScreenJabRef Screen