2

I apologize if this has already been answered somewhere. I've been trying to make flashcards in MikTeX, and I've installed the package. Here is my sample code.

\documentclass[frame]{flashcards}
\begin{document}
\begin{flascard}{why}
are you doing this to me
\end{flashcard}
\end{document} 

And this is the error I get when I compile using TeXWorks and WinEdt:

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9 64-bit)
entering extended mode
("C:/Users/Jay/Desktop/Latex/testing 3.tex"
LaTeX2e <2016/03/31> patch level 1
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\flashcards\flashcards.cls"
Document Class: flashcards 2010/08/13 1.0.1 ([email protected])
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ifthen.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
! Undefined control sequence.
\reserved@b ...@onefilewithoptions #1[{\cardpaper 
                                              }][{}]\noexpand \@pkgexten...
l.77 \setlength
           {\oddevenshift}{\oddoffset}
? 

More specifically, when I click on the warnings and errors tab in TeXWorks, it displays this:

flashcards.cls
77
Undefined control sequence.
\reserved@b ...@onefilewithoptions #1[{\cardpaper 
                                              }][{}]\noexpand \@pkgexten...
l.77 \setlength
           {\oddevenshift}{\oddoffset}

I've been racking my brain with this since 10a.m. this morning. The things I have tried include uninstalling and reinstalling, restarting my computer, downloading the flashcards folder and putting it in the tex file (which I honestly don't know if I put it in the right folder or not), uninstalling MikTeX 2.9 and reinstalling the newest version. Sometime before, when I didn't manaully install the package, it gave me the error telling me that flashcards.cls not found. I'm so confused, and after reading the pdf, it seems like the perfect set up for me to make some flashcards...can anyone please help me by telling me what that error means and how to fix it? It will be greatly appreciated!

Edit: I had a typo in the code above. This is the one that I compiled more recently after correction (thanks to Willie Wong):

\documentclass[frame,avery5388]{flashcards}
\begin{document}
\begin{flashcard}{why}
are you doing this to me
\end{flashcard}
\end{document}

and here is the error that it produced:

This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9 64-bit)
entering extended mode
(C:/Users/Jay/Documents/untitled-1.tex
LaTeX2e <2016/03/31> patch level 1
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.
("C:\Program Files\MiKTeX 2.9\tex\latex\flashcards\flashcards.cls"
Document Class: flashcards 2010/08/13 1.0.1 ([email protected])
("C:\Program Files\MiKTeX 2.9\tex\latex\base\ifthen.sty")
("C:\Program Files\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.9\tex\latex\base\size10.clo"))
Coudln't find avery5388.cfg, using defualt.
! Undefined control sequence.
\reserved@b ...@onefilewithoptions #1[{\cardpaper 
                                              }][{}]\noexpand \@pkgexten...
l.77 \setlength
           {\oddevenshift}{\oddoffset}
? 

Evidently, the avery5388.cfg file isn't being read. Anyone have any suggestions on a fix?

2
  • The flashcards documentation states "All documents should specify the paper type." You did not specify the paper type. Try passing avery5388 as an option in \documentclass[frame,avery5388]{flashcards}. Jul 29, 2016 at 4:32
  • You don't compile the .cls file. That bottom part of your question is entirely unhelpful. You said that you tried with the option: please edit your question to reflect the exact file that you used. Because if I include the avery5388 option and fix the typo in \begin{flascard}, the file compiles just fine. Jul 29, 2016 at 14:06

1 Answer 1

2

Edit: For MikTeX users, apparently there is a bug in the packaging of the flashcards package, resulting in certain crucial configuration files being left out. A quick workaround is to copy the following code:

\newcommand{\cardpapermode}{portrait}
\newcommand{\cardpaper}{letterpaper}
\newcommand{\cardrows}{3}
\newcommand{\cardcolumns}{1}
\setlength{\cardheight}{3.0in}
\setlength{\cardwidth}{5.0in}
\setlength{\topoffset}{1.0in}
\setlength{\oddoffset}{1.75in}
\setlength{\evenoffset}{1.75in}

