Skip to content

Setup: Anki

New to Anki?

If you have never used Anki before, I recommend using fsrs4anki to get more optimized settings than the default settings.

That article showcases only one way of setting up Anki's settings for language learning. Feel free to view some other examples here.


Updating Anki

It is highly recommended that you are using the latest (stable) Anki version (or as close as you can get to the latest Anki version). This includes using the Qt6 version instead of Qt5 if possible.

Using the latest version of Anki is recommended for the following reasons:

  • The note is primarily tested and maintained on the latest versions of Anki.
  • There are a few minor but known bugs that this note type has with older Anki versions. These bugs do not exist in newer Anki versions.

Worst case scenario, if any essential add-ons no longer work, you can always downgrade back to a previous version.

If you aren't upgrading Anki from an older version, you can skip the rest of this section.

Tips on Updating Anki (click here)

Official Documentation

The official documentation on how to install and upgrade Anki is shown below:

WindowsMacOSLinux

Note that for all three, there are additional sections in the table of contents to the left that could be helpful.

Add-ons Breaking

If an add-on (that worked in a previous version of Anki) no longer works, you have a few options you can try:

  • As a sanity check, click the Check for Updates button on Anki's Addons window.
  • Check that the add-on supports the current version of Anki in the official AnkiWeb page. If the page says that the current Anki version is supported, try reinstalling it again from AnkiWeb.

    Occasionally, the Check for Updates button doesn't properly work, so this method ensures that your addon is actually updated.


Enable Animations (2.1.61 - 2.1.63)

If you are using Anki versions 2.1.61, 2.1.62 or 2.1.63, animations are disabled by default. The note works best with animations enabled. To enable animations, head over to:

ToolsPreferencesAppearanceReduce Motion(unchecked)

Note

Starting Anki 2.1.64, Reduce Motion no longer affects animations within templates. 1


Dark Mode

Although light mode is supported, the recommended theme for this note is dark mode. With that being said, changing the theme is completely optional.

The note automatically adjusts according to Anki's theme. To change Anki's theme, head over to:

ToolsPreferencesBasicTheme (dropdown)

install Anki addons

Note

The note's theme currently cannot be forced to be a particular theme without changing Anki's settings.


Anki Add-ons

There are certain add-ons that must be installed for this note type to work.

Conflicting Add-ons

There are no conflicting add-ons, since I'm not aware of any currently. Let me know if you find one!

Downloading Add-ons

To download an add-on, copy the add-on's code, and navigate to the following to paste the code:

ToolsAdd-onsGet Add-ons...

install Anki addons


Required Add-ons

Anki-Connect

Code: 2055492159

Required for Yomichan and most other Anki-related automated tasks to work. I use the default config that comes with the add-on.

Note for Anki versions 2.1.49 and below

Anki versions 2.1.49 and below require a hack to the Anki-Connect config for certain features within the card to work. In particular, Anki-Connect is used for the "Kanji Hover" feature and the "Open Fields on New Card" feature.

To make those features work, add "null" to the webCorsOriginList list in the Anki-Connect config file. An example of how the config should look is shown below:

"webCorsOriginList": [
    "http://localhost",
    "null"
]

Of course, this isn't very safe and it is highly recommended that you upgrade Anki to avoid this problem.

If you aren't interested in those features, you can skip this step and disable them in the runtime options.


Optional Add-ons

These are a set of optional, but useful add-ons that can easily work with the card. If this is your first time here, I recommend skimming through the descriptions and choosing the add-ons that seem appealing for you.

Note

Make sure to head over to the final steps section afterwards!


CSS Injector

Code: 181103283

I strongly recommend using this, because if you don't use this, the fields within the Anki field editor won't have certain stylizations that makes the field actually interpretable.

CSS Injector comparison

There are two ways of using css injector with this note type:

Option 1: Automatically updates with the card (recommended)

As a preliminary step, you will have to remove the empty field.css and editor.css files that comes with the add-on. That can be done through command line (below), or you can simply navigate to the Anki2/addons21/181103283/user_files folder (within the addons folder) and delete both css files.

:: be sure to change USERNAME to your computer username!

del "C:\Users\USERNAME\AppData\Roaming\Anki2\addons21\181103283\user_files\field.css"
del "C:\Users\USERNAME\AppData\Roaming\Anki2\addons21\181103283\user_files\editor.css"

