You are on page 1of 6

Creating Models in Anki, by SpencerDub

Introduction
The best way to streamline your studying is by using card models. Models tell Anki what information you want to study and how to make flashcards based on that information. In Anki's default model, flashcards have a front side, which displays whatever you put in the Front text box, and a back side that displays the stuff in the Back box. By making a new model, however, you can have Anki make cards that go in multiple directions, like I described in the postall based on the same single set of information. It's pretty easy, and I'll walk you through it step-by-step.

Part One Creating a New Model and Making the Fields


So, start by opening Anki. I'm going to assume you already have a deck of Japanese cards, so find it in your list and click Open on the right-hand side. (If you don't have a deck yet, click Create near the bottom of the window, and give it a name. I like Tons of Japanese, personally, but you can go with whatever you'd like.) Go to the card creation window by clicking the Add Items button (a green plus sign), clicking Edit>Add Items, or by pressing Ctrl+D on a PC or Cmd+D on a Mac. In the Add Items window, click the wrench button. It's near the top of the window, next to the bar labeled Model. A new window called Deck Properties should open up. This has a bunch of information, including a list called Models. Let's make a new model by clicking Add and selecting Add: Basic from the dialog that pops up. This is our new modelbut right now, it's an exact copy of the old one. Let's change that. Highlight the new model called Basic [0 facts] and click the Edit button. We're now in the Model Properties window. Give this model a new name in the box labeled Name--Japanese Vocabulary is probably a good one. Below the Name box is a list labeled Card Templates. Templates are how Anki builds cards using the data you give it. There should be two in there right now, Front and Back. Let's start by editing Front to make it a card that asks you to give the English definition for a word in hiragana. Select Front and click Rename, and title it Hiragana->English. Then, click Card Layout in the lowerright hand corner. Oh no! Frightening code-type stuff! Don't panicfor now, just go to the tab called Fields. This tab is what tells Anki what type of information to ask for for use in flashcards. We want something more

detailed than Front and Back, though, so let's start by clicking Front to edit it. Change name the name from Front to Japanese word. This is where our hiragana or katakana are going to go. Since those are likely going to be fairly important, let's change the font size to size 40 so that by default, when this information is shown on a card, it's relatively big. There are some checkboxes below. These checkboxes are options for the specific field we're working onso right now, they're options for the Japanese word field. Leave most of them as-is; however, make sure that Prevent duplicate entries is unchecked. Because this field is for hiragana, and there are many homophones in Japanese written with the same hiragana but different kanji, we want to be able to use the same hiragana in different cards. Also, make sure to check Prevent empty entries, because if there's no Japanese word, there should be no flashcard in the first place! Again, leave the rest as-is. Let's move on to the next field Change the name of Back to Definition. Uncheck prevent duplicate entries, check prevent empty entries, and leave the rest alone. If all we wanted was to test on hiragana and their English definitions, we'd be done here. But there's so much more we can do. Add another field called Kanji. Change the font color to blue, the font size to 25, check prevent duplicates, and uncheck prevent empty entries, because not all words have kanji. How about an example sentence in Japanese? Probably useful, but we also don't want to make it necessary. Add another field called Example sentence. Make the font color green, and then uncheck both prevent duplicates and prevent empty entries. This way, you can write an example sentence if you want, and even use one from another card, but it's entirely optional. Of course, if we have example sentences, it would help to have definitions, too. Add another field called Example definition. This should be almost exactly the same as Example sentence, except for font size 16. Finallyand this one is very optionalthere might be times when you want to add a note about proper usage of a word. For instance, I've had to make note of words that might have unintended double meanings. Add one last field called Usage note, and set the color to orange, the size to 11, and in terms of options, check preserve whitespace. Phew. Thanks for sticking that one outthat's the hard work. Now, whenever you make a new card with the Japanese Vocabulary model, Anki will ask you for the Japanese word, its definition, the kanji, an example sentence, the example sentence's definition, and a usage notebut out of those, only the word and its definition will be required. If you want to make bare-bones cards, you can! But if you want to put in a lot of info, that's also possible now. The next step, though, is to tell Anki how to display all of the info that it collects here, and we do that using card templates.

Part Two Creating Card Templates


