I use a package to make flashcards which has the formatting \card{#1}{#2}
, where #1
and #2
represent the front and back side. The package works great.
I like to block out text, so I have made newcommands \frontcard
, which blocks out the text using highlighting or underlining and makes the text white, and \backcard
, which is essentially a dummy command that replaces frontcard. For example, I would have to write \card{The chancellor of Germany is \frontcard{Angela Merkel}}{The chancellor of Germany is \backcard{Angela Merkel}}
.
\documentclass[frontgrid]{flacards}
\usepackage{color}
\newcommand{\frontcard}[1]{\textcolor{yellow}{\colorbox{yellow}{$#1$}}}
\newcommand{\backcard}[1]{#1}
\begin{document}
\pagesetup{2}{4}
\card{The chancellor of \frontcard{Germany} is \frontcard{Angela Merkel}. }{The chancellor of \backcard{Germany} is \backcard{Angela Merkel}. }
\end{document}
What I would like to reduce 2 newcommands to one command, as writing two commands is a little redundant.
I can't think of an easy way to do this though, because of the arbitrary number of blank fields (2 or more). So something like:
\newcard{The chancellor of \blank{Germany} is \blank{Angela Merkel}}
I was thinking how I could accomplish this; maybe with the ifthen
package or etoolbox
package? So, if I'm in #1
do this command, if I'm in #2
then do the other command. However I can't figure out how to implement this exactly. Any suggestions?
\frontcard
in both arguments of\card
?