paste it into a file called avery5388.cfg, and put the file in the same directory as your tex file.

Alternatively, instead of creating avery5388.cfg by hand, you can do it using TeX's filecontents command. To do this, just edit your tex source code as

\begin{filecontents}{avery5388.cfg}
\newcommand{\cardpapermode}{portrait}
\newcommand{\cardpaper}{letterpaper}
\newcommand{\cardrows}{3}
\newcommand{\cardcolumns}{1}
\setlength{\cardheight}{3.0in}
\setlength{\cardwidth}{5.0in}
\setlength{\topoffset}{1.0in}
\setlength{\oddoffset}{1.75in}
\setlength{\evenoffset}{1.75in}
\end{filecontents}

\documentclass[frame,avery5388]{flashcards}
\begin{document}
\begin{flashcard}{why}
are you doing this to me
\end{flashcard}
\end{document} 

Compiling the above code should, in principle, create automatically the necessary .cfg file if it doesn't exist already.


Per the manual, it is imperative to specify a paper size when using the flashcards document class. The class pre-defines two sizes, one of which is avery5388 for use with index cards (the other is for use with business-card sized cards). The manual has complete instructions on how to define custom sized cards.

Your error message indicates that the command sequence

\cardpaper

is not defined. This is exactly what would happen if you did not define a paper size (reading through the .cls file code). (It is a bit funny that there is no default defined, but whatever.)

So fixing your code to read

\documentclass[frame,avery5388]{flashcards}
\begin{document}
\begin{flashcard}{why}
are you doing this to me
\end{flashcard}
\end{document} 

it builds just fine

[Fri Jul 29 10:12 AM] ArchDesktop ~/tmp $ pdflatex t.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Arch Linux) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./t.tex
LaTeX2e <2015/10/01> patch level 2
Babel <3.9m> and hyphenation patterns for 79 languages loaded.
(/usr/share/texmf-dist/tex/latex/flashcards/flashcards.cls
Document Class: flashcards 2010/08/13 1.0.1 ([email protected])
(/usr/share/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texmf-dist/tex/latex/flashcards/avery5388.cfg)
(/usr/share/texmf-dist/tex/latex/geometry/geometry.sty
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ifpdf.sty)
(/usr/share/texmf-dist/tex/generic/oberdiek/ifvtex.sty)
(/usr/share/texmf-dist/tex/generic/ifxetex/ifxetex.sty))) (./t.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
[1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] (./t.aux) )</usr/sha
re/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/share/texmf-dist/
fonts/type1/public/amsfonts/cm/cmr10.pfb>
Output written on t.pdf (2 pages, 21254 bytes).
Transcript written on t.log.

with output (2 pages, somewhat unevenly cropped in my image viewer)

enter image description here

enter image description here

8
  • Thanks, I copied your code, and it generated the same error. Any other suggestions?
    – kingdras
    Jul 29, 2016 at 15:34
  • Also, it seems like someone else was having a problem like this, but I don't understand any of what they did...(tex.stackexchange.com/questions/11408/…), maybe this will help out? I appreciate your time thus far.
    – kingdras
    Jul 29, 2016 at 15:43
  • @kingdras: basically MikTeX didn't include a working version of the flashcards document class. And apparently they still haven't fixed it since 5 years ago. I'll edit with a workaround. Jul 29, 2016 at 16:07
  • @kingdras: incidentally, you really should've copied and pasted the full logs (as you have done in the question for the version without the avery5388 option) after you still saw the error when you tried it with the option. The error is in fact subtly different: with the avery5388 option specified, a few lines above the Undefined control sequence you should've seen also the line Couldn't find avery5388.cfg, using default. which would've helped narrowing down the problem. Jul 29, 2016 at 16:22
  • I'm really sorry...something came up and had my brain all fuzzed out, I'm good now. I just realized right before you commented that I did get the error Couldn't find avery5388.cfg. I apologize, my struggle with code, and lack of experience with TeX stack exchange makes my communication horrible ._.
    – kingdras
    Jul 29, 2016 at 17:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .