TeX, BiBTeX, and Figures BiBTeX

Common Styles (/usr/local/teTeX/texmf/bibtex/bst/base/)

• plain — numbered references, sorted alphabetically

• alpha — 3-characters plus year, sorted alphabetically

• ieeetr — numbered, concise (first initials), order of reference Want more — see ~rph/tex/README or post questions to grad newsgroup.

.bib files

• Takes a bit of work to maintain

• In the long run, very much worth the effort

• Write citation key on the paper (I use first author and year)

• Many citation databases use bibtex (others use refer)

BiBTeX

• See, for example, http://www.cs.indiana.edu/cstr/search What is a bib file? Entries of form…

@article{smith92,
title = "Important stuff",
author= "John Smith",
year  = 1992,
month = jan,
volume= 5,
number= 7,
pages = "111--112",
journal = "Highly technical stuff"}

In tex file, use \cite{smith92} to produce citation and add it

into references, as in Smith talks about important stuff
\cite{smith92}.

• BibTeX will do uncapitalization of article names

– "Important Stuff in {VLSI}"

• Cites are not nouns

• Use \cite{smith92,smith93} for mutiple cites

– No space between items!

• Some abbreviations are defined in bst files, such as months and some journal names

• @string{icpp="Proc. Int. Conf. Par. Proc."} in the

.bib will define a new one.

• Read about the crossref field — great for proceedings with many cited aritcles…

@string{crc="CRC Press"}
@string{crc-a="New York"}
@inproceedings{smith91,
title = "Great stuff",
pages = "112--113",
note  = "//www.cse.ucsc.edu/great_stuff.html",
crossref="icpp91"}
@book{icpp91,
booktitle=icpp,
title = icpp,
year = 1991,
publisher= crc,
address = crc-a,
editor = "C.-L. Wu"}

Book definition must be after crossref — split bibliography into

mynonbooks.bib and mybooks.bib.

Figures

Generating:

• Drawing program — xfig with .fig (figure file) and .eps (postcript) output.

• From some other source — xv can translate many formats into postscript

• Plotting program — matlab, gnuplot:

  set term postscript eps monochrome dashed "Helvetica" 22
  set output plot.ps

• For algorithmic pictures, it may be worthwhile to learn LaTeX picture environments and extensions (epic, eepic).

Figure in a document…

\begin{figure}   % or \begin{table}
\centerline{\psfig{figure=fig.ps,width=0.9\textwidth}}
\caption{Great picture!}
\label{fig_great}  % Label after caption!!!!
\end{figure}
The great picture (Figure~\ref{fig_great}) is great!

Table and figures are floating — LaTeX will place them where they fit. For postscript figures, must include the psfig package in your document, so in old LaTeX, have a \input{psfig} before

\begin{document} or [psfig]{article} if you have a copy

of psfig.sty (there’s one in my tex directory). You can set height, width, or both (which can give non-uniform scaling) to absolute numbers or in terms of textwidth and textheight.

Problems with Figures

• Rotated figures can be fixed with

\psfig{figure=fig.ps,angle=90}

• In xfig, if figure is larger than standard size on screen, may have to reduce in the ‘xfig’ menu. Also, export in portrait mode to have figure unrotated.

• Figures that are in postscript rather than encapsulate postscript can cause a problem.

– Postscript figures include the “showpage” command for printing a figure and moving on to the next page.

– Encapsulated figures do not as they are on a single page.

– Sometimes, this can be fixed with some postscript hacking.

• Figures sometimes have a bounding box that is too large or small or non-existance. In the postscript file, there should be a comment line:

%%Bounding Box: llx lly urx ury

You can use ghostview to find picture coordinates to change or create the bounding box line.

Problems with Figures

Math in figures: How to include TEX

• Use xfig to draw the figure

• In figure, place text such as:

      $\sum_i^j x_i$

• In xfig ‘Edit Object’ menu – Set ‘Text Flag’ to ‘Special’

• Export into eepic

• You can fine tune the fig.eepic that xfig generates.

• In 2-column documents, figure* is a 2-column figure, and columnwidth is a single column (for use with psfig).

• For side-by-side figures,

\begin{figure}
\begin{tabular}{cc}
\psfig{figure=fig1.ps,width=0.45\textwdith}&
\psfig{figure=fig2.ps,width=0.45\textwdith}\\
(a)&(b)
\end{tabular}
\caption{First figure (a) and second figure (b).}
\label{fig1-2}
\end{figure}

