# How can I add a gap between card columns using flashcards package?

I have created numerous flashcards using the flashcards package. After having done so, I realized that the default Avery templates are not compatible with the European Avery stock. The avery5371 template produces two columns with 5 rows. The A4 version (C32010-25) does the same thing; however, it has a small gap of about 0.39in between the cards.

I tried to follow the documentation's recommendation to create my own .cfg file by modifying one of the template files. Here is what I have.

\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesFile{averyEU.cfg}
\newcommand{\cardpapermode}{portrait}
\newcommand{\cardpaper}{a4paper}
\newcommand{\cardrows}{5}
\newcommand{\cardcolumns}{2}
\setlength{\cardheight}{2.13in}
\setlength{\cardwidth}{3.35in}
\setlength{\topoffset}{0.53in}
\setlength{\oddoffset}{0.59in}
\setlength{\evenoffset}{0.59in}

\endinput


I found one recommendation and tried adding \setlength{\columnsep}{0.39in}, but that did not seem to do anything. I have not been able to find any other recommendations that would help. Below is a functional example with two cards.

\documentclass[AveryEU, grid]{flashcards}
\usepackage[latin1]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\cardbackstyle{empty}
\begin{document}

\begin{flashcard}[Derivatives]{$\displaystyle \frac{d}{dx}\sin x$}
\vspace*{\stretch{1}}

\begin{displaymath}
\frac{d}{dx}\sin x =\cos x
\end{displaymath}

\vspace*{\stretch{1}}
\end{flashcard}

\begin{flashcard}[Derivatives]{$\displaystyle \frac{d}{dx}\sin^{-1} x$}
\vspace*{\stretch{1}}

\begin{displaymath}
\frac{d}{dx}\sin^{-1} x = \frac{1}{\sqrt{1-x^2}}
\end{displaymath}

\vspace*{\stretch{1}}
\end{flashcard}

\end{document}


Any help would be most appreciated. I don't want to have to print these on regular paper and cut them all out by hand.

• I would set the \cardwidth and \cardheight to match the spacing, and set the \cardmargin to reduce the printable area. Alas, it uses the same value for both margins. You can use \hrule and \vrule to test it. Nov 20 '19 at 4:54
• I tried and used the "grid" option to see where the boxes would print. It didn't shift the boxes as I had hoped, and the card headers didn't seem to respect the margin offset. Let me know if you have any success; maybe I'm just implementing it incorrectly. Nov 20 '19 at 12:04

Flashcards uses the geometry package, but I could never get the cfg file to work right. One can reset the options using \geometry in the preamble. Interestingly, there is an unexpected \topskip gap above the first card.

The difference between grid and frame is that frame shows the printable area (after \cardmargin is removed). It is possible that grid increases the effective width and height by 2\fboxrule each time, hence its use in the calculations. (Frame should be okay, as it is inside a box.) These should be removed when not using grid, nor is showframe or bottom normally set.

This is the version I used to verify that the dimensions were correct.

\begin{filecontents}{averyEU.cfg}
%To make changes, one must delete the old file
\newcommand{\cardpapermode}{portrait}
\newcommand{\cardpaper}{a4paper}
\newcommand{\cardrows}{5}
\newcommand{\cardcolumns}{2}
\setlength{\cardheight}{2.139in}
\setlength{\cardwidth}{3.389in}
\setlength{\cardmargin}{0.02in}
\setlength{\topoffset}{0.53in}
\setlength{\oddoffset}{0.33in}
\setlength{\evenoffset}{0.33in}
\end{filecontents}

\documentclass[averyEU,grid]{flashcards}
\usepackage[latin1]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\cardbackstyle{empty}
\setlength{\topskip}{0pt}% wierd he never caught this

