Added rules of acquisition example to chapter 2
This commit is contained in:
parent
9932e13348
commit
b1b620f92d
BIN
006/images/roa-card-back.png
Normal file
BIN
006/images/roa-card-back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
006/images/roa-card-front.png
Normal file
BIN
006/images/roa-card-front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
@ -14,7 +14,16 @@ Unfortunately, flash cards are a lot of work to make. (You can buy commercial ve
|
|||||||
|
|
||||||
Fortunately, \LaTeX{} has a number of packages that make the production of flash cards a fairly simple process.
|
Fortunately, \LaTeX{} has a number of packages that make the production of flash cards a fairly simple process.
|
||||||
|
|
||||||
\section{The FlashCards Package}
|
\subsection{Online Examples}
|
||||||
|
|
||||||
|
I had a lot of fun playing around with these packages, and have created a number of example documents for you to download and play around with. I've posted these to both my personal git repository and Codeberg. You can see them here:
|
||||||
|
|
||||||
|
\begin{itemize}
|
||||||
|
\item \textbf{Personal:} \kref{https://git.kjodle.net/kjodle/flashcard-examples}{https://git.kjodle.net/kjodle/flashcard-examples}
|
||||||
|
\item \textbf{Codeberg:} \kref{https://codeberg.org/kjodle/flashcard-examples}{https://codeberg.org/kjodle/flashcard-examples}
|
||||||
|
\end{itemize}
|
||||||
|
|
||||||
|
\section{The \textsf{FlashCards} Package}
|
||||||
|
|
||||||
The \textsf{FlashCards} package (and note that it is written in CamelCase) allows you to easily create flashcards and then print them on standard sheet-fed business-card stock which is equivalent to Avery 5371.\footnote{This is for North American business-card stock, which is 8.5 $\times$ 11 inches.} (Avery products are pretty expensive, but I can usually find a less expensive off-brand version elsewhere.)
|
The \textsf{FlashCards} package (and note that it is written in CamelCase) allows you to easily create flashcards and then print them on standard sheet-fed business-card stock which is equivalent to Avery 5371.\footnote{This is for North American business-card stock, which is 8.5 $\times$ 11 inches.} (Avery products are pretty expensive, but I can usually find a less expensive off-brand version elsewhere.)
|
||||||
|
|
||||||
@ -46,7 +55,80 @@ The truly nice thing about the \textsf{FlashCards} package is that it automatica
|
|||||||
|
|
||||||
This way, the back of card A and front of card A will appear on opposite sides of the same card.\footnote{This is an incredibly difficult concept for some people to understand. (If you don't beleive me, just ask anyone who's ever worked in a copy shop.) Some people just have a lot of trouble re-orienting three-dimensional ojbects in their mind. I have a funny feeling that these are the people who just never got to build anything when they were children, or who never got to play with building toys like Lego or Tinker Toys.}
|
This way, the back of card A and front of card A will appear on opposite sides of the same card.\footnote{This is an incredibly difficult concept for some people to understand. (If you don't beleive me, just ask anyone who's ever worked in a copy shop.) Some people just have a lot of trouble re-orienting three-dimensional ojbects in their mind. I have a funny feeling that these are the people who just never got to build anything when they were children, or who never got to play with building toys like Lego or Tinker Toys.}
|
||||||
|
|
||||||
\subsection{Modifying the FlashCards Configuration Files}
|
\subsection{Using the \textsf{FlashCards} Package}
|
||||||
|
|
||||||
|
The \textsf{FlashCards} package defines a new document class (called, natch, ``\texttt{flashcards}'') with one required option and a few non-required options. The first option is the type of Avery cardstock you will be printing your cards on. Out of the box, it only supports business cards (Avery 5371) and index cards (Avery 5388) but it is easy enough to configure your own, which we'll see in a bit.
|
||||||
|
|
||||||
|
The non-required options include \texttt{fronts} and \texttt{backs} for typesetting only the fronts or backs of your cards, \texttt{grid} to draw lines where the perforations are (which is handy if you are printing on non-perforated card stock, because you can just cut them apart on the lines), and \texttt{frame} to draw a frame around the content of each card.
|
||||||
|
|
||||||
|
\textsf{FlashCards} defines a new environment (\texttt{flashcard}) with a single required argument, which is the text on the front of the card. Anything contained within the environment (which can include both math and \texttt{tikz} drawings) goes on the back of the card, like so:
|
||||||
|
|
||||||
|
\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, label=\fbox{FlashCards example}]
|
||||||
|
\begin{flashcard}[]{This is the front of the card}
|
||||||
|
This is the back of the card
|
||||||
|
\end{flashcard}
|
||||||
|
\end{Verbatim}
|
||||||
|
|
||||||
|
The argument contained in square brackets (which are empty in our example) allows you to add a header to the card, which will only appear if you used the \verb|\cardfrontstyle{headings}| command. This allows you to describe some cards in your flash card deck according to what they are (definition, formula, etc.). If you then use the \verb|\cardfrontfoot{<text>}| you can define a footer that will appear on \textit{every} card in your document (e.g. Biology 101).
|
||||||
|
|
||||||
|
You do have some options for modifying how the headers are footers are typeset, which is described clearly in the package documentation. You can also look at the sample files I've posted online for other examples.
|
||||||
|
|
||||||
|
\subsection{Having Fun with \textsf{FlashCards}}
|
||||||
|
|
||||||
|
When I first set up my own Git repo, one of the first things I did was add a list of the Ferengi Rules of Acquisition. When I started playing around with flash cards in \LaTeX{} I didn't really have anything I was studying at the time, so I decided to use the Rules as an example. However, there were a couple of issues I wanted to see if the \textsf{FlashCards} package could deal with.
|
||||||
|
|
||||||
|
The first is that I wanted the front side of the card to be in a unique font. That is, I wanted it to be something that didn't scream ``LaTeX'' when people saw it. The second is that the rules are numbered, and I have no desire to add all those numbers by hand, so I wanted to see how easy it was to use a counter with this package.
|
||||||
|
|
||||||
|
The first thing to do was to add a new font. I looked around and liked the ``Roman Rustic'' font,\footnote{Which you can see at \kref{https://tug.org/FontCatalogue/romanrustic/}{https://tug.org/FontCatalogue/romanrustic/}.} so I added these lines to my preamble:
|
||||||
|
|
||||||
|
\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, ]
|
||||||
|
% Font for front side of cards
|
||||||
|
% Use \rustfamily to apply font
|
||||||
|
\usepackage{rustic}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
|
||||||
|
\cardfrontstyle[\large\itshape\bfseries\rustfamily]{headings}
|
||||||
|
\cardbackstyle{plain} % plain option centers text
|
||||||
|
%\cardfrontfoot{Rules of Acquisition}
|
||||||
|
\end{Verbatim}
|
||||||
|
|
||||||
|
Lines 3 and 4 add our font\footnote{Notice that I also added comments on lines 1 and 2 regarding what this was and how to use them. I am not going to remember this next week, much less a year from now. Comments are free. Use them often.} and line 5 applies it to the card front. That line also says that we are going to use the \texttt{headings} option, although I decided not to when wetting up the actual cards.
|
||||||
|
|
||||||
|
I experimented with various fonts, and some of them contained a hash character (\#) and some of them did not. So I added a macro that would allow me to easily change that, based on the font.
|
||||||
|
|
||||||
|
\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, ]
|
||||||
|
% A new command in case we want to separate what we use to indicate 'number'
|
||||||
|
% May need to change this based on the font
|
||||||
|
\newcommand{\ksep}{\\ \vspace{5mm} No.}
|
||||||
|
\end{Verbatim}
|
||||||
|
|
||||||
|
(Is this a hack? No, not really. It's more of a kludge than anything else. Sometimes the thing you need is just a good hard slash through the Gordian knot of your current situation.)
|
||||||
|
|
||||||
|
I then needed to add my counter, which I did with
|
||||||
|
|
||||||
|
\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, ]
|
||||||
|
\newcounter{rule}
|
||||||
|
\setcounter{rule}{1}
|
||||||
|
\end{Verbatim}
|
||||||
|
|
||||||
|
I then started adding my cards, making sure to increment the counter after each card:
|
||||||
|
|
||||||
|
\begin{Verbatim}[frame=lines, numbers=left, xleftmargin=5mm, framesep=3mm, breaklines=true, label=\fbox{Rules of Acquisition FlashCards exampleS}]
|
||||||
|
\begin{flashcard}[]{Rule of Acquisition \ksep \arabic{rule}}
|
||||||
|
Once you have their money, you never give it back.
|
||||||
|
\end{flashcard}
|
||||||
|
\addtocounter{rule}{1}
|
||||||
|
\end{Verbatim}
|
||||||
|
|
||||||
|
Compiling that document gave me these beautiful flash cards:
|
||||||
|
|
||||||
|
\begin{center}
|
||||||
|
\includegraphics[scale=0.25]{roa-card-front} \hspace{10mm} \includegraphics[scale=0.25]{roa-card-back}
|
||||||
|
\end{center}
|
||||||
|
|
||||||
|
You can see the full file in either the repos I mentioned earlier.
|
||||||
|
|
||||||
|
\subsection{Modifying the \textsf{FlashCards} Configuration Files}
|
||||||
|
|
||||||
There's just one catch with the FlashCards package: it only includes support for business cards and $3\times5$ index cards. The documentation says that variants are easy to generate, so there has to be a way to do that, right? As it turns out, there is. The first step is to find those configuration files.
|
There's just one catch with the FlashCards package: it only includes support for business cards and $3\times5$ index cards. The documentation says that variants are easy to generate, so there has to be a way to do that, right? As it turns out, there is. The first step is to find those configuration files.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user