From 902297ba137736f81c0f3b977841ba0076570606 Mon Sep 17 00:00:00 2001
From: dae When restoring from a backup, any changes made since the backup was created will be lost. Anki disables automatic syncing and backups when you restore from a backup. Once you're
happy that you've restored the correct backup, close and re-open Anki to return to normal. Backups are created periodically. You can configure the time between backups
in the preferences screen. The default is 30 minutes. Certain operations will trigger a backup, even if the configured time has not
@@ -196,14 +195,10 @@ After backups are two days old, Anki will start removing some of the older ones.
You can control how many daily, weekly and monthly backups you'd like to keep. Backups created with 2.1.50 will not be importable into older Anki versions. Each time your collection is closed (when closing Anki, switching
-profiles, or doing a full sync download), Anki creates a backup. By default
-it will store up to 30 backups; you can adjust this in the preferences. You can restore from a manual backup by using File>Import. In Anki 2.1.50+, you can use File>Create Backup to trigger an immediate backup. This
functions like regular automatic backups, and does not include media files. To create a backup that includes your sounds and images: See this this add-on for why it is
advantageous to share notetypes with field and template ids, and how to add them to
existing ones. If you know the deck author has made changes and you wish to gain access to
-them, changing the notetype back is possible, but rather difficult. You'll need
-to do the following: If it prints two different notetype names, you will need to use the Change Notetype
-action to change the notetype of your existing notes to the desired one. You then need to use the Fields and Cards buttons to check the field and template
-names match the one in your test profile. They must match exactly - there should be no
-more or less, and the spelling should be identical.Backups
Restoring
Anki 2.1.50+
+Creating
Anki 2.1.50+
Older Anki versions
-Manual colpkg backups
Restoring
Creating
+Creating
Packaged Decks<
Not
Workaround for Anki 2.1.66 and Earlier
-
-
-
-nt = bcard().note().note_type()
-print("notetype", nt["name"], "has id", nt["id"])
-
-
-xxx
with the ID you got above:
-nt = bcard().note().note_type()
-print("current:", nt["name"], "has id", nt["id"])
-nt = mw.col.models.get(xxx)
-print("desired:", nt["name"], "has id", nt["id"])
-
-
diff --git a/print.html b/print.html
index 4da8ae74..1f695c41 100644
--- a/print.html
+++ b/print.html
@@ -1497,8 +1497,7 @@ Sib
the other hand, when you study a learning card, any new/review siblings
will be buried.
Also note that a card cannot be buried and suspended at the same time. Suspending a -buried card will unbury it. Burying a suspended card does not work on Anki -2.1.49+, whereas on earlier versions, it will unsuspend the card.
+buried card will unbury it. Suspended cards can't be buried.Most of the common operations in Anki have keyboard shortcuts. Most of them are discoverable in the interface: menu items list their shortcuts @@ -2036,10 +2035,7 @@
You can modify card templates by clicking the "Cards..." button inside the editing screen.
-For older Anki versions, on the top left is the front template, on the bottom left is the back -template, and in between them is the card styling section. For Anki versions -2.1.28+ the front, back, and styling are no longer shown at the same time. -You can switch between them with Ctrl+1, Ctrl+2, and Ctrl+3.
+You can switch between Front template, Back template and Styling with Ctrl+1, Ctrl+2, and Ctrl+3.
In Anki, templates are written in HTML, which is the language that web pages are written in. The styling section is CSS, which is the language used for styling web pages.
@@ -2444,7 +2440,6 @@This will ensure the card is generated only if both Field 2 and Field 1 are non-empty.
-The following limitations do not apply to Anki 2.1.28+ and AnkiMobile 2.0.64+.
-Older Anki versions cannot use negated conditionals for card generation. -For example, on Anki 2.1.28, the following would add a card if a field -called AddIfEmpty is empty, and Front is non-empty:
-{{^AddIfEmpty}}
- {{Front}}
-{{/AddIfEmpty}}
-
-On earlier Anki versions, the negated conditional is ignored, and card -generation will depend only on Front being non-empty.
-Mixing AND and OR conditions can also cause problems on older versions. -For example, the following ("add the card if A OR B OR C is non-empty") -is fine:
-{{A}}
-{{B}}
-{{C}}
-
-And the following ("add the card if A AND B AND C are non-empty") is fine:
-{{#A}}
- {{#B}}
- {{#C}}
- {{A}}
- {{/C}}
- {{/B}}
-{{/A}}
-
-But the following ("add the card if A OR (B AND C) are non-empty") will not work properly:
-{{A}}
-{{#B}}
- {{#C}}
- {{B}}
- {{/C}}
-{{/B}}
-
When you add a new note in Anki 2.1.28+ and AnkiMobile 2.0.64+, if the card +
When you add a new note in Anki, if the card templates and note fields combine to produce no cards, a blank card will be created using the first template. This allows you to add material even if it's incomplete, and modify it or the template later to make it valid. If you don't wish to keep an empty note, you can remove it with the Empty Cards function.
-On older Anki versions, Anki refuses to add or import a note if no cards -would be generated.
Please see the cloze deletion section for background info.
The cloze note type functions differently from regular note types. @@ -5095,7 +5053,6 @@
See this this add-on for why it is advantageous to share notetypes with field and template ids, and how to add them to existing ones.
-If you know the deck author has made changes and you wish to gain access to -them, changing the notetype back is possible, but rather difficult. You'll need -to do the following:
-nt = bcard().note().note_type()
-print("notetype", nt["name"], "has id", nt["id"])
-
-xxx
with the ID you got above:nt = bcard().note().note_type()
-print("current:", nt["name"], "has id", nt["id"])
-nt = mw.col.models.get(xxx)
-print("desired:", nt["name"], "has id", nt["id"])
-
-If it prints two different notetype names, you will need to use the Change Notetype -action to change the notetype of your existing notes to the desired one.
-You then need to use the Fields and Cards buttons to check the field and template -names match the one in your test profile. They must match exactly - there should be no -more or less, and the spelling should be identical.
-When restoring from a backup, any changes made since the backup was created will be lost.
Anki disables automatic syncing and backups when you restore from a backup. Once you're happy that you've restored the correct backup, close and re-open Anki to return to normal.
-Backups are created periodically. You can configure the time between backups in the preferences screen. The default is 30 minutes.
Certain operations will trigger a backup, even if the configured time has not @@ -5281,14 +5202,10 @@
After backups are two days old, Anki will start removing some of the older ones. You can control how many daily, weekly and monthly backups you'd like to keep.
Backups created with 2.1.50 will not be importable into older Anki versions.
-Each time your collection is closed (when closing Anki, switching -profiles, or doing a full sync download), Anki creates a backup. By default -it will store up to 30 backups; you can adjust this in the preferences.
You can restore from a manual backup by using File>Import.
-In Anki 2.1.50+, you can use File>Create Backup to trigger an immediate backup. This functions like regular automatic backups, and does not include media files.
To create a backup that includes your sounds and images:
@@ -5633,13 +5550,9 @@If you select this checkbox, statistics will be shown for your entire collection. You can also display graphs for arbitrary searches by adding filters in the search box at the top (2.1.28+).
By default, Anki 2.1.28+ will show you statistics for the last 12 months. +
By default, Anki shows you statistics for the last 12 months. You can change this to all history scope or deck life scope at the top. (The "today" section at the top remains of course unaffected by this selection.)
-Older versions of Anki will by default show you statistics for -the previous month. You can change this to a year scope or deck life scope -at the bottom. (Again, the “today” section at the top is unaffected -by this selection.)
...
Advanced users can override the default type-answer colors with the css classes 'typeGood', 'typeBad' and 'typeMissed'. AnkiMobile supports 'typeGood' and 'typeBad', but not 'typeMissed'. If you wish to override the size of the typing box and don’t want to change the font in the Fields dialog, you can override the default inline style using !important, like so: #typeans { font-size: 50px !important; } It is also possible to type in the answer for cloze deletion cards. To do this, add {{type:cloze:Text}} to both the front and back template, so the back looks something like this: {{cloze:Text}}\n{{type:cloze:Text}}\n{{Extra}} Note that since the cloze type does not use FrontSide, this must be added to both sides on a cloze note type. If there are multiple sections elided, you can separate the answers in the text box with a comma. Type answer boxes will not appear in the \"preview\" dialog in the browser. When you review or look at the preview in the card types window, they will display. Type answer boxes will not be displayed when you review your cards on ankiweb.net .","breadcrumbs":"Card Templates » Field Replacements » Checking Your Answer","id":"149","title":"Checking Your Answer"},"15":{"body":"To install Anki: Download Anki from https://apps.ankiweb.net . See the next section for how to choose between -qt5 and -qt6. Save the installer to your desktop or downloads folder. Double-click on the installer to run it. If you see an error message, please see the installation issues page . Once Anki is installed, double-click on the new star icon on your desktop to start Anki.","breadcrumbs":"Platform Notes » Windows » Install & Upgrade » Installing","id":"15","title":"Installing"},"150":{"body":"Reverse Cards Card Generation & Deletion Selective Card Generation Conditional Replacement Blank Back Sides Limitations in Older Anki Versions Adding Empty Notes Cloze Templates","breadcrumbs":"Card Templates » Card Generation » Card Generation","id":"150","title":"Card Generation"},"151":{"body":"You can watch a video about reversing cards on YouTube. If you want to create cards that go in both directions (e.g., both “ookii”→“big” and “big”→“ookii”), you have several options. The simplest is to select the “Basic (and reversed card)” built-in note type. This will generate two cards, one in each direction. If you want to generate reverse cards for only some of your material (perhaps you only want to take the time to study reverses for the most important material, or some of your cards don’t make sense reversed), you can select the “Basic (optional reversed card)” note type. This note type generates a forward-only card when you fill in only the first two fields; if you additionally enter something in the “Add Reverse” field (like a 'y'), Anki will generate a reverse card as well. The contents of this field will never be displayed on a card.","breadcrumbs":"Card Templates » Card Generation » Reverse Cards","id":"151","title":"Reverse Cards"},"152":{"body":"Anki will not create cards with empty front sides. Thus if “My Field” was empty, and one card’s front template included only that field, the card would not be created. When you edit a previously added note, Anki will automatically create extra cards if they were previously blank but no longer are. If your edits have made some cards blank when they previously were not, however, Anki will not delete them immediately, as that could lead to accidental data loss. To remove the empty cards, go to Tools → Empty Cards in the main window. You will be shown a list of empty cards and be given the option to delete them. Because of the way that card generation works, it is not possible to manually delete individual cards, as they would just end up being recreated the next time the note was edited. Instead, you should make the relevant conditional replacement fields empty and then use the Empty Cards option. Anki does not consider special fields or non-field text for the purposes of card generation. Thus if your front template looked like the following, no card would be generated if Country was empty: Where is {{Country}} on the map?","breadcrumbs":"Card Templates » Card Generation » Card Generation & Deletion","id":"152","title":"Card Generation & Deletion"},"153":{"body":"Sometimes you may want to generate extra cards for only some of your material, such as testing your ability to recall the most important words of a set. You can accomplish this by adding an extra field to your note, and adding some text into it (such as \"1\") on the notes you want the extra card. Then in the card template, you can make the card’s creation depend on that field being non-empty. For more information on this, please see the conditional replacement section below.","breadcrumbs":"Card Templates » Card Generation » Selective Card Generation","id":"153","title":"Selective Card Generation"},"154":{"body":"It is possible to include certain text, fields, or HTML on your cards only if a field is empty or not empty. An example: This text is always shown. {{#FieldName}} This text is only shown if FieldName has text in it\n{{/FieldName}} {{^FieldName}} This text is only shown if FieldName is empty\n{{/FieldName}} A real life example is only showing a label if the field is not empty: {{#Tags}} Tags: {{Tags}}\n{{/Tags}} Or say you want to display a specific field in blue on the front of your card if there are extra notes on the back (perhaps the fact that there are notes serves as a reminder that you should spend more time thinking about the answer). You can style the field as follows: {{#Notes}} \n{{/Notes}} {{FieldToFormat}} {{#Notes}} \n{{/Notes}} You can also use conditional replacement to control which cards are generated. This works since Anki will not generate cards which would have a blank front side. For example, consider a card with two fields on the front: {{Expression}}\n{{Notes}} Normally a card would be generated if either the expression or notes field had text in it. If you only wanted a card generated if expression was not empty, then you could change the template to this: {{#Expression}} {{Expression}} {{Notes}}\n{{/Expression}} And if you wanted to require both fields, you could use two conditional replacements: {{#Expression}} {{#Notes}} {{Expression}} {{Notes}} {{/Notes}}\n{{/Expression}} Keep in mind that this only works when you place the conditional replacement code on the front of the card; if you do this on the back, you will simply end up with cards with a blank back side. Similarly, since this works by checking if the front field would be empty, it is important to make sure you wrap the 'entire' front side in the conditional replacement; for instance, the following would not work as expected: {{#Expression}} {{Expression}}\n{{/Expression}}\n{{Notes}}","breadcrumbs":"Card Templates » Card Generation » Conditional Replacement","id":"154","title":"Conditional Replacement"},"155":{"body":"Card generation only looks at the front side of the card. For example, if you have a front template: {{Field 1}} and a back template: {{Field 2}} Then a card will be generated if Field 1 is non-empty. If Field 2 is empty, the card will still be generated, and you will get a blank back side. If you wish to avoid a blank back side, you will need to place a required field on the front template as a conditional, like so: {{#Field 2}} {{Field 1}}\n{{/Field 2}} This will ensure the card is generated only if both Field 2 and Field 1 are non-empty.","breadcrumbs":"Card Templates » Card Generation » Blank Back Sides","id":"155","title":"Blank Back Sides"},"156":{"body":"The following limitations do not apply to Anki 2.1.28+ and AnkiMobile 2.0.64+. Older Anki versions cannot use negated conditionals for card generation. For example, on Anki 2.1.28, the following would add a card if a field called AddIfEmpty is empty, and Front is non-empty: {{^AddIfEmpty}} {{Front}}\n{{/AddIfEmpty}} On earlier Anki versions, the negated conditional is ignored, and card generation will depend only on Front being non-empty. Mixing AND and OR conditions can also cause problems on older versions. For example, the following (\"add the card if A OR B OR C is non-empty\") is fine: {{A}}\n{{B}}\n{{C}} And the following (\"add the card if A AND B AND C are non-empty\") is fine: {{#A}} {{#B}} {{#C}} {{A}} {{/C}} {{/B}}\n{{/A}} But the following (\"add the card if A OR (B AND C) are non-empty\") will not work properly: {{A}}\n{{#B}} {{#C}} {{B}} {{/C}}\n{{/B}}","breadcrumbs":"Card Templates » Card Generation » Limitations in Older Anki Versions","id":"156","title":"Limitations in Older Anki Versions"},"157":{"body":"When you add a new note in Anki 2.1.28+ and AnkiMobile 2.0.64+, if the card templates and note fields combine to produce no cards, a blank card will be created using the first template. This allows you to add material even if it's incomplete, and modify it or the template later to make it valid. If you don't wish to keep an empty note, you can remove it with the Empty Cards function. On older Anki versions, Anki refuses to add or import a note if no cards would be generated.","breadcrumbs":"Card Templates » Card Generation » Adding Empty Notes","id":"157","title":"Adding Empty Notes"},"158":{"body":"Please see the cloze deletion section for background info. The cloze note type functions differently from regular note types. Instead of a customizable number of card types, it has a single type which is shared by all cloze deletions on a note. As mentioned in the card generation section above, generation of regular cards depends on one or more fields on the question being non-empty. Cloze deletion note types are generated differently: Anki looks on the front template for one or more cloze replacements, like {{cloze:FieldName}}. It then looks in the FieldName field for all cloze references, like {{c1::text}}. For each separate number, a card will be generated. Because card generation functions differently for cloze deletion cards, {{cloze:…}} tags can not be used with a regular note type - they will only function properly when used with a cloze note type. Conditional generation provides a special field so you can check which card you are rendering. If you wanted to display the \"hint1\" field on the first cloze, and \"hint2\" field on the second cloze for example, you could use the following template: {{cloze:Text}} {{#c1}} {{Hint1}}\n{{/c1}} {{#c2}} {{Hint2}}\n{{/c2}}","breadcrumbs":"Card Templates » Card Generation » Cloze Templates","id":"158","title":"Cloze Templates"},"159":{"body":"Card Styling Image Resizing Field Styling Audio Replay Buttons Text Direction Other HTML Browser Appearance Platform-Specific CSS Installing Fonts Night Mode Fading and Scrolling Javascript","breadcrumbs":"Card Templates » Styling & HTML » Styling & HTML","id":"159","title":"Styling & HTML"},"16":{"body":"Recent Anki versions come in separate Qt5 and Qt6 variants. The Qt6 version is recommended for most users. Advantages of the Qt6 version: Various bugfixes, including things like better support for less common languages. Very large images load faster than the Qt5 version. Security updates. Support for the Qt5 library was discontinued in Nov 2020, meaning that any security flaws discovered since then will remain unfixed. Some users experience freezes when using a custom shortcut key to switch input languages in Qt5. Disadvantages of the Qt6 version: Some add-ons currently only work with the Qt5 version.","breadcrumbs":"Platform Notes » Windows » Install & Upgrade » Qt5 vs. Qt6","id":"16","title":"Qt5 vs. Qt6"},"160":{"body":"You can watch a video about styling cards on YouTube. The video shows Anki 2.0’s interface, but the concepts are largely the same. The styling section of the Cards screen can be accessed by clicking the \"Styling\" button next to the \"Back Template\" button. In that section, you can change the background color of the card, the default font, the text alignment, and so on. The standard options available to you are: font-family The name of the font to use on the card. If your font has spaces in it like \"MS Unicode\", then you need to surround the font name in double quotes as in this sentence. It is also possible to use multiple fonts on one card; for information on that, please see below. font-size The size of the font in pixels. When changing it, make sure you leave px at the end. text-align Whether the text should be aligned in the center, left, or right. color The color of the text. Simple color names like 'blue', 'lightyellow', and so on will work, or you can use HTML color codes to select arbitrary colors. Please see this webpage for more information. background-color The color of the card background. Any CSS can be placed in the styling section – advanced users may wish to do things like add a background image or gradient, for example. If you’re wondering how to get some particular formatting, please search the web for information about how to do it in CSS, as there is a great deal of documentation available. The styling is shared between all cards, which means that when you make an adjustment it will affect all cards for that note type. It is also possible to specify card-specific styling, however. The following example will use a yellow background on all cards except the first one: .card { background-color: yellow;\n}\n.card1 { background-color: blue;\n}","breadcrumbs":"Card Templates » Styling & HTML » Card Styling","id":"160","title":"Card Styling"},"161":{"body":"Anki shrinks images to fit the screen by default. You can change this by adding the following to the bottom of your styling section (outside of the default .card { ... }): img { max-width: none; max-height: none;\n} AnkiDroid sometimes has trouble scaling images to fit the screen . Setting maximum image dimensions using css should fix this, but seems to be ignored as of AnkiDroid 2.9. A fix is to append !important to each style directive, for example: img { max-width: 300px !important; max-height: 300px !important;\n} If you try to change the style for images and find that the star that appears on marked cards is affected (for instance, it becomes way too large), you can target it with the following: img#star { ...;\n} You can explore the styling of cards interactively by using Chrome: https://addon-docs.ankiweb.net/porting2.0.html#webview-changes Anki 2.1.50+ supports image resizing within the editor natively.","breadcrumbs":"Card Templates » Styling & HTML » Image Resizing","id":"161","title":"Image Resizing"},"162":{"body":"The default styling applies to the whole card. You can also make certain fields or part of the card use a different font, color, and so on. This is particularly important when studying foreign languages, as Anki will sometimes be unable to correctly display characters unless an appropriate font has been chosen. Say you have an “Expression” field, and you want to give it the OSX Thai font “Ayuthaya”. Imagine your template already reads: What is {{Expression}}? {{Notes}} What we need to do is wrap the text we want to style in some HTML. We will put the following in front of the text: ...
Advanced users can override the default type-answer colors with the css classes 'typeGood', 'typeBad' and 'typeMissed'. AnkiMobile supports 'typeGood' and 'typeBad', but not 'typeMissed'. If you wish to override the size of the typing box and don’t want to change the font in the Fields dialog, you can override the default inline style using !important, like so: #typeans { font-size: 50px !important; } It is also possible to type in the answer for cloze deletion cards. To do this, add {{type:cloze:Text}} to both the front and back template, so the back looks something like this: {{cloze:Text}}\n{{type:cloze:Text}}\n{{Extra}} Note that since the cloze type does not use FrontSide, this must be added to both sides on a cloze note type. If there are multiple sections elided, you can separate the answers in the text box with a comma. Type answer boxes will not appear in the \"preview\" dialog in the browser. When you review or look at the preview in the card types window, they will display. Type answer boxes will not be displayed when you review your cards on ankiweb.net .","breadcrumbs":"Card Templates » Field Replacements » Checking Your Answer","id":"149","title":"Checking Your Answer"},"15":{"body":"To install Anki: Download Anki from https://apps.ankiweb.net . See the next section for how to choose between -qt5 and -qt6. Save the installer to your desktop or downloads folder. Double-click on the installer to run it. If you see an error message, please see the installation issues page . Once Anki is installed, double-click on the new star icon on your desktop to start Anki.","breadcrumbs":"Platform Notes » Windows » Install & Upgrade » Installing","id":"15","title":"Installing"},"150":{"body":"Reverse Cards Card Generation & Deletion Selective Card Generation Conditional Replacement Blank Back Sides Adding Empty Notes Cloze Templates","breadcrumbs":"Card Templates » Card Generation » Card Generation","id":"150","title":"Card Generation"},"151":{"body":"You can watch a video about reversing cards on YouTube. If you want to create cards that go in both directions (e.g., both “ookii”→“big” and “big”→“ookii”), you have several options. The simplest is to select the “Basic (and reversed card)” built-in note type. This will generate two cards, one in each direction. If you want to generate reverse cards for only some of your material (perhaps you only want to take the time to study reverses for the most important material, or some of your cards don’t make sense reversed), you can select the “Basic (optional reversed card)” note type. This note type generates a forward-only card when you fill in only the first two fields; if you additionally enter something in the “Add Reverse” field (like a 'y'), Anki will generate a reverse card as well. The contents of this field will never be displayed on a card.","breadcrumbs":"Card Templates » Card Generation » Reverse Cards","id":"151","title":"Reverse Cards"},"152":{"body":"Anki will not create cards with empty front sides. Thus if “My Field” was empty, and one card’s front template included only that field, the card would not be created. When you edit a previously added note, Anki will automatically create extra cards if they were previously blank but no longer are. If your edits have made some cards blank when they previously were not, however, Anki will not delete them immediately, as that could lead to accidental data loss. To remove the empty cards, go to Tools → Empty Cards in the main window. You will be shown a list of empty cards and be given the option to delete them. Because of the way that card generation works, it is not possible to manually delete individual cards, as they would just end up being recreated the next time the note was edited. Instead, you should make the relevant conditional replacement fields empty and then use the Empty Cards option. Anki does not consider special fields or non-field text for the purposes of card generation. Thus if your front template looked like the following, no card would be generated if Country was empty: Where is {{Country}} on the map?","breadcrumbs":"Card Templates » Card Generation » Card Generation & Deletion","id":"152","title":"Card Generation & Deletion"},"153":{"body":"Sometimes you may want to generate extra cards for only some of your material, such as testing your ability to recall the most important words of a set. You can accomplish this by adding an extra field to your note, and adding some text into it (such as \"1\") on the notes you want the extra card. Then in the card template, you can make the card’s creation depend on that field being non-empty. For more information on this, please see the conditional replacement section below.","breadcrumbs":"Card Templates » Card Generation » Selective Card Generation","id":"153","title":"Selective Card Generation"},"154":{"body":"It is possible to include certain text, fields, or HTML on your cards only if a field is empty or not empty. An example: This text is always shown. {{#FieldName}} This text is only shown if FieldName has text in it\n{{/FieldName}} {{^FieldName}} This text is only shown if FieldName is empty\n{{/FieldName}} A real life example is only showing a label if the field is not empty: {{#Tags}} Tags: {{Tags}}\n{{/Tags}} Or say you want to display a specific field in blue on the front of your card if there are extra notes on the back (perhaps the fact that there are notes serves as a reminder that you should spend more time thinking about the answer). You can style the field as follows: {{#Notes}} \n{{/Notes}} {{FieldToFormat}} {{#Notes}} \n{{/Notes}} You can also use conditional replacement to control which cards are generated. This works since Anki will not generate cards which would have a blank front side. For example, consider a card with two fields on the front: {{Expression}}\n{{Notes}} Normally a card would be generated if either the expression or notes field had text in it. If you only wanted a card generated if expression was not empty, then you could change the template to this: {{#Expression}} {{Expression}} {{Notes}}\n{{/Expression}} And if you wanted to require both fields, you could use two conditional replacements: {{#Expression}} {{#Notes}} {{Expression}} {{Notes}} {{/Notes}}\n{{/Expression}} Keep in mind that this only works when you place the conditional replacement code on the front of the card; if you do this on the back, you will simply end up with cards with a blank back side. Similarly, since this works by checking if the front field would be empty, it is important to make sure you wrap the 'entire' front side in the conditional replacement; for instance, the following would not work as expected: {{#Expression}} {{Expression}}\n{{/Expression}}\n{{Notes}}","breadcrumbs":"Card Templates » Card Generation » Conditional Replacement","id":"154","title":"Conditional Replacement"},"155":{"body":"Card generation only looks at the front side of the card. For example, if you have a front template: {{Field 1}} and a back template: {{Field 2}} Then a card will be generated if Field 1 is non-empty. If Field 2 is empty, the card will still be generated, and you will get a blank back side. If you wish to avoid a blank back side, you will need to place a required field on the front template as a conditional, like so: {{#Field 2}} {{Field 1}}\n{{/Field 2}} This will ensure the card is generated only if both Field 2 and Field 1 are non-empty.","breadcrumbs":"Card Templates » Card Generation » Blank Back Sides","id":"155","title":"Blank Back Sides"},"156":{"body":"When you add a new note in Anki, if the card templates and note fields combine to produce no cards, a blank card will be created using the first template. This allows you to add material even if it's incomplete, and modify it or the template later to make it valid. If you don't wish to keep an empty note, you can remove it with the Empty Cards function.","breadcrumbs":"Card Templates » Card Generation » Adding Empty Notes","id":"156","title":"Adding Empty Notes"},"157":{"body":"Please see the cloze deletion section for background info. The cloze note type functions differently from regular note types. Instead of a customizable number of card types, it has a single type which is shared by all cloze deletions on a note. As mentioned in the card generation section above, generation of regular cards depends on one or more fields on the question being non-empty. Cloze deletion note types are generated differently: Anki looks on the front template for one or more cloze replacements, like {{cloze:FieldName}}. It then looks in the FieldName field for all cloze references, like {{c1::text}}. For each separate number, a card will be generated. Because card generation functions differently for cloze deletion cards, {{cloze:…}} tags can not be used with a regular note type - they will only function properly when used with a cloze note type. Conditional generation provides a special field so you can check which card you are rendering. If you wanted to display the \"hint1\" field on the first cloze, and \"hint2\" field on the second cloze for example, you could use the following template: {{cloze:Text}} {{#c1}} {{Hint1}}\n{{/c1}} {{#c2}} {{Hint2}}\n{{/c2}}","breadcrumbs":"Card Templates » Card Generation » Cloze Templates","id":"157","title":"Cloze Templates"},"158":{"body":"Card Styling Image Resizing Field Styling Audio Replay Buttons Text Direction Other HTML Browser Appearance Platform-Specific CSS Installing Fonts Night Mode Fading and Scrolling Javascript","breadcrumbs":"Card Templates » Styling & HTML » Styling & HTML","id":"158","title":"Styling & HTML"},"159":{"body":"You can watch a video about styling cards on YouTube. The video shows Anki 2.0’s interface, but the concepts are largely the same. The styling section of the Cards screen can be accessed by clicking the \"Styling\" button next to the \"Back Template\" button. In that section, you can change the background color of the card, the default font, the text alignment, and so on. The standard options available to you are: font-family The name of the font to use on the card. If your font has spaces in it like \"MS Unicode\", then you need to surround the font name in double quotes as in this sentence. It is also possible to use multiple fonts on one card; for information on that, please see below. font-size The size of the font in pixels. When changing it, make sure you leave px at the end. text-align Whether the text should be aligned in the center, left, or right. color The color of the text. Simple color names like 'blue', 'lightyellow', and so on will work, or you can use HTML color codes to select arbitrary colors. Please see this webpage for more information. background-color The color of the card background. Any CSS can be placed in the styling section – advanced users may wish to do things like add a background image or gradient, for example. If you’re wondering how to get some particular formatting, please search the web for information about how to do it in CSS, as there is a great deal of documentation available. The styling is shared between all cards, which means that when you make an adjustment it will affect all cards for that note type. It is also possible to specify card-specific styling, however. The following example will use a yellow background on all cards except the first one: .card { background-color: yellow;\n}\n.card1 { background-color: blue;\n}","breadcrumbs":"Card Templates » Styling & HTML » Card Styling","id":"159","title":"Card Styling"},"16":{"body":"Recent Anki versions come in separate Qt5 and Qt6 variants. The Qt6 version is recommended for most users. Advantages of the Qt6 version: Various bugfixes, including things like better support for less common languages. Very large images load faster than the Qt5 version. Security updates. Support for the Qt5 library was discontinued in Nov 2020, meaning that any security flaws discovered since then will remain unfixed. Some users experience freezes when using a custom shortcut key to switch input languages in Qt5. Disadvantages of the Qt6 version: Some add-ons currently only work with the Qt5 version.","breadcrumbs":"Platform Notes » Windows » Install & Upgrade » Qt5 vs. Qt6","id":"16","title":"Qt5 vs. Qt6"},"160":{"body":"Anki shrinks images to fit the screen by default. You can change this by adding the following to the bottom of your styling section (outside of the default .card { ... }): img { max-width: none; max-height: none;\n} AnkiDroid sometimes has trouble scaling images to fit the screen . Setting maximum image dimensions using css should fix this, but seems to be ignored as of AnkiDroid 2.9. A fix is to append !important to each style directive, for example: img { max-width: 300px !important; max-height: 300px !important;\n} If you try to change the style for images and find that the star that appears on marked cards is affected (for instance, it becomes way too large), you can target it with the following: img#star { ...;\n} You can explore the styling of cards interactively by using Chrome: https://addon-docs.ankiweb.net/porting2.0.html#webview-changes Anki 2.1.50+ supports image resizing within the editor natively.","breadcrumbs":"Card Templates » Styling & HTML » Image Resizing","id":"160","title":"Image Resizing"},"161":{"body":"The default styling applies to the whole card. You can also make certain fields or part of the card use a different font, color, and so on. This is particularly important when studying foreign languages, as Anki will sometimes be unable to correctly display characters unless an appropriate font has been chosen. Say you have an “Expression” field, and you want to give it the OSX Thai font “Ayuthaya”. Imagine your template already reads: What is {{Expression}}? {{Notes}} What we need to do is wrap the text we want to style in some HTML. We will put the following in front of the text: ...
Advanced users can override the default type-answer colors with the css classes 'typeGood', 'typeBad' and 'typeMissed'. AnkiMobile supports 'typeGood' and 'typeBad', but not 'typeMissed'. If you wish to override the size of the typing box and don’t want to change the font in the Fields dialog, you can override the default inline style using !important, like so: #typeans { font-size: 50px !important; } It is also possible to type in the answer for cloze deletion cards. To do this, add {{type:cloze:Text}} to both the front and back template, so the back looks something like this: {{cloze:Text}}\n{{type:cloze:Text}}\n{{Extra}} Note that since the cloze type does not use FrontSide, this must be added to both sides on a cloze note type. If there are multiple sections elided, you can separate the answers in the text box with a comma. Type answer boxes will not appear in the \"preview\" dialog in the browser. When you review or look at the preview in the card types window, they will display. Type answer boxes will not be displayed when you review your cards on ankiweb.net .","breadcrumbs":"Card Templates » Field Replacements » Checking Your Answer","id":"149","title":"Checking Your Answer"},"15":{"body":"To install Anki: Download Anki from https://apps.ankiweb.net . See the next section for how to choose between -qt5 and -qt6. Save the installer to your desktop or downloads folder. Double-click on the installer to run it. If you see an error message, please see the installation issues page . Once Anki is installed, double-click on the new star icon on your desktop to start Anki.","breadcrumbs":"Platform Notes » Windows » Install & Upgrade » Installing","id":"15","title":"Installing"},"150":{"body":"Reverse Cards Card Generation & Deletion Selective Card Generation Conditional Replacement Blank Back Sides Limitations in Older Anki Versions Adding Empty Notes Cloze Templates","breadcrumbs":"Card Templates » Card Generation » Card Generation","id":"150","title":"Card Generation"},"151":{"body":"You can watch a video about reversing cards on YouTube. If you want to create cards that go in both directions (e.g., both “ookii”→“big” and “big”→“ookii”), you have several options. The simplest is to select the “Basic (and reversed card)” built-in note type. This will generate two cards, one in each direction. If you want to generate reverse cards for only some of your material (perhaps you only want to take the time to study reverses for the most important material, or some of your cards don’t make sense reversed), you can select the “Basic (optional reversed card)” note type. This note type generates a forward-only card when you fill in only the first two fields; if you additionally enter something in the “Add Reverse” field (like a 'y'), Anki will generate a reverse card as well. The contents of this field will never be displayed on a card.","breadcrumbs":"Card Templates » Card Generation » Reverse Cards","id":"151","title":"Reverse Cards"},"152":{"body":"Anki will not create cards with empty front sides. Thus if “My Field” was empty, and one card’s front template included only that field, the card would not be created. When you edit a previously added note, Anki will automatically create extra cards if they were previously blank but no longer are. If your edits have made some cards blank when they previously were not, however, Anki will not delete them immediately, as that could lead to accidental data loss. To remove the empty cards, go to Tools → Empty Cards in the main window. You will be shown a list of empty cards and be given the option to delete them. Because of the way that card generation works, it is not possible to manually delete individual cards, as they would just end up being recreated the next time the note was edited. Instead, you should make the relevant conditional replacement fields empty and then use the Empty Cards option. Anki does not consider special fields or non-field text for the purposes of card generation. Thus if your front template looked like the following, no card would be generated if Country was empty: Where is {{Country}} on the map?","breadcrumbs":"Card Templates » Card Generation » Card Generation & Deletion","id":"152","title":"Card Generation & Deletion"},"153":{"body":"Sometimes you may want to generate extra cards for only some of your material, such as testing your ability to recall the most important words of a set. You can accomplish this by adding an extra field to your note, and adding some text into it (such as \"1\") on the notes you want the extra card. Then in the card template, you can make the card’s creation depend on that field being non-empty. For more information on this, please see the conditional replacement section below.","breadcrumbs":"Card Templates » Card Generation » Selective Card Generation","id":"153","title":"Selective Card Generation"},"154":{"body":"It is possible to include certain text, fields, or HTML on your cards only if a field is empty or not empty. An example: This text is always shown. {{#FieldName}} This text is only shown if FieldName has text in it\n{{/FieldName}} {{^FieldName}} This text is only shown if FieldName is empty\n{{/FieldName}} A real life example is only showing a label if the field is not empty: {{#Tags}} Tags: {{Tags}}\n{{/Tags}} Or say you want to display a specific field in blue on the front of your card if there are extra notes on the back (perhaps the fact that there are notes serves as a reminder that you should spend more time thinking about the answer). You can style the field as follows: {{#Notes}} \n{{/Notes}} {{FieldToFormat}} {{#Notes}} \n{{/Notes}} You can also use conditional replacement to control which cards are generated. This works since Anki will not generate cards which would have a blank front side. For example, consider a card with two fields on the front: {{Expression}}\n{{Notes}} Normally a card would be generated if either the expression or notes field had text in it. If you only wanted a card generated if expression was not empty, then you could change the template to this: {{#Expression}} {{Expression}} {{Notes}}\n{{/Expression}} And if you wanted to require both fields, you could use two conditional replacements: {{#Expression}} {{#Notes}} {{Expression}} {{Notes}} {{/Notes}}\n{{/Expression}} Keep in mind that this only works when you place the conditional replacement code on the front of the card; if you do this on the back, you will simply end up with cards with a blank back side. Similarly, since this works by checking if the front field would be empty, it is important to make sure you wrap the 'entire' front side in the conditional replacement; for instance, the following would not work as expected: {{#Expression}} {{Expression}}\n{{/Expression}}\n{{Notes}}","breadcrumbs":"Card Templates » Card Generation » Conditional Replacement","id":"154","title":"Conditional Replacement"},"155":{"body":"Card generation only looks at the front side of the card. For example, if you have a front template: {{Field 1}} and a back template: {{Field 2}} Then a card will be generated if Field 1 is non-empty. If Field 2 is empty, the card will still be generated, and you will get a blank back side. If you wish to avoid a blank back side, you will need to place a required field on the front template as a conditional, like so: {{#Field 2}} {{Field 1}}\n{{/Field 2}} This will ensure the card is generated only if both Field 2 and Field 1 are non-empty.","breadcrumbs":"Card Templates » Card Generation » Blank Back Sides","id":"155","title":"Blank Back Sides"},"156":{"body":"The following limitations do not apply to Anki 2.1.28+ and AnkiMobile 2.0.64+. Older Anki versions cannot use negated conditionals for card generation. For example, on Anki 2.1.28, the following would add a card if a field called AddIfEmpty is empty, and Front is non-empty: {{^AddIfEmpty}} {{Front}}\n{{/AddIfEmpty}} On earlier Anki versions, the negated conditional is ignored, and card generation will depend only on Front being non-empty. Mixing AND and OR conditions can also cause problems on older versions. For example, the following (\"add the card if A OR B OR C is non-empty\") is fine: {{A}}\n{{B}}\n{{C}} And the following (\"add the card if A AND B AND C are non-empty\") is fine: {{#A}} {{#B}} {{#C}} {{A}} {{/C}} {{/B}}\n{{/A}} But the following (\"add the card if A OR (B AND C) are non-empty\") will not work properly: {{A}}\n{{#B}} {{#C}} {{B}} {{/C}}\n{{/B}}","breadcrumbs":"Card Templates » Card Generation » Limitations in Older Anki Versions","id":"156","title":"Limitations in Older Anki Versions"},"157":{"body":"When you add a new note in Anki 2.1.28+ and AnkiMobile 2.0.64+, if the card templates and note fields combine to produce no cards, a blank card will be created using the first template. This allows you to add material even if it's incomplete, and modify it or the template later to make it valid. If you don't wish to keep an empty note, you can remove it with the Empty Cards function. On older Anki versions, Anki refuses to add or import a note if no cards would be generated.","breadcrumbs":"Card Templates » Card Generation » Adding Empty Notes","id":"157","title":"Adding Empty Notes"},"158":{"body":"Please see the cloze deletion section for background info. The cloze note type functions differently from regular note types. Instead of a customizable number of card types, it has a single type which is shared by all cloze deletions on a note. As mentioned in the card generation section above, generation of regular cards depends on one or more fields on the question being non-empty. Cloze deletion note types are generated differently: Anki looks on the front template for one or more cloze replacements, like {{cloze:FieldName}}. It then looks in the FieldName field for all cloze references, like {{c1::text}}. For each separate number, a card will be generated. Because card generation functions differently for cloze deletion cards, {{cloze:…}} tags can not be used with a regular note type - they will only function properly when used with a cloze note type. Conditional generation provides a special field so you can check which card you are rendering. If you wanted to display the \"hint1\" field on the first cloze, and \"hint2\" field on the second cloze for example, you could use the following template: {{cloze:Text}} {{#c1}} {{Hint1}}\n{{/c1}} {{#c2}} {{Hint2}}\n{{/c2}}","breadcrumbs":"Card Templates » Card Generation » Cloze Templates","id":"158","title":"Cloze Templates"},"159":{"body":"Card Styling Image Resizing Field Styling Audio Replay Buttons Text Direction Other HTML Browser Appearance Platform-Specific CSS Installing Fonts Night Mode Fading and Scrolling Javascript","breadcrumbs":"Card Templates » Styling & HTML » Styling & HTML","id":"159","title":"Styling & HTML"},"16":{"body":"Recent Anki versions come in separate Qt5 and Qt6 variants. The Qt6 version is recommended for most users. Advantages of the Qt6 version: Various bugfixes, including things like better support for less common languages. Very large images load faster than the Qt5 version. Security updates. Support for the Qt5 library was discontinued in Nov 2020, meaning that any security flaws discovered since then will remain unfixed. Some users experience freezes when using a custom shortcut key to switch input languages in Qt5. Disadvantages of the Qt6 version: Some add-ons currently only work with the Qt5 version.","breadcrumbs":"Platform Notes » Windows » Install & Upgrade » Qt5 vs. Qt6","id":"16","title":"Qt5 vs. Qt6"},"160":{"body":"You can watch a video about styling cards on YouTube. The video shows Anki 2.0’s interface, but the concepts are largely the same. The styling section of the Cards screen can be accessed by clicking the \"Styling\" button next to the \"Back Template\" button. In that section, you can change the background color of the card, the default font, the text alignment, and so on. The standard options available to you are: font-family The name of the font to use on the card. If your font has spaces in it like \"MS Unicode\", then you need to surround the font name in double quotes as in this sentence. It is also possible to use multiple fonts on one card; for information on that, please see below. font-size The size of the font in pixels. When changing it, make sure you leave px at the end. text-align Whether the text should be aligned in the center, left, or right. color The color of the text. Simple color names like 'blue', 'lightyellow', and so on will work, or you can use HTML color codes to select arbitrary colors. Please see this webpage for more information. background-color The color of the card background. Any CSS can be placed in the styling section – advanced users may wish to do things like add a background image or gradient, for example. If you’re wondering how to get some particular formatting, please search the web for information about how to do it in CSS, as there is a great deal of documentation available. The styling is shared between all cards, which means that when you make an adjustment it will affect all cards for that note type. It is also possible to specify card-specific styling, however. The following example will use a yellow background on all cards except the first one: .card { background-color: yellow;\n}\n.card1 { background-color: blue;\n}","breadcrumbs":"Card Templates » Styling & HTML » Card Styling","id":"160","title":"Card Styling"},"161":{"body":"Anki shrinks images to fit the screen by default. You can change this by adding the following to the bottom of your styling section (outside of the default .card { ... }): img { max-width: none; max-height: none;\n} AnkiDroid sometimes has trouble scaling images to fit the screen . Setting maximum image dimensions using css should fix this, but seems to be ignored as of AnkiDroid 2.9. A fix is to append !important to each style directive, for example: img { max-width: 300px !important; max-height: 300px !important;\n} If you try to change the style for images and find that the star that appears on marked cards is affected (for instance, it becomes way too large), you can target it with the following: img#star { ...;\n} You can explore the styling of cards interactively by using Chrome: https://addon-docs.ankiweb.net/porting2.0.html#webview-changes Anki 2.1.50+ supports image resizing within the editor natively.","breadcrumbs":"Card Templates » Styling & HTML » Image Resizing","id":"161","title":"Image Resizing"},"162":{"body":"The default styling applies to the whole card. You can also make certain fields or part of the card use a different font, color, and so on. This is particularly important when studying foreign languages, as Anki will sometimes be unable to correctly display characters unless an appropriate font has been chosen. Say you have an “Expression” field, and you want to give it the OSX Thai font “Ayuthaya”. Imagine your template already reads: What is {{Expression}}? {{Notes}} What we need to do is wrap the text we want to style in some HTML. We will put the following in front of the text: ...
Advanced users can override the default type-answer colors with the css classes 'typeGood', 'typeBad' and 'typeMissed'. AnkiMobile supports 'typeGood' and 'typeBad', but not 'typeMissed'. If you wish to override the size of the typing box and don’t want to change the font in the Fields dialog, you can override the default inline style using !important, like so: #typeans { font-size: 50px !important; } It is also possible to type in the answer for cloze deletion cards. To do this, add {{type:cloze:Text}} to both the front and back template, so the back looks something like this: {{cloze:Text}}\n{{type:cloze:Text}}\n{{Extra}} Note that since the cloze type does not use FrontSide, this must be added to both sides on a cloze note type. If there are multiple sections elided, you can separate the answers in the text box with a comma. Type answer boxes will not appear in the \"preview\" dialog in the browser. When you review or look at the preview in the card types window, they will display. Type answer boxes will not be displayed when you review your cards on ankiweb.net .","breadcrumbs":"Card Templates » Field Replacements » Checking Your Answer","id":"149","title":"Checking Your Answer"},"15":{"body":"To install Anki: Download Anki from https://apps.ankiweb.net . See the next section for how to choose between -qt5 and -qt6. Save the installer to your desktop or downloads folder. Double-click on the installer to run it. If you see an error message, please see the installation issues page . Once Anki is installed, double-click on the new star icon on your desktop to start Anki.","breadcrumbs":"Platform Notes » Windows » Install & Upgrade » Installing","id":"15","title":"Installing"},"150":{"body":"Reverse Cards Card Generation & Deletion Selective Card Generation Conditional Replacement Blank Back Sides Adding Empty Notes Cloze Templates","breadcrumbs":"Card Templates » Card Generation » Card Generation","id":"150","title":"Card Generation"},"151":{"body":"You can watch a video about reversing cards on YouTube. If you want to create cards that go in both directions (e.g., both “ookii”→“big” and “big”→“ookii”), you have several options. The simplest is to select the “Basic (and reversed card)” built-in note type. This will generate two cards, one in each direction. If you want to generate reverse cards for only some of your material (perhaps you only want to take the time to study reverses for the most important material, or some of your cards don’t make sense reversed), you can select the “Basic (optional reversed card)” note type. This note type generates a forward-only card when you fill in only the first two fields; if you additionally enter something in the “Add Reverse” field (like a 'y'), Anki will generate a reverse card as well. The contents of this field will never be displayed on a card.","breadcrumbs":"Card Templates » Card Generation » Reverse Cards","id":"151","title":"Reverse Cards"},"152":{"body":"Anki will not create cards with empty front sides. Thus if “My Field” was empty, and one card’s front template included only that field, the card would not be created. When you edit a previously added note, Anki will automatically create extra cards if they were previously blank but no longer are. If your edits have made some cards blank when they previously were not, however, Anki will not delete them immediately, as that could lead to accidental data loss. To remove the empty cards, go to Tools → Empty Cards in the main window. You will be shown a list of empty cards and be given the option to delete them. Because of the way that card generation works, it is not possible to manually delete individual cards, as they would just end up being recreated the next time the note was edited. Instead, you should make the relevant conditional replacement fields empty and then use the Empty Cards option. Anki does not consider special fields or non-field text for the purposes of card generation. Thus if your front template looked like the following, no card would be generated if Country was empty: Where is {{Country}} on the map?","breadcrumbs":"Card Templates » Card Generation » Card Generation & Deletion","id":"152","title":"Card Generation & Deletion"},"153":{"body":"Sometimes you may want to generate extra cards for only some of your material, such as testing your ability to recall the most important words of a set. You can accomplish this by adding an extra field to your note, and adding some text into it (such as \"1\") on the notes you want the extra card. Then in the card template, you can make the card’s creation depend on that field being non-empty. For more information on this, please see the conditional replacement section below.","breadcrumbs":"Card Templates » Card Generation » Selective Card Generation","id":"153","title":"Selective Card Generation"},"154":{"body":"It is possible to include certain text, fields, or HTML on your cards only if a field is empty or not empty. An example: This text is always shown. {{#FieldName}} This text is only shown if FieldName has text in it\n{{/FieldName}} {{^FieldName}} This text is only shown if FieldName is empty\n{{/FieldName}} A real life example is only showing a label if the field is not empty: {{#Tags}} Tags: {{Tags}}\n{{/Tags}} Or say you want to display a specific field in blue on the front of your card if there are extra notes on the back (perhaps the fact that there are notes serves as a reminder that you should spend more time thinking about the answer). You can style the field as follows: {{#Notes}} \n{{/Notes}} {{FieldToFormat}} {{#Notes}} \n{{/Notes}} You can also use conditional replacement to control which cards are generated. This works since Anki will not generate cards which would have a blank front side. For example, consider a card with two fields on the front: {{Expression}}\n{{Notes}} Normally a card would be generated if either the expression or notes field had text in it. If you only wanted a card generated if expression was not empty, then you could change the template to this: {{#Expression}} {{Expression}} {{Notes}}\n{{/Expression}} And if you wanted to require both fields, you could use two conditional replacements: {{#Expression}} {{#Notes}} {{Expression}} {{Notes}} {{/Notes}}\n{{/Expression}} Keep in mind that this only works when you place the conditional replacement code on the front of the card; if you do this on the back, you will simply end up with cards with a blank back side. Similarly, since this works by checking if the front field would be empty, it is important to make sure you wrap the 'entire' front side in the conditional replacement; for instance, the following would not work as expected: {{#Expression}} {{Expression}}\n{{/Expression}}\n{{Notes}}","breadcrumbs":"Card Templates » Card Generation » Conditional Replacement","id":"154","title":"Conditional Replacement"},"155":{"body":"Card generation only looks at the front side of the card. For example, if you have a front template: {{Field 1}} and a back template: {{Field 2}} Then a card will be generated if Field 1 is non-empty. If Field 2 is empty, the card will still be generated, and you will get a blank back side. If you wish to avoid a blank back side, you will need to place a required field on the front template as a conditional, like so: {{#Field 2}} {{Field 1}}\n{{/Field 2}} This will ensure the card is generated only if both Field 2 and Field 1 are non-empty.","breadcrumbs":"Card Templates » Card Generation » Blank Back Sides","id":"155","title":"Blank Back Sides"},"156":{"body":"When you add a new note in Anki, if the card templates and note fields combine to produce no cards, a blank card will be created using the first template. This allows you to add material even if it's incomplete, and modify it or the template later to make it valid. If you don't wish to keep an empty note, you can remove it with the Empty Cards function.","breadcrumbs":"Card Templates » Card Generation » Adding Empty Notes","id":"156","title":"Adding Empty Notes"},"157":{"body":"Please see the cloze deletion section for background info. The cloze note type functions differently from regular note types. Instead of a customizable number of card types, it has a single type which is shared by all cloze deletions on a note. As mentioned in the card generation section above, generation of regular cards depends on one or more fields on the question being non-empty. Cloze deletion note types are generated differently: Anki looks on the front template for one or more cloze replacements, like {{cloze:FieldName}}. It then looks in the FieldName field for all cloze references, like {{c1::text}}. For each separate number, a card will be generated. Because card generation functions differently for cloze deletion cards, {{cloze:…}} tags can not be used with a regular note type - they will only function properly when used with a cloze note type. Conditional generation provides a special field so you can check which card you are rendering. If you wanted to display the \"hint1\" field on the first cloze, and \"hint2\" field on the second cloze for example, you could use the following template: {{cloze:Text}} {{#c1}} {{Hint1}}\n{{/c1}} {{#c2}} {{Hint2}}\n{{/c2}}","breadcrumbs":"Card Templates » Card Generation » Cloze Templates","id":"157","title":"Cloze Templates"},"158":{"body":"Card Styling Image Resizing Field Styling Audio Replay Buttons Text Direction Other HTML Browser Appearance Platform-Specific CSS Installing Fonts Night Mode Fading and Scrolling Javascript","breadcrumbs":"Card Templates » Styling & HTML » Styling & HTML","id":"158","title":"Styling & HTML"},"159":{"body":"You can watch a video about styling cards on YouTube. The video shows Anki 2.0’s interface, but the concepts are largely the same. The styling section of the Cards screen can be accessed by clicking the \"Styling\" button next to the \"Back Template\" button. In that section, you can change the background color of the card, the default font, the text alignment, and so on. The standard options available to you are: font-family The name of the font to use on the card. If your font has spaces in it like \"MS Unicode\", then you need to surround the font name in double quotes as in this sentence. It is also possible to use multiple fonts on one card; for information on that, please see below. font-size The size of the font in pixels. When changing it, make sure you leave px at the end. text-align Whether the text should be aligned in the center, left, or right. color The color of the text. Simple color names like 'blue', 'lightyellow', and so on will work, or you can use HTML color codes to select arbitrary colors. Please see this webpage for more information. background-color The color of the card background. Any CSS can be placed in the styling section – advanced users may wish to do things like add a background image or gradient, for example. If you’re wondering how to get some particular formatting, please search the web for information about how to do it in CSS, as there is a great deal of documentation available. The styling is shared between all cards, which means that when you make an adjustment it will affect all cards for that note type. It is also possible to specify card-specific styling, however. The following example will use a yellow background on all cards except the first one: .card { background-color: yellow;\n}\n.card1 { background-color: blue;\n}","breadcrumbs":"Card Templates » Styling & HTML » Card Styling","id":"159","title":"Card Styling"},"16":{"body":"Recent Anki versions come in separate Qt5 and Qt6 variants. The Qt6 version is recommended for most users. Advantages of the Qt6 version: Various bugfixes, including things like better support for less common languages. Very large images load faster than the Qt5 version. Security updates. Support for the Qt5 library was discontinued in Nov 2020, meaning that any security flaws discovered since then will remain unfixed. Some users experience freezes when using a custom shortcut key to switch input languages in Qt5. Disadvantages of the Qt6 version: Some add-ons currently only work with the Qt5 version.","breadcrumbs":"Platform Notes » Windows » Install & Upgrade » Qt5 vs. Qt6","id":"16","title":"Qt5 vs. Qt6"},"160":{"body":"Anki shrinks images to fit the screen by default. You can change this by adding the following to the bottom of your styling section (outside of the default .card { ... }): img { max-width: none; max-height: none;\n} AnkiDroid sometimes has trouble scaling images to fit the screen . Setting maximum image dimensions using css should fix this, but seems to be ignored as of AnkiDroid 2.9. A fix is to append !important to each style directive, for example: img { max-width: 300px !important; max-height: 300px !important;\n} If you try to change the style for images and find that the star that appears on marked cards is affected (for instance, it becomes way too large), you can target it with the following: img#star { ...;\n} You can explore the styling of cards interactively by using Chrome: https://addon-docs.ankiweb.net/porting2.0.html#webview-changes Anki 2.1.50+ supports image resizing within the editor natively.","breadcrumbs":"Card Templates » Styling & HTML » Image Resizing","id":"160","title":"Image Resizing"},"161":{"body":"The default styling applies to the whole card. You can also make certain fields or part of the card use a different font, color, and so on. This is particularly important when studying foreign languages, as Anki will sometimes be unable to correctly display characters unless an appropriate font has been chosen. Say you have an “Expression” field, and you want to give it the OSX Thai font “Ayuthaya”. Imagine your template already reads: What is {{Expression}}? {{Notes}} What we need to do is wrap the text we want to style in some HTML. We will put the following in front of the text: If you select this checkbox, statistics will be shown for your entire collection. You can also display graphs for arbitrary searches by adding filters in the search box at the top (2.1.28+).
By default, Anki 2.1.28+ will show you statistics for the last 12 months. +
By default, Anki shows you statistics for the last 12 months. You can change this to all history scope or deck life scope at the top. (The "today" section at the top remains of course unaffected by this selection.)
-Older versions of Anki will by default show you statistics for -the previous month. You can change this to a year scope or deck life scope -at the bottom. (Again, the “today” section at the top is unaffected -by this selection.)
Also note that a card cannot be buried and suspended at the same time. Suspending a -buried card will unbury it. Burying a suspended card does not work on Anki -2.1.49+, whereas on earlier versions, it will unsuspend the card.
+buried card will unbury it. Suspended cards can't be buried.Most of the common operations in Anki have keyboard shortcuts. Most of them are discoverable in the interface: menu items list their shortcuts diff --git a/templates/generation.html b/templates/generation.html index 0230f86c..95b2714c 100644 --- a/templates/generation.html +++ b/templates/generation.html @@ -154,7 +154,6 @@
This will ensure the card is generated only if both Field 2 and Field 1 are non-empty.
-The following limitations do not apply to Anki 2.1.28+ and AnkiMobile 2.0.64+.
-Older Anki versions cannot use negated conditionals for card generation. -For example, on Anki 2.1.28, the following would add a card if a field -called AddIfEmpty is empty, and Front is non-empty:
-{{^AddIfEmpty}}
- {{Front}}
-{{/AddIfEmpty}}
-
-On earlier Anki versions, the negated conditional is ignored, and card -generation will depend only on Front being non-empty.
-Mixing AND and OR conditions can also cause problems on older versions. -For example, the following ("add the card if A OR B OR C is non-empty") -is fine:
-{{A}}
-{{B}}
-{{C}}
-
-And the following ("add the card if A AND B AND C are non-empty") is fine:
-{{#A}}
- {{#B}}
- {{#C}}
- {{A}}
- {{/C}}
- {{/B}}
-{{/A}}
-
-But the following ("add the card if A OR (B AND C) are non-empty") will not work properly:
-{{A}}
-{{#B}}
- {{#C}}
- {{B}}
- {{/C}}
-{{/B}}
-
When you add a new note in Anki 2.1.28+ and AnkiMobile 2.0.64+, if the card +
When you add a new note in Anki, if the card templates and note fields combine to produce no cards, a blank card will be created using the first template. This allows you to add material even if it's incomplete, and modify it or the template later to make it valid. If you don't wish to keep an empty note, you can remove it with the Empty Cards function.
-On older Anki versions, Anki refuses to add or import a note if no cards -would be generated.
Please see the cloze deletion section for background info.
The cloze note type functions differently from regular note types. diff --git a/templates/intro.html b/templates/intro.html index 54e22cf3..ea174cab 100644 --- a/templates/intro.html +++ b/templates/intro.html @@ -167,10 +167,7 @@
You can modify card templates by clicking the "Cards..." button inside the editing screen.
-For older Anki versions, on the top left is the front template, on the bottom left is the back -template, and in between them is the card styling section. For Anki versions -2.1.28+ the front, back, and styling are no longer shown at the same time. -You can switch between them with Ctrl+1, Ctrl+2, and Ctrl+3.
+You can switch between Front template, Back template and Styling with Ctrl+1, Ctrl+2, and Ctrl+3.
In Anki, templates are written in HTML, which is the language that web pages are written in. The styling section is CSS, which is the language used for styling web pages.