TeX, LaTeX, BibTeX and the Graduate Student

Download Report

Transcript TeX, LaTeX, BibTeX and the Graduate Student

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/texarchive/info/lshort/english/lshort.pdf
http://www.ctan.org
http://www.andy-roberts.net/misc/latex/
http://dataninja.wordpress.com/2006/01/01/int
roduction-to-bibtex/
TeX
Created by Donald E. Knuth
Purpose: Typeset text and mathematical
formulae
High typographical quality
First released in 1982
TeX is the first syllable in the Greek word
texnologia (technology)
Pronounced “Tech” as in Technology
LaTeX
Written by Leslie Lamport
Interact at a Higher level Plain TeX
Uses TeX as its typeset engine
What can it produce?



Scientific and mathematical documents
Simple letters
Complete books
Pronounced “Lay-Tech” or “Lah-Tech”
LaTex vs. WYSIWYG
Not a WYSIWYG program like MS-Word
or Corel WordPerfect.
To preview the document, it must be
processed with LaTeX
Problems with WYSIWYG


Documents generated aesthetically pleasing
with very little or inconsistent structure
LaTeX forces the author to declare the logical
structure of the document
LaTeX Compared With WYSIWYG
WYSIWYG = “What You See Is What You Get”
WYSIWYG text is placed while it is typed
TeX, a formatter, separates entering text and placing it on the page
Examples Entering a New Section

Word Example:
Hit <Enter> twice to get two lines of vertical space
Type "Section 1.2: New results“
highlight the text, clicking to select a larger type size, clicking to select a new type style
Hit <Enter> two more times to get two more lines of vertical space.

Tex Example
Type "\section{New results}“
Format it later when it is “compiled”
Word processing a twenty page technical article is hard



keeping the vertical space between sections uniform is error-prone
making sure that all of the bibliographic entries follow the required format
correct equations lay out
Advantages of LaTeX over
WYSIWYG Word Processors
Best output
Fast
Stable - Documents that run today will still run in ten
years, or fifty. How is *.doc vs. *.docx?
Flexible
Input: plain text
Output: anything – PS, PDF, HTML, or whatever will
appear in the future
Highly portable and FREE
The scientific standard
Professionally crafted layouts available
Typesetting mathematical formulae convenient
complex structures Generated easily ( i.e. footnotes,
references, table of contents, bibliographies)
See Examples: http://www.tug.org/texshowcase/
Disadvantages of LaTeX over
WYSIWYG Word Processors
Does not work well for people who have sold
their souls to …
Although some parameters can be adjusted
within a predefined document layout, the design
of a whole new layout is difficult and takes a lot
of time.
Very hard to write unstructured and disorganized
documents.
Your hamster might, despite some encouraging
first steps, never be able to fully grasp the
concept of Logical Markup.
LaTeX Input Files
Plain ASCII Text created with any text editor
(WinEdt suggested later)
Contains the text and LaTeX layout commands
Whitespace treated as HTML treats whitespace
Special Characters need “Escaped”



#$%^&_{}~\
\# \$ \% \^{} \& \_ \{ \} \~{}
Note \ is not escaped using \\ since “\\” is used for line
breaking
LaTeX Commands
\commandName[options]{arguments}




Case Sensitive
options : optional
arguments : manditory
Example:
\includegraphics[width=2.5cm]{chick.eps}
LaTeX Command Example
Comments
Comment

Single Line Comment
Character: “%”
Ignores the rest of the line (and all whitespace at
the beginning of the next line)

Multi-line Comment
\begin{comment} … \end{comment}
Must include \usepackage{verbatim} in the
preamble of your document
Comment Examples
Input File Structure
\documentclass[options]
{class}
…
\usepackage[options]
{package}
…
\begin{document}
…
\end{document}
Specifies the type of
document you intend to
write
Include commands to
influence the style of the
whole document
Load external packages
Start the body of your
document
End the document –
anything that follows is
ignored
Input File Structure
\documentclass{article}
\usepackage{babel}
Preamble
\begin{document}
\title{An Example}
\maketitle
…
contents
…
\begin{bibliography}
…
\end{bibliography}
\end{document}
Front Matter
Body
Back Matter
Basic Processing Example
Create the file (small.tex)
\documentclass{article}
\begin{document}
Small is beautiful.
\end{document}
Run LaTeX on the file creating a dvi
latex small.tex
View dvi using yap

simply double-click on the dvi file
Ghostscript to change to a ps file
dvips -Pcmz small.dvi -o small.ps
Or Use WinEdt…more on that later
Basic Processing Architecture
Another 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 Possibilities
Making Tables
Adding Images
Adding Captions
Labels and Cross-References
BibTeX
Introduction
BibTeX is…



A plain-text file format and a program
designed to work with LaTeX
bibliographical information (author name,
journal title, date, etc) stored in the file
incorporates BibTeX file (.bib) into LaTeX
documents
Sample Bibliographic Entry
@article{ Hemmendinger07,
author = {David Hemmendinger},
title = {The ACM and IEEE-CS
guidelines for undergraduate
CS education},
journal = {Commun. ACM},
volume = {50},
number = {5},
year = {2007},
issn = {0001-0782},
pages = {46--53},
doi =
{http://doi.acm.org/10.1145/
1230819.1230838},
publisher = {ACM},
address = {New York, NY, USA},
}
@article lets BibTeX know that the
bibliographical entry is an article.
Other Types:





book
phdthesis
unpublished
misc
and others
Hemmendinger07 identifies the entry –
used when citing it in a LaTeX
document.
Using BibTeX in a LaTeX Doc
1. Set the bibliography style.



The standard is plain: \bibliographystyle{plain}
Location: after \begin{document}
Other Styles:
unsrt –same as plain except entries are numbered based on when they are
cited, not alphabetically by author.
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 author(s).
abbrv – Names and journal titles are abbreviated.
2. Make citations.

To cite, insert \cite{ident}
ident is the identifier (i.e. Hemmendinger07).
3. Tell LaTeX to make the bibilography near the end of the document.

\bibliography{bibfile}
bibfile is your bibliography file bibfile.bib (without the .bib)
Producing a Document with BibTeX
latex document
bibtex document
latex document
latex document
Produces an .aux file that
lists all citations made
within the document
Looks up .aux file for
citations, and generates a
.bbl according to style
Allows latex to look up
the .bbl file.
Final run needed to
resolve forward
references.
Basic Processing Architecture
Other Useful Software
WinEdt
JabRef
WinEdt
“A powerful and versatile ASCII editor and
shell for MS Windows with a strong
predisposition towards the creation of
[La]TeX documents.”
Eclipse is to Java as WinEdt is to LaTeX
http://www.winedt.com/
WinEdt Screen
JabRef
JabRef is an open source bibliography reference manager (FREE).
The native file format: BibTeX
Runs on the Java VM (version 1.5 or newer)
Features










Advanced BibTeX editor: Detailed editing of BibTeX entries.
Search functions: Search a pattern in the whole bibliography.
Classification of entries - You can group entries explicitly, by keywords
or any other fields.
Import of various formats
Built-in and custom export formats (i.e. HTML, Docbook, BibTeXML,
etc)
Customization of BibTeX fields
Customizable Interface
Integrates to your environment – Launch PDF/PS viewers, web
browser, etc.
Automatic Key generation
Search Medline, Citeseer, IEEEXplore and arXiv
http://jabref.sourceforge.net/
JabRef Screen