Inserting Tables and Figures

If you and your group have any questions, or get stuck as you work through this in-class exercise, please ask the instructor for assistance. Have fun!

  1. Immediately below \end{enumerate} type \newpage

  2. Using Chapter 4 (pg. 17-18) https://goo.gl/MFp45A for reference, write code below your most recent \newpage line to produce the tables below:**

    table 1

  3. Immediately below the last \end{tabular} type another \newpage

  4. Insert and refer figures
    Download the figure first: https://goo.gl/YH3R4n. Upload the picture by clicking “PROJECT” on the top of the page, and then “Files… → Computer”. Then, at the top of your document, type \usepackage{graphicx} directly after the \documentclass[a4paper,12pt]{article} and above the \begin{document}. Type the following codes below your most recent \newpage

    Insert a figure:

    \begin{figure}[h!]
    \centering
    \includegraphics[width=1\textwidth]{uvic.png}
    \caption{This is caption}
    \label{fig:uvic}
    \end{figure}
    

    Type the following to refer the figure. Example: Please see Figure~\ref{fig:uvic}.

    refer figures

  5. Immediately below the line referring the figure, type another \newpage

  6. Create a three-line table (research paper style)

    refer table

    First type: \usepackage{booktabs} and \usepackage{graphicx} at the top of your document after the \documentclass[a4paper,12pt]{article} and above the \begin{document}. Then type the following codes below the most recent \newpage

    \begin{table}[htbp]
    \centering
     \caption{\label{tab:test}Caption for table}
     \begin{tabular}{lcl} 
      \toprule
      Model & Adjusted $R^2$ & p-value \\
      \midrule
     Model1 & 0.6 & 0.01 \\
     Model2 & 0.7 & 0.02 \\
     Model3 & 0.8 & 0.03 \\
      \bottomrule
     \end{tabular}
    \end{table}
    

    three line table

    Note: in the \begin{tabular}{lcl}, it should type the “l” (in short for left) rather than digital number 1 and ‘c’ (in short for center). {lcl} is used for the column alignment in the table. There are three options for column alignment, namely l (left), c (center) and r (right). You can change this part as you like.

  7. Ensure that the following codes are inserted into your main body, anywhere below the \begin{document} but above the \end{document}.

  • Reference a table
    Type the following in your paragraph to refer the table: Please see Table~\ref{tab:test}.

  • Insert a footnote
    Type the following: This is the footnote.\footnote{Footnote text.}

  • Add Verbatim text

      Type Quote: Single `Quote', Double ``Quotes''
      \begin{verbatim}
      The verbatim environment
       reproduces every input,
      including  s p a c e s!
      \end{verbatim}
    

    verbatim

NEXT STEP: Typing Math Equations