Or add a middle column to the table to increase spacing

• Learn to use \newcommand or \def to avoid typing

• Use a good emacs style to avoid typing

Generating Other Formats

PS: dvips mydoc -o
HTML: latex2html

• Creates menus, and links

• Can create a flat file with

      latex2html -split 0 -info 0

• See html.sty in my tex directory for useful macros that, for example, create a URL footnote in TeX and a URL link in HTML.

PDF: distill

• Only on the solaris machines

• Much better than dvi2pdf

PDF: pdflatex

• Direct conversion

• Better than distill if usable

• Does NOT understand psfig

• Does understand epic

11  CE200  R. Hughey

List of commands/styles in ~rph/tex.  At the end is a summary of
bibtex style files in this directory and in /usr/local/TeX/lib/inputs.
Many of these files have documentation in the form of comments at
their top.
~rph/bin/btexa                  Bibtex entry:  asks for apropos keys.
If 2 files are specified on the
command line, all books and
proceedings are put in the second.
This is useful to make crossrefs work
better.  (ie have books after things
in them).  Format is in
~rph/bib/btexa.dat, the program
could be changed to have dat file
specified on the command line.
~rph/bin/twopage                Filters for printing multiple logical
fourpage               pages on one page.  Twopage and sixpage
sixpage                should be used with page reversal.  Ie.,
dvips -f -r foo | twopage | lpr
~rph/tex
10pt.sty                A null file
alpha3.bst              Alpha w/ first 3 char regardless of
et.al.
alpha3c.bst             Alpha3, no capitalization changes
alpha4.bst              Alpa w/ first 4 char
alphanc.bst             Alpha w/o capitalization changes
annotate.bst            Uses annotate field of bibtex
annotatea.bst           Annotate, cite as key, sort by author
etc
annotatek.bst           Annotate, cite as key, sort by key.
averbatim.sty           A small verbatim environment.  Loads a
7pt tt font, and fixes underscore.
biblist.tex             For printing full bibliographies.
brownphd.sty            Like it says.  Original by jts,
revisions by rjc, rpg, and rph.
cfloat.sty              Centered floats (see archive/float.sty)
chapters.tex            Modified, from kgk, look for file
numbers in directories (i.e.
ch1/ch1.tex, ch2/ch2.tex ...)
cite.bst                Include citation numbers in entries.
citenotes.sty           Superscripted citation numbers for
everything, taken from the aip.sty