Afterwards, open command prompt with elevated permissions.

Note

Be sure to open command prompt, and not PowerShell. If you've never used command prompt before, see this.

With command prompt opened, run the following command:

:: be sure to change USERNAME to your computer username and PROFILENAME to your Anki profile.
:: There are **two** USERNAME's to replace, and **one** PROFILENAME to replace
:: in the commands below.
:: Make sure to replace all the fields!

mklink "C:\Users\USERNAME\AppData\Roaming\Anki2\addons21\181103283\user_files\field.css" "C:\Users\USERNAME\AppData\Roaming\Anki2\PROFILENAME\collection.media\_field.css"
mklink "C:\Users\USERNAME\AppData\Roaming\Anki2\addons21\181103283\user_files\editor.css" "C:\Users\USERNAME\AppData\Roaming\Anki2\PROFILENAME\collection.media\_editor.css"

As a preliminary step, you will have to remove the empty field.css and editor.css files that comes with the add-on. That can be done through command line (below), or you can simply navigate to the Anki2/addons21/181103283/user_files folder (within the addons folder) and delete both css files.

rm "$HOME/Library/Application Support/Anki2/addons21/181103283/user_files/field.css"
rm "$HOME/Library/Application Support/Anki2/addons21/181103283/user_files/editor.css"

Afterwards, run the following command:

# be sure to change `PROFILENAME` to your Anki profile
ln -s "$HOME/Library/Application Support/Anki2/PROFILENAME/collection.media/_field.css" "$HOME/Library/Application Support/Anki2/addons21/181103283/user_files/field.css"
ln -s "$HOME/Library/Application Support/Anki2/PROFILENAME/collection.media/_editor.css" "$HOME/Library/Application Support/Anki2/addons21/181103283/user_files/editor.css"

As a preliminary step, you will have to remove the empty field.css and editor.css files that comes with the add-on. That can be done through command line (below), or you can simply navigate to the Anki2/addons21/181103283/user_files folder (within the addons folder) and delete both css files.

rm "$HOME/.local/share/Anki2/addons21/181103283/user_files/field.css"
rm "$HOME/.local/share/Anki2/addons21/181103283/user_files/editor.css"

Afterwards, run the following command:

