Usually my exams have a large blank space for students to write their names in.

If, instead, I wanted to generate individualised exams with their names printed in that space, this code will do that for you. It uses the pgffor package to loop over the list of names you provide.

\documentclass{article}
\usepackage{pgffor}
\def\classlist{Enda Hargaden,
George Akerlof,
Joe Stiglitz,
Don Bruce}
\pagenumbering{gobble}
\begin{document}
\foreach \studentname in \classlist{

Econ 381 Problem Set: \studentname's Copy

\begin{enumerate}
\item What is OLS?
\item What's the square root of 25?
\item More questions yadda yadda
\end{enumerate}

\newpage}

\end{document}
//

Over on Twitter, Gray Kimbrough suggests using colour to indicate statistical significance/p-values instead of the traditional stars. This was part of a broader argument for Powerpoint over Beamer.

I much prefer Beamer to Powerpoint, and I knew it would be very easy to implement coloured cells in regression tables directly from Stata into LaTeX/beamer.

I use the wonderful estout to produce regression tables (and have modified it in the past) so here’s how to produce the table above with one extra line in your do-file.

clear
sysuse auto

** This line generates a local named siggreen, defining significance with green opacity
local siggreen "star(\cellcolor{green!10} 0.10 \cellcolor{green!35} 0.05 \cellcolor{green!95} 0.01) nonotes"

** Run a few sample regressions
qui eststo: reg price foreign mpg weight
qui eststo: reg price foreign mpg weight turn
qui eststo: reg price foreign mpg weight turn gear_ratio displacement headroom

** Using esttab, produce the output with Enda's preferred options
esttab using myoutput.tex, replace booktabs nodepvars nomtitle se label ar2 `siggreen' title("Green Regression")

Then, to include that table into your TeX document:

\documentclass{article}
\usepackage[table]{xcolor}
\usepackage{booktabs}
\begin{document}
\input{myoutput}
\end{document} 

If you want to include this tables in your Beamer slides, see this post.

//

I’ve discussed in the past how to indicate statistical significance with colour rather than stars. Another concern people have about using Beamer is that it can be hard to squish results into one slide. In my opinion, that is solved very easily with my tinytable command.

\documentclass[xcolor={table}]{beamer}
\usepackage{booktabs}

\newcommand{\tinytable}[1]{\textcolor{black}{\tiny \input{#1} }}

\begin{document}
\begin{frame}
\frametitle{Fascinating}
\input{myoutput}
\end{frame}

\begin{frame}
\frametitle{Still fascinating, but smaller}
\tinytable{myoutput}
\end{frame}
\end{document} 

This generates the following:

//
Scroll to Top