I'm using the "flashcards" document class and I want to implement an automatic numbering in the front part, such that, for example, when I write:



it gets rendered to "Definition (i)", where "i" is the flashcard's number in the document. For now I tried to create a custom counter, and manually writing the code to show it inside the [Definition] part of the flashcard's command, but it is unpractical in the long run. Is there a better way to do it?

  • 2
    Welcome to TeX.SE. Please post a compilable document, not such fragments only. The flashcard class is a little bit aged, dating back to 2000 and scarce updates. – user31729 Oct 27 '17 at 17:02
  • Edited with a compilable example. Is there a newer class for the same purpose? I have not the knowledge to create one myself. – Francesco Manzali Oct 27 '17 at 17:11
  • I know of no newer class, but that doesn't mean there is one nevertheless. I'll suggest the very powerful tcolorbox package with its tcbraster library, however – user31729 Oct 27 '17 at 17:14
  • Related: tex.stackexchange.com/a/346618/31729 – user31729 Oct 27 '17 at 17:26

A way with tcolorbox and its tcbraster environment, there is no direct connection to printer labels producers like Avery etc, the specification has to be done manually.

The auto counter provides a new counter, here named 'flashcard' (well, hidden in a complex internal name) and \thetcbcounter is a wrapper for \the... macro connected to the counter.

I chose some of the most frequently used tcolorbox options which are pretty easy to remember and are very clear in their meanings (in my opinion)






\newtcolorbox[auto counter]{flashcard}[1][]{enhanced,
 title={Definition \thetcbcounter},
 sharp corners,

\begin{tcbraster}[raster columns=4,raster equal height]

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.