← All templates

Question and answer sheet (hideanswer)

A worksheet whose answers and worked solution are shown or hidden by one switch, giving the question sheet and the answer sheet from one file.

Create an account to use this
Category
Teaching
Document class
article (article.cls) — ships with TeX Live
Workflow
Assignment / problem set — no revision rounds
Author
Yukoh Kusakabe
Source
CTAN
Licence
hideanswer.sty: MIT License. Sample text: Manulyx, CC0 1.0 (free to use, no conditions).

What you get

  • main.tex — the file that is compiled · 1 KB

These become your files. Editing them afterwards changes your project and nothing else — a project owns its files from the moment it is made.

Link to this template. Send it to a student or co-author: it starts a new paper in this template, through sign-up if they need an account.

https://manulyx.com/start/ctan-teaching-hideanswer

2 venues use this class

Manulyx keeps one template per document class and relates every venue to it, rather than one near-identical card per journal. Searching the gallery for any of these names finds this template.

Journal of Machine Learning Research, Transactions on Machine Learning Research
  • Journal of Machine Learning Research
  • Transactions on Machine Learning Research

Source

main.tex — the file that is compiled · 1 KB
\documentclass[a4paper,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{booktabs}
\usepackage{tikz}
\usepackage{hideanswer}

% Uncomment to produce the question sheet: answers are hidden (printed in white, so the
% layout is identical) and the worked solutions are removed.
% \sethideanswer

\title{Your paper}
\author{Course Code -- Course Name}
\date{Worksheet 2}

\begin{document}
\maketitle

\section*{Fill in the blanks}
\begin{enumerate}
\item The derivative of $x^{3}$ is \underline{\hideanswer{\quad $3x^{2}$ \quad}}.
\item The value of $\int_0^{\pi} \sin x\,dx$ is \underline{\hideanswer{\quad $2$ \quad}}.
\item The SI unit of energy is the \underline{\hideanswer{\quad joule \quad}}.
\end{enumerate}

\section*{Table}
Complete the table of squares.
\begin{center}
\begin{tabular}{@{}lcccc@{}}
\toprule
$n$ & 1 & 2 & 3 & 4 \\
\midrule
$n^{2}$ & 1 & \hideanswer{4} & \hideanswer{9} & \hideanswer{16} \\
\bottomrule
\end{tabular}
\end{center}

\section*{Problem}
The right triangle has legs $a = 6$ and $b = 8$. Find the hypotenuse $c$.
\begin{center}
\begin{tikzpicture}[scale=0.4]
  \draw[thick] (0,0) -- (8,0) -- (8,6) -- cycle;
  \node[below] at (4,0) {$b$};
  \node[right] at (8,3) {$a$};
  \node[above left] at (4,3) {$c$};
\end{tikzpicture}
\end{center}
\begin{smashanswerdiv}
\textbf{Solution.} By Pythagoras,
\begin{equation}
  c = \sqrt{a^{2} + b^{2}} = \sqrt{36 + 64} = 10 .
\end{equation}
\end{smashanswerdiv}

\end{document}

The first page, as this template compiles today. Click it to enlarge, and again to shrink. Open the file ↗