file.
cprog.sty               From comp.text.tex:  routines to
read c programs directly into
LaTeX (or TeX) documents.
directories.sty         Modify \include to include chapters as
directories. Calling this causes a
redefinition of \input to first look
in that directory for the given file.
Also, \include will attempt to input a
file macros.tex in that directory and
scope the entire file (ie no global defs).
Also uses modified kgk \chapters
macro to include a set of directories.
Using \includeonly with \chapters
generates ignorable error messages.
endnotes.sty            Endnotes instead of footnotes.  Used
by ieeesubmit.sty
fcite.sty               Provides \citefnote and \citenorm to
switch between cites as footnotes and
cites as bracketed refs.  Useful for
minipaged tables, in which cites are
numbers and footnotes are letters.
ftsame.sty              Use same counter for figures and
tables.  This numbers them separately
but places them on the same float list
so order is preserved.
ieeecross.bst           IEEE style but w/o using citation for
cross references.
ieeesubmit.sty          Submissions to IEEE tr. c
ieeetr.sty              more ieee stuff.
largepage.sty           Not so full as fullpage....
IEEEtran.sty            IEEE transaction style file from the
IEEE (doc included in style file).
Obtained from help@ep.ieee.org.
Letter2.sty             UCSC letterhead with name etc. in
foot.  Documentation is at the top of
the style file.  See old/Lettertest.tex
for an example.
mput.sty                For figures, put something at a list
of points.
myslide.sty             Like it says.
newout.sty              A vastly improved output routine from
rar that that correctly handles
large headers and footers.
noncite.sty             Turn of citing and footnotes (e.g.,

when doing toc, lof, and lot).
nonote.sty              Turn off \note{} of draftnote.
nsf.sty                 Some parameters for nsf grants.  It
has a commented-out reduction of
baselinestretch.
numques.sty             How to turn ? into a numeric space filler.
page.tex                Some commented-out page settings.
plaincross.sty          Plain bibliography w/ expanded cross
references.
problems.sty            A problems environment with its own
counter that resets in each chapter.
psfig.sty               The psfig.tex package in a sty file.
**Needed for latex2html***
Latex2html will not load the psfig.perl
package unless psfig.sty is loaded as
a document option.
push.sty                Help for tabular and array
environments, to push items up and
down.  Defines \push (push up), \dpush
(push down), \apush (push up and
down), \rowspan (span 2 rows), and
\mpush in array (mbox & push).
resume.sty              Like it says...
rfloat.sty              Rotated floats (\tagrdiagram, etc)
Requires rotbox.sty
rotbox.sty              From rar for rotated boxes.
rsuperfloat.sty         Rotated super tables (requires
rotbox.sty) (\tagrsupertable etc and
\begin{rfsupertabulat}
sectionfig.sty          Include section numbers in figures.
sieee.bst               Sorted bib, but with ieeetr type
entries.
sieeecr.bst             As sieee, expand crossrefs.
sieeecrnotitle.bst      Perfect for extended abstracts!
smallsection.sty        Smaller headings for report.sty,
snarfed from ucsc-report.sty.
subeqnarray.sty         Numbered Subeqnarrays.
superfloat.sty          Supports \tagsupertable (see
float.sty),  which sets up
information for a multipage
\begin{fsupertabular}, acting much
like supertabular, but allowing
continued of the table on future
pages.  Use \nextline and \breakline
in the table.  Does not require the

input of supertab.sty, but does
require captcont, for the continuation
of captions.
supertab.sty            Multipage tables.
tablenotes.sty          Change minipage footnotes to be written
as a line accross the bottom of the
page, w/o a rule, and in \scriptsize
font.  Good for footnoted tables.
theorem.sty             Add several theorems and a proof
environment, SIAM format.
tightenum.sty           Less free space in enum environment.
underscore.sty          Use a real underscore in text.  For
some unknown reason, \_is a rule
rather than the appropriate font's
underscore
----------------------------------------------------------
~rph/tex/archive:               Mostly from the clarkson archive, many
have been modified for my own uses.
biihead.sty             Underlined page headings like Latex man.
bsf.sty, bsl.sty        Bold sf and slanted.  bsf.sty is from
the clarkson archive.
captcont.sty            Continuation of a caption (no number
etc) for multi-figure diagrams.
Additionally, redefines \caption so
that \caption{[List of
Figures]{Caption}} will work.  Useful
for \tag routines which do not have
optional caption argument. thanks to rar.
cite.sty                Compress lists of numbers in citations
to ranges, and
allow linebreaks with difficulty
doublespace.sty
draftnote.sty           Adds draft header & date to pages
\renewcommand{\versiontag} for version
labels.  Uses data and time.
Draft used at bottom of page.
\pagestyle{reprint}  Similar to plain pagestyle in draft mode
\note                Margin par (turn off with nonote.sty)
drop.sty                Dropped letters for opening chapters.
float.sty:              Extraction from clarkson lcustom.tex
needs captcont.sty (cf) which will
allow optional caption args for lof
and lot.  See cfloat.
\inputverbatim        Like it says...

\tagfigure*[FLOAT]{FILE}{CAPTION}{LABEL}
\input figureFILE, execute \box\graph,
give it caption and label (TPIC ouput).
FLOAT is float options (tbhp).
\tagdiagram*[FLOAT]{FILE}{CAPTION}{LABEL}
\input Dfile, a LaTeX input file
with caption and label
\tagverbatim*[FLOAT]{FILE}{CAPTION}{LABEL}
\inputverbatim of FILE
\tagtable*[FLOAT]{FILE}{CAPTION}{LABEL}
\input Tfile into a table
multibox.sty            Multiple box puts for figures.
myfootings.sty
\pagestyle{myfootings}Like myheadings
\markleftfoot{l_foot} Odd numbered pages
\markrightfoot{r_foot}Even numbered pages
overcite.sty            Give superscript numbers for
citations, compressing
lists to ranges, and move past punctuation
portland.sty            protrait and landscape mode.  use
dvips -t landscape.  see rotate.sty
showlabels.sty          Show \label, \ref, \pageref commands
explicitly.  Good for drafts
tabls.sty               Modify tabular environment to not let
hlines collide with text.  Takes
longer to set tables, but is a great
feature.
-----------------------------------------------
Bibstyle summary....
~rph/tex....
alpha3.bst              Alpha w/ first 3 char regardless of
et.al.
alpha3c.bst             Alpha3, no capitalization changes
alpha4.bst              Alpa w/ first 4 char
alphanc.bst             Alpha w/o capitalization changes
annotate.bst            Uses annotate field of bibtex
annotatea.bst           Annotate, cite as key, sort by author
etc
annotatek.bst           Annotate, cite as key, sort by key.
cite.bst                Include citation numbers in entries.
ieeecross.bst           IEEE style but w/o using citation for
cross references (ie, cross references
are filled in).
jmb.[bst,sty]           In /usr/local/TeX/lib/inputs.  Full

                        author's name and date.  The .sty file
                        changes \cite to use parens instead of
                        [].
jmbcr.bst               Jmb, but filling in crossreferences in
                        the bibliography.
sieee.bst               Sorted bib, but with ieeetr type
                        entries.
sieeecr.bst             As sieee, expand crossrefs.
overcite.sty            Give superscript numbers for
                        citations, compressing lists to
                        ranges, and move past punctuation
-----------------------------------------------
~rph/tex/old --- Things removed as being no longer useful.
Letter.sty              Better letterheads, with Brown CS logo
                        in foot.
outline.sty             Define \enumerate to have outline
                        labels (I,A,1,a,i)
biobib.sty              Mods to resume.sty for biobib.
-----------------------------------------------
~rph/tex/doc --- Gems if information
README -> ../README     This file
anti_mouse              More to do with X and twm than tex,
                        but this is my answers repository.
decpoints               How to get decimal points to line up.
draftacross             dvips hack to print 'draft' accross a page.
environment             Pointers in TEXINPUTS and BIBINPUTS
figureplacement         Why figures move around so much, and
                        solutions.
fonts                   News postings on fonts from me and
                        Wesley Mackey, in particular, how to
                        get bold italics.
hboxmessage             Adjusting parameters for fewer hbox
                        error messages.
info-tex.archive        Where Info-TeX is archived (an e-journal).
latexfigcaptions        One way of getting small figure captions.
latexfonts              Defining latex fonts for loaded TeX fonts.
Lettertest.tex          Test of Letter2.
lists                   How to make a list of, eg, captions.
mathfigures             How to get math mode in xfig.
metafonts.Z             And old FAQ on where to find fonts.
pagenumbers             Some comments on page numbers & how to remove.
pctex                   Tex for the PC
psfig.ps                Psfig documentation
put                     A way to put things in specific places.
smalltt                 Comments on getting a small tt font.

texaddress              Some sites for tex stuff.
texhax.archive          The TeXHax archive.
texinfo                 What to do with a .texi or .texinfo file.
texserve.Z              Another FAQ on tex-related addresses
titleson                How to turn things on/off in a bib file.
twofigures              How to get 2 figures next to each other.
whybtexa                Why I use btexa rather than emacs
                        bibtex.
writing.tex             Things that bug me in writing.
~/rph/tex/doc/bibtex
README -> ../README
bibtexinfo.Z            A bunch of bib maint routines from the net.
btxdoc.[tex,dvi]        "Bibtexing" -- how to use the current
                        version of bibtex (the LaTeX manual
                        discusses the old version).
btxhak.[tex,dvi]        How to hack bibtex .bst files.
btxbst.doc              Commented standard .bst style files.
-----------------------------------------------
/usr/local/TeX/lib/inputs/*.bst
aaai-named.bst          Requires other aaai styles.  Citation
                        is full last name and year.
abbrv.bst               Cite by number, sort alphabetic,
                        wordy (ie, 'editors' vs 'eds.').
                        Author initials and last names.
acm.bst                 Similar to abbrv, author names in
                        small caps, less wordy.
alpha.bst               Cite keys are 3 characters of single
                        author or conglomeration of last
                        initials ('+' for et al), year, and
                        possibly lower case letter.
                        Complete author name as given. Wordy.
amsalpha.bst            Full names, more italics than alpha,
                        keys like alpha, less wordy.
amsplain.bst            As above, numbers for keys, sorted.
apalike.bst             1 or 2 author names (or 1 + et.al) and
                        full year as key.  First initials in
                        reference list.  Wordy.
ieeetr.bst              Very compact.  Numbers as keys, in
                        order of reference.
plain.bst               Numbers as keys, full names, wordy.
siam.bst                Sorted number as key, like ieeetr but
                        with author names in small caps.
unsrt.bst               plain.bst with order by reference.