Lab 5: Professional Reporting with LaTeX

Overview

In this lab you will take the results of a completed data analysis (provided as tables and figures) and produce a professionally formatted report using LaTeX. You will work with an Overleaf template that also compiles locally in VS Code.

By the end of this lab you will be able to:

Estimated time: 90–120 minutes
Tools: Overleaf (free account) and/or VS Code + MiKTeX + LaTeX Workshop


What you receive

All files are in the Lab-5-Report/ folder:

Folder / File Description
sample-report/Sample-Report.md The full report in Markdown — your content source.
sample-report/tables/*.csv Four result tables (descriptive stats, GPA by faculty, regression, t-test).
sample-report/images/*.png Four publication-quality figures generated from the tables.
latex-template/main.tex A complete LaTeX template that already incorporates all content.
latex-template/references.bib BibTeX file with 3 course references.
latex-template/images/ Copies of the figures (ready for \includegraphics).

Part 1: Explore the Sample Report (15 min)

Task 1.1 — Read the Markdown report

Open sample-report/Sample-Report.md and read through the six sections. Notice:

Task 1.2 — Inspect the data files

Open the four CSV files in tables/ and the four PNG files in images/. Confirm you understand what each one shows and which section of the report it belongs to.


Part 2: Set Up Your LaTeX Environment (15 min)

Choose one of the two paths below.

Option A — Overleaf (recommended for first-time users)

  1. Go to overleaf.com and sign in (or create a free account).
  2. Click New Project > Upload Project.
  3. Zip the entire latex-template/ folder and upload it.
  4. Overleaf will detect main.tex automatically. Click Recompile to generate the PDF.

Option B — VS Code (local)

  1. Ensure you have installed MiKTeX, Strawberry Perl, and the LaTeX Workshop VS Code extension (see the course Install Guide).
  2. Open the latex-template/ folder in VS Code.
  3. Open main.tex. Press Ctrl+Alt+B (or run LaTeX Workshop: Build with recipe > latexmk).
  4. View the PDF preview in the side panel.

Checkpoint: You should see a multi-page PDF with title, abstract, table of contents, tables, and figures.


Part 3: Understand the LaTeX Structure (20 min)

Open main.tex and study each element listed below. For each one, find the corresponding line(s) in the .tex file and write down the line number(s) on your worksheet.

Task 3.1 — Document setup

Element What to find
Document class \documentclass[12pt, a4paper]{article}
Page margins \geometry{margin=2.5cm}
Line spacing \onehalfspacing
Image path \graphicspath{{images/}}

Task 3.2 — Title and abstract

Element LaTeX command
Title \title{...}
Author block \author{...}
Date \date{April 2026}
Abstract \begin{abstract} ... \end{abstract}
Table of contents \tableofcontents

Task 3.3 — Sections and subsections

Find the six \section{} commands and the four \subsection{} commands in the Results section. Note how the table of contents is generated automatically from these.

Task 3.4 — Tables

Find a table environment. Note the structure:

\begin{table}[h]
\centering
\caption{Your caption here.}
\label{tab:yourlabel}
\begin{tabular}{@{}lrr@{}}
\toprule
...
\bottomrule
\end{tabular}
\end{table}

Identify which package provides \toprule, \midrule, \bottomrule (hint: check the preamble).

Task 3.5 — Figures

Find a figure environment:

\begin{figure}[h]
\centering
\includegraphics[width=0.85\textwidth]{filename.png}
\caption{Your caption here.}
\label{fig:yourlabel}
\end{figure}

Task 3.6 — Cross-references and citations

Find examples of:


Part 4: Make Your Own Modifications (30 min)

Task 4.1 — Change the title and authors

Replace the title, author names, and date with your group's information. Recompile and verify the title page updates.

Task 4.2 — Add a new table

Create a new table anywhere in the Results section that presents the following data (you may invent a label and caption):

Program Count Mean Study Hours
Undergraduate 85 15.2
Graduate 75 21.8

Use the booktabs style (\toprule, \midrule, \bottomrule).

Task 4.3 — Add a new figure

Copy one of the existing PNG files, rename it (e.g., fig5_custom.png), place it in images/, and insert it into the document using \begin{figure}...\end{figure}. Write a declarative caption.

Task 4.4 — Add a citation

Open references.bib and add a new entry (you may use any real or fictional source). Then cite it in the Introduction using \cite{yourkey}. Recompile twice (once for the .bib, once to resolve references).

Task 4.5 — Cross-reference check

Add a sentence in the Discussion section that references your new table and your new figure by their labels (e.g., "As shown in Table~\ref{tab:yourlabel} and Figure~\ref{fig:yourlabel}..."). Verify the numbers auto-update after recompiling.


Part 5: Export and Submit (10 min)

Task 5.1 — Generate the final PDF

Recompile one last time. Download or locate the PDF output.

Task 5.2 — Check your PDF

Verify:


Deliverables

Submit via the LMS:

  1. Your modified main.tex file.
  2. Your modified references.bib file.
  3. The compiled PDF output.
  4. Any new image you added in Task 4.3.

Academic integrity

Use the provided template and data. Your modifications should be your own work.