Flashcards for printing

I find that I learn best when I learn in multiple different modalities – that is, not all screen time! So with that in mind I’ve lately been obsessing with printable flashcard sets as a supplement for more casual (i.e., no penalties if you are wrong!) study offline. As an offshoot of another project, I have succeeded in making an automatic flashcard generator. It starts with .csv files exported by Wankani Item Inspector, and spits out printable pages with 15 two-sided mini-cards per page, with kanji or Japanese word on one side and reading and meaning on the other.

It runs on Linux and is a shell script that assembles LaTeX files, which are then compiled by xelatex using a custom LaTeX package. So far I have made some prebuilt sets of cards for all WK kanji in 10 level chunks, and the vocabulary lists for the first 20 levels. You can use the script to make your own sets – as an example, my latest leech set is attached below. Gotta squash them leeches!


  • kanji cards have larger kanji so you can tell them apart from single kanji vocabulary cards
  • kanji cards have katakana readings on the back – I don’t know if this is strictly accurate, since maybe not all of the kanji readings are really on’yomi readings, but my katakana needs some serious reinforcement – 一石二鳥!
  • You can make card sets that are custom mixes of kanji and vocabulary (no radicals since I can’t get them to render, plus a handful of WK radicals are images anyway, not text characters), whatever filtration and selection you use to make .csv files in Item Inspector should work as long as you select the right fields to export as explained in the github repo.
  • You can easily change the paper size from US letter to a4 by editing a couple of template files.

Still to do

  • compile more vocabulary sets
  • make a4 paper versions available
  • figure out how to enable the user to easily switch from katakana to hiragana kanji readings. All it takes now to do this is a simple edit of the script file, but automation is fun and a challenge for me as a self-taught coder.



This is a pretty cool use of Item Inspector. I am pleased.

Here is a tip for you.

In Item Inspector use Reading By Type. You will get the readings of each kanji broken down as onyomi, kunyomi and nanori. You will see that most kanji have both onyomi and kunyomi readings and a handful have nanori readings.

Thanks! And thank YOU for the fabulous item inspector!

As for readings – yes, I see that most kanji have both kun and on readings, and I was looking at your “item type” field in my experiments. My point above was that the correct answer to kanji questions isn’t ALWAYS an on reading (right?), so those who make a strict distinction between borrowed (or imported) pronunciations and native Japanese pronunciations for words written in each set of kana might get upset with seeing all the kanji answers written in katakana. But I really need work on katakana and found a relatively simple way of flipping the kanji reading answers to katakana – partly inspired by the Katakana Madness script, so I made it the default for all of the kanji cards.

1 Like

There is a convention that when writing the readings of a kanji, onyomi readings are written in katakana and kunyomi are written in hiragana. Jisho.org for example follows this convention. Your approach goes against the convention. This is not a big deal because not everybody follows this convention. WK for instance does not.

Both onyomi and kunyomi are correct answers. Dictionaries list them both on an equal standing. WK has the habit of expecting the onyomi during a kanji review and leaving the kunyomi to some vocab. This is just the pedagogical choice they have made. They could easily have gone the other way round if they wanted to.

1 Like

Right, I’ve seen that elsewhere too, but I was thinking I was following it more than not, under the (perhaps mistaken?) idea that most answers to kanji questions here on WK are onyomi. But then, yeah, those conventions seem loose in some places, with names for animals, for example – I read somewhere that they are typically written in katakana (シロクマ, for example), but then I also see them in hiragana and kanji too. It’s so fun to be learning a language that has three (partly) interchangeable systems for writing!

You are correct. WK tends to want the onyomi reading as an answer for kanji reviews.

1 Like

UPDATE: added option for automatically generating A4 pages.

For letter paper run:

./makecards.sh filename.csv

For A4 run:

./makecards.sh filename.csv a4

NOTE: if you are using the next to last update of @prouleau’s Item Inspector script and can’t get the makecards.sh script to work, it should work with the latest, greatest update.

1 Like

I got this to work eventually, so hurray for that! I thought I’d document my issues that I did have so you can be aware of potential problems and areas to update the readme or whatever

The first problem I encountered was this error, resolved by installed the LangChinese package. I had the Japanese package installed already but I guess that didn’t cover some necessary dependencies.