\geometry{top=\dimexpr 0.5\paperheight-2.5\cardheight-5\fboxrule\relax,
bottom=\dimexpr 0.5\paperheight-2.5\cardheight-5\fboxrule\relax,
left=\dimexpr 0.5\paperwidth-\cardwidth-\fboxrule\relax,
right=\dimexpr 0.5\paperwidth-\cardwidth-\fboxrule\relax,
showframe}

\begin{document}

\begin{flashcard}{Front 1}
Back 1\\
\end{flashcard}

\begin{flashcard}{Front 2}
Back 2\\
\end{flashcard}

\begin{flashcard}{Front 3}
Back 3
\end{flashcard}

\begin{flashcard}{Front 4}
Back 4
\end{flashcard}

\begin{flashcard}{Front 5}
Back 5
\end{flashcard}

\begin{flashcard}{Front 6}
Back 6
\end{flashcard}

\begin{flashcard}{Front 7}
Back 7
\end{flashcard}

\begin{flashcard}{Front 8}
Back 8
\end{flashcard}

\begin{flashcard}{Front 9}
Back 9
\end{flashcard}

\begin{flashcard}{Front 10}
Back 10
\end{flashcard}

\end{document}


This version should be used to match the printable area to the forms. Note the new AveryEU.cfg file. The \geometry call is now optional.

\begin{filecontents}{averyEU.cfg}
%To make changes, one must delete the old file
\newcommand{\cardpapermode}{portrait}
\newcommand{\cardpaper}{a4paper}
\newcommand{\cardrows}{5}
\newcommand{\cardcolumns}{2}
\setlength{\cardheight}{2.139in}
\setlength{\cardwidth}{3.389in}
\setlength{\cardmargin}{0.02in}
\setlength{\topoffset}{36.05824pt}
\setlength{\oddoffset}{53.83037pt}
\setlength{\evenoffset}{53.83037pt}
\end{filecontents}

\documentclass[averyEU,frame]{flashcards}
\usepackage[latin1]{inputenc}
\usepackage{amsfonts}
\usepackage{amsmath}
\cardbackstyle{empty}
\setlength{\topskip}{0pt}% wierd he never caught this

\geometry{top=\dimexpr 0.5\paperheight-2.5\cardheight\relax,
left=\dimexpr 0.5\paperwidth-\cardwidth\relax,
right=\dimexpr 0.5\paperwidth-\cardwidth\relax}

\begin{document}

\begin{flashcard}{Front 1}
Back 1\\
\verb|\topoffset|=\the\dimexpr\topmargin+1in\relax\\
\verb|\oddoffset|=\the\dimexpr\oddsidemargin+1in\relax\\
\verb|\evenoffset|=\the\dimexpr\evensidemargin+1in\relax
\end{flashcard}

\begin{flashcard}{Front 2}
Back 2
\end{flashcard}

\begin{flashcard}{Front 3}
Back 3
\end{flashcard}

\begin{flashcard}{Front 4}
Back 4
\end{flashcard}

\begin{flashcard}{Front 5}
Back 5
\end{flashcard}

\begin{flashcard}{Front 6}
Back 6
\end{flashcard}

\begin{flashcard}{Front 7}
Back 7
\end{flashcard}

\begin{flashcard}{Front 8}
Back 8
\end{flashcard}

\begin{flashcard}{Front 9}
Back 9
\end{flashcard}

\begin{flashcard}{Front 10}
Back 10
\end{flashcard}

\end{document}

• I did a test print and the grid size for each card matches the card size of the Avery stock. I tried your recommendation and I found the cards are centered on the page and so there is still unused card space on the left and right of the page as the cards were not shifted apart at all. I measured and the gap is 1 cm between the outer edges of the cards. I tried to see if I can add a margin or change some other parameters, but I was unsuccessful. Is there something that I could add that might help further clarify? Nov 21 '19 at 0:31
• I used grid to verify the dimensions. Frame should be smaller, but centered on the labels. I don't have access to your paper/labels so based everything on your description (and assumed symmetry). Nov 21 '19 at 14:41