Go back to the Card Templates tab. Card templates are put together using a very simple syntax (a language that the program understands and interprets). I'm going to try to give a basic explanation so that in the future, you can tweak these to your liking, and there's also a very useful help section on the Anki wiki here (http://ichi2.net/anki/wiki/CardLayout ), but if you're not keen on learning anything, you can simply scroll down and copy and paste the templates I've written. When making cards, Anki goes through and reads the template as if it were a webpage, applying HTML and displaying text that you write in the template. If you replaced the contents of the Question box with Hi there!, then every Hiragana->English card you made would simply say Hi there! on the front. But that's not very usefulfor a flashcard to be useful, it has to actually display its contents. To tell Anki to display the contents of a field, we simply put the name of that field (case-sensitive) in two sets of curly brackets {{like this}}. For instance, in our model, {{Japanese word}} would turn into whatever the hiragana was for the card we were currently looking at, {{Example sentence}} would display the example sentence, and so on. But wait! Not all of our fields will always have stuff in them! Think of the Kanji field, for exampleif the word is only written in hiragana, then there won't be anything in Kanji, and if we write {{Kanji}} to tell Anki to display Kanji, it won't have any data to display! To solve this, we give Anki a very simple command that says, If there's something in the Kanji field, then display this stuff. To make that command, we write {{#Kanji}} , which means, If there's something in the Kanji field, write whatever we want to display if that's the case, then end it by writing {{/Kanji}}. On the flip side, if we want to tell Anki to only display something if there is nothing in the Kanji field, then we start the line with {{^Kanji}}, write whatever we want to display, and end with {{/Kanji}}. Note that I've been using the Kanji field as an example, but any of the fields we've created would do here. With that explanation done, here's the Question side of the Hiragana->English card. It tells Anki, If there's no kanji, just display the hiragana really big. If there are kanji, put the kanji up top, all big and blue, with the hiragana, smaller, underneath. Then, if there's an example sentence, show that. {{^Kanji}}{{Japanese word}}{{/Kanji}} {{#Kanji}}<span style="font-family: arial; font-size: 40px; color:blue">{{{Kanji}}}</span><br /> <span style="font-family: arial; font-size: 25px;">{{{Japanese word}}}</span> {{/Kanji}} {{#Example sentence}}<br />{{Example sentence}}{{/Example sentence}} And the Answer side is as follows. This one tells Anki, Show us the definition. If there's an example sentence, show its definition too. If there's a usage note, show the usage note too.

{{Definition}} {{#Example definition}}<br />{{Example definition}}{{/Example definition}} {{#Usage note}}<br/>{{Usage note}}{{/Usage note}} Select don't ask me to type in the answer, uncheck hide the question when showing answer, and check Allow the answer to be blank. Congratulations, you've made the first template! There are three more to go; however, you've already done the leg work. Hit the Close button on the Card Layout window, select Back, rename it to English->Hiragana, and click Card Layout again. If you go to the Fields tab, you'll see that all of the fields you already made are still there! That's because Anki will use the same data to make multiple types of cards, as you tell it to. So go back to the Card Templates tab, and copy the following templates: Question: How would you say "{{Definition}}"? {{#Example definition}}<br />For example: "{{Example definition}}"{{/Example definition}} This tells Anki, Ask the question, 'How would you say [this word]?' Then, if there's an English example sentence, say, 'For example:' and show that example sentence. Answer: {{Japanese word}} {{#Kanji}}<br />{{Kanji}}{{/Kanji}} {{#Example sentence}}<br />{{Example sentence}}{{/Example sentence}} This is almost the same as the front side of the Hiragana->English card: it shows the hiragana, the kanji if it's there, and the example sentence if it's there. Hit Close and go back to the Deck Properties window again. Hit Add, rename the new template to Hiragana->Kanji, and copy the following into the Card Layout: Question: How do you write<br /> {{Japanese word}}<br /> which means<br /> {{Definition}} in kanji? {{#Example definition}}<br />For example: "{{Example

definition}}"{{/Example definition}} Answer: {{#Kanji}}<span style="font-family: arial; font-size: 40px; color:blue">{{{Kanji}}}</span>{{/Kanji}} {{^Kanji}}Joke's on you, there is no kanji! Why did you make this card, anyway?<br /> {{Japanese word}}{{/Kanji}} Close, make one more template, rename it to Kanji->Hiragana, and copy the following: Question: How do you read<br /> <span style="font-family: arial; font-size: 40px; color:blue">{{{Kanji}}}</span>,<br /> as used in the following sentence?<br /> {{Example sentence}} Answer: {{Japanese word}}<br /> {{Definition}}<br /> {{Example definition}} Hit Close, and close more windows until you're back at the Add Items window.

Part Three Making New Cards


The final step is to make some new cards to get used to how this works. By default, your new model (Japanese Vocabulary) is selected; however, you can also choose your model from the pull-down menu at the top of this window. Remember: the model contains the data fields (which tell Anki what information to collect), and the card templates (which tell Anki how to make cards with that information). Fill out some information in the new fields, then, using the Cards button in the upper-right hand corner, check all of the cards you want to make (on a per-fact basis). Do you want to make only hiragana cards? Only kanji? Or all of the above? This is where you choose. When you've chosen what types of cards you want to make and filled out the fields, hit Add at the bottom. And that's it! You're now set up to make multiple cards from single facts. If you ever need to edit a factsay, you realize you made a typo on a cardrather than finding all of the cards that use that fact and changing them individually, you only need to find one and change its information, and the rest, since they draw from the same data fields, will update accordingly. Also, if you've only created a few of the types of cards (say, only hiragana),

but later decide you want to create more from the same fact, simply find the card in the Card Browser and hit Generate Cards in the toolbar (or go Actions>Generate Cards). Thanks for sticking with me through that! Hopefully, it illuminates the process and has given you enough information to not only replicate what I've done, but play with these options in the future.

-SpencerDub

You might also like