Tables and Figures#

Objective: Learn the basic commands to create and edit tables.

Tables#

Basic tables can be created with a combination of the commands below and the use package: tabularx

Basic Commands

Description

l, r, c

column alignment

&

ampersand separates columns

\\

double backslash begins new row

\hline

horizontal line

|

vertical line

Example: Creating a basic two column table#

Basic

Example: Adding vertical and horizontal lines#

Lines

Example: Centering and adding a caption#

Note the addition the \caption and \centering commands.

Caption

Exercise 1#

Use the tabularx package to create a simple table of the US Women’s Soccer Team’s 2019 World Cup Starting Roster: https://www.ussoccer.com/players

Begin with a header row and two columns.

  • Your two column headers will be: Position and Last Name – Left align the text of the left column

  • Center the text of the right column

  • Add vertical and horizontal lines

Add a caption “2019 Team Roster” and center the table.
Note: Using the \caption{} command will add the phrase “Table 1” in front of caption.

Use package needed: tabularx

Commands needed:
& = column separator
\\ = begin new row
l, r, c = column alignment

Position

Last Name

GK

Naeher

D

Sauerbrunn

D

Dahlkemper

D

O’Hara

D

Dunn

M

Mewis

M

Ertz

Exercise 2#

Create a table like the one below with columns spanning multiple rows or rows spanning multiple columns.

Multiple Columns

Questions?
Consult the answer key in the Overleaf Project to troubleshoot: https://www.overleaf.com/read/vkpyvmhgzsgm

More information sources:

Figures#

Objective: Learn to upload and position figures in Overleaf.

Uploading a figure#

Incorporating images and figures into your Overleaf project is best accomplished by creating your figures, particularly graphs and plots, outside of Overleaf and then importing them into Overleaf.

Click on the “upload” icon and navigate to the location of your figure.

upload

Figure Placement#

Use the following specifiers to adjust the placement of your figures.

Specifier

Permission

h

Place the float here: approximately, not exactly, at the same point it occurs in the source text

t

Position at the top of the page

b

Position at the bottom of the page

p

Put on a special page for floats only

!

Override internal parameters LaTeX uses for determining “good” float positions

H

Places the float at precisely the location in the LaTeX code. Requires the float package. This is somewhat equivalent to h!

Exercise 3: Upload a figure#

  1. To upload image, choose an image of your own, or find file at: EPS-Libraries-Berkeley/LaTeX

  2. Download keyboard_cat.png, and upload file to the Overleaf project.

  3. Place image with these commands:
    \usepackage{graphicx}
    \includegraphics[width=0.4\textwidth]{keyboard_cat}

cat

Exercise 4: Designate figure position#

Use b, t, h to see where figure moves. You might need to add additional text in the document to see how the figure placement varies.

\begin{figure}[b]
\centering
\includegraphics[width=0.6\textwidth]{keyboard_cat}
\end{figure}

Syncing and Uploading figures hosted elsewhere#

Find more information about syncing and hosting your figures outside of Overleaf.

Google Drive: https://www.overleaf.com/help/247-how-can-i-upload-files-from-google-drive#.W4WtwhPwZE5
GitHub/Dropbox: https://www.overleaf.com/help/343#.W4WtgxPwZE4