Created
July 22, 2015 05:04
-
-
Save betaveros/dca12db265b067e334b3 to your computer and use it in GitHub Desktop.
I wrote this in... December 2009? What the hell?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% underblank.sty: Blanks for tests and study guides and all that multiverse cr&p | |
% to get the answers, declare a command \underblankanswers to anything. | |
\ProvidesPackage{underblank} | |
\usepackage{ulem} | |
\usepackage{ifthen} % need 2 versions: w/, w/o answers | |
\normalem | |
\newlength{\answerwidth} | |
\newcommand{\emptyline}{\vspace{\baselineskip}} | |
\newcommand{\underblank}[2]{\settowidth{\answerwidth}{#1}\uline{\makebox[\answerwidth][c]{#2}}} | |
\ifthenelse{\isundefined{\underblankanswers}} | |
{ % With answers | |
\newcommand{\answerblank}[2]{\underblank{#1}{#2}} | |
\newcommand{\answerhide}[1]{#1} | |
\newcommand{\answerline}[1]{\mtline #1 \mtline} | |
} % End with answers | |
{ % Without answers | |
\newcommand{\answerblank}[2]{\underblank{#1}{}} | |
\newcommand{\answerhide}[1]{} | |
\newcommand{\answerline}[1]{\mtline ~ \mtline} | |
} % End without answers | |
% \answertblank: blank is twice the length of answer. | |
\newcommand{\answertblank}[1]{\answerblank{#1#1}{#1}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment