General ⇒ flashcards
flashcards
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}}.
What I would like to reduce 2 newcommands to one command, as writing two commands is a little redundant.
I cant 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 im in #1 do this command, if im in #2 then do the other command. However I can't figure out how to implement this exactly. Any suggestions?
Thanks in advance!
Loesung
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
flashcards
For an adequate problem description and in order to avoid guesses and random shots please prepare a proper minimal example that contains all necessary but only relevant information in form of code.
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10