! LaTeX Error: File `ctexhook.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

The next error I have absolutely no idea what is going on due to my low knowledge of Latex, but might be something on your end that you can fix. Everything seemed to work fine until the very end when the files were created, nothing would actually get done. The resulting message is the final results of the comand, so I “fixed” the problem by chanigng the line OUTPUT=pagelist.tex to OUTPUT=pagelist.tex.tex. I’m sure you might know a better solution than this but it works because I don’t know enought about your code to know why it’s asking for this.

No file pagelist.tex.tex.
(./kanji-1-10.aux (./pagelist.tex.aux)) )
No pages of output.
Transcript written on kanji-1-10.log.

I also made my settings so that the reading column for my exports is Reading by Type, and it resulted in an actually working card setup (after removing the commas), albeit very ugly for kanji with many readings. Now my plans are to actually set it up so that there are correct katakana and hiragana readings based on the kun/onyomi readings. I might try to hack together something for that myself once I get to level 12, or feel the need to work on this for myself even sooner.

1 Like

Thanks for trying it out and reporting the results! The extra \LaTeX dependency is one issue I figured would come up for some people, since there seems to be no standard set of packages in each and every installation. I have a fairly minimal install that bumps into this issue from time to time, and then I add new stuff as needed. I’ll note that one though.

As for the other issue, I’ll see what I can figure out there. I wonder if it had something to do with the difference between \include{} and \input{}. Can you get it to work if you change the line that reads \include{pagelist.tex} to \input{pagelist.tex} instead – in the templates/remix file.

Yes, this worked. I only tried it running on the Kanji-1-10.csv file, not on my own stuff since I already have that.

1 Like

Great! Unfortunately I am now unable to get things to work with anything but the kanji csv files for some unknown reason!

ETA: Actually, it does work I was entering the wrong file name arghhhhh! Do let me know if the \input{pagelist.tex} works for other files too. I think the issue you were having is that \include{} seems to add a linebreak in addition to the code it inserts while \input{} simply adds the code from an external file, which for some reason didn’t affect my results.

Thanks for testing though, and I hope you got some custom flashcards out of the deal!

It would be nice to be able to have some more customizable fields as well, but we shall see. This is definitely a learning process for me!

UPDATE: Now the script can handle (most) radicals, as well as alternate format csv files (those separated by tabs, semicolons, or with quotes around everything). Some radicals on WK are represented as images and cards with those radicals show up with blank front faces, enabling you to draw your own, but the majority now appear as lighter colored characters so you can distinguish them from identical kanji and vocab terms.

Made another update to the script.


  • Added command line options for changing paper size and for filtering csv files of vocabulary to print only verbs, adjectives or nouns.
  • Now if you include the on and kun reading fields in your csv file (see below) the script prints the first reading listed for kanji – on readings in katakana and kun readings in hiragana. Without this all readings print in good old hiragana.
  • Backs of cards are now printed in gray to make it harder to inadvertently see the answers through the cards on regular paper.
  • Previously, longer readings didn’t fit on a single line and squeezed the meanings off the card – that’s fixed now.
  • Script file is commented to explain the tangle of sed and awk commands that parse the csv file more clearly, and those have been cleaned up and simplified.
  • As before, kanji print bigger than vocab items that consist of the same single kanji so you can tell the difference, radicals are printed lighter for the same reason.

How to use

  • Works on Linux with the right LaTeX packages installed (listed in the repo README file).
  • Download csv file from Item Inspector with these settings:
    • Tables tab > You can create a custom table to avoid messing up the default table types – click on “new” next to the table list table and call it what you want.
    • Export tab – any cell separator and use of quotes should work.
    • Export tab > exported columns:
      • column 1: Reading Brief
      • column 2: Item
      • column 3: Meaning Brief
      • column 4: Item Type
      • OPTIONAL column 5: Reading by Type (on kun) OR Part of Speech
    • Filters tab: choose radicals, kanji and/or vocabulary as you like, filter as you like by level (including ranges like 12-18), SRS stage or whatever. (Radicals that are on WK as images remain blank on the front of the card, but the backs still have meanings, you can draw these radicals on the front and these cards won’t mess things up otherwise.)

(You could add both Reading by Type and Part of Speech as columns 5 and 6 but since one is used for getting the readings of kanji only and the other is used for selective printing of vocabulary items only, you probably won’t need both together ever.)

  • Usage examples
    • ./makecards.sh myfile.csv produces flashcards of all contents of the csv file. If you want kanji cards with katakana for on readings, you need column 5 set to Reading by Type (on kun). If this column is left blank all readings are printed in hiragana.
    • ./makecards.sh -p a4 myfile.csv prints your cards on a4 paper size as myfile-a4.pdf.
    • ./makecards.sh -o verbs myfile.csv prints cards of only godan and ichidan verbs, provided that you have column 5 set to Part of Speech, as myfile-verbs.pdf.
    • ./makecards.sh -o adjectives -p a4 myfile.csv prints all adjectives from your file as myfile-adjectives-a4.pdf on a4 paper. You can also get only nouns with -o nouns – you can’t get BOTH nouns and adjectives though. One set at a time.

Below is a sample file of all ichidan and godan verbs from levels 1-5. There’s a bunch more pre-made sets in the repo – kanji cards for levels 1-60, full vocab for levels 1-20, etc. for those who just want the goods and don’t want to mess around with Linux command lines scripts and LaTeX. Next thing I need to do is organize the files :stuck_out_tongue: .

Maybe someday this might evolve into a script that makes direct calls to the API, but since that is way above my abilities, I am happy to rely on Item Inspector to deal with getting and organizing the data needed.

Happy Holidays! Hope you enjoy, back to leech squashing for me.

I like what you are doing. I have a suggestion. For the “work with anything else” table you refer to one of the Item Inspector default table, isn’t it? If this is indeed the case could you pick a table name that is not one of the default tables? Like asking people to make a “Print Flashcard” table? Default tables are there for a reason and I think you shouldn’t request people to change these settings for reasons unrelated to the purpose of these tables.

1 Like

Aha, that makes perfect sense – I hadn’t noticed the “new” button next to the table list before. I’ll update the instructions to reflect that. Thanks!

1 Like

After a big rebuild and reorganization, you can find all of the available sets here. The link in the first post points directly to the GitHub Repository where you can get the build scripts if you want to make custom sets.

1 Like

I want to THANK you.

I fear my leeches. Now I have a little fear reading how to use your script to make my own leech-set. But it must be done. :smiley:

Thank You!

That’s awesome! I’ve visited your github and so much content was there! I can’t believe that post and the item inspector post were here for so long time and I didn’t heard about them before.

Thank you very much for all the generosity put on doing that and sharing it with us.