# be sure to change `PROFILENAME` to your Anki profile
ln -s "$HOME/.local/share/Anki2/PROFILENAME/collection.media/_field.css" "$HOME/.local/share/Anki2/addons21/181103283/user_files/field.css"
ln -s "$HOME/.local/share/Anki2/PROFILENAME/collection.media/_editor.css" "$HOME/.local/share/Anki2/addons21/181103283/user_files/editor.css"
Option 2: Manually without respecting updates
  1. Navigate to css injector addon folder (Anki2/addons21/181103283/user_files)
  2. Remove the existing field.css and editor.css files
  3. Copy the _field.css file and _editor.css file (found under your profile's media folder) into the css injector add-on directory.
  4. Rename _field.css to field.css.
  5. Rename _editor.css to editor.css.

Note

If either of the two css files ever update, you will have to manually copy and rename the file again.

AJT Japanese

Code: 200813220

JP Mining Note uses a slightly modified version of AJT Japanese that has been pre-configured to work with this note type.

Warning

As of writing this (2023/04/28), AJT Japanese is only guaranteed to work on Anki versions 2.1.60 and above, because it is no longer maintained on previous versions. If you are using an older version of Anki and you want to use this add-on, please update Anki to 2.1.60 or above.

This is an add-on that automatically adds furigana and pitch accents to cards upon Yomichan card creation. Previously known as AJT Furigana, and now comes packaged with AJT Pitch Accent.

If this add-on is not used, then the following features will be missing:

  • Automatically generated furigana
  • Devoiced and nasal information to pitch accents
  • Less coverage on pitch accents
    • If your Yomichan pitch accent dictionaries did not contain any pitch accent info for the word but the add-on does, then it will use the add-on data. This will likely happen for expressions containing more than one word. Fortunately, AJT Japanese can usually detect the existence of multiple words, and add the pitch accent for each individual word.

The version of AJT Japanese that is linked above has already been configured to work with JP Mining Note, so there is no need to modify the configuration. After installation, you can move on to Final Steps.

Additional Info

Furigana generation is occasionally incorrect, so if you plan on using furigana regularly, you should double-check the readings to make sure they are correct.

JapaneseSupport v.s. AJT Japanese (Furigana)

If you use JapaneseSupport, bolded words and other styles within a field are not transferred over from the original field to the reading field. Additionally, JapaneseSupport does not have an option to automatically add the reading upon card creation. AJT Japanese supports both of those of those features.

Config Changes

If you want to manually modify the configuration of AJT Japanese, this section might be useful. It details the changes that have been made to the default AJT Japanese configuration file. Documentation for configuring AJT Japanese can be found from the page for the original version of the add on.

To view the config of any Anki add-on, head over to:

ToolsAdd-ons → (select the add-on) → Config.

Below is an annotated copy of the config file that JP Mining Note uses:

Click here to see the full AJT Japanese config

The important changes to the config are:

  • fields
  • profiles
  • pitch_accent.reading_separator
  • pitch_accent.word_separator
  • pitch_accent.maximum_results
  • pitch_accent.style
{
  "cache_lookups": 1024,
  "last_file_save_location": "",
  "profiles": [ // (2)!
    {
      "name": "Add furigana for sentence",
      "note_type": "JP Mining Note",
      "source": "Sentence",
      "destination": "SentenceReading",
      "mode": "furigana",
      "split_morphemes": true,
      "triggered_by": "focus_lost,toolbar_button,note_added,bulk_add",
      "overwrite_destination": false
    },
    {
      "name": "Add furigana for word -- UNUSED BY jp-mining-note",
      "note_type": "AJT_JAPANESE_IGNORE_PROFILE",
      "source": "VocabKanji",
      "destination": "VocabFurigana",
      "mode": "furigana",
      "split_morphemes": false,
      "triggered_by": "focus_lost,toolbar_button,note_added,bulk_add",
      "overwrite_destination": false
    },
    {
      "name": "Add pitch accent for word",
      "note_type": "JP Mining Note",
      "source": "Word",
      "destination": "AJTWordPitch",
      "mode": "pitch",
      "split_morphemes": false,
      "output_format": "html",
      "triggered_by": "focus_lost,toolbar_button,note_added,bulk_add",
      "overwrite_destination": false
    },
    {
      "name": "Add audio for word -- UNUSED BY jp-mining-note",
      "note_type": "AJT_JAPANESE_IGNORE_PROFILE",
      "source": "VocabKanji",
      "destination": "VocabAudio",
      "mode": "audio",
      "split_morphemes": false,
      "triggered_by": "focus_lost,toolbar_button,note_added,bulk_add",
      "overwrite_destination": false
    }
  ],
  "pitch_accent": {
    "lookup_shortcut": "Ctrl+8",
    "output_hiragana": false,
    "kana_lookups": true,
    "skip_numbers": true,
    "reading_separator": "・", // (3)!
    "word_separator": "、",
    "blocklisted_words": "こと,へ,か,よ,ん,だ,び,の,や,ね,ば,て,と,た,が,に,な,は,も,ます,から,いる,たち,てる,う,ましょ,たい,する,です,ない",
    "maximum_results": 100, // (4)!
    "discard_mode": "discard_extra",
    "style": "none" // (1)!
  },
  "furigana": {
    "skip_numbers": true,
    "prefer_literal_pronunciation": false,
    "reading_separator": ", ",
    "blocklisted_words": "人",
    "mecab_only": "彼,猫,首,母,顔,木,頭,私,弟,空,体,行く",
    "maximum_results": 1, // (5)!
    "discard_mode": "discard_extra"
  },
  "context_menu": {
    "generate_furigana": true,
    "to_katakana": true,
    "to_hiragana": true,
    "literal_pronunciation": true,
    "look_up_word": true
  },
  "toolbar": { // (6)!
    "generate_all_button": {
      "enabled": false,
      "shortcut": "Alt+P",
      "text": "入"
    },
    "regenerate_all_button": {
      "enabled": false,
      "shortcut": "Alt+;",
      "text": "再"
    },
    "furigana_button": {
      "enabled": false,
      "shortcut": "",
      "text": "振"
    },
    "hiragana_button": {
      "enabled": false,
      "shortcut": "",
      "text": "平"
    },
    "clean_furigana_button": {
      "enabled": false,
      "shortcut": "",
      "text": "削"
    },
    "audio_search_button": {
      "enabled": false,
      "shortcut": "",
      "text": "検"
    },
    "add_definition_button": {
      "enabled": false,
      "shortcut": "",
      "text": "意"
    }
  },
  "audio_sources": [
    {
      "enabled": false, // (7)!
      "name": "NHK-2016",
      "url": "https://github.com/Ajatt-Tools/nhk_2016_pronunciations_index/releases/download/v1.2/NHK_main.zip"
    },
    {
      "enabled": false,
      "name": "NHK-1998",
      "url": "https://github.com/Ajatt-Tools/nhk_1998_pronunciations_index/releases/download/v1.1/NHK_main.zip"
    },
    {
      "enabled": false,
      "name": "Shinmeikai-8",
      "url": "https://github.com/Ajatt-Tools/shinmeikai_8_pronunciations_index/releases/download/v1.5/Shinmeikai-8_main.zip"
    },
    {
      "enabled": false,
      "name": "Daijisen",
      "url": "https://github.com/Ajatt-Tools/daijisen_pronunciations_index/releases/download/v1.0/Daijisen_main.zip"
    },
    {
      "enabled": false,
      "name": "TAAS",
      "url": "https://github.com/Ajatt-Tools/taas_pronunciations_index/releases/download/v1.0/TAAS_main.zip"
    }
  ],
  "audio_settings": {
    "dictionary_download_timeout": 30,
    "audio_download_timeout": 6,
    "attempts": 4,
    "maximum_results": 99,
    "ignore_inflections": false,
    "stop_if_one_source_has_results": false,
    "search_dialog_field_name": "VocabAudio",
    "tag_separator": "<br>"
  },
  "definitions": {
    "timeout": 10,
    "remove_marks": true,
    "dict_name": "meikyou",
    "search_type": "exact",
    "source": "VocabKanji",
    "destination": "VocabDef",
    "behavior": "append"
  }
}
  1. "style": "none" formats the pitch accent data using a simple html span structure, which makes it easy to control how pronunciation information is displayed. Without this, pitch accent information in the AJTWordPitch field will not render correctly.

  2. The Add audio for word and Add furigana for word profiles are not used. In order to disable them, the note type is set to AJT_JAPANESE_IGNORE_PROFILE, which only matches note types containing the string AJT_JAPANESE_IGNORE_PROFILE. It is very unlikely that your Anki notes will unintentionally contain this string.

  3. This makes the separators behave like the old version, and has to be changed to this for the default config of jp-mining-note to work.

  4. This is set to a high number in order for many pitch accents to be displayed for long expressions. This is fine because the pitch accent display is usually overwritten by the PAPositions field, so it's rare to see the AJTWordPitch field results anyways. Additionally, a higher number increases the sample size for the internal auto-pitch-accent module, to better search for devoiced and nasal markers.

  5. (Optional) This is to restrict the generated furigana to only show one reading. Feel free to leave this as the default (3).

  6. (Optional) I personally have the buttons removed because I don't want it to clutter up the editor toolbar. Feel free to have these enabled.

  7. (Optional) These are disabled because it slows down Anki's startup time. Additionally, the note does not use this feature. If you want to use this feature, feel free to enable these.


Final Steps: After Installing Add-ons

After the above setup, make sure to restart Anki for the add-ons and config changes to take effect. If the css injector add-on is installed correctly, your Anki field editor should now have color!

Additionally, now that Anki-Connect is installed, kanji hover should also be functioning. Hover over a kanji within the word reading to make sure that a popup appears. In particular, the 者 kanji in the example 偽者 and 不審者 cards should point to each other.

Note

Hovering over the other kanjis will display a Kanji not found. message, because the template only searches for kanjis within existing jp-mining-note cards.

If you wish to see usages of the kanji within words outside of your deck, I highly recommend using Marv's JPDB Kanji Yomichan Dictionary.


Transfer Existing Notes

If you wish to transfer existing cards into this note type (say, to make kanji hover work on existing cards), please see this page.


Updating the Note

If you wish to update the note, follow the steps in this page.

This note does not auto-update. This should keep your setup stable, as long as you do not update Anki.

When updating Anki, don't forget to check if there is a new version of this note available, because this note should update along with Anki.


Setting up Yomichan

Of course, you can have an Anki template, but what's the point of it if you can't make cards with it?

We will use Yomichan to create these cards.

Click here see how to setup Yomichan!


Last update: February 7, 2024