Generalflashcards

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
loesung
Posts: 2
Joined: Fri Jun 17, 2011 5:25 pm

flashcards

Post by loesung »

Hello!

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

flashcards

Post by localghost »

Just for information to other users for awareness of possibly already existing solutions. The question has also been posted to {TeX} SX (with an accepted answer).

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
Post Reply