4. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Things to Remember
Remember . . .
When specifying the location of the graphic file, the path is
taken as relative to your working directory.
There are several package we can use, we’ll be using the
graphicx package mostly in this course. Thus, you’ll need to
ensure that you are “using” the graphicx package like so:
Example
usepackage{graphicx}
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
6. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
The includegraphics Command
You can specify the height or width of the graphic easily. Using
either of these commands will resize while maintaining the
height/width ratio.
includegraphics[height=3in]{insert_this}
includegraphics[width=4cm]{insert_that}
includegraphics[scale=0.5]{insert_that}
By the way, I use the scale argument the most!
Example
Try it with an image! (One can be found in
http://sites.google.com/site/latexcourse/files)
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
7. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Bibliographies in LATEX
Bibliographies are very convenient in LATEX
There are several different ways to do bibliographies in LATEX.
We’ll be using another program to help us called BibTeX.
BibTeX is a separate program from LATEX that takes an input
a file of bibliography entries.
BibTeX input files are normally named with the .bib
extension.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
8. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Bibliographies in LATEX
Bibliographies are very convenient in LATEX
There are several different ways to do bibliographies in LATEX.
We’ll be using another program to help us called BibTeX.
BibTeX is a separate program from LATEX that takes an input
a file of bibliography entries.
BibTeX input files are normally named with the .bib
extension.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
9. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Bibliographies in LATEX
Bibliographies are very convenient in LATEX
There are several different ways to do bibliographies in LATEX.
We’ll be using another program to help us called BibTeX.
BibTeX is a separate program from LATEX that takes an input
a file of bibliography entries.
BibTeX input files are normally named with the .bib
extension.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
10. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Bibliographies in LATEX
Bibliographies are very convenient in LATEX
There are several different ways to do bibliographies in LATEX.
We’ll be using another program to help us called BibTeX.
BibTeX is a separate program from LATEX that takes an input
a file of bibliography entries.
BibTeX input files are normally named with the .bib
extension.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
11. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Bibliographies in LATEX
Bibliographies are very convenient in LATEX
There are several different ways to do bibliographies in LATEX.
We’ll be using another program to help us called BibTeX.
BibTeX is a separate program from LATEX that takes an input
a file of bibliography entries.
BibTeX input files are normally named with the .bib
extension.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
15. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
You must compile your .bib file using bibtex before the
citations can be used in your LATEX document.
How you go about this depends on your environment.
One the command line it would be as follows assuming that
your latex compiler executable is named latex, your main
document is named paper.tex, and your bibliography is
named paper.bib:
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
16. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
You must compile your .bib file using bibtex before the
citations can be used in your LATEX document.
How you go about this depends on your environment.
One the command line it would be as follows assuming that
your latex compiler executable is named latex, your main
document is named paper.tex, and your bibliography is
named paper.bib:
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
17. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
You must compile your .bib file using bibtex before the
citations can be used in your LATEX document.
How you go about this depends on your environment.
One the command line it would be as follows assuming that
your latex compiler executable is named latex, your main
document is named paper.tex, and your bibliography is
named paper.bib:
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
19. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Including Citations in Your Documents
The cite a document contained in your bibliography we use
the cite command.
The cite command typically accepts a single argument which
is the key of bibliography entry.
Additional arguments are, for instance, used to cite certain
pages in a book.
In our previous example (ex. 3) , the key to our entry was
name.08.
To cite this document we would use the cite command as
follows:
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
20. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Including Citations in Your Documents
The cite a document contained in your bibliography we use
the cite command.
The cite command typically accepts a single argument which
is the key of bibliography entry.
Additional arguments are, for instance, used to cite certain
pages in a book.
In our previous example (ex. 3) , the key to our entry was
name.08.
To cite this document we would use the cite command as
follows:
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
21. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Including Citations in Your Documents
The cite a document contained in your bibliography we use
the cite command.
The cite command typically accepts a single argument which
is the key of bibliography entry.
Additional arguments are, for instance, used to cite certain
pages in a book.
In our previous example (ex. 3) , the key to our entry was
name.08.
To cite this document we would use the cite command as
follows:
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
22. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Including Citations in Your Documents
The cite a document contained in your bibliography we use
the cite command.
The cite command typically accepts a single argument which
is the key of bibliography entry.
Additional arguments are, for instance, used to cite certain
pages in a book.
In our previous example (ex. 3) , the key to our entry was
name.08.
To cite this document we would use the cite command as
follows:
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
23. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Including Citations in Your Documents
The cite a document contained in your bibliography we use
the cite command.
The cite command typically accepts a single argument which
is the key of bibliography entry.
Additional arguments are, for instance, used to cite certain
pages in a book.
In our previous example (ex. 3) , the key to our entry was
name.08.
To cite this document we would use the cite command as
follows:
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
25. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Its difficult to remember the schema for each kind of
document.
Also, there may be complicated cross references (e.g.,
inproceedings, proceedings) contained in your bibliography.
Therefore, several very good programs exist to help you
manage your .bib file. There’s a few listed on
http://sites.google.com/site/latexcourse/links-2.
One may exist on the lab computers, but if not, we’ll install
one called JabRef.
JabRef is a Java program and shouldn’t require any
complicated installation process, and moreover should run
(correctly) on all platforms.
Let’s take a few minutes and visit
http://www.haptonstahl.org/latex/work_bibtex.php
and follow the on screen instructions!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
26. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Its difficult to remember the schema for each kind of
document.
Also, there may be complicated cross references (e.g.,
inproceedings, proceedings) contained in your bibliography.
Therefore, several very good programs exist to help you
manage your .bib file. There’s a few listed on
http://sites.google.com/site/latexcourse/links-2.
One may exist on the lab computers, but if not, we’ll install
one called JabRef.
JabRef is a Java program and shouldn’t require any
complicated installation process, and moreover should run
(correctly) on all platforms.
Let’s take a few minutes and visit
http://www.haptonstahl.org/latex/work_bibtex.php
and follow the on screen instructions!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
27. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Its difficult to remember the schema for each kind of
document.
Also, there may be complicated cross references (e.g.,
inproceedings, proceedings) contained in your bibliography.
Therefore, several very good programs exist to help you
manage your .bib file. There’s a few listed on
http://sites.google.com/site/latexcourse/links-2.
One may exist on the lab computers, but if not, we’ll install
one called JabRef.
JabRef is a Java program and shouldn’t require any
complicated installation process, and moreover should run
(correctly) on all platforms.
Let’s take a few minutes and visit
http://www.haptonstahl.org/latex/work_bibtex.php
and follow the on screen instructions!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
28. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Its difficult to remember the schema for each kind of
document.
Also, there may be complicated cross references (e.g.,
inproceedings, proceedings) contained in your bibliography.
Therefore, several very good programs exist to help you
manage your .bib file. There’s a few listed on
http://sites.google.com/site/latexcourse/links-2.
One may exist on the lab computers, but if not, we’ll install
one called JabRef.
JabRef is a Java program and shouldn’t require any
complicated installation process, and moreover should run
(correctly) on all platforms.
Let’s take a few minutes and visit
http://www.haptonstahl.org/latex/work_bibtex.php
and follow the on screen instructions!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
29. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Its difficult to remember the schema for each kind of
document.
Also, there may be complicated cross references (e.g.,
inproceedings, proceedings) contained in your bibliography.
Therefore, several very good programs exist to help you
manage your .bib file. There’s a few listed on
http://sites.google.com/site/latexcourse/links-2.
One may exist on the lab computers, but if not, we’ll install
one called JabRef.
JabRef is a Java program and shouldn’t require any
complicated installation process, and moreover should run
(correctly) on all platforms.
Let’s take a few minutes and visit
http://www.haptonstahl.org/latex/work_bibtex.php
and follow the on screen instructions!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
30. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Bibliography Entries
Compiling Bibliographies
Citing Documents
Bibliography Managers
Its difficult to remember the schema for each kind of
document.
Also, there may be complicated cross references (e.g.,
inproceedings, proceedings) contained in your bibliography.
Therefore, several very good programs exist to help you
manage your .bib file. There’s a few listed on
http://sites.google.com/site/latexcourse/links-2.
One may exist on the lab computers, but if not, we’ll install
one called JabRef.
JabRef is a Java program and shouldn’t require any
complicated installation process, and moreover should run
(correctly) on all platforms.
Let’s take a few minutes and visit
http://www.haptonstahl.org/latex/work_bibtex.php
and follow the on screen instructions!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
31. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
About The Tabular Environment
The tabular environment is basically used to make tables.
This is a bit confusing since there is also a table
environment, but we’ll cover that in the next section.
The LATEXcode to generate tables can be a pain.
The good news is that you can use other software to write
this code for you.
There are several tools available to help you create tables in
LATEX from other documents (e.g., an excel worksheet). Some
of these are listed in the Wiki.
My personal favorite is a tool called csv2latex which is a
command line tool typically included in most *NIX
distributions, including, of course, OS X.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
32. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
About The Tabular Environment
The tabular environment is basically used to make tables.
This is a bit confusing since there is also a table
environment, but we’ll cover that in the next section.
The LATEXcode to generate tables can be a pain.
The good news is that you can use other software to write
this code for you.
There are several tools available to help you create tables in
LATEX from other documents (e.g., an excel worksheet). Some
of these are listed in the Wiki.
My personal favorite is a tool called csv2latex which is a
command line tool typically included in most *NIX
distributions, including, of course, OS X.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
33. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
About The Tabular Environment
The tabular environment is basically used to make tables.
This is a bit confusing since there is also a table
environment, but we’ll cover that in the next section.
The LATEXcode to generate tables can be a pain.
The good news is that you can use other software to write
this code for you.
There are several tools available to help you create tables in
LATEX from other documents (e.g., an excel worksheet). Some
of these are listed in the Wiki.
My personal favorite is a tool called csv2latex which is a
command line tool typically included in most *NIX
distributions, including, of course, OS X.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
34. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
About The Tabular Environment
The tabular environment is basically used to make tables.
This is a bit confusing since there is also a table
environment, but we’ll cover that in the next section.
The LATEXcode to generate tables can be a pain.
The good news is that you can use other software to write
this code for you.
There are several tools available to help you create tables in
LATEX from other documents (e.g., an excel worksheet). Some
of these are listed in the Wiki.
My personal favorite is a tool called csv2latex which is a
command line tool typically included in most *NIX
distributions, including, of course, OS X.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
35. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
About The Tabular Environment
The tabular environment is basically used to make tables.
This is a bit confusing since there is also a table
environment, but we’ll cover that in the next section.
The LATEXcode to generate tables can be a pain.
The good news is that you can use other software to write
this code for you.
There are several tools available to help you create tables in
LATEX from other documents (e.g., an excel worksheet). Some
of these are listed in the Wiki.
My personal favorite is a tool called csv2latex which is a
command line tool typically included in most *NIX
distributions, including, of course, OS X.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
36. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
About The Tabular Environment
The tabular environment is basically used to make tables.
This is a bit confusing since there is also a table
environment, but we’ll cover that in the next section.
The LATEXcode to generate tables can be a pain.
The good news is that you can use other software to write
this code for you.
There are several tools available to help you create tables in
LATEX from other documents (e.g., an excel worksheet). Some
of these are listed in the Wiki.
My personal favorite is a tool called csv2latex which is a
command line tool typically included in most *NIX
distributions, including, of course, OS X.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
37. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Tabular By Hand
Three environmental commands do about the same thing and use
the same syntax:
begin{tabular}[pos]{cols} ... end{tabular}
begin{tabular*}{width}[pos]{cols} ... end{tabular}
begin{array}[pos]{cols} ... end{tabular}
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
38. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Details
The tabular environment creates a table whose width is set
automatically based on the content.
The tabular* environment gives you the option of setting
the overall width of the table.
The array environment is used in math mode.
In fact, there’s a useful eqnarray environment in math mode
thats very useful for aligning multi-lined equations!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
39. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Details
The tabular environment creates a table whose width is set
automatically based on the content.
The tabular* environment gives you the option of setting
the overall width of the table.
The array environment is used in math mode.
In fact, there’s a useful eqnarray environment in math mode
thats very useful for aligning multi-lined equations!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
40. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Details
The tabular environment creates a table whose width is set
automatically based on the content.
The tabular* environment gives you the option of setting
the overall width of the table.
The array environment is used in math mode.
In fact, there’s a useful eqnarray environment in math mode
thats very useful for aligning multi-lined equations!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
41. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Details
The tabular environment creates a table whose width is set
automatically based on the content.
The tabular* environment gives you the option of setting
the overall width of the table.
The array environment is used in math mode.
In fact, there’s a useful eqnarray environment in math mode
thats very useful for aligning multi-lined equations!
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
42. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Details
Arguments
[pos] is an optional command.
If you set [t], then the top line of the table is aligned with
the baseline of the text preceding the table.
If you set [b] or do not use this command, the bottom of the
table is aligned with the baseline of the text preceding the
table.
{cols} sets the number of columns and the default alignment
in each column.
You can also add vertical lines between columns (borders)
that run the entire height of the table.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
46. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Centering a table: You can center a table by putting
begin{center} and end{center} around it.
Partial horizontal lines: The command cline{n-m} draws a
horizontal line from the left side of column n to the
right side of column m.
Spanning columns: The command
multicolumn{num}{col}{text} puts text is a cell
that spans num columns using alignment and border
formatting col.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
47. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
begin{center}
begin{tabular}{cp{2.5in}rr}
Qty & Description & Cost each & Sub Total
hline
10 & Course text & $12.95 & $129.50
1 & Custom-built software, including full
documentation & $4,500 & 4,500.00
2 & Servers (to run the software) &
$1,495.00 & 2,990.00
hline
multicolumn{3}{r}{Total (not including tax):} &
$7,619.50
cline{4-4}
end{tabular}
end{center}
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
49. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Qty Description Cost each Sub Total
10 Course text $12.95 $129.50
1 Custom-built software, including full
documentation
$4,500 4,500.00
2 Servers (to run the software) $1,495.00 2,990.00
Total (not including tax): $7,619.50
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
50. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Notes
To type a dollar sign, you must precede it with to tell
LaTeX you’re not entering math mode.
The multicolumn command is used since the ”Total (not
including tax): is expected to be wider than the ”Cost each”
column, and we don’t want that column to automatically be
way too wide for the dollar amounts.
The cline command lets us underline the total dollar
amount.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
52. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
LaTeX can automatically create indexes while you work on
your document.
To use LaTeX indexing, you must first include the makeidx
command in the preamble.
The full command is:
usepackage{makeidx}
makeindex
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
54. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
There are several types of index entries that LaTeX can create.
These are:
Plain entry: uses the basic command index{cheese} to make
an entry for cheese with the current page number
Subindex Entry: uses the basic command with an exclamation
point to separate the first main entry from the
subentry. The command for a single level of subentry
appears as such: index{cheese!gouda}
Subentries can be up to one additional level deep,
and the command appears as such:
index{cheese!gouda!brie}
Cross-references: Entries which are simple ”See” and another entry
are created using the vertical bar with this command:
index{cheese|see{crackers}}
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics
55. Outline
Graphics
Bibliographies
Tabular
Floats
Indices
Font changes: To change the style of an index entry, use the @
sign followed by a font change command like this:
This example indexes Kraft and italicizes it at the
same time. Any of the standard font change
commands which use text... will work within this
syntax. Out of sequence: This can be used to make
index entries appear out of sequence, so that they
appear with the work they represent. For instance:
index{cheese@gouda} Would place gouda in the
list right next to cheese, as if gouda was actually
spelled cheese.
Raffi Khatchadourian Lancaster University LATEX 1-Day Course: Special Topics