# AnkiMobile beta testing Source: https://docs.ankiweb.net/ankimobile/beta-testing ## Joining Beta testing is open to existing AnkiMobile users. To join the beta testing program, you must be using the latest version from the app store, and you must be syncing to AnkiWeb. To join, please post a [private ticket](https://anki.tenderapp.com/discussions/private) requesting an invite. If you sync AnkiMobile with a different email address, please include your AnkiWeb ID in the message as well. ## Switching to/from stable Switching between beta versions and stable versions will preserve any cards you have on your device. But just to be safe, please sync any changes you've made to AnkiWeb before switching versions. Once you've received an invite, please accept it and install the TestFlight app from the app store. Using the TestFlight app, you can download the latest beta. As new beta versions are released, you will receive a notification, and can upgrade as you please. If you would like to revert to the store version, you can go to AnkiMobile's app store page and tap on the cloud icon. Once you switch back to the store version, you will receive normal app updates as you did before. If you no longer wish to beta test and do not want to receive further notifications, you can remove yourself using the TestFlight app. If you experience any issues with the betas, please either post a [private ticket](https://anki.tenderapp.com/discussions/private), or post on the [Beta Testing section](https://forums.ankiweb.net/c/anki/beta-testing/13) of the forums. # Collection Transfer Source: https://docs.ankiweb.net/ankimobile/collection-transfer If you don’t have regular internet access, it’s still possible to copy your collection back and forth between devices, though the process is not as convenient. Collection transfer works by importing or exporting **all your decks at once**, in a special file called `collection.colpkg`. You can export that file on one device, copy it to another device, and import it there. When you import a collection file, any existing content you have is replaced with the contents of the file - it is a one-way transfer from your other device. This means that unlike syncing via AnkiWeb, you can’t make changes from two locations at once and then merge them - you need to make sure you’ve imported any recent changes from your other device before you make changes, or you’ll end up losing the changes made on one device. A workflow you would typically use is to export your collection from your mobile device and import it into the computer version, make modifications (such as importing a shared deck you downloaded to your computer), and then export your collection and import it back into your mobile device. ## Computer to iPhone/iPad ### Export the File On your computer: 1. Open the computer version of Anki. 2. Choose **File>Export** from the menu. 3. Click the **Export​** button. Make sure to leave "All decks" and "Include scheduling information" turned on. 4. Anki will automatically create a `collection.colpkg` file on your desktop. If the file is named something else like `deckname.apkg`, please see the previous step again. If it is called `collection.apkg`, that will work - your Anki version is just old. ### Transfer the File If your devices are on the same wifi network and signed in to iCloud, you can use the AirDrop option in Finder to [AirDrop](https://support.apple.com/en-au/HT204144) the `collection.colpkg` file to your mobile device. If you do not have access to AirDrop, you can use [Finder](https://support.apple.com/en-us/HT210598) or [iTunes](http://support.apple.com/kb/HT4094) to drop the .colpkg file into Anki's file sharing area. ### Import the File If you AirDropped the file, AnkiMobile should have automatically popped up and imported the file when you accepted it. If you transferred the file via iOS file sharing, go to AnkiMobile's deck list screen, and then: 1. Tap the **Add/Export** button on the bottom left. 2. Choose **Import from iTunes**, then confirm the replacement. 3. If you receive a message about "No file found to import", please check to make sure you put the `collection.colpkg` file in AnkiMobile's file sharing section. Once complete, the decks on your device will have been replaced with the decks from your desktop. When you import a `collection.colpkg` file, Anki will avoid copying any sounds or images if they already exist on your mobile device, and are the same file size. This will make imports after the first one considerably faster if you have a lot of media files. ## iPhone/iPad to Computer On AnkiMobile, tap the **Add/Export** button on the bottom left of the decks list. ### AirDrop 1. Choose **Export to Share**, and then choose **AirDrop**. 2. Select your computer. If your computer doesn't appear, make sure you have AirDrop open on your computer. 3. Once the file has arrived on your computer, use **File>Import** inside Anki to import the file. ### Finder/iTunes 1. Choose **Export to iTunes**, and tap **Export**. Then on your computer: 1. Connect your Apple device to your computer via the USB cable. 2. Open Finder or iTunes. 3. Locate Anki’s file sharing section with [Apple’s instructions](http://support.apple.com/kb/HT4094). 4. Drag the `collection.colpkg` file from Finder or iTunes to your desktop. 5. Use File>Import in Anki to import the file. 6. After importing, you can delete the file on your desktop if you wish. # Custom Fonts Source: https://docs.ankiweb.net/ankimobile/custom-fonts AnkiMobile allows you to use non-system fonts on your cards. To set them up, the desktop client is required. Please see [the section in the desktop manual](/manual/templates/styling#installing-fonts) for more information. Please note that AnkiMobile has to load the entire font into memory in order to use it, and fonts for Asian languages can be quite large. If you have an older device and notice AnkiMobile crashing frequently after installing a font, you may have exceeded your device’s memory limits. We have had reports from one user that no more than 3 fonts could be embedded - this may be a limitation imposed by the system web libraries. If you need access to lots of fonts, you may want to look at installing the fonts into iOS instead. # The Deck List Source: https://docs.ankiweb.net/ankimobile/deck-list The deck list is the screen you see when you start AnkiMobile. It displays a list of your card decks, and provides buttons for performing various actions. Next to each deck, two numbers are displayed. The top, green number corresponds to how many cards are due to be reviewed again today. On a deck you’ve never studied before, there won’t be any cards waiting for review. The second, blue number, corresponds to how many new cards you have to learn today. Anki will introduce 20 new cards a day by default, and you can customize this number in the deck options if you’d like. To study cards in a deck, simply tap on the deck, and AnkiMobile will switch to study mode. If you wish to export, rename, or delete a deck, swipe your finger from right to left over it, and buttons will appear. At the top of the screen, you’ll see four buttons. * The question mark opens this help page * The graph icon opens the deck statistics screen. * The magnifying glass opens the card browser. * The gear/cog opens the preferences screen. On the bottom of the screen, there are two more buttons. * **Add/Export** allows you to download shared decks, add/create an empty deck, import `.apkg` files from iTunes, and export your entire collection. * To import an `.apkg` or [properly formatted](/manual/importing/text-files) plain-text `.csv`/`.tsv` file that you have saved on your device, tap on the file in your file manager and open it in AnkiMobile. * **Synchronize** synchronizes your cards with the cloud. * The synchronize button will change color if you have made changes that need to be synchronized to AnkiWeb, or if changes are waiting on AnkiWeb that need to be synchronized to the device. One of the changes that Anki synchronizes to other clients is the current deck, so tapping on a deck will change the button color, even if you do not study any cards. # Adding & Editing Source: https://docs.ankiweb.net/ankimobile/editing ## Adding To add cards to a deck, tap the "Add" button while reviewing. The "Type" button at the top allows you to select the type of note you’d like to add. For more information about note types, please see the introduction in the [computer version’s manual](/manual/getting-started#note-types). When you tap on a field, a keyboard will come up, allowing you to type in information. You can use the next and previous buttons to move between fields. The toolbar has the following icons: **B I U**\ Mark the text as bold, italics or underline. **Fx**\ Remove formatting. **Paintbrush**\ Sets the text color. **Paperclip/Camera**\ Allows you to add media files from the camera, microphone, photo library or from a file. On iPads, the mic button is shown separately. **Pen**\ Only available on iPads. Allows you to draw an image and attach it to the card. You can later edit a drawn image by holding two fingers on it. **Square root**\ Shortcuts to subscript/superscript, and [MathJax](./mathjax). **Eye**\ Shows a preview of how the card will appear when reviewed. **\**\ Reveals the underlying HTML that fields are comprised of. When you’ve typed in the content of a note, hit the save button to add it to your collection. ## Editing To edit a note, tap the "Edit" button while reviewing. The edit screen is similar to the adding screen mentioned above, with some key differences: * There is no note type selection button or deck selection button. If you want to change the type of an existing note, go to the "Browse" screen, tap the checkmark button at the upper right corner, select the card, then use Actions->Change Notetype. * There is a "Tools" button at the top of the screen. Tapping on it will allow you to perform actions on the current card or note. Please see the [action descriptions](./study-tools#actions) for more information on what each action does. ## Browsing You can search or browse your deck by tapping the "Browse" button while reviewing. The browse screen will show all the cards in the current deck by default. You can type text into the search box in order to limit the cards further. If you only wanted to show cards in the current deck that contain the text "hello" for example, you’d modify the text so it says `deck:current hello` and then tap return. If you wish to search across multiple decks, you can remove the `deck:current` part. AnkiMobile supports all the search strings that the desktop version of Anki does, allowing you to perform quite complex searches. Some examples: `tag:marked` show cards that with the tag "marked" `is:due` show only cards that are waiting for review `front:rabbit` show only cards where the front field is exactly "rabbit" For a full list of the possibilities, please see the section in the [desktop manual](/manual/searching). Tapping the Filter button will reveal a list of filters you can apply, like the side bar in the computer version. Tapping on a line will replace the current search; you can also swipe on a line to add to the existing search instead. The Options button will allow you to change what is shown in the left and right columns, and change the order cards are shown in. The Select button allows you to select multiple cards at once, and then perform actions on them like changing their deck, or suspending them. # User Interface Language Source: https://docs.ankiweb.net/ankimobile/interface-language AnkiMobile's interface has been translated into a few different languages. Your iOS settings control which language AnkiMobile will appear in. ## Wrong Language If AnkiMobile is not appearing in your desired language, please go to the **iOS Settings app > General > Language & Region**. In that section, you can specify the languages you prefer. If you want English to be used in AnkiMobile, please ensure English is listed above the language you don't want to see. If your native language is not English, you can put your native language first. You can see the list of available languages on AnkiMobile's app store page. ## App-specific settings You can also control the language on a per-app basis. For example, if you want all apps on your device to appear in Chinese, but want Anki to show in English, you can do this by going to the Settings app. 1. Go to the **iOS Settings app > General > Language & Region**. 2. If only one language is shown in the **Preferred Language Order** section, add the other language you wish to use as the second preference. If you have two or more languages shown already, you can skip this step. 3. Go back to the first screen of the iOS Settings app. 4. Scroll down to the list of apps at the bottom, and locate Anki. 5. Tap on Anki, and choose the language you wish to use. Some users have reported that AnkiMobile did not appear in the iOS Settings screen until they went into AnkiMobile's **Preferences > Review > Notifications** section and enabled notifications. ## New Translations If you would like to help translate AnkiMobile into another language, please see the [translation guide](/translators) # Introduction Source: https://docs.ankiweb.net/ankimobile/intro Thank you for buying AnkiMobile! Anki development would not be able to continue without your support, so it is greatly appreciated. Some basic concepts covered in the [computer manual](/manual/intro) are not repeated here, so please check it out if you have not already done so. ## Legal **Privacy** No data you store in AnkiMobile is shared with us or other Anki users by default. If you use the optional synchronization feature, please see [AnkiWeb’s privacy policy](https://ankiweb.net/account/privacy). **Trademarks** Anki and designs are trademarks of Anki Software, LLC. Apple, the Apple logo, iPhone, iPad and iPod Touch are trademarks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc. # MathJax Source: https://docs.ankiweb.net/ankimobile/mathjax MathJax allows you to easily add mathematical equations to your cards. AnkiMobile supports MathJax out of the box. Simply place something like the following on your card: ```text theme={null} This is some text \(x^2\) with an inline equation. An equation block: \[\sqrt{-1}\] ``` More information is available in the [computer manual](/manual/math#mathjax). # More Features Source: https://docs.ankiweb.net/ankimobile/more ## Javascript The [warnings](/manual/templates/styling#javascript) that apply to the computer version also apply to AnkiMobile. In addition to the above, another thing to be aware of in AnkiMobile is that your code also needs to play nicely with AnkiMobile’s tap detection. Taps on A/BUTTON elements, or elements that have an onclick handler should work as you expect. If you have other elements that must receive tap events, give them the class 'tappable' to tell AnkiMobile 2.0.39 or later that it should pass taps through to the element. ## Play Buttons To change the styling of the audio replay buttons, please see [Audio Replay Buttons](/manual/templates/styling#audio-replay-buttons). ## Image Resizing When you attach an image from the photo gallery it is automatically resized to have a maximum length of 1024 along its longest edge. Recent Anki versions allow you to customize this limit in the **Preferences > General** screen, and control whether the limit should also be applied to images pasted from the clipboard. # Night Mode Styling Source: https://docs.ankiweb.net/ankimobile/night-mode By using the Edit Card Template action, it is possible to customize how cards appear when night mode/dark mode is enabled. If you wanted a grey background instead of black, you could use something like: ```css theme={null} .card.nightMode { background-color: #555; } ``` If you have a 'myclass' style, the following would show the text in yellow when night mode is enabled: ```css theme={null} .nightMode .myclass { color: yellow; } ``` # Preferences Source: https://docs.ankiweb.net/ankimobile/preferences The preferences screen can be accessed by tapping on the gear icon at the top right of the deck list. It allows you to customize various application settings and how AnkiMobile appears. The Preferences screen is divided up into different sections, which are covered below. ## Syncing The syncing screen allows you to customize [cloud synchronization](./syncing) with AnkiWeb. **Sync Sounds & Images**\ By default, AnkiMobile will sync sounds and images as well as your cards and review history. If you disable this option, sounds and images will not be synced by AnkiMobile. **One-Way Sync**\ The One-Way Sync button allows you to force a full upload or download of your collection. This is useful if you accidentally deleted some cards and want to revert to the local or remote version, instead of having those deletions propagate to other devices. After tapping the button and confirming, the Synchronize button on the deck list will turn red. The next time you sync you’ll be given a choice of whether you want to upload your collection or download it from AnkiWeb. Please note this option only affects how cards, notes and review history are transferred - it does not change how sounds and images are synced. ## Review The review screen allows you to customize how AnkiMobile behaves when you’re reviewing cards. **Feedback Ticks**\ Flash a tick or cross in the top right to confirm your answer choice. **Tools Overlay Button**\ Show the gear/cog icon on the study screen. If you prefer not to see it, you can assign the tools action to the top bar instead. **Tools Overlay Position**\ Allows you to put the tools button on the left. **Audio Buttons**\ Allows you to hide the play button that appears for each audio file you’ve placed on the card. Useful if you’d rather replay audio via the "Replay Audio" action bound to a swipe or tap. **Always Duck + Ignore Mute**\ When enabled, AnkiMobile will quieten any music you have playing in the background, and will automatically play audio even when the mute/vibrate/silent switch is turned on. **Answer Keeps Zoom**\ By default, if you have zoomed in on a card, the screen will zoom out when you reveal the answer. If you enable this option, AnkiMobile will not zoom out. **Never Type Answer**\ If you have set up your cards to ask you to type in the answer (as explained in [this section](/manual/templates/intro) of the desktop manual), AnkiMobile will display a keyboard on such cards and allow you to check your answer. If you find typing on a mobile device inconvenient, you can use this option to disable the keyboard for all cards. **Shake Action**\ Allows you to customize what happens when you shake your device. The default action is to undo the previous answer. **Double Tap Prevention**\ This option ignores a second tap when two taps are made in quick succession, so that you don’t accidentally reveal the answer or advance to the next card. If you review your cards very quickly, you may wish to select a shorter detection time. ### Scheduling These options affect the way Anki schedules cards in all decks. **Day Starts**\ Controls when a new day starts and new cards become available. Default is 04:00, which means new cards become available at 4AM. **Learn Ahead Minutes**\ The number of minutes to look ahead when the only cards remaining to review with a next repetition time in the future. The default is 20 minutes, which means cards due to show in 10 minutes will be shown immediately if nothing else is available to show. ### Notifications When enabled, Anki will display an alert at the selected time of day, reminding you to study and telling you how many reviews are waiting. ### Top Bar You can assign frequently used actions to the top bar for convenient access. For an explanation of the available actions, please see the [actions list](./study-tools#actions). ### Bottom Bar **Show Bottom Bar**\ Hides or shows the bottom area that shows the answer buttons and card counts. **Remaining Count**\ Whether to show the card counts when the question side of a card is being shown. **Answer Buttons**\ Whether to show the answer buttons on the answer side of a card. **Next Times**\ Whether to show the next study time above each of the answer buttons. ### Taps When you’re reviewing, you can tap on different parts of a card in order to trigger different actions. Anki divides the screen into 9 sections: Each section can have a different action assigned to it if you wish, and the taps when the question is shown are also different from the taps when the answer is shown. By default, AnkiMobile responds as follows when the question in shown: In other words, tapping anywhere on the screen will show the answer. When the answer is shown, by default AnkiMobile responds as follows: This allows you to tap on the left side of the screen to trigger the red button, and the right side of the screen to trigger the green button. Taps near the middle of the screen will be ignored. You can assign frequently used actions to taps for convenient access. For an explanation of the available actions, please see the [actions list](./study-tools#actions). ### Swipes You can also swipe up, down, left or right across a card to trigger an action. To ensure swipes don’t interfere with your ability to scroll on a large card or select text, a vertical swipe must begin from the far left or right side of the screen. Begin by placing your finger on the left or right side of the screen, and then move it up or down to trigger the relevant swipe. Horizontal swipes can be begun from any point on the screen. With the default settings: * Swiping left displays the tools window * Swiping right returns to the deck list You can assign frequently used actions to swipes for convenient access. For an explanation of the available actions, please see the [actions list](./study-tools#actions). ### Scratchpad **Ignore Fingers**\ When enabled, the scratchpad will only respond to the Apple Pencil. **Undo Clears All**\ Reverses the behaviour of the undo button, so a quick tap clears everything, and a long press clears the last stroke. **Scratchpad Below Buttons**\ Whether the scratchpad should be placed above or below the bottom bar. ### Gamepads From AnkiMobile 2.0.53+, you can control the study screen with a game controller. The controller must be supported by iOS, and must provide an [extended controller profile](https://developer.apple.com/documentation/gamecontroller/gcextendedgamepad). Controllers with fewer buttons can not currently be used. For more information on setup, please see [this page](https://support.apple.com/en-au/HT210414). The gamepads section of the preferences allows you to configure which actions are triggered when each button is pressed. You can assign an action to each direction on the d-pad, but the analog thumbpads can not be customized - they will always scroll the card up or down. ## General ## Theme The theme screen allows you to customize the bar colours AnkiMobile uses. The available options will depend on whether night mode or iOS 13’s dark mode is enabled. To customize the appearance of your cards, you’ll need to alter your card templates. You can do this using the Card Template action in the tools screen, or by using the computer version. For more info, please see [http://www.youtube.com/watch?v=F1j1Zx0mXME\&yt:cc=on](http://www.youtube.com/watch?v=F1j1Zx0mXME\&yt:cc=on) ## Profiles Profiles allow multiple users to study with the same device. You can add profiles from the settings screen. To rename or remove a profile, swipe to the left on it. Each profile needs to be synced with its own AnkiWeb account. Please be careful not to sync two profiles with the same AnkiWeb ID, as this could lead to data loss. ## Backups AnkiMobile will automatically create backups of your collection for you. The backups include all your cards and statistics, but do not include sounds or images, since they take up a lot of space. To restore from a backup, open the Backups section in the preferences, and tap on the backup you wish to restore to. If you’re unable to get AnkiMobile to start due to a serious error, you can still retrieve the backups from the iTunes file sharing area: 1. Connect your Apple device to your computer via the USB cable. 2. Open iTunes if it doesn’t open automatically. 3. Locate Anki’s file sharing section with [Apple’s instructions](http://support.apple.com/kb/HT4094). 4. Drag the your backup folder from iTunes to your desktop. 5. With the computer version of Anki, create a new, empty profile via File>Switch Profile, and then File>Import the latest backup colpkg from within that profile to confirm that it’s ok. If it is corrupt, you can try a previous backup. You'll need Anki 2.1.50+ to open the backups. ## Check Database This will check your collection for a number of possible errors and fix them if possible. It also will remove any tags that are no longer used by any cards. ## Check Media This scans all your notes for references to sounds and images, and then checks to make sure that the sounds and images are available. It will display a report letting you know of any sounds or images that are missing, and any sounds or images that are not used by any cards. If you tap the delete button, the unused sounds or images will be deleted. # Installing AnkiMobile on multiple devices Source: https://docs.ankiweb.net/ankimobile/reinstalling Once purchased, you can use AnkiMobile on multiple devices you own without having to pay again. To do so, make sure the device is using the same Apple ID as you made the original purchase with, or is enrolled in [family sharing](https://support.apple.com/en-au/HT201060). * Open the App Store on the device you want to install AnkiMobile on. * Tap on your profile icon in the top right * Tap on Purchased * If you have family sharing enabled, tap on the person who bought the app originally. * When you've located AnkiMobile, tap on the cloud icon to download it. ## Account troubles Apple do not provide us with any access to their systems, so we do not have the ability to help you recover an old account, or confirm a previous purchase you have made. If you have any trouble with the purchase or download process, please give Apple a call: [http://support.apple.com](http://support.apple.com) # Shared Decks Source: https://docs.ankiweb.net/ankimobile/shared-decks ## From AnkiWeb To download a shared deck directly to your mobile device: 1. Ensure you’re connected to the internet. 2. Tap **Add/Export** on the bottom left. 3. Choose **Shared Deck List**. AnkiWeb will open. 4. Select a category, or type in a search. 5. Tap on a deck you’d like to study. 6. Scroll down and tap **Download**. 7. Safari will start downloading the file. 8. When it’s done, tap on the blue download arrow in Safari, then **Downloads**. 9. Tap on the file, and **Open in Anki** if prompted. 10. When the import completes, your deck should be ready to study. ## Other Sources If you've downloaded a shared deck from another website, or received it in an email or messaging app: 1. Tap on the file. 2. Locate the "Open In" or "Share" icon, and select AnkiMobile from the available options. # The Study Screen Source: https://docs.ankiweb.net/ankimobile/study-screen If you have not used Anki on a computer before, please have a look at the first [intro video](/manual/getting-started#videos) before reading on, as it explains the basic review process. When you tap on a deck in the deck list, the study screen will load, and if any cards are waiting to be studied, a card’s question will be shown to you. If you wish to change to a different deck, you can do so by tapping the top left button. The next three buttons allow you to add cards, edit the current card, and search/browse all cards. The gear/cog in the bottom right will open up the [tools screen](./study-tools). On the bottom of the screen you’ll see three numbers. From the left, these correspond to new cards, learning cards, and cards to review. These are explained in more detail in the intro videos for the desktop program, so please [check them out](/manual/getting-started#videos) if you haven’t already. When you’ve looked at a card’s question and remembered the answer, or decided you don’t know it, tap anywhere in the card area in order to show the answer. When you do, the bottom area will change to display 2-4 answer buttons, depending on how you’ve answered the card previously. The buttons will display the time a card will next be shown, so 10m means "10 minutes" and "5d" means "5 days". You can tap directly on these buttons to choose a particular answer. To make reviewing faster, you can also tap on the card in order to answer it. For more information on the available taps and how to customize them, please see the [taps](./preferences#taps) section. If you are studying content for which it is useful to sketch something before showing the answer on the card (e.g., characters in a foreign language), AnkiMobile provides a feature called the 'scratchpad' (the analogous feature is called the 'whiteboard' in AnkiDroid). You can enable the scratchpad by tapping on the tools button, then "Scratchpad". When you’ve finished the cards that are due to be studied today, you’ll be shown a congratulations message. If you have other decks, you can tap the top left button to return to the decks list and select a different one. You can tap the home button to close Anki and save your progress at any time, whether you have completed the day’s reviews or not. If you have a bluetooth keyboard, you can use the keyboard to review. Space will show the answer or answer Good, and 1-4 will choose the answer buttons. You can also press 'r' to repeat the audio on the current card. # Study Tools Source: https://docs.ankiweb.net/ankimobile/study-tools The tools screen will open when you tap on the gear/cog icon in the study screen. On the top right, there are buttons that will adjust the text size on your cards. The "Frequent Actions" section contains some commonly used actions. You can rearrange the actions there or remove actions by holding your finger on a button for a second or so. Below the "Frequent Actions" section is a list of all available actions in AnkiMobile. You can add these actions to the "Frequent Actions" section by long-pressing on them. ## Actions The following actions can be run from the tools screen, or by assigning them to a tap, swipe, or the top bar in the preferences. **Add**\ Opens a new window to add cards to the deck. **Answer "Again"**\ When the answer screen is shown, choose the red button, indicating you wish to review the card again soon. This is useful when you forgot a card or wish to review it more frequently. **Answer "Hard"**\ When the answer screen is shown and there are four buttons, choose the second button from the left, indicating you found the card hard to remember. **Answer "Good"**\ When the answer screen is shown, choose the green button. This is the button you should end up using the most. **Answer "Easy"**\ When the answer screen is shown, choose the button on the right, indicating you found the card too easy to remember and would like a much longer delay. **Auto Advance**\ Allows you to automatically reveal the answer, and automatically rate or bury cards. You can customize the behaviour in the deck's study options. **Bottom Bar**\ Hides or shows the bottom bar, where the answer buttons and card counts are shown. **Browse**\ Opens the card browser, where you can search for and modify cards. **Bury Card**\ Hides the current card from review. It will be shown again the next day, or when you manually unbury cards. **Bury Note**\ Hides the current note from review. It will be shown again the next day, or when you manually unbury cards. **Card Info**\ Shows information about the current card. **Card Template**\ Allows you to edit the card template, changing which fields are shown on the front and back of the card, and the card styling. **Current Audio +5s**\ Jump forward 5 seconds in the currently playing audio. **Current Audio -5s**\ Jump backward 5 seconds in the currently playing audio. **Custom Study**\ Allows you to study outside of the normal schedule. Please see the documentation of the computer version for more information on custom study presets. **Deck Statistics**\ Shows graphs and statistics about your deck or collection. **Decks**\ Returns to the deck list. **Delete Note**\ Deletes the currently shown note and all of its cards. If you’re not studying in multiple directions, this will just delete a single card. **Edit**\ Edits the current card. **Empty**\ Removes all cards from the current filtered deck. **Filter/Cram**\ Allows you to create a temporary deck based on search criteria such as "tag:hard". Please see the documentation of the computer version for more information on filtered decks. **Flag 1 - 4**\ Sets or clears the card’s flag. Flagging cards allows you to find them easily in the browse screen later. **Mark**\ Adds a tag called "Marked" to the current note, so it can be easily found in a search. **Mark & Bury**\ Marks the card, then buries it. **Mark & Suspend**\ Marks the card, then suspends it. **Night Mode**\ Switch the interface between light and dark mode, if you don't want to use the system setting. **Off**\ Don’t do anything. Useful if you want to disable certain swipes, tap zones and so on. Not shown in the tools screen. **Pause Audio**\ Temporarily stops or restarts the currently playing audio file. **Rebuild**\ When in a filtered or custom study deck, rerun the search to fetch any cards that may newly match the criteria. **Record Voice**\ Allows you to create a temporary recording of your voice, to compare it to audio that you have on your card. **Replay Audio**\ Replay the card’s audio. You can customize whether the audio in the question is replayed while the answer is shown in the computer Anki. **Reset Card**\ Turn the current card back into a new card. **Scratchpad**\ Show or hide the writing pad, allowing you to practice writing characters during review. Anki will remember the on/off state for each card type. You can tap once on the undo button to undo a stroke, or hold on it for a second to clear all strokes. On devices that support pressure sensitivity (iPhone 6S, iPad w/ Apple Pencil), the stroke width will depend on how hard you press. **Scratchpad Size**\ Alters the size of the scratchpad window. **Scroll Up**\ **Scroll Down**\ When card content is larger than one screen, scrolls up or down. Useful when using a gamepad without an analog control stick. **Set Due Date**\ Make the card a review card if it is not already one, and make it due in the number of days you specify. If you choose 0 days, the card will be ready to review immediately. **Show Answer**\ Reveals the answer when a card’s question is shown. **Study Options**\ Show the study options screen. **Suspend Card**\ Prevent current card from being shown during review until you unsuspend it via the search action. **Suspend Note**\ Prevent all cards of current note from being shown during review until you unsuspend them via the search action. **Top bar**\ Show or hide the bar at the top of the screen. **Tools**\ Show the tools screen. **Unbury Deck**\ Makes any buried cards in the current deck ready for review again. **Undo**\ Undoes the last review. **User Action 1-8** From 2.0.88+. An advanced feature that allows you to trigger JavaScript in the review screen. Please note we can not provide any assistance with using this feature, as it uses [JavaScript](/manual/templates/styling#javascript). Some shared decks provide keyboard shortcuts to perform actions like revealing a hint, or revealing the next cloze deletion. If that action is available as a public function, you can tell AnkiMobile to call it when a user action is triggered. This makes it possible to trigger the action with your gamepad instead. To define a user action, you must know the function the card template provides. If you know it provides a `revealNext()` function for example, you can tell AnkiMobile to call it with the following code: ``` var userJs1 = revealNext; ``` The author of the shared deck or template may be able to tell you if a function is available. Please note that standard Anki templates do not provide any actions - this feature is only useful for triggering actions you have written yourself, and ones that certain shared decks/templates provide. # Study Options The study options can be accessed from the tools screen. Almost all the options available in the computer version can also be adjusted in AnkiMobile. For a description of what everything does, please see the [computer documentation](/manual/deck-options). While some of the options have different wording, the behaviour is the same as the computer version. # Support Source: https://docs.ankiweb.net/ankimobile/support There are two ways to get help with AnkiMobile. Both are regularly checked by Anki's developer, so there's no need to post the same question on both sites. * There is a [public user forum](https://forums.ankiweb.net/c/ankimobile/help/10). This is a better choice for most questions, as other members of the community may be able to answer you faster. * There is also a [private helpdesk](https://anki.tenderapp.com/discussions/private) for AnkiMobile. Messages posted here will not be visible to other users. If your question is about the computer version of Anki or AnkiWeb, please use the [user forums](https://forums.ankiweb.net) instead. # Cloud Sync Source: https://docs.ankiweb.net/ankimobile/syncing Anki has a free cloud synchronization service called AnkiWeb that makes it easy to keep your card decks in sync between mobile devices and your computer. If you are an existing Anki user with cards on your computer, syncing is the easiest way to start using those cards on your mobile device as well. ## Intro Videos Please check out these short videos that explain syncing: * [Initial Setup](https://www.youtube.com/watch?v=YkiM4DPzSVc\&list=PLGgmaKOIHykFoomqkBJAyGiDQ2kyiuTao) * [Syncing Sounds and Images](https://www.youtube.com/watch?v=phP9GGG-PxY\&list=PLGgmaKOIHykFoomqkBJAyGiDQ2kyiuTao\&index=2) * [One-Way Syncs](https://www.youtube.com/watch?v=UEAcpfMQnjo\&list=PLGgmaKOIHykFoomqkBJAyGiDQ2kyiuTao\&index=3) If you'd prefer not to watch videos, please read on. ## Creating an Account To sync with AnkiWeb, you’ll first need to create an account. If you have used AnkiWeb in the past, you can skip this step. 1. Visit [https://ankiweb.net](https://ankiweb.net) and click the **Sign Up** button. 2. Type in your email address and a password of your choice. ## Computer to iPhone/iPad If you have decks on your computer and would like them to be synced to AnkiMobile: 1. Open the computer version and click the sync button at the top right of the Anki window. 2. If prompted to upload or download, choose 'upload' to send your cards to AnkiWeb. Please make sure you [wait for media files to finish syncing](/faqs/media-files-may-take-time-to-sync). 3. Tap Synchronize in AnkiMobile and then 'download' to grab the cards from AnkiWeb. Please make sure you [wait for media files to finish syncing](/faqs/media-files-may-take-time-to-sync). ## iPhone/iPad to Computer If you have decks in your phone/iPad and would like them to be synced to the computer version: 1. Tap Synchronize in AnkiMobile and then 'upload' to send the cards to AnkiWeb. 2. Open the computer version and click the sync button at the top right of the Anki window. 3. If prompted to upload or download, choose 'download' to grab your cards from AnkiWeb. ## Subsequent Syncs If you have a lot of sounds or images on your cards, the first sync may take some time, and until it completes, [sounds and images may fail to appear](/faqs/media-files-may-take-time-to-sync). After the first synchronization has completed, you can click the synchronize button again any time you wish to synchronize your changes to the cloud. Only changes made since the previous sync will be sent, so subsequent syncs are a lot faster. If you add some new cards on the desktop computer and want to sync them to AnkiMobile, you’d repeat the same process: sync on desktop (or close the program, as it syncs automatically on close by default), and then tap the sync button on AnkiMobile. The sync button will change colour when a normal or full sync is required. ## Missing Images If you receive a message about an image being missing, the most common cause is because [media has not finished syncing yet](/faqs/media-files-may-take-time-to-sync). Please follow the steps on that page to confirm that all of your Anki clients have finished syncing media. Remember that if you've added images on your computer, you'll need to confirm the computer has finished syncing first, and then check AnkiMobile. If you have confirmed media has finished syncing, but still receive a message about a missing image, then it is possible that the author of the shared deck you are using has accidentally or deliberately failed to include one or more images. If you're able to contact the deck author, it may be worth notifying them of the issue, as they may be able to provide you with the missing image in a deck update. If you're unable to reach them, and want to make the warning go away, please read on. If you open the Edit screen and see a broken image icon, one of the images on that card is missing. You can delete the image icon to make the warning go away. If you see a warning about the same image name on every card, it means that the deck author has added an image to the "Card Template", which is shared by multiple cards. You can make the message go away by tapping on the gear/cog in the bottom right of the review screen, then scrolling down to "Card Template". In the screen that follows, search for the image name in both the Front and Back of the card - it will look something like ``. Remove the text starting with ``, and it should resolve the problem. # Text to Speech Source: https://docs.ankiweb.net/ankimobile/tts AnkiMobile 2.0.56+ supports using TTS tags in card templates. Please see [the computer manual](/manual/templates/fields#text-to-speech-for-individual-fields) for more information. To get the best quality sound, please go to the iOS Settings app, then: * Tap on Accessibility * Tap on VoiceOver * Tap on Speech * Tap on Voice * Tap on the voice you want to use * If there is an (Enhanced) version available, download it. Please note that Apple limit Siri to their own apps, so you will need to pick a voice other than Siri. The Voice section will only show options for your current language. To add voices for other languages, tap on "Rotor Languages", and after selecting another language, you will have a chance to download voices. Like regular audio, text to speech will not play automatically when your device’s mute/vibrate switch is enabled. # URL Schemes Source: https://docs.ankiweb.net/ankimobile/url-schemes AnkiMobile supports URL schemes for opening third party dictionaries, and for adding content to AnkiMobile from other applications. ## AnkiMobile’s URL Schemes ### Adding Notes A 'URL Scheme' is like a link to a website, but it instead links to an app. A simple example is: ```text theme={null} anki:// ``` If you type this into Safari on your device, you’ll see AnkiMobile open up. From 2.0.30 onwards, AnkiMobile provides a scheme for adding new notes to your collection. This can be used with dictionary apps that support calling other apps via URL schemes, and with automation apps like [Shortcuts](https://support.apple.com/guide/shortcuts/welcome/ios). The scheme to add cards looks like this: ```text theme={null} anki://x-callback-url/addnote?profile=User%201&type=Basic&deck=Default&fldFront=front%20text&fldBack=back%20text ``` The first part must always be there: ```text theme={null} anki://x-callback-url/addnote? ``` After the first part, keys and values are separated by an ampersand. The following keys must always be provided: * `type=` * `deck=` * Separate nested decks with `::` ```text theme={null} - `deck=::` ``` Fields are entered by prefixing their name with "fld". So if your first field is called "Text", the key would be "fldText". The field text is interpreted as HTML, so if you wanted a newline in the text you’d use something like "line 1\
line 2". Special characters in the URL must be escaped. For example, if you have spaces in a field, they must be represented with `%20`. If you’re using the Shortcuts app, there is a URL encode action which you may find useful. The remaining keys are optional: * `profile=` If provided, adding will fail if the provided profile is not currently active. * `tags=` * `dupes=1` - if provided, allow a note to be added even if the same content is on an existing note. * `x-success=` - use to automatically return to another app after the note is added. If a field you provide is a link to an image or audio file, AnkiMobile will automatically download that media and place a link to it in the field. Eg: ```text theme={null} fldFront=http://example.com/image.jpg ``` The link will only be downloaded if it ends with a recognized file extension. If your link is to a dynamic webpage, you can add a fake argument with the extension at the end, eg `http://example.com/getImage?imgID=1234&fakePath=foo.jpg`. Be careful to escape the URL before including it in the URL scheme, as otherwise ? and & characters will be interpreted as part of the URL scheme instead of the URL. ### Info for Adding There is a separate URL scheme that third-party apps can use to get your profile, deck and notetype names, so that they can be presented to you in a friendly manner. The app should invoke the following URL: `anki://x-callback-url/infoForAdding?x-success=...` If the user authorises the request, the requested data will be available on the clipboard, and can be retrieved using the following. You should clear the clipboard after retrieving the data. ```swift theme={null} let PASTEBOARD_TYPE = "net.ankimobile.json" if let data = UIPasteboard.general.data(forPasteboardType: PASTEBOARD_TYPE) { // clear clipboard UIPasteboard.general.setData(Data(), forPasteboardType: PASTEBOARD_TYPE) // ... handle json } ``` ### Search From AnkiMobile 2.0.90+. Allows you to open the search string with the provided search. `anki://x-callback-url/search?query=...` ### Sync From AnkiMobile 2.0.90+. Performs the same action as tapping on the Sync button. `anki://x-callback-url/sync` ## Dictionary Links The desktop version of Anki provides the ability to open a web page based on the contents of a field, for easily creating a link to an online dictionary site. This is documented [in this section](/manual/templates/fields#dictionary-links) of the manual, though please start from the [cards & templates](/manual/templates/intro) section as the above link assumes you have read it. Like the desktop, AnkiMobile supports links to dictionary websites. In addition to that, you can also link to different dictionary apps that you have installed on your device using a URL scheme. Some dictionary apps provide a URL scheme that allows you to provide a particular phrase to search for. For example, an app called iDict+ allows the following type of URL: ```text theme={null} idictplus://?search=mysearchtext ``` If you have iDict+ installed and type that into Safari, iDict+ should open up and immediately search for "mysearchtext". iDict+ also supports passing a return link. We can replace the above with: ```text theme={null} idictplus://?search=txt&scheme=anki:// ``` If you type that into Safari, it will search for "mysearchtext" like before, but will also provide a "return" button that when pressed will open up Anki. By taking that text and combining it with the instructions for the desktop version linked above, it’s possible to have a link on your cards that searches for a word in another app, and then allows you to return to Anki when you’re done. Unfortunately, there is no standard for URL schemes: some apps implement them, some don’t, and the way they implement them can different. For example, in the app called "Kotoba!", the URL scheme is: ```text theme={null} kotoba://dictionary?word=mysearchtext ``` Note how not only the app name differs but also the text after it, and how Kotoba! doesn’t provide the ability to automatically return to the app that opened it, meaning that you need to double tap the home button and manually return to AnkiMobile. Some dictionary apps publish their URL scheme in their documentation. If you’re using a dictionary app that doesn’t, please contact the authors and ask them for more information. # A deck I want has disappeared from AnkiWeb Source: https://docs.ankiweb.net/faqs/a-deck-i-want-has-disappeared-from-ankiweb The shared decks on AnkiWeb are provided by other Anki users. If the deck author has chosen to remove a shared deck, the deck has been deleted from our servers, and we do not have the ability to restore it. Shared decks may also be hidden from view for other reasons, such as their copyright status needing to be confirmed. For legal reasons, we can not restore decks in these cases until we hear back from the deck author. # A shared deck is not showing images/playing audio Source: https://docs.ankiweb.net/faqs/a-shared-deck-is-not-showing-images-or-playing-audio Some shared decks are missing sounds or images, either because the author expects you to download them from a separate location, or because they've accidentally or deliberately omitted them. When downloading a shared deck from AnkiWeb, the number of included sounds and images is listed near the top of the download page. If you've downloaded a shared deck from somewhere other than AnkiWeb and media files are not working, please contact the sharer for assistance. # Can I reveal parts of a card one at a time? Source: https://docs.ankiweb.net/faqs/can-i-reveal-parts-of-a-card-one-at-a-time Typical flashcards, both on paper and in Anki, have a front and a back: the prompt or question is shown on the front and the answer on the back. Sometimes people want to add more steps to the answer. For instance, you might want to show the word in a foreign language on the front, then show a definition when you press the button once, then show an example sentence when you press it again, and so on. This is generally not a good idea. The more complicated you make your cards, the more difficult they become to remember ([rule 4](http://www.supermemo.com/articles/20rules.htm)) and the less efficiently they can be scheduled. The difference between the amount of time it takes to learn and review a few complex cards and the amount of time it takes to learn a larger number of much simpler cards containing the same information can be stunning. For this reason, Anki doesn't support having more than two sides per card. In our foreign-language words example, you might instead want to create multiple [card types](/manual/templates/intro), so that you would be asked for each of the items *on separate cards* – one card could show you the word and ask for a definition, another could show the example sentence with the word missing and ask what word logically fits, and so on. In some cases, you might want to include extra non-essential information on a card without showing it until you need it. For this situation, Anki offers [hint fields](/manual/templates/fields#hint-fields). # Card template has a problem Source: https://docs.ankiweb.net/faqs/card-template-has-a-problem Anki has recently become stricter about reporting mistakes in card templates. In the past, it would silently ignore some problems, but display templates in unexpected ways. This change has been made to make mistakes easier to notice. If you have not edited your card templates yourself, it is likely you have downloaded a shared deck, where the original deck author made a mistake when creating the template. You can correct mistakes on the template by opening the card templates screen: * On the computer version, edit a problem card, and then click on the Cards... button * On AnkiMobile, while viewing a problem card in the review screen, tap the cog/gear, then Card Template. When you correct a mistake, it will update all cards of that type - you do not need to make the same change for every card that uses the template. What needs changing will depend on the message you are getting. **Found '\{\{Field}}', but there is no field called 'Field'** This indicates your template includes the name of a field that doesn't exist. To fix the problem, locate the \{\{Field}} inside the card template, and remove it. **Missing }} in \{\{Field** This message is shown when \{\{ is found in the template without a matching }}. For example, if you have ``` {{Field ``` then this needs to be changed to ``` {{Field}} ``` **Missing \{\{/Field}}** This means Anki found `{{#Field}}` or `{{^Field}}` in your card template, without a matching `{{/Field}}`. Removing `{{#Field}}` or `{{^Field}}` from the template will fix the error. **Found \{\{/One}}, but expected \{\{/Two}}** Conditional replacements need to be closed in the same order they are opened. For example, the following template is incorrect: ``` {{#One}} {{#Two}} {{Three}} {{/One}} {{/Two}} ``` To fix the problem, the template should be changed like so: ``` {{#One}} {{#Two}} {{Three}} {{/Two}} {{/One}} ``` **Found \{\{/Field}}, but missing '\{\{#Field}}' or '\{\{^Field}}'** Closing tags must be matched by opening tags. For example, the following is invalid, because there is no `{{#Two}}` or `{{^Two}}` at the start: ``` {{Field}} {{/Two}} ``` It can be fixed by removing the closing tag: ``` {{Field}} ``` # Cards are being placed in the "Default" deck Source: https://docs.ankiweb.net/faqs/cards-are-being-placed-in-the-default-deck This is usually caused by an AnkiDroid bug, but can happen for other reasons as well. To fix the problem, please click the Cards button while adding a card, select the card type you're having trouble with via the tabs at the top, and ensure Options>Deck Override (More>Deck Override on Anki 2.0) is turned off. # Cards are reversed / appearing twice Source: https://docs.ankiweb.net/faqs/cards-are-reversed-appearing-twice Anki can be configured to show cards in both a forward and reverse direction. If you want cards to only show from front->back, you can delete the reverse card. If you have added cards to the `Basic (and reversed)` or `Basic (optional reversed)` notetypes, you can change the cards to the "Basic" card type by selecting them in the Browse screen, then using the Change Note Type menu item. Select your Basic note type, choosing to keep Card 1, and discard Card 2. If you have modified the Basic card template to add an unwanted reverse direction, you can modify it back instead: * Edit a card * Click the 'Cards' button * You will see one or more tabs at the top representing each card type that will be created. Locate the card type you don't want, click the Options button, and remove the unwanted card template. # Characters are cut off Source: https://docs.ankiweb.net/faqs/characters-are-cut-off If you find that parts of your characters are missing, the font you're using is probably not appropriate for the language you're studying. To fix this: * While an affected card is shown, click Edit, then Cards. * Click the Add Field button. * Select Front or Back, depending on which side you want the field to be shown on. * Choose a font that is intended for the language you're studying. * After clicking OK, you should see the field appear a second time on your card, and this time it should appear correctly. If it doesn't, add the field again and try a different font. * Remove any other \{\{field}} references on the left side, so that the field only appears once on your card. If you're using Windows, you may need to install language support for the language you want to use in Windows first. After rebooting, any newly added fonts should become available to Anki. # Customizing MathJax Source: https://docs.ankiweb.net/faqs/customizing-mathjax Anki's bundled MathJax support is loaded before your card content, so if you wish to customize MathJax, you will need to do so in a specific way. For recent Anki versions, use something like this: ```html theme={null} ``` For older Anki versions: ```html theme={null} ``` Notes: * Please avoid changing the standard open/close tags (`\(` and `\[`), to something like `$` and `$$`, as Anki has special logic for cloze deletions, which will not work if you change the delimiter. # Errors when recording Source: https://docs.ankiweb.net/faqs/errors-when-recording If you have problems recording audio in Anki, please make sure: * a microphone is connected to the computer * the microphone is set as the default recording device in your system's sound settings * another program like Skype is not using the microphone - you may need to close the other microphone-using program. If that does not help, please try restarting your computer. If you receive the message `IOError: [Errno Unanticipated host error] -9999` on Windows 10, please make sure you have allowed Anki to use the microphone: [https://winaero.com/blog/disable-app-access-microphone-windows-10/](https://winaero.com/blog/disable-app-access-microphone-windows-10/) # Extra characters appearing on cards Source: https://docs.ankiweb.net/faqs/extra-characters-appearing-on-cards Sometimes users notice that text is appearing in front of or on their cards that they don't remember putting there. Usually it is just a couple of letters or nonsense. For instance, on the front side of your card you have written `book`, but when you review the card it appears as `fybook`. This problem is caused by accidentally placing text in the card template. You can solve it as follows: 1. While reviewing with the computer version, locate one of the cards that has the problem, and edit it. (Alternatively, search for one in the browser.) 2. Click the Cards button. 3. Look in the Front Template box (or, if the text is appearing on the back of the card, the Back Template box). You should see the extra text in there somewhere. Being careful not to delete anything else, remove it. After you close the Cards dialog, your cards should appear as normal again. If you don't have access to the computer version, you can study such a card in AnkiMobile, then tap on Tools>More>Edit Card Template. # Hiding Decks Source: https://docs.ankiweb.net/faqs/hiding-decks If you do not intend to study a deck for some time do not want to delete it, you may wish to *hide* it. There are two ways to do this. **A) Export the deck and delete it.** 1. Choose File → Export. Select `Anki Deck Package (*.apkg)` from the *Export Format* drop-down. 2. Select the deck to be removed from the *Include* drop-down. 3. Make sure that *Include scheduling information* and *Include media* are checked—otherwise you will have lost your review history and possibly your media when it comes time to use the deck again. 4. Click Export and save the apkg file somewhere you can find it again. 5. Finally, delete the deck from your collection. You can restore the deck to your collection by choosing File → Import and importing the deck again. It will be restored with the same name it had when you exported it. **B) Create an "unused" deck.** You can create a tree of decks in Anki by dragging and dropping the decks in the deck list. You can use a combination of this property and options groups to hide decks you do not intend to use: 1. Click *Create Deck* and add a deck called "Unused," "Hidden," or something similar. You can place a tilde (\~) before the name (like "\~Unused") if you want to force the deck to appear at the bottom of the list. 2. Drag and drop the deck you wish to hide to underneath the new deck. Then collapse the Unused deck by clicking the minus sign next to the name. 3. You can stop here if you're happy with this; however, if you leave it this way, due counts will still be displayed. If you would rather get rid of them, continue with step 4. 4. Click the options button next to the Unused deck and choose Options. 5. Click the options button in the upper-right-hand corner and add a new options group (you can call it "unused deck" or something similar). 6. On the New Cards tab, select a new cards/day limit of 0. On the reviews tab, select a maximum reviews/day limit of 0. To restore the deck, simply drag and drop it back into the main deck list (you can go either to the very top or the very bottom of the list to get the top level). You can leave the Unused deck for future use. # How can I work with someone else to create a deck? Source: https://docs.ankiweb.net/faqs/how-can-i-work-with-someone-else-to-create-a-deck Anki's collaboration support is limited at the moment, but it is possible for multiple people to work on content together. If you are creating cards that have no sounds or images, then the easiest option may be to take advantage of an online document collaboration service such as Google Drive. With this system, you create your cards in a spreadsheet (one column per field in the note type you're using). To allow updating easily, the first column should be one that you do not expect to change if you update the cards. You can add and edit cards together at whatever time you want; when you're ready to update your collection with new and updated cards, each user can export the spreadsheet to a text file and [import it into Anki](/manual/importing/intro). If you are creating cards that contain images or sounds, it gets more complicated. You can use the above approach, but it means you'll need to distribute the media files separately. Instead, we recommend taking turns to create the content. For example, if students are collaborating on a class, student A creates a deck "lesson 1" and puts all the first lesson content in it, then student B creates "lesson 2", and so on. As each lesson is done, the student exports the deck to an apkg file, and uploads/emails/etc it, and the other people import it. Using a separate deck for each unit of work makes it easier to export the content separately, instead of sharing everything that's been created so far (which would lead to large files). After other users import the content, they can move it to another deck if they wish, using the computer version. Advanced users can skip the separate deck step by instead creating a filtered deck using something like 'added:7' to only include cards added in the last 7 days, and then exporting that filtered deck to share. There are also add-ons available that support collaboration, such as [AnkiHub](https://www.ankihub.net) or [AnkiCollab](https://www.ankicollab.com/). Additional add-ons offering similar functionality can be found on the [shared add-ons page](https://ankiweb.net/shared/addons). # How do I move cards between decks? Source: https://docs.ankiweb.net/faqs/how-do-i-move-cards-between-decks You may want to move cards between decks for a variety of reasons, for example: * you accidentally put them in the wrong deck * you made a single large deck and want to break it into several smaller ones * you made several small decks and want to combine them into a larger one The [browser](/manual/browsing) offers a **Change Deck** option in the menu bar for these kinds of tasks. See also [Merging/combining two decks](/faqs/merging-or-combining-two-decks#mergingcombining-two-decks) for more precise instructions for that exact situation. *** If you want to move cards between *profiles*, or share cards with other people, you can use Anki's [export](/manual/exporting) function to export a packaged deck. If you want to share or move to a new profile only some of the cards in a deck, you can first use the change deck option above to move them into a temporary deck, then export that deck. # Introduction Source: https://docs.ankiweb.net/faqs/intro Here are some frequently asked anki questions. To get started select a category on the left or use the search bar above. # Can I link cards together? Source: https://docs.ankiweb.net/faqs/linking-cards-together Anki supports links between cards of a note, but not between unrelated cards. Imagine you are studying Japanese and aiming to be able to both recognize and reproduce the Japanese. You may enter the word "ookii", which means "big", and tell Anki to generate two cards - ookii→big and big→ookii. In the above situation Anki can space reviews of those two sibling cards out so that they don’t appear one after the other. Some people want to extend this link between arbitrary cards. They want to be able to tell Anki "after showing me this card, show me that card", or "don’t show me that card until I know this card well enough". This might sound like a nice idea in theory, but in practice it is not practical. For one, unlike the sibling card case above, you would have to define all the relations yourself. Entering new notes into Anki would become a complicated process, as you’d have to search through the rest of the deck and assign relationships between the old and new material. Secondly, remember that Anki is using an algorithm to determine when the optimum time to show you material again is. Adding constraints to card display that cause cards to display earlier or later than they were supposed to will make the spaced repetition system less effective, leading to more work than necessary, or forgotten cards. The most effective way to use Anki is to make each note you see independent from other notes. Instead of trying to join similar words together, you’ll be better off if you can determine the differences between them. Synonyms are rarely completely interchangeable - they tend to have nuances attached, and it’s not unusual for a sentence to become strange if one synonym is replaced with another. Continuing with the Japanese example earlier, imagine you want to learn the word "dekai", which also roughly translates to "big", but is a more colloquial expression. If you still want to review in both directions, you might make the English prompt of this word "big (more casual)". The further you progress in your language studies though, the more of a burden it becomes to define the differences between similar words, which is why cards asking you to produce a particular word are best left to the early stage of your studies. With a strong base vocabulary, moving towards recognition-based study makes more sense, as we all have a much larger passive vocabulary than our active vocabulary. As for ensuring that difficult material is introduced after easier material, a number of existing tools are available. New cards are by default introduced in the order they are added to the deck, so as long as the learning materials or sources of information you are using are adequately graded for your level, material should appear in order of easiness. # Merging/combining two decks Source: https://docs.ankiweb.net/faqs/merging-or-combining-two-decks Anki does not have an explicit feature to combine decks, but you can accomplish this easily by moving all the cards in one deck to the other deck. Please follow these steps: 1. Open the browser (click **Browse** at the top of Anki's main window) and select one of the decks you want to merge in the left pane. 2. Select all the cards (Edit → Select All or Ctrl-A) and click the **Change Deck** option in the menu bar. Select the other deck and click **Move Cards**. 3. If you want to merge more than two decks, repeat steps 1 and 2 as necessary until you have only one deck remaining. 4. Close the browser to return to the deck list and delete the now-empty deck(s) by clicking the settings button to the right of each. (Anki will warn you if you try to delete a deck that still has cards in it.) See also [How do I move cards between decks?](/faqs/how-do-i-move-cards-between-decks?highlight=mergin#how-do-i-move-cards-between-decks). # Multiple choice questions Source: https://docs.ankiweb.net/faqs/multiple-choice-questions Multiple choice questions are not the most effective way to study. The reason they are commonly used in an academic setting is because they are easy to mark, and they allow the person studying to demonstrate their ability to recognize the correct answer, even if they can’t produce it themselves. When you need to pick from a selection of answers, it is easy to "cheat", as you can guess what the correct answer is if you know what the other displayed options are. When multiple choice tests are designed by humans, the test creator can create clever "distractors" that are similar to the correct answer, making it harder for you to guess. Computers are not so good at this. If you are studying for a test and you have a sample test with a multiple choice questions, like the following: ```text theme={null} Q: What animal has a really long neck? A: 1. A monkey. 2. A giraffe. 3. A donkey. 4. A snail. ``` Then the recommended way to put that question into Anki is to drop the incorrect answers, turning it into a simple question/answer card instead: ```text theme={null} Q: What animal has a really long neck? A: A giraffe. ``` # No cloze found on card Source: https://docs.ankiweb.net/faqs/no-cloze-found-on-card ## Single empty cards When making clozes, each cloze number is turned into a separate card. For example, the following will create three cards: ``` {{c1::This}} is a {{c2::sample}} {{c3::sentence}}. ``` If you you later edit the text, and either remove or change a cloze number, the previously created card may become blank. For example: ``` {{c1::This}} is a {{c2::sample}} ``` and ``` {{c1::This}} is a {{c2::sample}} {{c1::sentence}}. ``` are both changes that would make card 3 blank. When you view card 3, you'll see a message indicating that the card is blank, and can be cleaned up with the Empty Cards function. You can access that function via the Tools menu of the computer version's main window, and use it to remove blank cards. Please check the reported empty cards first, and if in doubt, create a backup with the File>Export menu item before proceeding. ## All cloze cards empty If you accidentally modify your card template, it may prevent any cloze deletions from appearing. If that has happened, please edit one such problem card, and note down the name of the first field - it is usually called "Text". Then, please: * Click on the Cards... button * Replace the front text with ``` {{cloze:Text}} ``` * Replace the back text with the same. If your field was called something other than Text, replace Text with the name of the field. # Printing cards in your collection Source: https://docs.ankiweb.net/faqs/printing-cards-in-your-collection Some people like to print the cards in their collection so that they can review them on paper or for other reasons. Before you do this, please keep in mind that Anki is most effective when you study only through the application. Studying a list of your cards will necessarily require you to study them at suboptimal intervals compared to the ones Anki gives you. Printing in Anki is handled by the [Basic Printing Support](https://ankiweb.net/shared/info/1025789669) add-on. If you have trouble getting your browser to open, please follow the directions in the review "WORKS, but does not open the browser automatically", located on that page. # Removing duplicate note types Source: https://docs.ankiweb.net/faqs/removing-duplicate-note-types After you have used Anki for a while, you may find you have multiple note types with the same name followed by different characters, like `Basic-908e4`, `Cloze-37a28`, or `Image Occlusion++++`. This can happen when you import a shared deck that uses a note type with the same name as one that is already in your collection, or if you create a note type with a duplicate name. Anki adds characters to the name to avoid merging or overwriting the existing note type. While these "duplicate" note types are generally harmless, it can be somewhat confusing if you can't tell which note type you are using. To clean that up, you can do the following: 1. Compare the fields, card templates, and styling of each of the note types by clicking Fields and Cards in the Manage Note Types window (Notes → Manage Note Types). * If they are the same, decide which note type to delete and click Rename to change its name so you will know which one it is (e.g., add `-delete` to the name). * If they aren't the same, rename one to something more descriptive, and keep them both. 2. In the Browse window, in the left Sidebar, select the note type that you want to delete, then choose Edit → Select All to select all of its notes/cards. 3. Choose Notes → Change Note Type and select the note type that you are keeping from the dropdown on the right side of the screen. \[This step will require a one-way sync the next time you sync with AnkiWeb, so if you have unsynced progress on other devices, you should stop here and get your devices in sync. Anki will give you a warning about this.] Verify that the fields and templates are mapping as you expect. Click Save. 4. Repeat steps 2 & 3 for any other note types you want to delete. 5. Open the Manage Note Types window again and delete the now-unused note types (each will say it is used by "\[0 notes]"). # Restoring an Automatic Backup (Recovering from Data Loss) Source: https://docs.ankiweb.net/faqs/restoring-an-automatic-backup-recovering-from-data-loss Sometimes your collection may become very damaged. For instance: * You accidentally deleted a card type or hundreds of cards and didn't notice in time to undo it. * Your collection has become corrupted. * There was a syncing error and you accidentally overwrote a large number of reviews that you did on another device. * ...or anything else that leaves you with lost data. Anki automatically backs up your collection every time you close Anki or sync (AnkiMobile backs up after fixed time intervals and before syncs), and by default it stores 30 backups. For information on restoring an automatic backup, please visit the relevant page: * Restore a [backup made by Anki on your computer](/manual/backups) * Restore a [backup made by AnkiMobile](/ankimobile/preferences#backups) * Restore a [backup made by AnkiDroid](https://ankidroid.org/docs/manual.html#backups) # "Some updates were ignored because note type has changed" Source: https://docs.ankiweb.net/faqs/some-updates-were-ignored-because-the-note-type-has-changed When importing a shared deck that has previously been imported, Anki will only be able to update your existing cards if: * the name, number and order of fields has not changed * the name, number and order of card templates has not changed Changes to the front and back template will not prevent updates. If changes have been made to the fields or card templates and you want to apply updates, you will need to modify the note type in your collection to match the one in the deck you're trying to import. To do this, you can import the shared deck into a new profile, note down the note type's fields and card templates, and then compare them with the note type in your profile. If you're not concerned with updates, and just want to grab any new cards, one way to make importing work is to delete the old note type via the Tools>Manage Note Types screen. This will delete any cards associated with it, so if you wish to preserve the existing cards, you'll need to manually use the Change Note Type option in the browse screen to move them to a new note type. Please note that if the deck sharer has used the 'change note type' option in their collection, they will have permanently broken link between your copy and theirs, and updating via .apkg import will not be possible even if your note type's fields and card templates match. You can check the note types are linked by using the following command in the [debug console](/manual/misc#debug-console) while looking at a card in the study screen: ``` pp(card()['_note'].mid) ``` Repeat for the shared deck imported into a temporary profile. If the numbers match, the note types are still linked. If one of the fields in the shared deck has not been altered, it is also possible to apply updates via a text import. After importing the shared deck into a temporary profile, use File>Export to save the notes in txt format. Then in your original profile, you can import the text file, matching against a field that has not changed. Text imports can only operate on one note type at once, so if the shared deck you've downloaded contains multiple note types, you'll need to do the process one note type at a time. More info is at [updating](/manual/importing/packaged-decks#updating). # Sound/image media files have gone missing! Source: https://docs.ankiweb.net/faqs/sounds-or-images-have-gone-missing Anki stores your cards' sound and image files on your computer, in your [Anki folder](/manual/files#file-locations), in User 1/collection.media. If you delete any files from that folder, Anki notes they have been removed and on the next sync it will remove them from your other devices as well. What sometimes happens is users tidy up files on their computer, and accidentally remove the sounds and images that their cards use, resulting in sounds not playing or images not appearing. This is particularly easy to do accidentally on a Mac with the "all my files" feature of the Finder, but can happen on other platforms as well. You can use Anki's Tools>Check Media function to find out which images are missing from your collection by looking at the "Used on cards but missing from media folder" section. If you've accidentally deleted the files your cards were using, you may be able to restore them from your recycle bin / trash can if the trash has not been emptied yet. Placing them back in the collection.media folder should cause the media to work again. If you are unable to recover your media from any of your devices, we may be able to restore it from AnkiWeb's backups for you if it was deleted recently. If you've lost your sound and images, but had obtained them from a shared deck, if the shared deck is still available you can import it into a new profile, and then copy the sounds and images from it into your original collection to restore the data. When editing fields, Anki shows the names of sound files. To see the names of image files, you can press ctrl+shift+x while the cursor is in the field with the image (cmd+shift+x on a Mac). For an image or sound file to work, a file with the exact same file name must be in the collection.media folder. # Splitting a field into multiple fields Source: https://docs.ankiweb.net/faqs/splitting-a-field-into-multiple-fields ## Recent Anki versions With recent Anki versions, there is no need to export+import. An example is provided [in this forum post](https://forums.ankiweb.net/t/cloze-type-to-basic-type/23305/2). ## Older Anki versions Sometimes you may create a deck, or download a shared deck, with several things in one field, such as text and audio, but then later decide that you would rather have the information in two fields so that you can have more precise control over what displays on each card. One option is to add a new field and then manually cut and paste the content between fields; this may be the fastest if you have less than a hundred cards or so, but otherwise it will be very tedious and slow. Here is a method you can use based on exporting to a text file and doing a search and replace; as an example, we'll focus on 1. If the field you want to split is the first field, make a different field the first field by using the **Reposition** button in the Fields dialog. This field needs to be unique, so that no two cards have the same content in that field. If you don't have any unique fields except the one you're trying to split, you can use the [add note ID](https://ankiweb.net/shared/info/8897764) add-on to add a unique field to the notes. 2. Export the entire deck to a text file, using the **Notes in plain text** choice. 3. Add a new field to your note type. The new field should come immediately after the one that you're trying to split, so if you had a "Word and Audio" field, you could rename it to "Word" and then add an "Audio" field and reposition it to go after the "Word" field. 4. Open the text file and do the search and replace. If your text editor supports a certain form of regular expressions, this might work for the expression: `s/\[sound/\t\[sound/`. Otherwise, if you're not sure how to form the expression, you can ask on the Community section or look for regular expression help on the Internet. 5. Import the text file back into your collection, making sure to use the correct note type and deck. Your notes will be updated with the newly split field. If you run into problems, please ask on the Community category, as this is outside the scope of the official support we can provide for Anki. # When adding a new card, some fields do not reset! Source: https://docs.ankiweb.net/faqs/sticky-fields Anki supports adjusting sticky fields directly from the editor window from v 2.1.45. This feature can be turned on / off by clicking on the pin icon on the right of a field. If the pin icon is inactive, Anki will clear out the field's content after a note is added. # Text to speech support Source: https://docs.ankiweb.net/faqs/text-to-speech-support # For Anki 2.1.20+ Please see [Text to Speech for individual fields](/manual/templates/fields#text-to-speech-for-individual-fields) # For AnkiMobile 2.0.56+ Please see [TTS](/ankimobile/tts) # For AnkiDroid Please search for TTS in the AnkiDroid manual. # For older Anki versions There is a popular add-on called AwesomeTTS that supports a number of text to speech programs and services. You can read more about it here: [https://ankiweb.net/shared/info/814349176](https://ankiweb.net/shared/info/814349176) It works by downloading the audio into your collection, so that when you sync with AnkiWeb, your other devices will gain access to the audio as well. If you want to use the generated files outside the computer version, make sure you use the stored files mode and not 'on the fly'. While AnkiMobile \<2.0.56 has no official support for on-device TTS, Apple introduced TTS support in iOS7, and it is possible to gain access to it. The following is based on a user-contributed solution. ```html theme={null} {{Word}} ``` You can change en-GB to other languages like en-US, de-DE, ja-JP, zh-HK, etc. You can use the example section on the following page to see all the different languages. [https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/getVoices](https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis/getVoices) You may need to install the Enhanced audio files for the language you want to play, which you can do so via the Settings app, then General, Accessibility, Speech and Voices. # Add-ons Source: https://docs.ankiweb.net/manual/addons Anki's capabilities can be extended with add-ons. Add-ons can provide features like extra support for specific languages, extra control over scheduling, and so on. To browse the list of available add-ons, select **Tools > Add-ons**, then click on **Get Add-ons**. Alternatively, open [ankiweb.net/shared/addons](https://ankiweb.net/shared/addons) in a web browser. If you have downloaded an add-on that is not working properly, or if you accidentally made a mistake when editing an add-on, you can use the **Delete** option in the menu to remove it. Add-ons use and modify arbitrary parts of Anki’s codebase, so in some cases, updating Anki can break the compatibility with older add-ons. If one of your add-ons stops working after updating Anki, please consider reporting the issue to the add-on author. If you rely on this add-on, you will need to keep using an older Anki version until the add-on gets an update. There is a **Contact Author** button on most add-ons pages on AnkiWeb, and many authors include their email address in the add-on, so if you need to get in touch with the author, editing the add-on and looking at the top of the file may help. To learn how to write your own add-ons, see the [add-on writing guide](https://addon-docs.ankiweb.net). # Background Source: https://docs.ankiweb.net/manual/background > [!NOTE] > > **Summary** > > Anki helps you to remember anything you want. With Anki, you'll learn much > faster (or more material in the same time frame) compared with traditional > study methods. > > For that, Anki uses scientifically well-established principles of memory > sciences: > > 1. **Active Recall** (You try to remember actively, rather than reading / > listening passively). > 2. **Spaced Repetition** (You'll only study cards when you're about to forget > them. The easier the card, the longer the intervals between reviews becomes). > > Anki is open source and cross-platform. It supports many addons developed by > contributors. It also uses the FSRS algorithm, which will improve your studying > results drastically. Anki is a program which makes remembering things easy. Because it is a lot more efficient than traditional study methods, you can either greatly decrease your time spent studying, or greatly increase the amount you learn. Anyone who needs to remember things in their daily life can benefit from Anki. Since it is content-agnostic and supports images, audio, videos and scientific markup, the possibilities are endless. For example: * Learning a language * Studying for medical and law exams * Memorizing names and faces of people * Brushing up on geography * Mastering long poems * Even practising guitar chords! There are two simple concepts behind Anki: **active recall testing** and **spaced repetition**. They are not known to most learners, despite being well-documented in scientific literature. Understanding how these concepts work will make you a more effective learner. ## Active Recall Testing *Active recall testing* means being asked a question and trying to remember the answer. This is in contrast to *passive study*, where we read, watch, or listen to something without pausing to consider if we know the answer. Research has shown that active recall testing is far more effective at building strong memories than passive study. There are two reasons for this: * The act of recalling something *strengthens* the memory, increasing the chances we’ll be able to remember it again. * When we're unable to answer a question, it tells us we need to return to the material to review or relearn it. You have probably encountered active recall testing in your school years without even realizing it. When good teachers give you a series of questions to answer after reading an article, or make you take weekly tests, they are not doing it simply to see if you understood the material or not. By testing you, they are increasing the chances you will be able to remember the material in the future. A good way to integrate active recall testing into your own studies is to use *flashcards*. With traditional paper flashcards, you write a question on one side of a card, and the answer on the other side. By not turning the card over until you've recalled the answer, you can learn things more effectively than passive observation allows. ## Use It or Lose It Our brains are efficient machines, and they rapidly forget information that doesn't seem useful. Chances are that you don't remember what you had for dinner on Monday two weeks ago, because this information is not usually useful. However, if you went to a fantastic restaurant that day and have spent the last two weeks telling people about how great it was, you're likely to still remember it in vivid detail. The brain's "use it or lose it" policy applies to everything we learn. If you spend an afternoon memorizing some science terms, and then don't think about that material for two weeks, you'll probably have forgotten most of it. In fact, studies show we forget about 75% of material learned within a 48 hour period. This can seem pretty depressing when you need to learn a lot of information! However, the solution is simple: *review*. By reviewing newly-learned information, we can greatly reduce forgetting. The only problem is that traditionally, reviewing has not been very practical. If you are using paper flashcards, it's easy to flick through all of them if you only have 30 of them to review, but as the number grows to 300 or 3000, it quickly becomes unmanageable. ## Spaced Repetition The *spacing effect* was reported in 1885 by a German psychologist called Hermann Ebbinghaus. He observed that we tend to remember things more effectively, if we spread reviews out over time, instead of studying multiple times in one session. Since the 1930s, there have been a number of proposals for utilizing the spacing effect to improve learning, in what has come to be called *spaced repetition*. One example was in 1972, when a German scientist called Sebastian Leitner popularized a method of spaced repetition with paper flashcards. By separating the paper cards into a series of boxes, and moving the cards to a different box on each successful or unsuccessful review, it was possible to see at a glance a rough estimate of how well a card was known and when it should be reviewed again. This was a great improvement over a single box of cards, and it has been widely adopted by computerized flashcard software. It is a rather rough approach however, as it cannot give you an exact date on which you should review something again, and it does not work very well with material of varying difficulty. The biggest developments in the last 30 years have come from the authors of SuperMemo, a commercial flashcard program that implements spaced repetition. SuperMemo pioneered the concept of a system that keeps track of the ideal time to review material and optimizes itself based on the performance of the user. In SuperMemo's spaced repetition system, every time you answer a question, you tell the program how well you were able to remember it — whether you forgot completely, made a small mistake, remembered with trouble, remembered easily, etc. The program uses this feedback to decide the optimal time to show you the question again. Because a memory gets stronger each time you successfully recall it, the time between reviews gets longer and longer — so you may see a question for the first time today, then 3 days later, 15 days later, 45 days later, and so on. This was a revolution in learning, as it meant material could be learned and retained with the absolute minimum amount of effort necessary. SuperMemo's slogan sums it up: with spaced repetition, you can: "forget about forgetting". ## Why Anki? While there is no denying the huge impact SuperMemo has had on the field, it is not without its problems. The program is often criticized for being buggy and difficult to navigate. It only runs on Windows computers. It is proprietary software, meaning that end-users cannot extend it or access the raw data. And while very old versions have been made available for free, they are quite limited for modern use. Anki addresses these issues. There are free clients for Anki available on many platforms, so struggling students and teachers with budgetary constraints are not left out. Anki is open source, with an already flourishing library of add-ons contributed by end-users. It is multi-platform, running on Windows, macOS, Linux/FreeBSD, and some mobile devices. And it is considerably easier to use than SuperMemo. Anki's spaced repetition system is based on an older version of the SuperMemo algorithm called [SM-2](/faqs/what-spaced-repetition-algorithm). Recently, a new algorithm called [FSRS](/manual/deck-options?highlight=FSRS#fsrs) has been integrated as an alternative to the legacy SM-2 algorithm. # Backups Source: https://docs.ankiweb.net/manual/backups ## Automatic backups Anki will create automatic backups of your card data. These include the text on your cards and your scheduling information, but do not include sounds or image files. Automatic backups can be useful to recover from mistakes, but you should not rely solely on them. Because they are stored on your local device, they will not protect you if your device breaks or is stolen. We recommend you combine them with [manual backups](./#manual-colpkg-backups). ### Restoring To restore from an automatic backup: * Open Anki, and choose Switch Profile from the File menu. * Click on the "Open Backup" button. * Select the backup you wish to restore from. > [!WARNING] > > 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. ### Creating Backups are created periodically. You can configure the time between backups in the [preferences](./preferences) screen. The default is 30 minutes. Certain operations will trigger a backup, even if the configured time has not elapsed yet: * A one-way sync download * Importing a .colpkg file using **File > Import** * **Tools > Check Database** 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. > [!NOTE] > > Backups created with 2.1.50 will not be importable into older Anki versions. ## Manual colpkg backups ### Restoring You can restore from a manual backup by using **File > Import**. ### Creating 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: * Select Export from the File menu. * Ensure "Anki collection package (.colpkg)" is selected. * Enable the "include media" option. This will create a .colpkg file that contains all of your cards and any sounds/images they use. We recommend you store the file somewhere safe, like a different device, or a cloud-based file storage service like Dropbox or Google Drive. ## AnkiWeb [Synchronising](./syncing) your collection with AnkiWeb provides some level of protection against your device being lost or stolen. If you need to restore your collection from AnkiWeb, you can force a one-way sync in the preferences screen, or sync from a new device, and then choose "Download". ## Deletion log Anki logs deleted notes to a text file called `deleted.txt` in your profile folder. These notes are in a text format that can be read by **File > Import**. Historically, Anki only supported a single note type at one time. So, if you had deleted notes from different note types, you needed to split the file into separate files for each note type first. However, profiles created in Anki versions newer than 25.09.2 have the following snippet at the top of `deleted.txt` (hence allowing you to import `deleted.txt` without the need to split the file): ``` #guid column:1 #notetype column:2 ``` > [!NOTE] > > `deleted.txt` is unique to each profile and is not interchangeable between different > user profiles. # Browsing Source: https://docs.ankiweb.net/manual/browsing The Browse window allows you to search through your cards and notes, and edit them. It is opened by clicking **Browse** in the main window, or by pressing B. It is comprised of three sections: the *sidebar* on the left, the *card/note table* on the top right, and the *editing area* on the bottom right. By positioning the mouse between two sections, it is possible to click and drag to expand one section and shrink the other. ## Table Modes ![Table Modes](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/browser_table_modes.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=16fabb39c33e4e28669f595a15d75708) Anki 2.1.45+ offers two modes: either cards or notes are shown in the data table. You can change the current mode by clicking the switch at the top, to the left of the search area, or pressing Ctrl+Alt+T or Cmd+Opt+T. The switch also indicates if **C**ards or **N**otes are currently shown. **Note**: For the sake of simplicity, this manual generally assumes the Cards mode to be the active one. Whenever selecting/finding/etc. "cards" is mentioned, the reader may substitute it for "cards or notes depending on the active mode". ## Sidebar The *sidebar* on the left allows quick access to common search terms. On Anki 2.1.45+, it also provides a searchbar, facilities to edit tags and decks, and a choice of two different tools, which are discussed in the following sections. You can switch tools using the toolbar at the top of the sidebar or the shortcuts Alt+1/2. ### Search Tool ![Search Tool](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/browser_search_tool.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=a516ba64bc0b12b2a92b24895b737dba) With this tool, the sidebar behaves as in previous versions: Clicking on an item will search for it. You can hold down Ctrl (Command on Mac) while clicking in order to append the clicked item to the current search with an AND condition, instead of starting a new search. If you wanted to show *learning* cards that were also in the German deck for instance, you could click on "Learning", then Ctrl-click on "German". You can hold down Shift to create an OR search instead of an AND. For example, you could click one deck, then Shift-click another to show cards from either of the decks in the same view. You can hold down Alt (Option on Mac) in order to reverse the search (prepend a `-`): for example, to show all cards in a current deck that do *not* have a certain tag. Alt/Option can be combined with either Ctrl or Shift (e.g. clicking with Ctrl+Alt will result in adding a new search term that is negated). On Anki 2.1.39+, you can also hold down both Ctrl and Shift together when clicking a search term to replace all occurrences of the same kind of search with the new one. Let's say you had previously typed in a complicated search expression like `deck:Swahili (is:due or tag:important)` and now want to perform the same search for your Urdu deck. You can hold down Ctrl+Shift while clicking the Urdu deck in the sidebar to obtain the following search expression: `deck:Urdu (is:due or tag:important)`. ### Selection Tool ![Selection Tool](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/browser_selection_tool2.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=7f971a626ab0d3a386511d206e0253c0) The Selection tool allows for selecting multiple items at the same time by holding down Ctrl or Shift while clicking. It also enables drag-and-drop to reorder decks and tags. Here is an example: Say you have the tags `Math`, `Calculus`, and `Algebra`. Click on the `Calculus` tag, then Ctrl-click on the `Algebra` tag. Now both tags are selected, click and drag any of the two onto the `Math` tag to make them both children of this tag. Behind the scenes, Anki has renamed the two tags to `Math::Calculus` and `Math::Algebra` respectively and updated your notes accordingly. Another use case for selecting multiple items is searching: If you right-click on a selection of items, you can choose **Search > All/Any Selected**. This can be combined with keyboard modifiers as described in [Search Tool](./#search-tool) to append the resulting search to the current search. ### Saved Searches If you regularly search for the same thing, you can save the current search by right-clicking the topmost item in the sidebar, choosing **Save Current Search** and typing in a name. You can also drag and drop any sidebar item onto this area to add an equivalent saved search, effectively pinning it at the top. ### Editing Items You can delete or rename tags, decks, and saved searches directly from the sidebar, from the right-click menu, or by using a shortcut key (Del and F2 on Windows). Deletion even works for multiple items at once (see [Selection Tool](./#selection-tool)). ### Finding Items To find a certain item in the sidebar tree, type part of its name into the searchbar at the top. ## Search Box Above the card list is a search box. You can type in various things there to search for cards. For information on the search syntax, see [Searching](./searching). ## Card/Note Table The table's rows represent cards or notes that match the current search. When you click on a row, the corresponding note will be shown in the bottom section. ### Rows If you drag the mouse or hold Ctrl or Command to select multiple rows, the editor will be temporarily hidden. Various operations (such as changing the deck) can operate on multiple cards or notes at once, independent of the active mode. Therefore in Cards mode, a note is considered to be selected if any of its cards is selected, and in Notes mode, a card is considered to be selected if its note is selected. Other operations (like showing card information) only operate on a single card or note. This is called the *current* card or note, which is usually the one that was last selected or clicked. In Cards Mode, again, the current note is the note of the current card and in Notes mode, the current card is the first card of the current note. The background colour will change depending on the card and note. In Cards mode, the first match will be used: 1. if the card is **flagged**, use the flag colour, 2. if the card is **suspended**, yellow, 3. if the card's note is **marked**, purple. In Notes mode, colour is only applied to marked notes.\ For more information about marked notes and suspended cards, see [Editing and More](./studying#editing-and-more). ### Columns The columns are configurable: right click on one (or Ctrl-click on a Mac) to choose which columns you'd like to see. You can drag columns to reorder them. Clicking on a column will sort by that column; click again to reverse the sort order. Note that you cannot sort by the Question and Answer columns. All columns are available for both [Cards and Notes mode](./#table-modes) but sometimes with slightly different names and data. The following table lists the behaviours for both modes. | Column | Cards mode | Notes mode | | - | - | - | | Answer | The back side of the card in one line with the question stripped. You can also choose a [custom format](./templates/styling#browser-appearance) in the card type editor instead. | The same as in Cards mode, only for the first card of the note. | | Card(s) | The name of the card's template. | The number of cards the note has. | | Card Modified | The last time changes were made to the card (e.g. when you reviewed the card and the review history and interval were updated). | The last time changes were made to one of the note's cards. | | Created | The same as in Notes mode for the card's note. | The date the note was created. | | Deck | The name of the deck the card is in. | The number of different decks the note's cards are in, or the deck name if all cards are in the same deck. | | Due | The due date for cards in review or (re)learning, and the position in the new card queue for new cards. The line is wrapped in brackets if the card is suspended or buried. Sorting is done by type and only then by date or position. | The due date for the note's next due review or (re)learning card that is not suspended, buried or in a filtered deck. | | (Avg.) Ease | The card's ease if it is not new. | The average ease for the note's cards that are not new. | | (Avg.) Interval | The card's interval if the card is in review or relearning. | The average interval for the note's cards that are in review or relearning. | | Lapses | How often the card was rated “Again”. | The total lapses for all cards of the note. | | Note | The same as in Notes mode for the card's note. | The name of the note's note type. | | Note Modified | The same as in Notes mode for the card's note. | The last time the note (e.g. the content of a field) was edited. | | Question | The front side of the card in one line. You can also choose a [custom format](./templates/styling#browser-appearance) in the card type editor instead. | The same as in Cards mode, only for the first card of the note. | | Reviews | How often the card has been reviewed. | The total review count for all cards of the note. | | Sort Field | The same as in Notes mode for the card's note. | The content of the note's field that is defined as the note type's sort field. Only this one field can be displayed and sorted by. You can change the sort field by clicking **Fields...** in the editing area. | | Tags | The same as in Notes mode for the card's note. | The note's tags. | ## Editing Area The bottom right area displays the note of the currently selected row. For more information about cards and notes, see [Getting Started](./getting-started). For more information on formatting buttons, see [Editing](./editing). You can see a preview of what the currently selected card would look like when reviewing by clicking the **Preview** button at the top of the editing area. Note that this will not display any type-the-answer fields on your cards, which makes it easier to preview the cards quickly. In Notes mode, the preview is shown for the first card of the selected note. ## Menus and Actions At the top of the browser window, you find a toolbar with various menus which in turn offer various actions that can be performed in the browser. ### Edit | Name | Action | | - | - | | Undo | Revert the most recently performed operation. | | Select All | Select all rows displayed. | | Select Notes | Show only the currently selected notes and select all rows. | | Invert Selection | Select those rows not selected, and deselect the currently selected rows. | | Create Filtered Deck | Show the [filtered deck](./filtered-decks#creating-manually) dialog and set the current browser search as a filter. Use Alt / Option to set the second filter instead. | ### Notes Most of the following actions operate on the selected notes. They are also available through a context menu when a selected row is right-clicked in Notes mode. In Cards mode, they can be found in a submenu of the context menu. | Name | Action | | - | - | | Add Notes | Open the [Add](./editing#adding-cards-and-notes) dialog. | | Create Copy | Open a [duplicate](./browsing#finding-duplicates) of the current note in the [editor](./editing#adding-cards-and-notes), which can be slightly modified to easily obtain variations of your cards. By default, the duplicate card will be created in the same deck as the original. | | Export Notes | Open the [Export](./exporting) dialog. | | Add Tags | Add provided tags to all selected notes. | | Remove Tags | Enter tags and remove them from all selected notes. | | Clear Unused Tags | Remove all tags from the sidebar that are not used by any notes. | | Toggle Mark | If the current note is marked (i.e., has the *Marked* tag), unmark all selected notes. If the current is not marked, mark all selected notes. | | Change Note Type | Convert the selected notes from one type to another. For example, imagine you have a *Russian* note type and a *Computer* note type, and you accidentally added some computer-related text into a *Russian* note. You can use this option to fix that mistake. The scheduling of cards is not affected. Changing the type of a note requires a one-way sync. | | Find Duplicates | Open the [Duplicates](./#finding-duplicates) dialog. | | Find and Replace | Open the [Find and Replace](./#find-and-replace) dialog. | | Manage Note Types | Open the [Note Types](./editing#adding-a-note-type) dialog. | | Delete | Delete all selected notes and their cards. It is not possible to remove individual cards, as individual cards are controlled by the [templates](./templates/intro). | ### Cards The following actions operate on the currently selected cards. They are also available through a context menu when a selected row is rightclicked in Cards mode. In Notes mode, they can be found in a submenu of the context menu. | Name | Action | | - | - | | Change Deck | Move currently selected cards to a different deck. | | Set Due Date | Turns cards into review cards if they are new, and makes them due on a certain date. This can be useful for moving cards forward or back a few days when your study schedule is interrupted. Entering a range like `60-90` will make the selected cards due between 60 and 90 days from now. New cards will have their interval set to the same delay, but review cards will be rescheduled without changing their current interval, unless an exclamation mark (`!`) is included at the end of the range. Note that the answer time is not recorded when manually scheduling cards, since the action can be performed even outside of review, and Anki isn't aware of which card may or may not be shown at the time. | | Reset | Move currently selected cards to the end of the new queue. The existing review history is preserved. In 2.1.50+, there are options to restore the original card position, and to reset the card's lapse and repetition counters. | | Reposition | Change the order new cards will appear in. You can find out the existing positions by enabling the *due* column, as described in the [table](./#cardnote-table) section above. If you run the reposition command when multiple cards are selected, it will apply increasing numbers to each card in turn. By default the number increases by one for each card, but this can be adjusted by changing the "step" setting. The **Shift position of existing cards** option allows you to insert cards between currently existing ones, pushing the currently existing ones apart. For instance, if you have five cards and you want to move 3, 4, and 5 between 1 and 2, selecting this setting would cause the cards to end up in the order 1, 3, 4, 5, 2. By contrast, if you turn this option off, 1 and 2 will get the same position number (and it will thus be unpredictable which of the cards with the same number comes up first). Note that when enabled, any card with a higher position will be modified, and all of those changed cards will need to be sent the next time you sync. | | Toggle Suspend | [Suspend](./studying#editing-and-more) or unsuspend all selected cards, depending on whether the current card is suspended or not. | | Flag | Toggle the flags of all selected cards. Whether a flag is added or removed depends on whether the current card has the chosen flag. | | Info | Show various information about the current card, including its review history. For more information, see [Card Info](./stats#card-info). | ### Go This menu exists to provide keyboard shortcuts to jump to various parts of the browser, and to go up and down the card list. ## Find and Replace This dialog allows for replacing text on notes. As described above, it is available from the toolbar and the table's context menu. The first input field is for the text that is going to be replaced, the second one for the replacement. Next, there is a dropdown menu that allows you to specify where Anki should look for text to replace: in a note's tags (requires Anki 2.1.45+), in all fields, or just in a specific field (only fields belonging to a selected note will be listed). By default, only selected notes will be affected. If you want to lift that restriction, you can untick the "selected notes only" checkbox (requires Anki 2.1.45+). The regular expression option allows you to perform complex replacements. For example, assume there is the following text in a field: ```text theme={null} ``` We use these settings: ![Find and Replace dialog](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/find_and_replace.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=9a4f50f0fef775a4c0b2f14a2000be14) (Note that on Anki versions prior to 2.1.28, you would need to replace `${1}` with `\1`.) Then the assumed field content will change to: ```text theme={null} pic.jpg ``` A full discussion on regular expressions is outside the scope of this document. There are a number of syntax guides available on the web: * For Anki 2.1.28+, see [https://docs.rs/regex/latest/regex/index.html#syntax](https://docs.rs/regex/latest/regex/index.html#syntax). * For older Anki versions, see [http://docs.python.org/library/re.html](http://docs.python.org/library/re.html). ## Finding Duplicates You can use the **Notes > Find Duplicates** option to search for notes that have the same content. When you open the window, Anki will look at all of your note types and present a list of all possible fields. If you want to look for duplicates in the *Back* field, you’d select it from the list and then click **Search**. By default, it will search in all note types that have the field you provided. This differs from the duplicate check when you add cards manually, which is limited to a single note type. The **Optional filter** text box allows you to narrow down where Anki will look for duplicates. If you only want to search for duplicates in the "French Vocab" and "French Verbs" note types, you would enter: ```text theme={null} "note:french vocab" or "note:french verbs" ``` Or you might want to look only for duplicates in a particular deck, so you could use: ```text theme={null} "deck:myDeck" ``` The search syntax is the same as used when searching in the browser. For more information, see [Searching](./searching). You can click one of the links in the search results list to display the duplicate notes in that set. If the search brings up a large number of duplicates, you may wish to instead click the **Tag Duplicates** button, which will tag all matching notes with *duplicate*. You can then search for this tag in the browser and handle them all from the same screen. # Contributing Source: https://docs.ankiweb.net/manual/contrib ## Sharing Decks Publicly To share decks with the general public, [synchronize](./syncing) them with AnkiWeb, then log into AnkiWeb and click on "Share" from the menu next to the deck you wish to share. If you shared a deck previously (including with previous versions of Anki), you can update it by clicking "Share" as above. Updating a shared deck will not reset the download counts or ratings. You can delete a shared deck that you have uploaded using the Delete button on the shared deck's page. When updating a deck, AnkiWeb expects the deck to be at the same location as before. If you shared a deck when it was called "Korean Verbs" for example, and then renamed it to "Korean::Korean Verbs", resharing will not be able to update the existing copy. If you have forgotten the original name, you can guess it by downloading the deck on AnkiWeb and importing it (File > Import) in a new profile (File > Switch profile > Add). Then you can copy the exact name of the deck when it was first shared. If this doesn't work, please contact support. When you update a shared deck, users who downloaded the deck previously will not automatically receive updates. If they download the deck again and re-import it, newly added material will be imported without altering their existing study progress, provided neither you nor the user has altered the note type since the first import. ## Sharing Decks Privately If you’d like to share decks with a limited group of people (such as a study group or class) rather than the general public, you can do so by sharing them outside of AnkiWeb. To share a deck privately, go to the File menu and choose Export. Select a single deck (not "All Decks"), and turn off "include scheduling information". This will produce an .apkg file which you can share with others. You can share the .apkg file by emailing it to people, placing it on a website or shared folder, or using a free file sharing service like Dropbox or Google Drive and sending people a link. Both the computer version and mobile clients make it easy to import from an apkg file simply by clicking or tapping on it. AnkiWeb does not have the ability to import apkg files however, so the recipients of your deck will need to have the computer version or Anki on their mobile device. When a user imports an .apkg file, cards that already exist in their collection will be ignored and any new cards will be added. As long as they use the same note type, modified cards will also be updated. To prevent data loss, cards that have been deleted in the new apkg file will not be deleted in the user’s collection, so if you need to delete cards from users' decks for whatever reason, you will need to contact them about it. ## Sharing Add-ons See [Sharing Add-ons](/addons/sharing) ## Translating Anki See [https://translating.ankiweb.net](https://translating.ankiweb.net) ## Contributing Code Anki's source code is available at [https://github.com/ankitects/anki](https://github.com/ankitects/anki) Before contributing, please see [contributing.md](https://github.com/ankitects/anki/blob/main/docs/contributing.md). # Deck Options Source: https://docs.ankiweb.net/manual/deck-options Deck options primarily control the way Anki schedules cards. It is recommended that you spend a few weeks with the defaults to get a feel for how Anki works before you start adjusting the options. Make sure you understand the options before changing them, as mistakes can reduce Anki's effectiveness. On your computer, do any of the following to open deck options: * Click the gear icon on the Decks screen. * Select a deck on the Decks screen, and then click **Options** at the bottom of the screen. * Click **More > Options** while in review mode. * Press O while in review mode. Here are some community posts about deck options that have been contributed in the past: * [Deck Options Explained](https://forums.ankiweb.net/t/deck-options-explained/213) * [Deck Options in a Mental Map](https://forums.ankiweb.net/t/deck-options-in-a-mental-map/15757) ## Presets Anki allows you to share options between different decks, to make it easier to update options in many decks at once. To do this, options are grouped into *presets*. If you change an option in a preset, the change is applied to all decks that use the same preset. All newly created decks use the "Default" preset. To change the options in one deck but not other decks, click the arrow icon in the top right of the Deck Options window. You can do the following: * **Save**: Save all modifications you've made in deck options. * **Add Preset**: Add a new preset for this deck, with the default options. * **Clone**: Clone your current preset, which is useful if you want to modify some of the options but keep the rest as they are. * **Rename**: Change the name of the current preset. * **Delete**: Delete the current preset. This will make your next sync a [one-way sync](./syncing#conflicts). * **Save to All Subdecks**: Like **Save**, but also assigns the selected preset to all subdecks of the currently selected deck. Deck options are not retroactive. For example, if you change an option that controls the delay after failing a card, cards that you failed before changing this option will still have the old delay, not the new one. ## Subdecks If your deck has subdecks, and you wish one or more of them to have different settings from the parent deck, you can assign those subdecks to separate presets. When Anki shows a card, it will check which subdeck the card is in, and use the options for that deck. There are two exceptions: * The **New cards/day** and **Maximum reviews/day** [limits](./#daily-limits) of a subdeck affect the number of cards that can be gathered from that subdeck. But the total number of cards you see during your study session is controlled by the limits of the deck you select to study. * The [display order](./#display-order) options are taken from the deck you select to study, not the deck of the current card. For example, let's say you have this collection: ```text theme={null} - Deck A (Preset 1) - Deck A::Subdeck B (Preset 2) ``` Preset 1 and Preset 2 are identical, with two exceptions: * Preset 1: * **Learning steps**: `1m 10m` * **New/review order**: `Mix with reviews` * Preset 2: * **Learning steps**: `20m 2h` * **New/review order**: `Show after reviews` If you choose to study Subdeck B: * Learning steps for all new cards will be `20m 2h` (Preset 2 applies). * All new cards will be shown after reviews (Preset 2 applies). If you choose to study Deck A: * Learning steps for new cards in Deck A will be `1m 10m` (Preset 1 applies). * Learning steps for new cards in Subdeck B will be `20m 2h` (Preset 2 applies). * All new cards will be mixed with reviews (Preset 1 applies). ## Daily Limits ### New Cards/Day This option controls how many new cards can be introduced each day you open the program. If you study fewer than the limit, or miss a day, the next day the counts will be back to their original setting: you won't be given more cards than your limit allows. When studying a deck that has subdecks inside it, the limits set on each subdeck control the maximum number of cards drawn from that particular deck. The selected deck's limits control the total number of cards that will be shown. For earlier versions, see [this FAQ page](/faqs/the-anki-2.1-scheduler). Studying new cards will temporarily increase the number of reviews you need to do a day, as newly-learned material needs to be repeated a number of times before the delay between repetitions can increase appreciably. If you are consistently learning 20 new cards a day, you can expect your daily reviews to be roughly about 200 cards/day. You can decrease the reviews required by introducing fewer new cards each day until your review burden decreases. More than one Anki user has excitedly studied hundreds of new cards over their first few days of using the program, and then has become overwhelmed by the reviews required. ### Maximum Reviews/Day Allows you to set an upper limit on the number of review cards to show each day. When this limit is reached, Anki will not show any more review cards for the day, even if there are more waiting. If you study consistently, this setting can help to smooth out occasional peaks in due card counts, and can save you from a heart attack when returning to Anki after taking a week off. When reviews have been hidden due to this option, a message will appear in the congratulations screen, suggesting you consider increasing the limit if you have time. When studying a deck that has subdecks inside it, the review limit behaves similarly to the new card limit. Anki includes any learning cards that have [crossed the day boundary](./preferences#scheduler) (interday learning cards) in the review count, so those learning cards will be subject to the review limit. ### Per-Deck Daily Limits It is possible to use the same preset for different decks, with customized limits for each of them. This eliminates the need to create cloned presets just for that purpose, and makes it easier to set custom limits on subdecks. Anki provides three options for daily limits: * **Preset**: applies to all the decks using a preset. * **This deck**: specific to a particular deck. * **Today only**: specific to a particular deck, and temporary. ### New Cards Ignore Review Limit By default, the review limit also applies to new cards, and no new cards will be shown when the review limit has been reached. If this option is enabled, new cards will be shown regardless of the review limit. If you have a backlog of overdue review cards, it is recommended that you stop introducing new cards until you catch up with that backlog. Continuing to introduce new cards when you're already behind can make the backlog worse. ### Limits Start From Top By default, the daily limits of a higher-level deck do not apply if you select one of its subdecks. A parent deck can have a new card limit of 10 cards/day and its subdecks can have a new card limit of 20 cards/day. The limits set on the parent deck do not affect the number of new cards you can study from its subdeck. When this option is enabled, the limits set on higher-level decks also apply to their subdecks when a subdeck is selected. In the previous example, you will be able to study only 10 new cards from the subdecks instead of 20 new cards. This option can be useful if you wish to study individual subdecks, while enforcing a total limit on cards in all the subdecks. ## New Cards The options here only affect new cards and [learning cards](./getting-started#card-states). Once a card has graduated (that is, gone through all the learning steps), the options in this section no longer apply to the card. ### Learning Steps Controls the number of learning repetitions, and the delay between them. One or more delays, separated by spaces must be entered. Each time you click **Good** during review, the card moves to the next step. Each time you click **Again**, the card goes back to the first step. For example, let's say that your learning steps are `1m 10m 1d`. * When you click **Again**, the card goes through the first step, and is shown again 1 minute later. * When you click **Good** on a new card or after the 1 minute step, it moves to the next step, and is shown again in 10 minutes. * When you click **Good** on a card after the 10 minute step, it is delayed until the next day. * When you click **Good** on the card the next day, it graduates and becomes a review card. The card is shown again after the delay configured by the *graduating interval*. The **Hard** button works differently depending on which step you're on. * When you're on the first step, the **Hard** button shows a delay of `6m`. The `6m` delay is the average of first two steps: `1m` and `10m`. * Exception: When there's only one learning step, the **Hard** button shows a delay 1.5 times that step. This delay is at most 1 day longer than the learning step. * When you're on any other step, the **Hard** button repeats that step. If there’s nothing else to study, Anki will show learning cards up to 20 minutes early by default. To turn this off or change the amount of time to look ahead, see [Preferences](./preferences). #### Day Boundaries Anki treats small steps and steps that [cross a day boundary](./preferences#review) differently. With small steps, the cards are shown as soon as the delay has passed, in preference to review cards and new cards. This is done so that you can answer the card as closely to your requested delay as possible. In contrast, if the step crosses a day boundary, the delay is automatically converted to days. For example, if the next day starts after 5 hours and the delay is 6 hours, Anki converts the delay to 1 day. ### Graduating Interval The number of days to wait before showing a card again, after the Good button is used on the final learning step. This means that it is the first interval after the learning card graduates. See the example from [earlier in this section](./deck-options#learning-steps). ### Easy Interval The number of days to wait before showing a card again, after the Easy button is used on it. The **Easy** button turns learning cards into a review cards regardless of which step you're on, and assigns them the delay you have configured in this option. Easy interval should always be at least as long as the graduating interval, and typically a few days longer. ### Insertion Order Controls whether Anki should add new cards into the deck randomly, or sequentially. When you change this option, Anki will re-sort the decks in the current preset. On recent Anki versions, you should leave this option set to `Sequential`, and adjust the [display order](./deck-options#display-order) instead. ## Lapses When you click **Again** on a review card, it is called a *lapse*. The options listed here affect such lapsed cards. ### Relearning Steps The same as learning steps, but for lapsed cards. When you fail a review card (press **Again**), the card goes through *relearning steps*, before it becomes a review card again. If you leave the steps blank, the card will skip relearning, and will be assigned a new interval of 1 day by default. ### Minimum Interval Specifies a minimum number of days a card should wait after it finishes relearning. The default is one day, meaning once relearning is finished, it will be shown again the next day. ### Leeches Control the way Anki handles leeches. For details, see the [leeches](./leeches) section. ## Display Order The options in this section are taken from the deck you select to study, not the deck of the currently displayed card. Some further information about display order is available in the [studying section](./studying#display-order). ### New Card Gather Order Controls how Anki gathers new cards from a deck. The options are: * **Deck**: Gathers cards from each subdeck in order, starting from the top. Cards from each subdeck are gathered in ascending position. If the daily limit of the selected deck is reached, gathering may stop before all subdecks have been checked. This order is fastest in large collections, and allows you to prioritize subdecks that are closer to the top. Decks/subdecks are always ordered alphabetically, so you can give them a numeric prefix like 001 to control the order they appear in. You can also use `_` and `~` as a prefix to place items at the top or bottom. Although position order depends initially on the insertion order option, you can manually [reposition](./browsing#cards) cards in different ways. * **Deck, then random notes**: Gathers cards from each subdeck in order, starting from the top. Cards from each subdeck are gathered from randomly selected notes. * **Ascending position**: Gathers cards by ascending position (due #), which is typically the oldest-added first. * **Descending position**: Gathers cards by descending position (due #), which is typically the latest-added first. * **Random notes**: Gathers cards from randomly selected notes. * **Random cards**: Gathers cards in a random order. ### New Card Sort Order Controls how the new cards are sorted after they have been gathered. The options are: * **Card type, then order gathered**: Shows cards in order of card type number. Cards of each card type number are shown in the order they were gathered. If you have sibling burying disabled, this ensures all front→back cards are seen before any back→front cards. This order is useful if you don't want sibling cards to appear too close to each other. * **Order gathered**: Shows cards exactly as they were gathered. If sibling burying is disabled, this typically results in all sibling cards appearing one after the other. * **Card type, then random**: Shows cards in order of card type number, but shuffles the cards of each card type number. This order is useful if you don't want sibling cards to appear too close to each other, but still want the cards to appear in a random order. * **Random note, then card type**: Picks notes at random, then shows all of their siblings in order. * **Random**: Fully shuffles the gathered cards. ### New/Review Order Whether new cards should be mixed in with review cards, shown before them, or shown after them. ### Interday Learning/Review Order Whether (re)learning cards that cross a day boundary should be mixed in with review cards, shown before them, or shown after them. Because learning cards tend to be harder than review cards, some users prefer to see them at the end (getting the easy stuff done first), or at the start (allowing more time to review forgotten ones). ### Review Sort Order Controls how the review cards are sorted. The options are: * **Due date, then random**: The default order prioritizes cards that have been waiting longer, and it's the recommended order when you are up to date, or when you only have a small backlog. If you have taken an extended break or have fallen behind in your reviews, you may want to consider changing the sort order temporarily. * **Due date, then deck**: This also prioritizes cards that have been waiting longer, and then shows review cards for each subdeck in turn. * **Deck, then due date**: Shows review cards for each subdeck in turn. This order is generally not recommended, as having material appear consistently in the same order makes it easier to guess the answer based on context, and leads to weaker memories. * **Ascending intervals**: Shows cards with shorter intervals first. * **Descending intervals**: Shows cards with longer intervals first. * **Ascending ease**: Shows more difficult cards first. * **Descending ease**: Shows less difficult cards first. * **Relative overdueness**: Shows cards that you're more likely to have forgotten first. This is generally recommended if you have a large backlog that may take some time to get through, and you want to reduce the chances of forgetting more cards. When using the SM-2 algorithm, overdueness is determined by comparing how overdue cards are, and how long their interval is. For example, a card with a current interval of 5 days that is overdue by 2 days, will display before a card with a current interval of 10 days that is overdue by 3 days. When FSRS is enabled, this sort order is removed; the FSRS equivalent is **Ascending retrievability**, which is calculated based on each card's retrievability (probability of recall) and the desired retention in the preset. ## Burying When Anki gathers cards, it first gathers intraday learning cards, then interday learning cards, then review cards, and finally new cards. This affects how burying works: * If you have all burying options enabled, the sibling that comes earliest in that list will be shown. For example, a review card will be shown in preference to a new card. * Siblings later in the list can not bury earlier card types. For example, if you disable burying of new cards, and study a new card, it will not bury any interday learning or review cards, and you may see both a review sibling and new sibling in the same session. The options are: * **Bury new siblings**: Whether other new cards of the same note (e.g. reverse cards, adjacent cloze deletions) will be delayed until the next day. * **Bury review siblings**: Whether other review cards of the same note will be delayed until the next day. * **Bury interday learning siblings**: Whether other learning cards of the same note that crossed a day boundary will be delayed until the next day. For more info about burying cards, see [this section](./studying#siblings-and-burying) of the manual. ## Audio * **Don't play audio automatically**: By default, Anki automatically plays any audio you have on cards. If you turn on this option Anki will not play audio until you press the replay audio key, R or F5. * **Skip question when replaying answer**: Controls whether audio from the question side is played when you use replay action on the answer side. Note that, Anki [does not automatically play](./templates/fields#special-fields) audio from the `{{FrontSide}}` field. This option does not influence the behaviour of automatic play. ## Timers Anki monitors how long it takes you to answer each card, so that it can show you how long was spent studying each day. The time taken does not influence scheduling. ### Internal Timer * Maximum answer seconds: The default limit is 60 seconds. If you take longer than that, Anki assumes you have walked away from your computer or have been distracted, and caps the recorded time at 60 seconds, so that you don’t end up with inaccurate statistics. * This internal timer runs from when the question is shown until you press a button to grade your answer. If you consistently spend longer than 60 seconds on a card, you may want to consider either raising this limit, or even better, making your cards simpler. ### On-screen Timer * Show on-screen timer: On the Study screen, show a timer that counts the time you're taking to study each card. (This timer will stop when it reaches the Maximum answer seconds set for the internal timer.) * Stop on-screen timer on answer: Whether the on-screen timer should continue running from when you show the answer until you press a button to grade your answer. This option does not impact the time that is recorded for your statistics. ## Auto Advance Requires Anki 23.12 or later. Auto Advance allows you to automatically take some actions after a certain amount of time has passed. To use it, you must first set a non-zero time in **Seconds to show question for** and/or **Seconds to show answer for**. Then, in the study screen, use the Auto Advance action from the **More** button to start advancing. ## Easy Days If you want to spend less time on Anki on some days of the week, such as Sundays, this feature can help you do that. After the interval is calculated, it will be adjusted by a small amount to change the due date. Note that setting all days to "Reduced" or "Minimum" will result in the same workload as setting all days to "Normal". This feature works with both FSRS and the legacy SM-2 algorithm. Changing your Easy Days configuration doesn't retroactively change existing intervals and will only affect future intervals. Simply put, you will not see immediate changes in the number of due cards. ## FSRS The [Free Spaced Repetition Scheduler (FSRS)](https://github.com/open-spaced-repetition/fsrs4anki/wiki/ABC-of-FSRS) is an alternative to Anki's legacy SuperMemo 2 (SM-2) algorithm. By more accurately determining how much information you are likely to forget, it can help you remember more material in the same amount of time. When you turn on FSRS, some new options become available, and SM-2 specific options, such as **Graduating interval**, **Easy bonus**, etc. are hidden. This option is shared by all presets. **Before Enabling** * Ensure all of your Anki clients support FSRS. Anki 23.10, AnkiMobile 23.10, and AnkiWeb all support it. AnkiDroid supports it in 2.17+. If one of your clients doesn't support it, things will not work correctly. * If you previously used the "custom scheduling" version of FSRS, make sure you clear out the custom scheduling section before enabling FSRS. ### A Short Guide * Enable FSRS under the "FSRS" section, at the bottom of the deck options page. FSRS can only be enabled globally; you cannot enable it for some presets and disable it for others. * Ensure that all your learning and re-learning steps are shorter than 1d and can be completed on the same day. 23h is not recommended even though it's less than one day because you won't be able to finish this step on the same day as your first review. Steps such as 10m or 30m are good. * Click the "Optimize" button under the "FSRS parameters" field. If you see a message that says "The FSRS parameters currently appear to be optimal", that's fine. * Choose a value of desired retention: the proportion of cards recalled successfully when they are due. **This is the most important setting in FSRS. Higher retention leads to shorter intervals and more reviews per day.** The default is 90%, which offers a good balance of retention and workload. Above 90% the workload increases very quickly, and above 97% the workload can be overwhelming. You can use ["Compute minimum recommended retention"](./#compute-minimum-recommended-retention) to help you choose the value of desired retention. Parameters and desired retention are preset-specific, so you can create multiple presets with different settings. FSRS can adapt to almost any habit, except for one: pressing "Hard" instead of "Again" when you forget the information. When you press "Hard", FSRS assumes you have recalled the information correctly (though with hesitation and a lot of mental effort). If you press "Hard" when you have failed to recall the information, all intervals will be unreasonably high. So, if you have this habit, please change it and use "Again" when you forget the information. Regarding add-on compatibility, as a general rule of thumb, if an add-on affects intervals and scheduling in some way, it shouldn't be used with FSRS. ### Desired Retention Desired retention controls how likely you are to remember cards when they are scheduled for a review. The default value of 90% will schedule cards so you have a 90% chance of remembering them when they come up for review again. This should normally translate to remembering around 90% cards when they are reviewed, and only failing around 10%. Here is a graph that shows how adjusting desired retention will affect your workload: ![graph showing an exponential increase in workload as desired retention nears one.](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/FSRS_retention.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=77ca151a675f464aae4f6a232456dd84) The exact shape of the graph is different for everyone. However, the overall shape is more or less the same. In general, at lower desired retention you will have to do significantly fewer reviews per day, but you will also forget more cards. As desired retention approaches 100%, the workload increases drastically. For this reason, we suggest you be conservative when adjusting this number, and recommend you keep it lower than 97%. In the latest version of Anki, you can set different values of desired retention for different decks within the same preset. ### Help Me Decide **Help Me Decide (Experimental)** allows you to simulate workload at different levels of retention. In other words, you can find out what your own, personalized retention-workload graph looks like. This can help you choose what value of desired retention is the best for your needs. If you are unsure what to do with this information, you can ask yourself "How many reviews can I realistically do per day?" or "How many minutes can I realistically spend on reviews per day?", and check the corresponding workload graph to see what value of desired retention gives you a tolerable workload. Alternatively, you can check the amount of reviews/day (or time/day) at your *current* desired retention, then check how it will change if you change desired retention, and ask yourself "Do I want to study this much more to remember this much more?" or "Do I want to study this much less if it means remembering this much less?". For more information about the simulator, please read [this section](./deck-options#the-simulator). ### FSRS Parameters FSRS parameters affect how cards are scheduled. Do not change the parameters manually or copy them from someone else. **Optimize FSRS Parameters** The FSRS optimizer uses machine learning to learn your memory patterns and find parameters that best fit your review history. To do this, the optimizer requires several reviews to fine-tune the parameters. When you click the **Optimize** button, FSRS will analyze your review history, and generate parameters that are optimal for your memory and the content you're studying. If you have decks that vary wildly in subjective difficulty, it is recommended to assign them separate presets, as the parameters for easier decks will be different from harder decks. There is no need to optimize your parameters frequently: once every month is sufficient. By default, parameters are calculated from the review history of all decks using the current preset. You can optionally [adjust the search](./searching) before optimizing the parameters, if you'd like to change which cards are used for optimization. You can also optimize the parameters for all of your presets at once by clicking on **Optimize All Presets**. **Health Check** You can enable **Check health when optimizing (slow)** to check how well FSRS can adapt to your review history. Some common reasons why FSRS may not perform well: * Low number of reviews (less than a few hundred). As a machine learning algorithm, FSRS needs data to learn from. * [Hard misuse](/manual/studying#answer-buttons). Hard should **not** be used when you forgot the answer; it is a passing grade, not a failing grade. * Not using Again when you forgot the answer. Anki assumes that if you forgo the answer, you will press Again, and if you recalled it, you will press Hard/Good/Easy. ### Reschedule Cards on Change This option controls whether the due dates of cards will be changed when you enable FSRS, change desired retention, or change the parameters. The default is not to reschedule cards: future reviews will use the new scheduling, but there will be no immediate change to your workload. If rescheduling is enabled, the due dates of cards will be changed. Depending on your desired retention, it will often result in a large number of cards becoming due, so **this option is not recommended** when first switching from SM-2. Use this option sparingly, as it will add a review entry to each of your cards, and increase the size of your collection. If you're first switching from SM-2 and still wish to use this option, we recommend you first create a backup, enable FSRS with rescheduling, and then if needed, you can undo or restore from the backup. ### Compute Minimum Recommended Retention (\<25.07) > [!WARNING] > > ***Removed Feature*** > > This feature has been removed as of anki version 25.07 Compute minimum recommended retention (CMRR) attempts to find the desired retention value that leads to the most material learned, in the least amount of time. The calculated number can serve as a reference when deciding what to set your desired retention to. You may wish to choose a higher desired retention, if you’re willing to trade more study time for a greater retention rate. However, setting your desired retention lower than the minimum is not recommended, as you'll spend more time studying than necessary, due to increased forgetting. ### The Simulator You can use the simulator to get an estimate of your workload, either in reviews per day or in minutes of studying per day. * **Days to simulate** controls the duration of the simulated study history. * **Additional new cards to simulate** controls whether the simulator should simulate more cards than this preset already has. For example, if you currently have 100 cards under this preset, and you set **Additional new cards to simulate** to 50, the simulator will simulate a total of 150 cards. This can be useful if you plan to create more new cards in the future. * **New cards/day** and **Maximum reviews/day** control how many new cards will be learned each day and the maximum number of reviews per day. * **Maximum interval** controls the maximum interval length (in days). To make the simulation as realistic as possible, the simulator takes into account the real memory states (difficulty, stability, retrievability) of your cards. It also uses your FSRS parameters and the value of desired retention, therefore changing them will affect the simulation. #### Learning and Relearning Steps (Re)learning steps of 1 day or greater are not recommended when using FSRS. The main reason they were popular with the legacy SM-2 algorithm is because repeatedly failing a card after it has graduated from the learning phase could reduce its ease a lot, leading to what some people called "ease hell". This is not a problem that FSRS suffers from. By keeping your learning steps under a day, you will allow FSRS to schedule cards at times it has calculated are optimal for your material and memory. Another reason not to use longer learning steps is because FSRS may end up scheduling the first review for a shorter time than your last learning step, leading to the **Hard** button showing a longer time than **Good**. We also recommend you keep the number of learning steps to a minimum. Evidence shows that repeating a card multiple times in a single day does not significantly contribute to long-term memory, so your time is better spent on other cards or a shorter study session. In the latest version of Anki you can let FSRS control short-term scheduling by leaving the (re)learning steps field empty. This is an experimental feature. Note that just because FSRS-5 *can* give you intervals shorter than one day doesn't necessarily mean that it *will*. Your **Again** interval can be one day long, or even longer. #### Add-On Compatibility Some add-ons can cause conflicts with FSRS. As a general rule of thumb, if an add-on affects a card's intervals, it shouldn't be used with FSRS. A list of commonly used add-ons and their FSRS compatibility can be found in [Add-on Compatibility](https://github.com/open-spaced-repetition/fsrs4anki#add-on-compatibility). #### More Several frequently asked questions about FSRS have been answered in [its FAQ](/faqs/frequently-asked-questions-about-fsrs). For more info on FSRS, check: * [FSRS4Anki Wiki](https://github.com/open-spaced-repetition/fsrs4anki/wiki) * [FSRS4Anki on Github](https://github.com/open-spaced-repetition/fsrs4anki) ## Advanced ### Maximum Interval The maximum number of days a review card will wait before it's shown again. When reviews have reached the limit, **Hard**, **Good** and **Easy** will all give the same delay. The shorter you set this, the greater your workload will be. The default is 100 years; you can decrease this to a smaller number if you’re willing to trade extra study time for higher retention. ### Historical Retention This setting is hidden unless FSRS is turned on. When some of your review history is missing, FSRS needs to fill in the gaps. By default, it will assume that when you did those old reviews, you remembered 90% of the material. If your old retention was appreciably higher or lower than 90%, adjusting this option will allow FSRS to better approximate the missing reviews. Your review history may be incomplete for two reasons: * Because you're using the **Ignore cards reviewed before** option. * Because you previously deleted review logs to free up space, or imported material from a different SRS program. The latter is quite rare, so unless you're using the former option, you probably don't need to adjust this setting. ### Ignore Cards Reviewed Before If set, cards reviewed before the provided date will be ignored when optimizing FSRS parameters. This can be useful if you imported someone else's scheduling data, or have changed the way you use the answer buttons. ### Starting Ease Controls the ease that cards start out with. It is set when a card graduates from learning for the first time. It defaults to 2.50, meaning that once you have finished learning a card, answering **Good** on subsequent reviews will increase the delay by approximately 2.5x (e.g. if the last delay was 10 days, the next delay would be around 25 days). Based upon how you rate the card in subsequent reviews, the ease may increase or decrease from its starting value. ### Easy Bonus An extra multiplier applied to the interval when a review card is answered **Easy**. With the default value of 1.30, **Easy** will give an interval that is 1.3 times the Good interval (e.g. if the Good interval was 10 days, the Easy interval would be around 13 days). ### Interval Modifier An extra multiplier that is applied to all reviews. At its default of 1.00 it does nothing. If you set it to 0.80, intervals will be generated at 80% of their normal size (so a 10 day interval would become 8 days). You can thus use the multiplier to make your reviews less or more frequent. For moderately difficult material, the average user should find they remember approximately 90% of mature cards when they come up for review. You can find out your own performance by opening the graphs/statistics for a deck and looking at the Answer Buttons graph - mature retention is the correct% on the right side of the graph. If you haven’t been studying for long, you may not have any mature cards yet. As performance with new cards and younger cards can vary considerably, it’s a good idea to wait until you have a reasonable amount of mature reviews before you start drawing conclusions about your retention rate. On the SuperMemo website, they suggest that you can find an appropriate multiplier for a desired retention rate. Their formula boils down to: ```text theme={null} log(desired retention%) / log(current retention%) ``` Imagine we have a current retention rate of 85% and we want to increase it to 90%. We’d calculate the modifier as: ```text theme={null} log(90%) / log(85%) = 0.65 ``` You can use any [search engine to calculate this](https://duckduckgo.com/?q=log\(0.90\)+%2F+log\(0.85\)). If you enter the resulting 65% into the interval modifier, you should find over time that your retention moves closer to your desired retention. One important thing to note however is that the trade-off between time spent studying and retention is not linear: we can see here that to increase our retention by 5 percentage points, we would have to study 35% more frequently. If the material you are learning is very important then it may be worth the extra effort – that is, of course, something you will need to decide for yourself. If you are simply worried that you are forgetting too much, then you may find investing more time at the initial learning stage, or using mnemonics will give you more gain for less effort. One final thing to note is that Anki forces a new interval to be at least 1 day longer than it was previously, so that you do not get stuck reviewing with the same interval forever. If your goal is to repeat a card once a day for multiple days, you can do that by setting more learning mode steps, instead of by adjusting this modifier. ### Hard Interval The multiplier applied when you use the **Hard** button. The percentage is relative to the previous interval, e.g. with a default of 1.20, a card with a 10-day interval will be given 12 days. ### New Interval The multiplier applied when you use the **Again** button on a review card. The default 0.00 means that a review card's delay is reset to zero when you forget it (which then becomes 1 day after the [minimum interval](./#minimum-interval) is applied). If changed from the default, it is possible for forgotten cards to preserve part of their previous delay. For example, if a card had a 100 day interval, and you set the **New Interval** to 0.20, the new interval would be 20 days. While preserving part of the interval may seem to make sense, SuperMemo has observed that preserving part of the delay can actually [be counter-productive](https://supermemo.guru/wiki/Post-lapse_stability). For this reason, we recommend you leave it on the default setting. ### Custom Scheduling You can have more control over Anki's scheduling of cards by using your own JavaScript in the custom scheduling field. This is a global option, so code entered here applies to every preset. Here is an example custom scheduling script. Note that, for Qt5 versions of Anki, the code needs to be transpiled. ```javascript theme={null} // print the existing states console.log(JSON.stringify(states, null, 4)); // load the debugger if the web inspector is open debugger; // if the hard button is a learning step, make it // a 123 minute delay if (states.hard.normal?.learning) { states.hard.normal.learning.scheduledSecs = 123 * 60; } // apply the same change in a rescheduling filtered deck if (states.hard.filtered?.rescheduling?.originalState?.learning) { states.hard.filtered.rescheduling.originalState.learning.scheduledSecs = 123 * 60; } // increase ease factor by 0.2 when Easy used on a review if (states.good.normal?.review) { states.easy.normal.review.easeFactor = states.good.normal.review.easeFactor + 0.2; } ``` You can also see [FSRS custom scheduling code](https://github.com/open-spaced-repetition/fsrs4anki/blob/main/fsrs4anki_scheduler.js) as an example. The various scheduling states of cards are described in [SchedulingStates](https://github.com/ankitects/anki/blob/main/proto/anki/scheduler.proto). # Adding/Editing Source: https://docs.ankiweb.net/manual/editing ## Adding Cards and Notes Recall from the [basics](./getting-started) that in Anki we add notes rather than cards, and Anki creates cards for us. Click **Add** in the [main window](./studying#decks), and the Add Notes window will appear. ![Add Screen](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/add_screen.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=683e07fe688a1cedb836f34d9a3e8998) The top left of the window shows us the current [note type](./getting-started#note-types). If it does not say "Basic," then you may have added some note types when you downloaded a shared deck. The text below assumes that "Basic" is selected. The top right of the window shows us the [deck](./getting-started#decks) cards will be added to. If you would like to add cards to a new deck, you can click on the deck name button and then click **Add**. Below the note type, you'll see some buttons, and an area labelled "Front" and "Back". Front and Back are called [fields](./getting-started#notes--fields), and you can add, remove, and rename them by clicking the "Fields…​" button above. Below the fields is another area labelled "**tags**". Tags are labels that you can attach to your notes, to make organizing and finding notes easier. You can leave the tags blank if you wish, or add one or more of them. Tags are separated by a space. If the tags area says ```text theme={null} vocab check_with_tutor ``` …​then the note you add would have two tags. When you have entered text into the front and back, you can click the **Add** button or press Ctrl+Enter (Command+Enter on a Mac) to add the note to your collection. When you do so, a card will be created as well, and placed into the deck you chose. If you would like to edit a card you added, you can click the history button to search for a recently added card in the [browser](./browsing). For more information on the buttons between the note type and the fields, see the [editor](./editing) section. ### Duplicate Check Anki checks the first field for uniqueness, so it will warn you if you enter two cards with a Front field of "apple" (for example). The uniqueness check is limited to the current note type, so if you're studying multiple languages, two cards with the same Front would not be listed as duplicates as long as you had a different note type for each language. Anki does not check for duplicates in other fields automatically for efficiency reasons, but the browser has a "Find Duplicates" function, which you can run periodically. ### Effective Learning Different people like to review in different ways, but there are some general concepts to keep in mind. An excellent introduction is [this article](https://super-memory.com/articles/20rules.htm) on the SuperMemo site. In particular: * **Keep it simple**: The shorter your cards, the easier they are to review. You may be tempted to include lots of information "just in case," but reviews will quickly become painful. * **Don't memorize without understanding**: If you are studying a language, try to avoid large lists of words. The best way to learn languages is in context, which means seeing those words used in a sentence. Likewise, imagine you're studying a computer course. If you attempt to memorize the mountain of acronyms, you'll find it very difficult to make progress. But if you take the time to understand the concepts behind the acronyms, learning the acronyms will become a lot easier. ## Adding a Note Type While basic note types are sufficient for simple cards with only a word or phrase on each side, as soon as you find yourself wanting to include more than one piece of information on the front or back, it's better to split that information up into more fields. You may find yourself thinking "but I only want one card, so why can't I just include the audio, a picture, a hint, and the translation in the Front field?" If you'd prefer to do that, that's fine. But the disadvantage of that approach is that all the information is stuck together. If you wanted to sort your cards by the hint, you wouldn't be able to do that as it is mixed in with the other content. You also wouldn't be able to do things such as moving the audio from the front to the back, except by laboriously copying and pasting it for every note. By keeping content in separate fields, you make it much easier to adjust the layout of your cards in the future. To create a new type of note, choose **Tools > Manage Note Types** from the main Anki window. Then click **Add** to add a new type of note. You will now see another screen that gives you a choice of note types to base the new type on. "Add" means to base the newly created type on one that comes with Anki. "Clone" means to base the newly created type on one that is already in your collection. For instance, if you'd created a French vocab type already, you might want to clone that when creating a German vocab type. After choosing OK, you will be asked to name the new type. The subject material that you are studying is a good choice here – things like "Japanese", "Trivia", and so on. Once you have chosen a name, close the Note Types window, and you will return to the adding window. ## Customizing Fields To customize fields, click the **Fields...** button when adding or editing a note, or while the note type is selected in the Manage Note Types window. ![Fields](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/fields.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=7dbad6da901151b875cb654ea944989c) You can add, remove, or rename fields by clicking the appropriate buttons. To change the order in which the fields appear in this dialog and the add notes dialog, you can use the reposition button, which asks for the numerical position you want the field to have. So if you want to change a field to be the new first field, enter "1". Alternatively you can also drag and drop the field names to reorder them. To do that, use your mouse or finger to drag the field to the desired position. An indicator will show you where the field will be moved to. Do not use "Tags", "Type", "Deck", "Card", or "FrontSide" as field names, as they are [special fields](./templates/fields#special-fields) and will not work properly. The options at the bottom of the screen allow you to edit various properties of the fields to be used when adding and editing the cards. This is *not* where you customize what appears on your cards when reviewing; for that, see [templates](./templates/intro). * **Editing Font** allows you to customize the font and size used when editing notes. This is useful if you want to make unimportant information smaller, or increase the size of non-Latin characters which are hard to read. The changes you make here do not affect how cards appear when reviewing: to do that, see the [templates](./templates/intro) section. If you have enabled the "type in the answer" function, however, the text you type will use the font size defined here. (For information about how to change the actual font face when typing the answer, see the [checking your answer](./templates/fields#checking-your-answer) section.) * **Sort by this field…​** tells Anki to show this field in the Sort Field column of the browser. You can use this to sort cards by that field. Only one field can be the sort field at once. * **Reverse text direction** is useful if you are studying languages that display text from right to left (RTL), such as Arabic or Hebrew. This setting currently only controls editing; to make sure the text displays correctly during review, you'll need to adjust your [template](./templates/styling#text-direction). * **Use HTML editor by default** is useful if you prefer to edit the fields directly in HTML. * **Collapse by default**. Fields can be collapsed/expanded. The animation can be disabled in the [preferences.](./preferences) * **Exclude from unqualified searches (slower)** can be used if you want the content of a certain field not to appear in unqualified [(not limited to a specific field)](./searching#limiting-to-a-field) searches. After you have added fields, you will probably want to add them to the front or back of your cards. For more information on that, see the [templates](./templates/intro) section. ## Changing Deck / Note Type While adding, you can click on the top left button to change note type, and the top right button to change deck. The window that opens up will not only allow you to select a deck or note type, but also to add new decks or manage your note types. ## Organizing Content ### Using Decks Appropriately [Decks](./getting-started#decks) are designed to divide your content up into broad categories that you wish to study separately, such as English, Geography, and so on. You may be tempted to create lots of little decks to keep your content organized, such as "my geography book chapter 1", or "food verbs", but this is not recommended, for the following reasons: * Lots of little decks may mean you end up seeing cards in a recognizable order. On older scheduler versions, new cards can only be introduced in deck order. And if you were planning to click on each deck in turn (which is slow), you will end up seeing all the "chapter 1" or "food verb" reviews together. This makes it easier to answer the cards, as you can guess them from the context, which leads to weaker memories. When you need to recall the word or phrase outside Anki, you won't always have the luxury of being shown related content first! * While less of a problem than it was in earlier Anki versions, adding hundreds of decks may cause slowdowns, and very large deck trees with thousands of items can actually break the display of the deck list in Anki versions before 2.1.50. ### Using Tags Instead of creating lots of little decks, it's a better idea to use tags and/or fields to classify your content. Tags are a useful way to boost search results, find specific content, and keep your collection organized. There are many ways of using tags and flags effectively, and thinking in advance about how you want to use them will help you decide what will work best for you. Some people prefer using decks and subdecks to keep their cards organized, but using tags offers a big advantage over decks for that: you can add several tags to a single note, but a single card can only belong to one deck, which makes tags a more powerful and flexible categorization system than decks in most cases. You can also organize tags in trees [in the same way as you can do for decks](./getting-started#decks). For example, instead of creating a "food verbs" deck, you could add those cards to your main language study deck, and tag the cards with "food" and "verb". Since each card can have multiple tags, you can do things like [search](./searching#tags-decks-cards-and-notes) for all verbs, or all food-related vocabulary, or all verbs that are related to food. You can add tags from the Edit window and from the [Browser](./browsing), and you can also add, delete, rename, or organize tags there. Note that tags work at [note](./getting-started#notes--fields) level, which means that when you tag a card that has siblings, all the siblings will be tagged as well. If you need to tag a single card, but not its siblings, you should consider using flags instead. ### Using Flags Flags are similar to tags, but they will appear during study in the review window, showing a colored flag icon on the upper right area of the screen. You can also search for flagged cards in the Browse screen, rename flags from the browser and create filtered decks from flagged cards, but unlike tags, a single card can have only one flag at a time. Another important difference is that flags work at [card](./getting-started#cards) level, so flagging a card that has siblings won't have any effect on the card's siblings. You can flag / unflag cards directly while in review mode (by pressing Ctrl+1-7 on Windows or Cmd+1-7 on Mac) and from the [Browser.](./browsing) ### The "Marked" Tag Anki treats a tag called "marked" specially. There are options in the review screen and browse screen to add and remove the "marked" tag. The study screen will show a star when the current card's note has that tag. And cards are shown in a different color in the browse screen when their note is marked. Note: Marking is mainly left around for compatibility with older Anki versions; most users will want to use [flags](./editing#using-flags) instead. ### Using Fields For those who like to stay very organized, you can add fields to your notes to classify your content, such as "book", "page", and so on. Anki supports searching in specific fields, which means you can do a search for `"book:my book" page:63` and immediately find what you're looking for. ### Custom Study and Filtered Decks Using [custom study and filtered deck](./filtered-decks) you can create temporary decks out of search terms. This allows you to review your content mixed together in a single deck most of the time (for optimum memory), but also create temporary decks when you need to focus on particular material, such as before a test. The general rule is that if you always want to be able to study some content separately, it should be in a normal deck; if you only occasionally need to be able to study it separately (for a test, when under a backlog, etc.), then filtered decks created from tags, flags, marks or fields are better. ## Editing Features The editor is shown when [adding notes](./editing), [editing a note](./studying#editing-and-more) during reviews, or [browsing](./browsing). ![Editor icons](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/editor_icons.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=a1b0cce041c4a8f9834c81c3db8c8769) On the top left are two buttons, which open the [fields](./editing#customizing-fields) and [cards](./templates/intro) windows. On the right are buttons that control formatting. Bold, italic and underline work like they do in a word processing program. The next two buttons allow you to subscript or superscript text, which is useful for chemical compounds like H2O or simple mathematical equations like x2. Then, there are two buttons to allow you to change text colour. The rubber eraser button clears any formatting in the currently selected text — including the colour of the text, whether the selected text is bold, etc. The next three buttons allow creating lists, text alignment and text indent. You can use the paper-clip button to select audio, images, and videos from your computer's hard drive and attach them to your notes. Alternatively, you can copy the media onto your computer's clipboard (for instance, by right-clicking an image on the web and choosing "Copy Image") and paste it into the field that you want to place it in. For more information about media, see the [media](/media) section. The microphone icon allows you to record from your computer's microphone and attach the recording to the note. The Fx button shows shortcuts to add MathJax or [LaTeX](./math) to your notes. The \[…​] buttons are visible when a cloze note type is selected. ![Cloze icons](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/cloze_icons.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=f935828413edf06731f3d3a793c6bcf2) The `` button allows editing the underlying HTML of a field. ![HTML icon](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/html_icon.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=1f0f7aa8e8e781ff84e7e45804ac6edf) Anki 2.1.45+ supports adjusting sticky fields directly from the editing screen. If you click on the pin icon on the right of a field, Anki will not clear out the field's content after a note is added. If you find yourself entering the same content into multiple notes, you may find this useful. On previous Anki versions, sticky fields were toggled from the Fields screen. ![Pin icon](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/Pin_icon.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=99a954e1269072adf24946024d8d28c4) Most of the buttons have shortcut keys. You can hover the mouse cursor over a button to see its shortcut. When pasting text, Anki will keep most formatting by default. If you hold down the Shift key while pasting, Anki will strip most of the formatting. Under Preferences, you can toggle "Paste without shift key strips formatting" to modify the default behaviour. ## Cloze Deletion *Cloze deletion* is the process of hiding one or more words in a sentence. For example, if you have the sentence: ```text theme={null} Canberra was founded in 1913. ``` …​and you create a cloze deletion on "1913", then the sentence would become: ```text theme={null} Canberra was founded in [...]. ``` Sometimes sections that have been removed in this fashion are said to be "occluded". For more information on why you might want to use cloze deletion, see Rule 5 [here](https://super-memory.com/articles/20rules.htm). Anki provides a special cloze deletion type of note, to make creating clozes easy. To create a cloze deletion note, select the Cloze note type, and type some text into the "Text" field. Then drag the mouse over the text you want to hide to select it, and click the \[…​] button. Anki will replace the text with: ```text theme={null} Canberra was founded in {{c1::1913}}. ``` The "c1" part means that you have created one cloze deletion in the sentence. You can create more than one deletion if you'd like. For example, if you select Canberra and click \[…​] again, the text will now look like: ```text theme={null} {{c2::Canberra}} was founded in {{c1::1913}}. ``` When you add the above note, Anki will create two cards. The first card will show: ```text theme={null} Canberra was founded in [...]. ``` …​on the question, with the full sentence on the answer. The other card will have the following on the question: ```text theme={null} [...] was founded in 1913. ``` You can also elide multiple sections on the same card. In the above example, if you change c2 to c1, only one card would be created, with both Canberra and 1913 hidden. If you hold down Alt (Option on a Mac) while creating a cloze, Anki will automatically use the same number instead of incrementing it. Cloze deletions don't need to fall on word boundaries, so if you select "anberra" rather than "Canberra" in the above example, the question would appear as "C\[…​] was founded in 1913", giving you a hint. You can also give yourself hints that don't match the text. If you replace the original sentence with: ```text theme={null} Canberra::city was founded in 1913 ``` …​and then press \[…​] after selecting "Canberra::city", Anki will treat the text after the two colons as a hint, changing the text into: ```text theme={null} {{c1::Canberra::city}} was founded in 1913 ``` When the card comes up for review, it will appear as: ```text theme={null} [city] was founded in 1913. ``` For information on testing your ability to type in a cloze deletion correctly, see the section on [typing answers](./templates/fields#checking-your-answer). From version 2.1.56, nested cloze deletions are supported. For example, the following is valid: ```text theme={null} {{c1::Canberra was {{c2::founded}}}} in 1913 ``` The inner cloze is entirely nested within the outer. There is no support for partial overlaps, such as: ```text theme={null} [...] founded in 1913 -> Canberra was Canberra [...] in 1913 -> was founded ``` with the word "was" appearing in both deletions. The current implementation can only handle a limited amount of nesting. In Anki 24.11, it is 3 levels. In other versions, the limit is around 8, but Anki may become slow as you approach the limit. It is not possible to extend the limit. If you use this feature, it is recommended you limit yourself to a few levels of nesting. Prior to version 2.1.56, if you need to create clozes from overlapping text, add another Text field to your cloze, add it to the [template](./templates/intro), and then when creating notes, paste the text into two separate fields, like so: ```text theme={null} Text1 field: {{c1::Canberra was founded}} in 1913 Text2 field: {{c2::Canberra}} was founded in 1913 ``` The default cloze note type has a second field called Extra, that is shown on the answer side of each card. It can be used for adding some usage notes or extra information. The cloze note type is treated specially by Anki, and cannot be created based on a regular note type. If you wish to customize it, make sure to clone the existing Cloze type instead of another type of note. Things like formatting can be customized, but it is not possible to add extra card templates to the cloze note type. Anki now supports a new syntax that allows a single cloze deletion to appear on multiple cards: ```text theme={null} {{c1::-té}}, {{c2::-sion}}, or {{c3::-tion}} are {{c1,2,3,4::feminine}}. ``` This creates 4 cards, each hiding “feminine” in a different context. The same result can however still be achieved with the older nested syntax: ```text theme={null} {{c1::-té}}, {{c2::-sion}}, {{c3::-tion}} are {{c4::{{c3::{{c2::{{c1::feminine}}}}}}}} ``` The new syntax is easier to read and write, while the old syntax is more verbose. ## Image Occlusion Anki 23.10+ supports Image Occlusion cards natively. An Image Occlusion (IO) note is a special case of cloze deletion based on images instead of text, and allows you to create cards that hide some parts of an image, testing your knowledge of that hidden information. ![Image Occlusion](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/io.jpg?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=108e9d4c145675b855c9fa88a64ae6c8) ### Adding an image To add IO cards to your collection, open the Add screen, click on "Type" and choose "Image Occlusion" from the list of built-in note types. Then, click on **Select Image** to load an image file saved on your computer's hard drive, or on **Paste image from clipboard** if you have an image copied to the clipboard. ### Adding IO cards After loading an image, the IO editor will open. Click on the icons on the left to add as many areas to your image as you want. There are three basic shapes to choose from: * Rectangle * Ellipse * Polygon You can also choose between two different IO modes for each note: * **Hide All, Guess One**: All areas are hidden and only one area at a time is revealed while learning. * **Hide One, Guess One**: Only one area at a time is hidden and will be revealed during learning. The other areas will be visible. ![Image Occlusion Modes](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/io_modes.jpg?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=88b5dfcf249503f91e35dedc75a9375d) The default IO note type also has standard fields: **Header** (displayed above the image on the front and back of each card), **Back Extra** (displayed below the image on the back of each card), and **Comments** (not displayed on the cards). To access those from the IO editor, click the **Toggle Mask Editor** button. There you can also view and edit the **Tags** of the note. Once you're done, click on the "Add" button, at the bottom of the screen. Anki will add a card for each shape or group of shapes you added in the previous step, and you can start reviewing them normally. ## Editing IO notes You can edit your IO notes by clicking on "Edit" while reviewing, or directly from the browser. There are several tools that you can use. Of note: * Select: It allows you to select one or more shapes to move, resize, delete or group them. * Zoom: You can freely move the image and zoom in or out using the mouse wheel. * Shapes (Rectangle, Ellipse or Polygon): Use them to add new shapes / cards. * Text: It adds text areas to your image. These text areas can be moved, resized or deleted, but no card will be created when you use this tool. * Undo / Redo. * Zoom In / Out - Reset zoom. * Toggle Translucency: Use this tool to temporarily view the hidden areas. * Delete: Use this tool to delete selected shapes and text areas. Note that deleting a shape won't delete its associated card automatically; you will need to use Tools>Empty Cards afterwards, the same as with regular cloze deletions. * Duplicate. * Group selection: Use this tool to create a cluster of shapes, which will allow you to move, resize or delete them simultaneously. Note that two or more single shapes will create only one card once grouped. * Ungroup selection: Select a group and then click this button to make each shape independent again. * Alignment: This tool can be used to align your shapes / text areas as desired. While reviewing IO Cards a "Toggle Masks" button will appear just below the image. This button will temporarily clear all shapes of the note when using "Hide All, Guess One" mode. ## Inputting Non-Latin Characters and Accents All modern computers have built-in support for typing accents and non-Latin characters, and multiple ways to go about it. The method we recommend is by using a keyboard layout for the language you want to learn. Languages with a separate script like Japanese, Chinese, Thai, and so on, have their own layouts specific to that language. European languages that use accents may have their own layout, but can often be typed on a generic "international keyboard" layout. These work by typing the accent, then the character you want accented - e.g. an apostrophe (´) then the letter a (a) gives á. ### Adding international keyboard layouts Instructions on how to use international keyboards vary depending on the operating system and desktop environment that you are using. To get started, see the links below. Windows: * [https://thegeekpage.com/how-to-add-us-international-keyboard-in-windows-10/](https://thegeekpage.com/how-to-add-us-international-keyboard-in-windows-10/) Mac: * [http://www.macworld.com/article/1147039/os-x/accentinput.html](http://www.macworld.com/article/1147039/os-x/accentinput.html) Linux: * Gnome: [https://help.gnome.org/gnome-help/tips-specialchars.html](https://help.gnome.org/gnome-help/tips-specialchars.html) * KDE Plasma: [https://userbase.kde.org/Tutorials/ComposeKey](https://userbase.kde.org/Tutorials/ComposeKey) ### Adding keyboard layouts for specific languages Keyboards for specific languages are added in a similar way, but we can not cover them all here. For more information, please try searching on the internet for "input Japanese on a mac", "type Chinese on Windows 10", and so on. For Linux it's best to look at the wiki pages of your distro, e.g. [Arch Linux](https://wiki.archlinux.org/title/Input_method) and [Debian Linux](https://wiki.debian.org/Keyboard#Modern_strategy). As an example, `apt install ibus-anthy` on Debian allows you to type hiragana characters. ### Right-to-left Languages If you are learning a right-to-left language, there are lots of other things to consider. See [this page](http://dotancohen.com/howto/rtl_right_to_left.html) for more information. ### Limitations The toolkit on which Anki is built has trouble dealing with a few input methods, such as holding down keys to select accented characters on macOS, and typing characters by holding down the Alt key and typing a numeric code on Windows. ## Unicode Normalization Text like `á` can be represented in multiple ways on a computer, such as using a specific code for that symbol, or by using a standard `a` and then another code for the accent on top. This causes problems when mixing input from different sources, or using different computers - if your computer handles keyboard input in one form, but the content is stored in a different form, it will not match when searching, even though the end result appears identical. To ensure content can easily be found in searches, Anki normalizes the text to a standard form. For most users this process is transparent, but if you are studying certain material like archaic Japanese symbols, the normalization process can end up converting them to a more modern equivalent. If you want character variants preserved, the following in the [debug console](./misc) will turn off normalization: ```python theme={null} mw.col.conf["normalize_note_text"] = False ``` Any content added after that will remain untouched. The trade-off is that you may find it difficult to search for the content if you're switching between operating systems, or pasting content from mixed sources. # Exporting Source: https://docs.ankiweb.net/manual/exporting Exporting allows you to save part of your collection as a text file or packaged Anki deck. To export, click the File menu and choose **Export**. ## Text Files If you choose "Notes in Plain Text", Anki will write the contents of the notes into a text file. Each field is separated by a tab. If you edit the resulting file and don't modify the first field, you can later import that file back into Anki and Anki will update your notes based on your edits, provided you import back into the same note type. If you find yourself needing to edit the first field as well, you'll need to change the format of your note type so that the first field is an ID number rather than actual text. (You can install the [Add note id](https://ankiweb.net/shared/info/8897764) add-on to make this easier.) In order for formatting to be preserved when you import text back in, the text is exported with all the HTML formatting embedded in it. ## Packaged Decks A "packaged deck" consists of cards, notes, note types, and any sounds or images bundled up into a file ending with .apkg or .colpkg. You can use packaged decks to transfer cards between people, or for backing up parts of your collection. There are two different kinds of packaged decks. ### Collection (.colpkg) `.colpkg` stands for "Anki Collection Package". Exporting it will export your entire collection. The collection contains all decks with scheduling included. You can use the collection package to back up your collection, or copy it to another device. > [!NOTE] > > Collection packages created with previous versions of Anki were called > `collection.apkg`. #### What Happens on Import? If you import a `.colpkg` file, then all of your current cards in Anki will be deleted and replaced by the cards from the `.colpkg` file. This is useful for copying your collection back and forth between devices. Existing media in your collection is not deleted when you import a collection package. To delete unused media, use **Tools > Check Media**. #### Export Options ##### Include Media If true, local media will be included. If false, the `.colpkg` will not contain any audio, images or other media. ##### Support older Anki versions (slower/larger files) If true, a legacy version of the file is created. Turn this on if you need to support older clients. If false, a modern version of the file is created. Imports and exports will be faster, and media files will be compressed, but the resulting file will not be readable by older Anki clients. ### Deck (.apkg) `.apkg` stands for "Anki Deck Package". You can use it to export a single deck (and any child decks it may have). > [!NOTE] > > If the filename is `collection.apkg`, then it is a collection package instead. All > other filenames ending with `.apkg` are deck packages. #### What Happens on Import? When you import a deck package, Anki will add the contents into your collection, rather than overwriting your collection. If some notes in the deck package have previously been imported, Anki will keep the version with the most recent modification time. > [!NOTE] > > You have a deck with the name *Biology* and use it in Anki. You now download an > updated version of that same deck. If you import the updated deck, then Anki > will incorporate all the edits into your own Anki collection. > > If you re-import an unchanged `.apkg` after making changes in your own > collection (e.g. editing cards), then Anki will keep the changes in your > collection instead of overwriting them. #### Export Options ##### Include Scheduling Information If true, scheduling information such as your review history will be exported. If false, Anki will assume that you are sharing the deck with other people, and will remove the entire scheduling information, including marked and leech tags. That way users will have a clean copy of your deck. ##### Include Deck Presets If true, deck presets will be included. ##### Include Media If true, local media will be included. If false, the `.apkg` will not contain any audio, images or other media. ##### Support older Anki versions (slower/larger files) If true, a legacy version of the file is created. Turn this on if you need to support older clients. If false, a modern version of the file is created. Imports and exports will be faster, and media files will be compressed, but the resulting file will not be readable by older Anki clients. # Managing Files and Your Collection Source: https://docs.ankiweb.net/manual/files Managing Files ## Checking Your Collection It is a good idea to occasionally check your collection file for problems. You can do this via the Tools>Check Database menu item. Checking the database ensures the file has not been corrupted, rebuilds some internal structures, and optimizes the file. When you check the database, your tag list is also rebuilt. When you delete individual decks or cards, Anki does not update the list of used tags, as it's inefficient to do so. If you want to clear old tags out from the list that are no longer in use, checking your database is one way to do it. > [!NOTE] > > The clearing out of unused tags is not synced to other devices with the rest of your > collection, so you will need to run *Check Database* separately on each device. Note that Anki will automatically optimize your collection once every 2 weeks. This optimization ensures the collection performs well, but it does not check for errors or rebuild the tag list when automatically optimizing. ## User Data On **Windows**, the latest Anki versions store your collection files in your appdata folder. You can access it by opening the file manager, and typing `%APPDATA%\Anki2` in the location field. Older versions of Anki stored your Anki files in a folder called `Anki` in your `Documents` folder. On **Mac** computers, recent Anki versions store all user data in the `~/Library/Application Support/Anki2` folder. The `~` stands for your home folder. To open the Anki folder: 1. Open Finder and choose **Go → Go to Folder** from the menu bar, or press Shift+Command+G. 2. Paste `~/Library/Application Support/Anki2` and press Return. 3. Open the folder named after your Anki profile. For example, media for a profile named `User 1` is in `Anki2/User 1/collection.media`. This works even though the Library folder is hidden by default. You can also open Library from Finder's **Go** menu by holding down Option and choosing **Library**, then opening **Application Support → Anki2**. If you're on an older Anki version, your Anki files will be in your `Documents/Anki` folder. On **Linux**, recent Anki versions store your user data in `~/.local/share/Anki2`, or `$XDG_DATA_HOME/Anki2` if you have set a custom data path. If you are using a third-party **Flatpak** build, your files will be in `~/.var/app/net.ankiweb.Anki/data/Anki2/`. Older versions of Anki stored your files in `~/Documents/Anki` or `~/Anki`. Within the Anki folder, the program-level and profile-level preferences are stored in a file called `prefs.db`. There is also a separate folder for each profile. The folder contains: * Your notes, decks, cards and so on in a file called `collection.anki2` * Your audio and images in a `collection.media` folder * A backups folder * Some system files You should never copy or move your collection while Anki is open. Doing so could cause your collection to become corrupt. Please do not move or modify the other files in the folder either. ## Program Files Anki is installed in the following locations by default: * Windows: `%LOCALAPPDATA%\Programs\Anki` * macOS: `/Applications/Anki.app` * Linux: `/usr/local/share/anki` When you install/update Anki in versions 25.07 to 25.09.4, it downloads support files and places them in the following locations: * Windows: `%LOCALAPPDATA%\AnkiProgramFiles` * macOS: `~/Library/Application Support/AnkiProgramFiles` * Linux: `~/.local/share/AnkiProgramFiles` Removing that folder will cause the launcher to behave like a fresh install. The `AnkiProgramFiles` contains all the files needed to run Anki aside from the launcher. You can copy it to a different folder or system, and start Anki from the new location by opening `AnkiProgramFiles/.venv/bin/anki` (or `AnkiProgramFiles\.venv\scripts\anki` on Windows). If placed in the standard location on a new computer, the launcher will also be able to re-use the existing files, provided the files were copied with modification times preserved. See the flash drive section below for more. ## Startup Options If you have made a destructive change on one computer and have an undamaged copy on another computer, you may wish to start Anki without syncing in order to use the full sync option without first downloading the changes. Similarly, if you are experiencing problems with Anki, you might need to (or might be instructed to) disable add-ons temporarily to see if one might be causing the problem. To do both of these things at the same time, you can open Anki in safe mode by holding down the Shift key while starting Anki. Keep holding Shift down until the on-screen message informs you that Anki has started in safe mode. If you're on Linux and that didn't work, run 'anki --safemode'. It is possible to specify a custom folder location during startup. This is an advanced feature that is primarily intended to be used with portable installations, and we recommend you use the default location in most circumstances. The syntax to specify an alternate folder is as follows: ```text theme={null} anki -b /path/to/anki/folder ``` * If you have multiple profiles, you can pass -p \ to load a specific profile. * If you pass -p some-fake-name, Anki will show the profile screen on startup. If no profile is provided, the last-used profile is loaded. * To change the interface language, use -l \, such as "-l ja" for Japanese. If you always want to use a custom folder location, you can modify your shortcut to Anki. On Windows, right-click on the shortcut, choose Properties, select the Shortcut tab, and add "-b \path\to\data\folder" after the path to the program, which should leave you with something like ```text theme={null} "C:\Program Files\Anki\anki.exe" -b "C:\AnkiDataFolder" ``` You can also use this technique with the -l option to easily use Anki in different languages. On Windows, you should use a backslash (\\) not a forward slash (/). On a Mac there is no easy way to alter the behaviour when clicking on the Anki icon, but it is possible to start Anki with a custom base folder from a terminal: ```text theme={null} open /Applications/Anki.app --args -b ~/myankifolder ``` Alternatively, you can define the environment variable "ANKI\_BASE". On Windows, you can define the environment variable with: ```text theme={null} set "ANKI_BASE=C:/path/to/AnkiDataFolder" ``` On Linux and macOS, you can use: ```text theme={null} export ANKI_BASE="/path/to/AnkiDataFolder" ``` ## DropBox and File Syncing We do not recommend you sync your Anki folder directly with a third-party synchronization service, as it can lead to database corruption when files are synced while in use. If you just want to synchronize your media, you can link external folders into services like DropBox. See [DropboxWiki: Sync Folders Outside Dropbox (archive.org)][dropboxwiki-sync-other] for more info. [dropboxwiki-sync-other]: http://web.archive.org/web/20180919153730/http://www.dropboxwiki.com/tips-and-tricks/sync-other-folders If you wish to keep your collection in sync as well, it is strongly recommended that you create a script that copies your files from your synced folder to a local folder, launches Anki, and then copies the files back when Anki is closed. This will ensure that the files are never synchronized while they are open. ## Network Filesystems We strongly recommend you have Anki store your files on a local hard disk, as network filesystems can lead to database corruption. If a network filesystem is your only option, regular use of Tools>Check Database to detect corruption is recommended. ## Running from a Flash Drive On Windows, Anki can be installed on a USB / flash drive and run as a portable application. The following example assumes your USB drive is drive E; adjust as necessary. * Copy the %LOCALAPPDATA%\Programs\Anki folder to the flash drive, so you have a folder like E:\Anki. * Create a text file called E:\anki.bat with the following text: E:\anki\anki.exe -b E:\ankidata If you would like to prevent the black command prompt window from remaining open, you can instead use: ```text theme={null} start /b E:\anki\anki.exe -b E:\ankidata ``` * Double-clicking on anki.bat should start Anki with the user data stored in E:\ankidata. The full path including drive letter is required - if you try using `\anki\anki.exe` instead you will find syncing stops working. WARNING: The drive letter must be the same on all devices. If you set this up for drive E, it won't work for a flash drive mapped to drive D for example. WARNING: Media syncing with AnkiWeb may not work if your flash drive is formatted as FAT32. Please format the drive as NTFS to ensure media syncs correctly. ### Anki Launcher These instructions apply to Anki versions 25.07 to 25.09.4: 1. Download the latest Anki launcher, and install it in a custom location: `E:\Anki\Launcher`. Not `E:\Anki\Launcher\Anki`. 2. When the launcher appears, close it without installing. 3. Put the following in a file `E:\Anki\Anki.bat`: ```bat theme={null} @echo off echo Starting Anki... set USB_ROOT=%~dp0 set ANKI_LAUNCHER_VENV_ROOT=%USB_ROOT%\AnkiProgramFiles set ANKI_LAUNCHER=%USB_ROOT%\Launcher\anki set ANKI_BASE=%USB_ROOT%\AnkiData start /b %ANKI_LAUNCHER% ``` 4. Double-click on the .bat file you created, and install Anki as normal. 5. You can now double-click on the .bat file to run Anki from other machines. Tools>Upgrade/Downgrade will continue to function, but only when your machine has access to the internet. ## Backups See [this section](./backups). ## Inaccessible Harddisk If Anki can't write to files in the [Anki folder](./#user-data), a message will be displayed on startup saying that Anki can't write to the harddisk, and Anki will close. If you're unsure how to fix the permissions, please contact someone near you who is knowledgeable about computers and can help you out. ## Permissions of Temp Folder Anki uses the system's temporary folder to store temporary data. If the permissions of this folder have been changed from the default settings by a rogue app or buggy antivirus app, Anki will not function properly. If you're on a Windows 7 machine, the general steps to fix the problem are listed below. As this is somewhat complicated, please ask someone knowledgeable about Windows if you are not sure. 1. Click on the start bar, and type in %temp% (including the percents), then hit Enter. 2. Go up one folder, and locate the temp folder. Right click on it, and choose Properties. 3. In the security tab, click on Advanced. 4. Click on the Owner tab. If you're not listed as the owner, click the button to take ownership. 5. On the permissions tab, ensure that you have full control. On a default W7 install the control will actually be inherited from c:\users\your-username. ## Corrupt Collections Anki uses a file format that is robust against program and computer crashes, but it's still possible for your collection to become corrupt if the files are modified while Anki is open, stored on a network drive, or corrupted by a bug. When you run Tools>Check Database, you will receive a message if Anki detects the file has been corrupted. **The best way to recover from this is to restore from the most recent [automatic backup](./#backups)**, but if your backup is too old, then you can attempt to repair the corruption instead. On Linux, make sure sqlite3 is installed. On a Mac, it should be installed already. On Windows, download [http://www.sqlite.org/sqlite-3\_6\_23.zip](http://www.sqlite.org/sqlite-3_6_23.zip). Next, create a backup of your collection.anki2 file, in case something goes wrong with the steps below. ### Linux/macOS Open a terminal, change to the folder your collection is located in, and type: ```text theme={null} sqlite3 collection.anki2 .dump > dump.txt ``` Open the resulting dump.txt file in a text editor, and look at the final line. If it reads "rollback;", change it to "commit;" Then run the following in a terminal: ```text theme={null} cat dump.txt | sqlite3 temp.file ``` Make sure you use temp.file - do not put collection.anki2 on the right, or you will blank out the file. When you're done, proceed to the final step. ### Windows Copy the `sqlite3.exe` program and your deck to your desktop. Then go to **Start>Run** and type in `cmd.exe`. If you're on a recent Windows, the command prompt may not start on your desktop. If you don't see desktop displayed in the command prompt, type something like the following, replacing "administrator" with your login name. ```text theme={null} cd C:\Users\Administrator\Desktop ``` Then type: ```text theme={null} sqlite3 collection.anki2 .dump > dump.txt ``` Open the resulting dump.txt file in a text editor, and look at the final line. If it reads "rollback;", change it to "commit;" Then run the following in a terminal: ```text theme={null} type dump.txt | sqlite3 temp.file ``` Make sure you use temp.file - do not put collection.anki2 on the right, or you will blank out the file. When you're done, proceed to the final step. ### Final Step Check that you didn't get an error message, and that temp.file is not empty. The procedure optimizes the collection in the process, so it's normal for the new file to be somewhat smaller than the old one. When you've confirmed the file is not empty: * rename the original collection.anki2 file to something else * rename temp.file to collection.anki2 * move collection.anki2 back into your collection folder, overwriting the old version * start Anki and go to Tools>Check Database to make sure the collection has been successfully restored. # Filtered Decks & Cramming Source: https://docs.ankiweb.net/manual/filtered-decks Filtered Decks When you study a regular deck in Anki, only a limited number of cards are shown: the cards Anki thinks you are about to forget, and a daily limit of new cards. This is generally useful, as it ensures you don't spend more time studying than necessary. But sometimes it can be useful to step outside of these normal limits, such as when you need to review for a test, focus on particular material, and so on. To make this possible, Anki provides a different type of deck called a "filtered deck". Filtered decks offer a lot of possibilities. They can be used for previewing cards, cramming cards before a test, studying particular tags, catching up on a backlog with a particular sort order, reviewing ahead of schedule, going over the day's failed cards, and more. ## Custom Study The easiest way to create a filtered deck is with the Custom Study button, which appears at the bottom of the screen when you click on a deck. It offers some convenient preset filters for common tasks like reviewing the cards that you have failed that day. It will create a filtered deck called "Custom Study Session" and automatically open it for you. If an existing "Custom Study Session" deck exists, it will be emptied before a new one is created. If you wish to keep a custom study deck, you can rename it from the deck list. Here is a summary of each of the options: **Increase today's new card limit**\ Add more new cards to the deck you are currently studying. Note that unlike other options, this does "not" create a new filtered deck, it modifies the existing deck. **Increase today's review card limit**\ If not all reviews due today were shown because of the daily review limit, this option allows you to show more of them. As with the new cards option, this modifies the existing deck. **Review forgotten cards**\ Show all the cards, for which you've answered Again (1) within the number of days you specify. **Review ahead**\ Show cards that will be due in the near future (the number of days you specify). This is useful for working through some of your older cards before a vacation, but it will not help with cards you have learned recently. See the [reviewing ahead](./#reviewing-ahead) section below for more info. **Preview new cards**\ Show cards that you have recently added, without converting them to review cards as they are answered. **Study by card state or tag**\ Select a certain number of cards from the current deck to study. You can choose to select new cards only, due cards only, or all cards; after you click "Choose Tags", you can also limit the selected cards by tags. If you wish to see all the cards in the deck (for instance, to study before a big test), you can set the number of cards to more than the number of cards in the deck. ## Home Decks When a card is moved to a filtered deck, it retains a link to the deck, from which it came. That previous deck is said to be the card's "home deck". Cards automatically return to their home deck after they are studied in the filtered deck. This can be after a single review, or after multiple reviews, depending on your settings. It is also possible to move all cards back to their home decks at once: * The "Empty" button in the study overview moves all cards in the filtered deck back to their home deck, but does not delete the empty filtered deck. This can be useful if you want to fill it again later (using the Rebuild button). * Deleting a filtered deck does the same thing as "Empty" does, but also removes the emptied deck from the deck list. No cards are deleted when you delete a filtered deck. ## Creating Manually Advanced users can create filtered decks with arbitrary search strings (or "filters"), instead of relying on the preset filters. To create a filtered deck manually, choose Create Filtered Deck from the Tools menu. When you click the Build button, Anki finds cards that match the settings you specified, and temporarily moves them from their existing decks into your new filtered deck for study. If you wish to fetch cards again using the same filter options (for instance, if you want to study all cards with a particular tag every day), you can use the Rebuild button at the bottom of the deck's overview screen. The **search** area controls what cards Anki will gather. All of the searches possible in the browser are also possible for filtered decks, such as limiting to tags, finding cards forgotten a certain number of times, and so on. See the [searching](./searching) section of the manual for more information on the different possibilities. Filtered decks cannot pull in cards that are suspended, buried, or already in a different filtered deck. For this reason, a search in the browser may reveal cards that do not end up in the filtered deck. The **limit** option controls how many cards will be gathered into the deck. The order you select controls both the order cards are gathered in, and the order they will be reviewed in. If you select "most lapses" and a limit of 20 for example, then Anki will show you only the 20 most lapsed cards. The **enable second filter** option allows you to create a filtered deck comprised of two different searches, so that you can, for example, include due cards with one order, and a smaller amount of new cards with a different order. ## Order The "cards selected by" option controls the order that cards will appear in. If the maximum number of cards you select is lower than the number of cards that match the filter criteria, Anki will exclude the cards at the end of this sorted list first. **Oldest seen first**\ Display those cards first, that you haven't seen in reviews for the longest time. **Random**\ Randomize the order of all cards that match the filter criteria (use no set order). **Increasing intervals**\ Display cards that have the smallest interval first. **Decreasing intervals**\ Display cards that have the largest interval first. **Most lapses**\ Display those cards first, that you have failed the most times. **Order added**\ Display cards that you added first (i.e. those cards that have the earliest creation date). **Order due**\ Display cards with the earliest due date first. **Latest added first**\ Display cards that you have most recently added to the deck first. (This is the opposite of "Order added".) **Relative overdueness**\ Display cards that you're most likely to have forgotten first. This is useful if you have a large backlog that may take some time to get through, and you want to reduce the chances of forgetting more cards. When using the SM-2 algorithm, overdueness is determined by comparing how overdue cards are, and how long their interval is. For example, a card with a current interval of 5 days that is overdue by 2 days, will display before a card with a current interval of 10 days that is overdue by 3 days. When using FSRS, overdueness is calculated based on each card's retrievability, and the desired retention in the deck preset. ## Steps & Returning By default, Anki will use the steps of a card’s home deck. If a new card would normally be reviewed twice when being learned, the same thing will happen when you study it in a filtered deck. To learn about how (re)learning steps work, see [Deck Options](./deck-options#learning-steps) section. Cards return to their home deck when (re)learning is complete. Thus if you have 3 learning steps, a new card will return to its home deck upon three presses of "Good" or a single press of "Easy". Filtered decks with rescheduling disabled show 4 buttons. The **Again**, **Hard**, and **Good** buttons have configurable delays. The **Easy** button removes cards from the filtered deck. ## Due Reviews If the filtered deck includes cards that were due for review, they will be shown like they would have been in their original deck: they appear in the review card count at the bottom of the screen, and there are four choices for how well you remembered. Upon a correct answer, the card will be moved back to its home deck, and its next delay adjusted using the home deck's settings. If you forget the card, it will be shown according to the relearning steps defined in the home deck. ## Reviewing Ahead If your search included cards that are not due, Anki will show the reviews ahead of time. Anki uses a special algorithm for these reviews that takes into account how early you are reviewing. If the cards were almost due to be shown, they will be given a new delay similar to what they would have received if you had reviewed them on time. If the cards are reviewed soon after they were scheduled however, their new delay will be similar to their previous delay. This calculation works on a sliding scale. Because reviewing a card shortly after it is scheduled has little impact on scheduling (e.g. a card due tomorrow with a one day interval will remain due tomorrow if reviewed early), **the "review ahead" custom study setting is not appropriate for repeated use**. If used to go through a week's worth of cards before a trip, the mature cards will be rescheduled into the future and the new cards will remain at small intervals, because you don't know them well enough for them to be rescheduled further. If you review ahead again the next day, all you'll end up doing is going through those same new cards again, to little benefit. ## Rescheduling By default, Anki will return cards to their home decks with altered scheduling, based on your performance in the filtered deck. To change this behaviour, turn off **Reschedule cards based on my answers**. When this is turned off, cards are shown in a simple "preview mode", and when they are returned to their original deck, they are returned exactly as they started. ## Catching Up Filtered decks can be useful for catching up when you've fallen behind in your reviews. One Anki user describes the way they use the filtered decks to catch up as follows: ```text theme={null} I did this for a backlog of 800 cards with filtered subdecks. Worked very well for me. Just Due filter with: "is:due prop:due>-7" Over Due filter with: "is:due prop:due<=-7" The Just Due deck will then contain cards that became due in the past week. That's the deck you should study every day as it gets the cards that become due regularly. With this you can study as if there weren't any backlog. The Over Due deck will contain your backlog — cards which you didn't study in time. You can study them the same way you would study new cards. They go back into the regular cards, so the number of overdue will never grow as long as you keep your Just Due deck in check. How long it takes depends on how many overdue cards you study each day in addition to the ones that become due regularly. You can still motor through them when you feel like it - or you can do a specific number per day like you would for new cards. Up to you. ``` # Getting help Source: https://docs.ankiweb.net/manual/getting-help ## Asking good questions With the exception of AnkiMobile, Anki and its support are provided free of charge, by people who generously volunteer their time. Please bear this in mind when posting - if you are rude and demanding, or have made no effort to solve the problem on your own, people are less likely to want to help you. Start by trying to resolve the issue on your own: * Read the [getting started](./getting-started) section of the manual, and check out the intro videos. * If you've encountered a bug, please follow [these steps](./troubleshooting). * Use the search button on this page to search frequently asked questions. * Use the search button in the manual. * Use the search button on the forums. * Search the internet for the issue. If you have tried the above and are still stuck, it's time to ask for help. When writing a post, please explain the problem you are having clearly, and in detail. Avoid vague questions like: ```text theme={null} > "My Anki doesn't work, what should I do?" ``` Instead, provide as much detail as you can. For example: ```text theme={null} > "When I double-click on the Anki icon, an error message pops up. I tried > searching the internet for the error, but couldn't find anything useful. I > have copied and pasted the error message to the bottom of my post. I > followed the steps on the "When problems occur" page, but the error message > does not go away. What should I do?" ``` This is a much better question. It tells us: * What you have tried. * What steps you are taking when the problem happens. * What problems/errors you are getting when things go wrong. Knowing these things makes it much easier to answer your question. The user forums use a different login to AnkiWeb, so please create an account there if it's your first time. ## Anki Desktop (the computer version) and AnkiWeb After reading the above section, please post on the [user forums](https://forums.ankiweb.net) for assistance. The user forums use a different login to AnkiWeb, so please create an account there if it's your first time. ## AnkiDroid (Android devices) See [AnkiDroid's support page](https://docs.ankidroid.org/help.html). ## AnkiMobile (iPhone/iPad) See [AnkiMobile's support page](/ankimobile/support). ## Private questions For security reports and business enquiries, you can post a private ticket [here](https://anki.tenderapp.com/discussions/private). If you have a question about Anki, AnkiWeb or AnkiDroid, please use the [user forums](https://forums.ankiweb.net) instead. # Getting Started Source: https://docs.ankiweb.net/manual/getting-started ## Installing & Upgrading The Anki ecosystem is made up of Anki, AnkiMobile, AnkiDroid, and AnkiWeb, all of which are linked from our [official website](https://apps.ankiweb.net). For instructions on how to install and upgrade Anki for your computer, read the links below: * [Windows](./platform/windows/installing) * [Mac](./platform/mac/installing) * [Linux](./platform/linux/installing) ## Videos For a quick way to dive into Anki, have a look at these intro videos. Some were made with a previous Anki version, but the concepts are the same. * [Shared Decks and Review Basics](http://www.youtube.com/watch?v=QS2G-k2hQyg\&yt:cc=on) * [Syncing](https://www.youtube.com/watch?v=YkiM4DPzSVc\&list=PLGgmaKOIHykFoomqkBJAyGiDQ2kyiuTao\&yt:cc=on) * [Switching Card Order](http://www.youtube.com/watch?v=DnbKwHEQ1mA\&yt:cc=on) * [Styling Cards](http://www.youtube.com/watch?v=F1j1Zx0mXME\&yt:cc=on) * [Typing in the Answer](http://www.youtube.com/watch?v=5tYObQ3ocrw\&yt:cc=on) ## Key Concepts ### Cards A question and answer pair is called a *card*. It's similar to a paper flashcard with a question on the front and answer on the back. However, in Anki, a card doesn't look like a physical card, and when you show the answer the question remains visible by default. For example, if you're studying basic chemistry, you might see a question like: ```text theme={null} Q: Chemical symbol for oxygen? ``` After deciding the answer is O, you click the **Show Answer** button, and Anki shows you: ```text theme={null} Q: Chemical symbol for oxygen? A: O ``` After confirming that you are correct, you tell Anki how well you remembered the answer, and Anki will choose when to show you the card again. For example, Anki might decide to show you the card again in 3 days. In this case, we say the card now has a 3 day interval. #### Card States * **New:** Cards that you have downloaded or created yourself, but have never studied before. * **Learning:** Cards that were seen for the first time recently, and are still being learned. * **Review:** Cards that you have finished learning. These cards will be shown again after their delay (interval) has elapsed. There are two types of review cards: * **Young:** A young card is one that has an interval of less than 21 days. * **Mature:** A mature card is one that has an interval of 21 days or greater. * **Relearn:** Cards that you forgot in the review stage. These cards are returned to the relearning state to be learned again. ### Decks A *deck* is a group of cards. You can place cards in different decks to study parts of your card collection instead of studying everything at once. Each deck can have different settings, such as how many new cards to show each day, or how long to wait until cards are shown again. Decks can contain other decks, which allows you to organize decks into a tree. Anki uses double colons ("::") to show different levels within the deck tree. For example, a deck called "Chinese::Hanzi" refers to a "Hanzi" deck, which is part of a "Chinese" deck. If you select "Hanzi", then only the Hanzi cards will be shown; if you select "Chinese", then all the Chinese cards will be shown, including the Hanzi cards. To place decks within a tree, you can either name them with double colons between each level, or drag and drop them within the deck list. Decks that have been placed inside another deck are often called "subdecks", and top-level decks are called "parent decks". Anki starts with a deck called "Default"; any cards which have somehow become separated from other decks will go here. Anki will hide the default deck if it contains no cards and you have added other decks. Alternatively, you may rename this deck and use it for other cards. Decks in the deck list are sorted alphabetically. This can result in a surprising order if your deck names contain numbers. For example, "My Deck 10" will come before "My Deck 9", as 1 comes before 9. If you want "My deck 9" to appear earlier, you can rename it to "My deck 09", which appears before "My deck 10". Decks are best used to hold broad categories of cards, rather than specific topics such as "food verbs" or "lesson 1". For more information about this, see the [using decks appropriately](./editing#using-decks-appropriately) section. For information on how the order of decks affects the order cards are studied in, see the [display order](./studying#display-order) section. ### Notes & Fields When making flashcards, it’s often desirable to make more than one card that relates to the same information. For example, if you’re learning French, and you learn that the word *bonjour* means hello, you may wish to create one card that shows you "bonjour" and asks you to remember "hello", and another card that shows you "hello" and asks you to remember "bonjour". One card is testing your ability to recognize the French word, and the other card is testing your ability to produce it. When using paper flashcards, your only option in this case is to write out the information twice, once for each card. Some flashcard programs make life easier by providing a feature to flip the front and back sides. This is an improvement over the paper situation, but there are two major downsides: * Because such programs don’t track your performance of recognition and production separately, cards will tend not to be shown to you at the optimum time, meaning you forget more than you’d like, or you study more than is necessary. * Reversing the question and answer only works when you want exactly the same content on each side. This means it’s not possible to display extra info on the back of each card for example. Anki solves these problems by allowing you to split the content of your cards up into separate pieces of information. You can then tell Anki which pieces of information you want on each card, and Anki takes care of creating the cards for you, and updating them if you make any edits in the future. Imagine we want to study French vocabulary, and we want to include a textbook page number on the back of each card. We want our cards to look like this: ```text theme={null} Q: Bonjour A: Hello Page #12 ``` And this: ```text theme={null} Q: Hello A: Bonjour Page #12 ``` In both cards, we have the same three related pieces of information: a French word, an English meaning, and a page number. If we put them together, they’d look like this: ```text theme={null} French: Bonjour English: Hello Page: 12 ``` In Anki, this collection of related information is called a *note* and each piece of information is contained in a *field*. In this example, the note has three fields: "French", "English", and "Page". To add and edit fields, click the **Fields...** button while adding or editing notes. For more information on fields, see the [Customizing Fields](./editing#customizing-fields) section. ### Card Types In order for Anki to create cards based on our notes, we need to give it a blueprint that says which fields should be displayed on the front or back of each card. This blueprint is called a *card type*. Each type of note can have one or more card types; when you add a note, Anki will create one card for each card type. All card types have two *templates*, one for the question and one for the answer. In the previous French example, we wanted the back of our recognition card to look like this: ```text theme={null} Q: Bonjour A: Hello Page #12 ``` To do this, we can set the answer template to: ```text theme={null} Q: {{French}} A: {{English}}
Page #{{Page}} ``` In card templates, field names are wrapped in double curly brackets, like `{{French}}` or `{{English}}`. Anki replaces those with the actual text the fields contain. This is called a ["Field replacement"](./templates/fields). Text not wrapped in double curly brackets appears the same on each card. For example, we won't need to add "Page #" on every note because the template will add it automatically to every card. The `
` tag is a special code that tells Anki to move to the next line. For details, see the [templates](./templates/intro) section. The production card's templates will also work in a similar way: ```text theme={null} Q: {{English}} A: {{French}}
Page #{{Page}} ``` After a card type has been created, every time you add a new note, a card will be created based on that card type. Card types make it easy to keep the formatting of your cards consistent and can greatly reduce the amount of effort involved in adding information. They also mean Anki can ensure related cards don't appear too close to each other, and they allow you to fix a typing mistake or factual error once and have all the related cards update at once. To add and edit card types, click the **Cards...** button while adding or editing notes. For more information on card types, see the [Cards and Templates](./templates/intro) section. ### Note Types Anki allows you to create different types of notes for different material. Each type of note has its own set of fields and card types. It's a good idea to create a separate note type for each broad topic you're studying. In the previous French example, we might create a note type called "French" for that. If we wanted to learn capital cities, we could create a note type for that as well, with fields such as "Country" and "Capital City". Anki comes with some standard note types included. These note types are provided to make Anki easier for new users, but in the long run it's recommended you create your own note types specifically for the content you are learning. The standard note types are: * **Basic**\ Has "Front" and "Back" fields, and will create one card. Text you enter in "Front" will appear on the front of the card, and text you enter in "Back" will appear on the back of the card. * **Basic (and reversed card)**\ Like "Basic", but creates two cards for the text you enter: front→back and back→front. * **Basic (optional reversed card)**\ Like "Basic", but has a third field called "Add Reverse". If you enter any text into that field, a reversed card (back→front) will also be created. For details, see the [Cards and Templates](./templates/intro) section. * **Basic (type in the answer)**\ This is essentially "Basic", with an extra text box on the front where you can type your answer in. When you reveal the back, Anki will show you any differences between your input and the actual answer. For details, see the [Checking Your Answer](./templates/fields#checking-your-answer) section. * **Cloze**\ A note type that allows you to select text and turn it into a cloze deletion (e.g. "Humans landed on the moon in \[…​]" → "Humans landed on the moon in 1969"). For details, see the [cloze deletion](./editing#cloze-deletion) section. * **Image Occlusion**\ Like the cloze note type, but it works with images instead of text, which is especially useful when studying material that heavily relies on images, such as anatomy and geography. For details, see the [Image Occlusion](./editing#image-occlusion) section of the manual. To add your own note types and modify existing ones, you can use **Tools > Manage Note Types** from the main Anki window. Notes and note types are common to your whole collection rather than limited to an individual deck. This means you can use different note types in a single deck, or have cards generated from the same note put into different decks. When you add notes using the Add window, you can select what note type to use and what deck to use, and these choices are completely independent of each other. You can also [change the note type of notes](./browsing#notes) after you've already created them. ### Collection Your *collection* is all the material stored in Anki: your cards, notes, decks, note types, deck options, and so on. ## Shared Decks You can watch a video about [Shared Decks and Review Basics](http://www.youtube.com/watch?v=QS2G-k2hQyg\&yt:cc=on) on YouTube. The easiest way to get started with Anki is to download a deck of cards someone else has shared: 1. Click the **Get Shared** button at the bottom of the deck list. 2. When you've found a deck you're interested in, click the **Download** button to download a deck package. 3. Double-click the downloaded package to import it into Anki, or go to **File > Import**. Note: It’s not currently possible to add shared decks directly to your AnkiWeb account. You need to first import them to the desktop app, AnkiMobile, or AnkiDroid, then [synchronize](./syncing) to upload the decks to AnkiWeb. Creating your own deck is the most effective way to learn a complex subject. Subjects like languages and the sciences can’t be understood simply by memorizing facts — you need explanation and context to learn them effectively. Furthermore, inputting the information yourself forces you to decide what the key points are, leading to a better understanding. If you are a language learner, you may be tempted to download a long list of words and their translations, but this won’t teach you a language any more than memorizing scientific equations will teach you astrophysics. To learn properly, you might need textbooks, teachers, or exposure to real-world sentences. ```text theme={null} Do not learn if you do not understand. --SuperMemo ``` Most shared decks are created by people who are learning material outside Anki, such as from textbooks, classes, TV, etc. They select the interesting points from what they learn and put them into Anki. They might not make any effort to add background information or explanations to the cards, because they already understand the material. So when someone else downloads their deck and tries to use it, they might find it very difficult as the background information and explanations are missing. That is not to say shared decks are useless. If you’re studying textbook ABC and someone has shared a deck of ideas from ABC, that’s a great way to save some time. And for simple subjects that are basically a list of facts, such as capital city names or country flags, you probably don’t need any external material. However, for complex subjects, shared decks should be used as a *supplement* to external material, not as a *replacement* for it. # Importing Source: https://docs.ankiweb.net/manual/importing/intro Anki can import text files, packaged Anki decks created by the export feature and Mnemosyne 2.0 .db files. To import a file, click the File menu and then "Import". # Packaged Decks Source: https://docs.ankiweb.net/manual/importing/packaged-decks Anki packages (.apkg files) enable you to import decks, notes, note types, and cards from other users. They are commonly shared on [AnkiWeb](https://ankiweb.net/shared/decks). ## Scheduling Anki packages may also contain scheduling information, which is useful if you want to transfer decks between devices or profiles. However, when importing a deck shared by someone else, you typically do not want to adopt their card intervals or review history. If you encounter imported cards with unexpectedly large intervals, the deck author may accidentally have included their scheduling information. You can use the [Set Due Date feature](../browsing#cards) to reset the imported cards. On Anki 23.10 and later, you can remove any scheduling information during the import process by leaving the "Import any learning progress" option unselected. This will also remove any "leech" or "marked" tags from the imported cards. ## Updating When you import an .apkg file, Anki will identify any notes in it that are already in your collection due to a previous import. If the notes in the file are newer than your local copy, the notes will be updated with the contents of the file by default. This updating process is generally not possible if the note type is changed (e.g. if either you or the deck author do things like add an extra field to the note type). You will still be able to import any missing notes from the file, but notes you have imported previously will not be updated if the deck author has made changes. ### Anki 23.10 and Later Anki 23.10 introduced more flexibility: You can choose to unconditionally update notes and note types, always overwriting your modifications, or, on the other hand, never update existing objects. Also, if both you and the deck author modified the same note type, you can now decide to *merge* the two versions. This will preserve all templates and fields contained in either one, but will require a full sync, and may mark other existing notes as modified. #### Note to Deck Authors Merging relies on template and field ids, which were introduced in Anki 2.1.67. If a template or field lacks an id, because it has been created with an earlier release, Anki attempts to find an equivalent by comparing names. See this [this add-on](https://ankiweb.net/shared/info/2063785767) for why it is advantageous to share note types with field and template ids, and how to add them to existing ones. # Text Files Source: https://docs.ankiweb.net/manual/importing/text-files Any **plain text** file that contains fields separated by commas, semicolons or tabs can be imported into Anki, provided some conditions are met. * The files must be plain text (myfile.txt). Other formats like myfile.xls, myfile.rtf, myfile.doc must be saved as a plain text file first. * The files must be in UTF-8 format (see below). * Anki determines the number of fields in the file by looking at the first (non-commented) line. If some of the later records in the file contain fewer fields, Anki will treat the missing fields as if they were blank. If some of your records contain extra fields, the extra content will not be imported. * Anki tries to guess which field separator (commas, tabs, etc.) your file uses. If it guesses wrongly, you can change it in the import options window and preview the results. Or you can add [file headers](./#file-headers) to force a specific field separator. Fields in your text file can be mapped to any field in your notes, including the tags field. You can choose which field in the text file corresponds to which field in the note when you import. When you import a text file, you can choose what deck to put the cards in. Keep in mind that if you have the deck override option set for one or more of your templates, the cards will go to that deck rather than the one you’ve selected. This is an example of a valid file with three fields: ```text theme={null} apple;banana;grape first field;second field;third field ``` There are two ways to include newlines or the field separator in fields. **Escape the characters by placing the contents of the field in quotation marks**: ```text theme={null} hello;"this is a two line answer" two;this is a one line field "this includes a ; (semicolon)";another field ``` Because quotes are used to mark where a field begins and ends, if you wish to include them inside your field, you need to replace a single doublequote with two doublequotes to "escape" them from the regular handling, like so: ```text theme={null} field one;"field two with ""escaped quotes"" inside it" ``` When you use a spreadsheet program like Libreoffice to create the CSV file for you, it will automatically take care of escaping double quotes. **Use HTML new lines**: ```text theme={null} hello; this is
a two line answer two; this is a one line one ``` You need to turn on the **Allow HTML in fields** in the import dialog for HTML newlines to work. Escaped multi-lines will not work correctly if you are using cloze deletions that span multiple lines. In this case, use HTML newlines instead. You can also include tags in another field and select it as a tags field in the import dialog: ```text theme={null} first field;second field;tags ``` This is an example of a valid file where the first line is ignored (#): ```text theme={null} # this is a comment and is ignored foo bar;bar baz;baz quux field1;field2;field3 ``` ## Spreadsheets and UTF-8 If you have non-Latin characters in your file (such as accents, Japanese and so on), Anki expects files to be saved in a "UTF-8 encoding". The easiest way to do this is to use the free LibreOffice spreadsheet program instead of Excel to edit your file, as it supports UTF-8 easily, and also exports multi-line content properly, unlike Excel. If you wish to keep using Excel, see [this doc](https://docs.google.com/document/d/12YE_FS6A9ANLTESJNtPP116ti4nNmCBghyoJBRtno_k/edit?usp=sharing) for more information. To save your spreadsheet to a file Anki can read with LibreOffice, go to **File > Save As**, and then select CSV for the type of file. After accepting the default options, LibreOffice will save the file and you can then import the saved file into Anki. ## HTML Anki can treat text imported from text files as HTML (the language used for web pages). This means that text with bold, italics and other formatting can be exported to a text file and imported again. If you want to include HTML formatting, you can check the "allow HTML in fields" checkbox when importing. You may wish to turn this off if you’re trying to import cards whose content contains angle brackets or other HTML syntax. If you wish to use HTML for formatting your file but also wish to include angle brackets or ampersands, you may use the following replacements: | Character | Replacement | | - | - | | \< | `<` | | > | `>` | | & | `&` | ## Importing Media If you want to include audio and pictures from a text file import, copy the files into the [collection.media folder](../files). **Do not put subdirectories in the media folder, or some features will not work.** After you’ve copied the files, change one of the fields in your text file as follows. ```text theme={null} ``` or ```text theme={null} [sound:myaudio.mp3] ``` Alternatively, you can use the [find and replace](../browsing) feature in the browse screen to update all the fields at once. If each field contains text like "myaudio", and you wish to make it play a sound, you’d search for (.\*) and replace it with "\[sound:\1.mp3]", with the **regular expressions** option enabled. When importing a text file with these references, you must make sure to enable the "Allow HTML" option. You might be tempted to do this in a template, like: ```text theme={null} ``` Anki doesn’t support this for two reasons: searching for used media is expensive, as each card has to be rendered, and such functionality isn’t obvious to shared deck users. Please use the find & replace technique instead. ## Bulk Media Another option for importing large amounts of media at once is to use the [media import add-on](https://ankiweb.net/shared/info/129299120). This add-on will automatically create notes for all files in a folder you select, with the filenames on the front (minus the file extension, so if you have a file named apple.jpg, the front would say "apple") and the images or audio on the back. If you would like a different arrangement of media and filenames, you can [change the note type](../browsing) of the created cards afterwards. ## Duplicates and Updating When importing text files, Anki uses the first field to determine if a note is unique. By default, if the file you are importing has a first field that matches one of the existing notes in your collection and that existing note is the same type as the type you’re importing, the existing note’s other fields will be updated based on content of the imported file. A drop-down box in the import screen allows you to change this behaviour, to either ignore duplicates completely, or import them as new notes instead of updating existing ones. The **match scope** setting controls how duplicates are identified. When **note type** is selected, Anki will identify a duplicate if another note with the same note type has the same first field. When set to **note type and deck**, a duplicate will only be flagged if the existing note also happens to be in the deck you are importing into. If you have updating turned on and older versions of the notes you’re importing are already in your collection, they will be updated in place (in their current decks) rather than being moved to the deck you have set in the import dialog. If notes are updated in place, the existing scheduling information on all their cards will be preserved. For info on how duplicates are handled in .apkg files, see the [Deck Packages](../exporting#packaged-decks) section. ## File Headers Anki 2.1.54+ supports certain headers that can be included in the text file to make importing more powerful or convenient. They consist of `#key:value` pairs and must be listed in separate lines at the top of the file. | Key | Allowed Values | Behaviour | | - | - | - | | `separator` | `Comma`, `Semicolon`, `Tab`, `Space`, `Pipe`, `Colon`, or the corresponding literal characters | Determines the field separator. | | `html` | `true`, `false` | Determines whether the file is treated as HTML. | | `tags` | List of tags, separated by spaces | Adds the listed tags to every imported note. | | `columns` | List of names, separated by the previously set separator | Determines the number of columns and shows their given names when importing. | | `notetype` | Note type name or id | Presets the note type, if it exists. | | `deck` | Deck name or id | Presets the deck, if it exists. | | `notetype column` | `1`, `2`, `3`, ... | Determines which column contains the note type name or id of each note, see [Notetype Column](./#notetype-column). | | `deck column` | `1`, `2`, `3`, ... | Determines which column contains the deck name or id of each note, see [Deck Column](./#deck-column). | | `tags column` | `1`, `2`, `3`, ... | Determines which column contains the tags of each note. | | `guid column` | `1`, `2`, `3`, ... | Determines which column contains the GUID of each note, see [GUID Column](./#guid-column). | Some headers have further implications. ### Notetype Column Usually, all notes from a file will be mapped to a single note type. That changes, if there is a column with note type names or ids. This allows you to import notes with different note types, and their fields will be mapped implicitly: The first regular column is used for the first field of any note regardless of its note type, the second regular column for the second field, and so on. A *regular column* here being a column that does not contain special information like decks, tags, note types or GUIDs. ### Deck Column Usually, any new cards created as a result of importing a text file will be placed in a single deck of your choice. If the file contains a deck column, however, new cards of a note will be placed in its specified deck instead. If the deck does not exist, a deck with the given name will be created. ### GUID Column GUID stands for *Globally Unique Identifier*. When you create notes in Anki, Anki assigns each note a unique ID, which can be used for duplicate checking. If you export your notes with the GUID included, you can make changes to the notes, and as long as you do not modify the GUID field, you'll be able to import the notes back in to update the existing notes. Note that the GUID is intended to be created by Anki. If you are creating your own IDs, such as `MYNOTE0001`, then it's recommended that you place the IDs in the first field, instead of assigning them to Anki's internal GUID. When importing, Anki is able to use either the first field or the GUID for duplicate checking, so you do not need to make IDs a GUID in order to be able to update your notes. One other thing to note is that the duplicate option will not work for rows that have a non-empty GUID. If a GUID is provided, and already exists in the collection, a duplicate will not be created. # Introduction Source: https://docs.ankiweb.net/manual/intro ## Mobile Clients This is the manual for the computer version of Anki. Separate manuals are available for the mobile clients: * [AnkiDroid Manual](https://docs.ankidroid.org/) (Android) * [AnkiMobile Manual](/ankimobile/intro) (iPhone/iPad) ## Quickstart In a hurry? Jump straight to [Getting Started](./getting-started). ## Getting Help Looking for help? See [Getting Help](./getting-help). ## Translations Volunteers have contributed translations of this manual. The translations may not always be up to date. * [Bahasa Indonesia](https://web.archive.org/web/20250228144632/https://apps.ankiweb.net/docs/manual.id.html) * [Deutsch](https://web.archive.org/web/20240413080739/https://www.dennisproksch.de/anki) * [Español](https://web.archive.org/web/20250130154657/https://apps.ankiweb.net/docs/manual.es.html) * [Français](https://web.archive.org/web/20250209100830/https://apps.ankiweb.net/docs/manual.fr.html) * [Italiano](https://web.archive.org/web/20160423223801/http://192.167.9.6/Anki_ITA/Manual_ITA.htm) * [Oʻzbekcha](https://itsbilolbek.github.io/anki-manual/) * [Polski](https://platynowy.github.io/anki-manual/) * [Português Brasileiro](https://mizerablebr.github.io/anki-manual/) * [русский язык](https://andreykaiu.github.io/anki-manual-ru/) * [Українська](https://astropsy999.github.io/anki-manual/) * [العربية](https://abdnh.github.io/anki-manual/) * [فارسى](https://msadrashakouri.github.io/anki-manual/) * [日本語](http://wikiwiki.jp/rage2050/) * [简体中文](https://open-spaced-repetition.github.io/anki-manual-zh-CN/) If you would like to help translate the manual into a different language, please see the [translation docs](https://translating.ankiweb.net/anki/manual.html). ## Legacy Documentation Not on the latest version of Anki? Find archives of this manual at the [Internet Archive](https://web.archive.org/web/20240829022941/https://docs.ankiweb.net/). For information on old scheduler versions, see [this FAQ](/faqs/the-anki-2.1-scheduler). # Leeches Source: https://docs.ankiweb.net/manual/leeches Leeches are cards that you keep forgetting. Because they require so many reviews, they take up a lot more of your time, compared to other cards. Anki can help you identify leeches. Each time a review card "lapses" (is failed while it is in review mode), a counter increases. When this counter reaches 8, Anki tags the note as a leech and suspends the card. The threshold, and whether to suspend or not, can be adjusted in the [deck options](./deck-options). If you keep failing that card, Anki will continue to alert you about the leech periodically. These warnings occur at half the initial leech threshold. For example, if you set the warning at 8 lapses, future warnings will happen every 4 lapses (at 12, 16, and so on). Once a leech is found, there are several ways to handle it. ## Editing The most efficient method to deal with leeches is to change how the information is presented. Maybe your cards have too much information, or you’re trying to memorize something without fully understanding it. Often, it helps to follow the [20 rules of formulating knowledge](https://supermemo.guru/wiki/20_rules_of_knowledge_formulation), proposed by Dr Piotr Wozniak, the creator of SuperMemo. Some cards can benefit from a mnemonic. Even some well-written cards may need a boost in coherence, e.g. by adding cards for related concepts. However, it takes a lot of experience to know how to formulate the material properly, break it down into smallest possible components, and use mnemonic techniques. ## Deleting If the material you’re struggling with isn't important enough to justify the time spent, you can simply delete the card. By selectively deleting difficult and obscure items, you can spend more time learning other material, making studying more enjoyable. If you think the card might be useful for future reference, you can leave it suspended. ## Waiting Some leeches are caused by "interference". For example, an English learner may have recently learned the words "disappoint" and "disappear". As they look similar, the learner may find themselves confusing the two when trying to answer. In such situations, it’s often helpful to concentrate on one idea at a time. Once that idea is firmly ingrained in your mind, you can then start learning the other idea. So, in these situations, you might want to leave one of the words suspended until you have learned the other one well, and then unsuspend it. For a more detailed discussion, you can refer to the article "[Dealing with Leeches](https://controlaltbackspace.org/leech/)", written by Soren Bjornstad. # Math and Symbols Source: https://docs.ankiweb.net/manual/math Math & Symbols ## MathJax [MathJax](https://www.mathjax.org) is a modern, browser-based typesetting system, useful for mathematical and chemical equations. It does not require the installation of any extra software, so it is easy to use, and it is recommended for most users. MathJax is supported out of the box on Anki 2.1+, AnkiMobile, and AnkiDroid 2.9+. To try it out: 1. Type the following in a field: ```text theme={null} \sqrt{x} ``` 2. Select the text you just typed. 3. Click the rightmost button in the editor, and choose "MathJax inline" from the menu. Anki will change the text so it reads: ```text theme={null} \(\sqrt{x}\) ``` 4. Click the **Cards...** button. You’ll see a preview of how the equation will appear when the card is reviewed. $$ \sqrt\{x\} $$ Anki’s MathJax support expects content in TeX format. If you’re not familiar with TeX formatting, see [this cheatsheet](https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference). Note that point 1 does not apply in Anki - Anki uses `\(` and `\)` for inline equations, and `\[` and `\]` for display equations. If you want to use newlines in a MathJax expression, use Shift+Enter instead of just Enter, as a normal newline will prevent MathJax from working correctly. Anki includes built in support for mhchem for rendering chemical equations. See the "chemical equations" section and the following sections for more information: [https://mhchem.github.io/MathJax-mhchem/](https://mhchem.github.io/MathJax-mhchem/) ### Customize MathJax Anki's bundled MathJax support is loaded before card content, so if you wish to customise MathJax you'll have to do so in a specific way. An example is provided here. ```javascript theme={null} ``` > [!NOTE] > > Anki has special logic for cloze deletions that might not work if you change the > standard delimiters for MathJax equations. ## LaTeX LaTeX is a powerful typesetting system, useful for entering mathematical formulas, chemical formulas, musical notation and so on. Anki provides some support for LaTeX, allowing you to enter LaTeX code in your notes. When you review a card, Anki will call LaTeX and display the generated image instead. LaTeX is more work to set up, and images can only be generated with the computer version of Anki - though once generated, the images can be displayed by mobile clients. Because of the extra complexity LaTeX brings, it is only recommended for users that need more features than MathJax provides. ### Enable LaTeX > [!CAUTION] > > LaTeX code can contain malicious commands that can read or write non-Anki > data on your computer. For this reason, recent Anki versions will refuse to > generate LaTeX images by default. > > **We strongly recommend you do not enable this option if you use shared decks, or think > you will import shared decks in the future, as you are potentially giving any shared > deck author access to your computer**. If you wish to use LaTeX on your own cards, you will need to enable the **Generate LaTeX images** option in the preferences screen. You do not need to enable this option for shared decks. If a shared deck author has correctly generated all the images prior to them sharing the deck, the images should already be available. ### Assumed Knowledge Anki’s LaTeX support is not turn-key: it is assumed that you know how to use LaTeX already, and that you have it installed. If you have no experience with LaTeX, please consult one of the many guides available on the internet. If you are having trouble with markup, please ask on a LaTeX forum. To install LaTeX, on Windows use MiKTeX; on macOS use MacTeX, and on Linux use your distro’s package manager. Dvipng must also be installed. On Windows, go to Settings in MikTeX’s maintenance window, and make sure "Install missing packages on the fly" is set to "Always", not to "Ask me first". If you continue to have difficulties, one user reported that running Anki as an administrator until all the packages were fetched helped. On macOS, LaTeX has only been tested with MacTeX and BasicTeX. If you use BasicTeX, you need to install dvipng separately, with the following command: ```text theme={null} sudo tlmgr update --self; sudo tlmgr install dvipng ``` The command may not be on the path, so you may need to provide the full path, e.g /usr/local/texlive/2014basic/bin/x86\_64-darwin/tlmgr. If you are not using the above LaTeX packages, you will need to use the [edit LaTeX](https://ankiweb.net/shared/info/937148547) add-on to specify the full path to latex and dvipng. ### Web/Mobile When you review a card with LaTeX on it, Anki will generate an image for that LaTeX and place the image in your collection’s media folder for future use. The web & mobile clients will display these images if they already exist, but can not generate the images on their own. To avoid having to review all your cards at least once before you can study on the other clients, Anki can generate the images in bulk for you. To generate all the images, go to Tools>Check Media. After that, syncing should upload the generated media to AnkiWeb and the other clients. ### Example The most general way to input LaTeX content is to surround it with \[latex]\[/latex] tags. There’s a shortcut button for this documented in the [editor](./editing) section. \[latex] tags must be used inside a field - placing them in the card template will [cause problems](./templates/fields). For example, entering the following on the front of an Anki flashcard: ```text theme={null} Does [latex]\begin{math}\sum_{k = 1}^{\infty}\frac{1}{k}\end{math}[/latex] converge? ``` will produce this when the flashcard is viewed: ![convergence question](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/convergence_question.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=62550f4062bbf073340214232eb3a4f9) The formula in the example above is called a "text formula", because it is displayed right within the non-mathematical text. In contrast, the following example shows a "displayed formula": ```text theme={null} Does the sum below converge? [latex]\begin{displaymath}\sum_{k = 1}^{\infty}\frac{1}{k}\end{displaymath}[/latex] ``` ![convergence question 2](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/convergence_question_2.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=ee82a662bb031b5619270afe4a591cff) "Text formulas" and "display formulas" are the most common type of LaTeX expressions, so Anki provides abbreviated versions of them. Expressions of the form: ```text theme={null} [latex]\begin{math}...\end{math}[/latex] ``` can be shortened to ```text theme={null} [$]...[/$] ``` and expressions of the form ```text theme={null} [latex]\begin{displaymath}...\end{displaymath}[/latex] ``` can be shortened to ```text theme={null} [$$]...[/$$] ``` For example, the two LaTeX snippets shown before are equivalent to ```text theme={null} Does [$]\sum_{k = 1}^{\infty}\frac{1}{k}[/$] converge? ``` and ```text theme={null} Does the sum below converge? [$$]\sum_{k = 1}^{\infty}\frac{1}{k}[/$$] ``` respectively. ### Packages Anki allows you to customize the LaTeX preamble so you can import custom packages for chemistry, music and so on. For example, imagine you find an example file for chemtex on the internet: ```text theme={null} \documentclass[a4paper,12pt]{report} \usepackage{chemtex} \begin{document} \initial \begin{figure}[h]\centering \parbox{.3\textwidth}{\ethene{H}{H$_3$C}{CH$_3$}{Br}} \hfil \parbox{.3\textwidth}{\cbranch{H}{S}{H}{S}{C}{S}{}{S}{H} \xi=-200 \cright{}{Q}{C}{D}{O}{S}{OH}} \hfil \parbox{.3\textwidth}{\hetisix{Q}{Q}{Q}{Q}{Q}{Q}{O}{Q}{O} \xi=-171 \fuseup{Q}{Q}{Q}{Q}{D}{Q}{D}{Q}{D}} \caption{Chemie mit {\tt CHEMTEX}\label{a1}} \end{figure} \end{document} ``` Firstly, follow the documentation of the package and MiKTeX/MacTeX in order to install the package. To check the package is working, you’ll want to put code like the above into a .latex file and test if you can compile it from the command line. Once you’ve confirmed that the package is available and working, we can integrate it with Anki. To use the package with Anki, click "Add" in the main window, then click the note type selection button. Click the "Manage" button, then select the note type you plan to use and click "Options". The LaTeX header and footer are shown. The header will look something like: ```text theme={null} \documentclass[12pt]{article} \special{papersize=3in,5in} \usepackage{amssymb,amsmath} \pagestyle{empty} \setlength{\parindent}{0in} \begin{document} ``` To use chemtex, you’d add the usepackage line in the earlier example, so it looks like: ```text theme={null} \documentclass[12pt]{article} \special{papersize=3in,5in} \usepackage{amssymb,amsmath} \usepackage{chemtex} \pagestyle{empty} \setlength{\parindent}{0in} \begin{document} ``` After that, you should be able to include lines like the following in your Anki cards: ```text theme={null} [latex]\ethene{H}{H$_3$C}{CH$_3$}{Br}[/latex] ``` ### Template Conflicts As of Anki 2.1.20 / AnkiMobile 2.0.56 / AnkiDroid 2.13, this workaround is no longer required, as `{{field}}` text inside fields no longer causes problems. If you need to support older versions and want to keep using this syntax, make sure you place the `{{=<% %>=}}` string at the very top of your front and back template, as recent Anki versions will not recognize it anywhere but the start. For older versions: It’s not uncommon for \{\{ and }} to pop up in LaTeX code when writing mathematical equations. To ensure that your LaTeX equations don’t conflict with Anki’s field replacements, it’s possible to change the separator to something else. For example, if you have a template: ```text theme={null} {{latex field}} ``` Changing it to the following will make it unlikely that the LaTeX will conflict: ```text theme={null} {{=<% %>=}} <%latex field%> ``` ### Cloze Conflicts Cloze deletions are terminated with `}}`, which can conflict with a `}}` appearing in your LaTeX. To prevent LaTeX from being interpreted as a closing cloze marker, you can put a space between any double closing braces that do not indicate the end of the cloze, so ```text theme={null} {{c1::[$]\frac{foo}{\frac{bar}{baz}}[/$] blah blah blah.}} ``` will not work, but ```text theme={null} {{c1::[$]\frac{foo}{\frac{bar}{baz} }[/$] blah blah blah.}} ``` will (and LaTeX ignores spaces in math mode, so your equation will render the same). If you want to avoid adding the extra space into the rendered text (for example, when you are making Cloze cards for learning programming languages), another option is to use a HTML comment when editing the card in HTML mode: ```text theme={null} {{c1::[$]\frac{foo}{\frac{bar}{baz}}[/$] blah blah blah.}} ``` You may use either workaround if you need to use the `::` character sequence within the Cloze-deleted text. The first card generated for the following note text will read `[type] in C++ is a type-safe union`: ```text theme={null} {{c1::std::variant::~type~}} in C++ is a {{c2::type-safe union}} ``` ### Unsafe Commands Anki prohibits certain commands like \input or \def from being used on cards or in templates, because allowing them could allow malicious shared decks to damage your system. (To be on the safe side, these commands are prohibited even in comments, so if you’re getting this error but don’t think you’ve used one, please double-check any comments you have in your headers, templates, and cards.) If you need to use these commands, add them to a system package and import that package as described in the previous section. # Media Source: https://docs.ankiweb.net/manual/media Anki stores the sounds and images used in your notes in a folder next to the collection. For more on the folder location, see the [file locations](./files#user-data) section. When you add media within Anki, either by using the paperclip icon in the [editor](./editing) or by pasting it into a field, Anki will copy it from its original location into the media folder. This makes it easy to back up your collection’s media or move it to another computer. If your media filenames contain spaces or other special characters such as percentage signs, the way the filenames appear in the HTML editor will differ from the way the filenames appear on disk. For example, a file called `hello 100%.jpg` will appear as `hello%20100%25.jpg` in the HTML editor. Internally, Anki still uses the original filenames, so if you would like to [search](./searching) for the file or modify the filename with [Find\&Replace](./browsing#find-and-replace), you will need to use the name as it appears on disk, not as it appears in the HTML editor. Exporting to a text file is another way to see the underlying representation. ## Checking Media You can use the Tools>Check Media menu option to scan your notes and media folder. It will generate a report of files in the media folder that are not used by any notes, and media referenced in notes but missing from your media folder. It also allows you: * To delete unused media files. * To tag notes that refer to missing media files. * To empty your trash folder. * To restore the deleted files back to your media folder. This tool does not scan question or answer templates, which is why you can’t place media references to fields in the template. If you need a static image or sound on every card, name it with a leading \_ (e.g., `_dog.jpg`) to tell Anki to ignore it when checking for media. If you delete media using the unused media check, Anki will move it into your operating system’s trash folder, so you can recover if you accidentally delete media that shouldn’t have been deleted. ## Manually Adding Media When you add media via Anki's interface, Anki takes care of ensuring the filenames are encoded in a way that should work across different devices, removing characters that won't work on certain operating systems, and truncating very long filenames. If you manually add files to your [media folder](./files#user-data), you should use Tools>Check Media afterwards, to ensure the filenames are encoded correctly. If you skip this step, any filenames that are not compatible will be skipped when syncing. Anki doesn’t follow symbolic links in the media folder when syncing. If you rely on symlinks for including fonts, stylesheets, or other resources, these files may appear to work on desktop but fail on mobile. To ensure files sync properly, copy the actual files into the collection.media folder instead of using symlinks. ## Supported Formats Anki uses a program called mpv (and mplayer as a fallback) in order to support sounds and videos. A wide variety of file formats are supported, but not all of these formats will work on AnkiWeb and the mobile clients. MP3 audio and MP4 video seems to be the most universally supported. # Miscellanea Source: https://docs.ankiweb.net/manual/misc Miscellaneous ## Menu Shortcuts On Windows/Linux you can hold down the Alt key and press a highlighted letter to activate a particular menu. Although macOS doesn’t support this feature, it does allow you instead to assign shortcuts to specific menu items. See [https://support.apple.com/en-au/guide/mac-help/mchlp2271/mac](https://support.apple.com/en-au/guide/mac-help/mchlp2271/mac) for more information. ## Debug Console Sometimes you may be asked to use the debug console to change a setting or check something. Unless asked to enter text in the "debug console", you will probably not need this. Advanced users may like to read more about it in the [add-on writing guide](/addons/debugging#debug-console). When asked to enter text into the "debug console", please start Anki, and in the main window, press Ctrl+Shift+; (the control key, shift key, and semi-colon key at the same time) On a Mac, press Command+Shift+; (the command key, shift key, and semi-colon key at the same time) On some non-English keyboards, you may need to press : or + instead of ;. In the window that has popped up, paste the text you were asked to paste in the top section. When you’ve done so, press Ctrl+Return (On Mac, Command+Return), and some text should appear in the bottom section. If you’ve been asked to paste the resulting output, copy it from the bottom area, and paste it back to the support person. If you press Ctrl+Shift+Return instead of just Ctrl+Return, Anki will try to print the result rather than doing what you asked it to. If you are getting unexpected errors, make sure you’re not holding down the Shift key. # Platform Notes Source: https://docs.ankiweb.net/manual/platform/intro This section explains the way Anki is installed, and the possible problems you may encounter, depending on your OS: * [Windows](./windows/intro) * [macOS](./mac/intro) * [Linux](./linux/intro) If you have already installed Anki, you can skip to the [Getting Started](../getting-started) section. # Blank Main Window Source: https://docs.ankiweb.net/manual/platform/linux/blank-window Some Linux distros have recently updated glibc. Recent versions break the web toolkit that Anki is built on, causing Anki's main window to appear blank. There are two ways to work around this: 1. Install the latest Qt6 version of Anki, which uses an updated toolkit: [https://apps.ankiweb.net](https://apps.ankiweb.net) 2. Use one of the workarounds posted on the following threads: * [https://forums.ankiweb.net/t/another-blank-main-window-solution-for-linux/32835](https://forums.ankiweb.net/t/another-blank-main-window-solution-for-linux/32835) * [https://forums.ankiweb.net/t/please-use-file-import-popup-on-startup/14695](https://forums.ankiweb.net/t/please-use-file-import-popup-on-startup/14695) * [https://forums.ankiweb.net/t/setting-disable-seccomp-filter-sandbox-by-default-on-linux/13765](https://forums.ankiweb.net/t/setting-disable-seccomp-filter-sandbox-by-default-on-linux/13765) * [https://forums.ankiweb.net/t/fedora-35-and-anki-2-1-47-updates-with-blank-anki-window/13431/11](https://forums.ankiweb.net/t/fedora-35-and-anki-2-1-47-updates-with-blank-anki-window/13431/11) # Display Issues on Linux Source: https://docs.ankiweb.net/manual/platform/linux/display-issues Display Issues Hardware acceleration defaults to on. If you experience blank screens or display issues, you can try enabling software rendering. ### Changing the Driver From the Preferences Screen In Anki 23.10+, you can change the graphics driver from preferences screen by navigating to **Tools → Preferences** and then selecting the driver from the dropdown menu. ### Changing the Driver From the Terminal ``` echo software > ~/.local/share/Anki2/gldriver6 ``` If you wish to switch back to the default, change `software` to `auto`, or remove that file. # Packages Distributed by Linux Distributions Source: https://docs.ankiweb.net/manual/platform/linux/distro-packages Linux Distro Packages We have seen a lot of issues caused by the customized versions of Anki distributed by Linux distributions: * Anki depends on third-party libraries like Qt, and Linux distributions often substitute different versions of those libraries, without testing the impact of those changes. * Sometimes the version of Anki they distribute is years old, or is an alpha/beta version not intended for stable release. Distributions will often disable the built-in update check as well, to prevent you from being notified of newer versions. Compiled builds of Anki are available on [https://apps.ankiweb.net](https://apps.ankiweb.net). Most of the necessary libraries are included, and Anki has been tested to work with these library versions. If you're experiencing issues with your distro's version, the first thing you should try is switching to the latest packaged version we provide. You are welcome to continue using your distro's version of Anki if you prefer, but if you run into any issues, you will need to report them to your distribution's package maintainers. # Anki not picking up GTK theme on Gnome/Linux Source: https://docs.ankiweb.net/manual/platform/linux/gtk-theme Incorrect GTK Theme You can work around this issue by explicitly telling Anki what the GTK theme is. Run the following commands in a terminal: ```shell theme={null} theme=$(gsettings get org.gnome.desktop.interface gtk-theme) echo "gtk-theme-name=$theme" >> ~/.gtkrc-2.0 echo "export GTK2_RC_FILES=$HOME/.gtkrc-2.0" >> ~/.profile ``` Then log out and log back into your computer, and Anki should pick up the GTK theme. # Input Methods on Linux Source: https://docs.ankiweb.net/manual/platform/linux/input-methods Input Methods ## Fcitx The standard Anki build includes fcitx support, but it may not work on all distributions. If you are unable to use fcitx, you may want to run Anki from [Python wheels](https://betas.ankiweb.net/#via-pypipip) instead. # Installing & Upgrading Anki on Linux Source: https://docs.ankiweb.net/manual/platform/linux/installing Install & Upgrade ## Requirements The packaged version requires a recent 64 bit Intel/AMD Linux with glibc 2.35+ or ARM/AArch64 with glibc 2.39+, and common libraries like libwayland-client and systemd. If you are on a different architecture, or a barebones Linux distro, you will not be able to use the packaged version, but you may be able to use the [Python wheels](https://betas.ankiweb.net/#via-pypipip) instead. Debian and derivatives, such as Ubuntu and [Chromebooks with Linux enabled](https://support.google.com/chromebook/answer/9145439), use the following before installing: ```shell theme={null} sudo apt install libxcb-xinerama0 libxcb-cursor0 libnss3 libxcb-icccm4 libxcb-keysyms1 ``` Arch and derivatives, such as Manjaro, please use the following before installing: ```shell theme={null} sudo pacman -S libxinerama xcb-util-cursor nss ``` If Anki fails to start after installing, you may be [missing other libraries](./missing-libraries). If you're on Ubuntu 24.04 and Anki won't start, please see [this thread](https://forums.ankiweb.net/t/issues-running-on-ubuntu-24-04/40974). Anki's build system only supports glibc, so musl-based distros are not currently supported. ## Installing To install Anki: 1. Download Anki from [https://apps.ankiweb.net](https://apps.ankiweb.net) to your Downloads folder. 2. If zstd is not already installed on your system, you'll need to install it using your package manager (e.g `sudo apt install zstd` on Debian/Ubuntu, or `sudo pacman -S zstd` on Arch). 3. Open a terminal and run the following commands, replacing the filename as appropriate. ```shell theme={null} tar xaf Downloads/anki-2X.XX-linux-x86_64.tar.zst cd anki-linux-2X.XX-* sudo ./install.sh ``` On some Linux systems, you may need to use `tar xaf --use-compress-program=unzstd`. 4. You can then start Anki by typing `anki` and hitting Enter. If you encounter any issues, please see the links on the left. ## Upgrading If you were running Anki from a .deb/.rpm/etc in the past, make sure to remove the system version before installing the package provided here. If you're upgrading from a previous package, simply repeat the installation steps to upgrade to the latest version. Your user data will be preserved. If you wish to downgrade to a previous version, make sure you [downgrade first](http://changes.ankiweb.net). ## Add-on Compatibility Some add-ons may not always work with the latest Anki release. If you upgrade to the latest Anki version and find an add-on you cannot live without stops working, you can download older Anki versions from the [releases page](https://github.com/ankitects/anki/releases). ## System Qt versions Anki uses the official PyQt builds by default. This makes it easier to install Anki on distros that don't have the relevant Python/Qt versions, but means that you may not have access certain Qt features provided by your Linux distro, such as certain Qt themes, support for the FCITX input method, etc. If your Linux distro provides up-to-date Anki packages, you may find using them easiest. ## Problems If you encounter any issues when installing or starting Anki, please see the following pages: * [Missing Libraries](./missing-libraries) * [Display Issues](./display-issues) * [Blank Main Window](./blank-window) * [Linux Distro Packages](./distro-packages) * [Incorrect GTK Theme](./gtk-theme) * [Wayland](./wayland) * [Input Methods](./input-methods) # Linux Source: https://docs.ankiweb.net/manual/platform/linux/intro ## Installing & Upgrading Anki on Linux For instructions on how to install or upgrade Anki on Linux, see: * [Install & Upgrade](./installing) ## Problems If you encounter any issues when installing or starting Anki, please see the subsections in the table of contents. # Missing Libraries Source: https://docs.ankiweb.net/manual/platform/linux/missing-libraries If Anki fails to start, please run it from a terminal with `anki`. If it says a library is missing, please install it and try again. If it complains about no platform being available, please start Anki with the following command line, which should reveal a missing library: ```shell theme={null} QT_DEBUG_PLUGINS=1 anki ``` After installing the library with `apt-get` or similar, repeat the process. You may need to do this a few times before all required libraries are installed. # Wayland Source: https://docs.ankiweb.net/manual/platform/linux/wayland From Anki 2.1.48, you can force Anki to use Wayland by defining ANKI\_WAYLAND=1 before starting Anki. Wayland may give you better rendering across multiple displays, but it is currently off by default, due to the following issues: * On some distros, windows are rendered without borders. * Bringing windows to the front is not possible, so for example, clicking on Add to reveal an existing Add Cards window will not work. # Display Issues on macOS Source: https://docs.ankiweb.net/manual/platform/mac/display-issues Display Issues ## Change the Video Driver ### Changing the Driver From the Preferences Screen If you're experiencing display issues or crashes in Anki 23.10+, you can try changing the video driver in the preferences screen by navigating to **Anki → Preferences** and then selecting the driver from the dropdown menu. After that it is necessary to restart Anki. ### Changing the Driver From Terminal.app Older Anki versions did not provide an option in the preferences, but allowed you to adjust the driver by opening Terminal.app, then pasting the following and hit Enter: ``` echo software > ~/Library/Application\ Support/Anki2/gldriver6 ``` It will not print anything. You can then start Anki again. If you wish to switch back to the default, change `software` to `auto`, or remove that file. ## eGPUs If you experience blank screens when using an external graphics card on a Mac, you can Ctrl-click on the Anki app, click **Get Info**, and enable the **prefer eGPU** option. ## Monitors with Different Resolutions See [this forum post](https://forums.ankiweb.net/t/mac-known-issues-wording-suggestion/7331). # Installing & Upgrading Anki on macOS Source: https://docs.ankiweb.net/manual/platform/mac/installing Install & Upgrade ## Requirements macOS version requirements are listed on the download page. If you're on an old machine, you can obtain the old version from the [releases page](https://github.com/ankitects/anki/releases). The Qt5 builds on 24.11 and earlier support macOS 10.14 and later. If your macOS is between 10.10 and 10.13, you'll need to use [Anki 2.1.35-alternate](https://github.com/ankitects/anki/releases/tag/2.1.35). ## Installing 1. Download Anki from [https://apps.ankiweb.net](https://apps.ankiweb.net). 2. Save the file to your desktop or downloads folder. 3. Open it, and drag Anki to your Applications folder or desktop. 4. Double-click on Anki in the location you placed it. ## Upgrading To upgrade, close Anki if it is open, and then follow the steps above. Drag the Anki icon into the same location you previously stored it, and when prompted, overwrite the old version. Your card data will be preserved. ## Homebrew [Homebrew](https://brew.sh/) users can install Anki using `brew install --cask anki` in their preferred Terminal application. Upgrading can be done using `brew upgrade`, and for uninstalling: `brew uninstall --cask anki` ## Add-on Compatibility Some add-ons may not always work with the latest Anki release. If you upgrade to the latest Anki version and find an add-on you cannot live without stops working, you can download older Anki versions from the [releases page](https://github.com/ankitects/anki/releases). ## Problems If you encounter any issues when installing or starting Anki, please see: * [Display Issues](./display-issues) # macOS Source: https://docs.ankiweb.net/manual/platform/mac/intro ## Installing & Upgrading Anki on macOS For instructions on how to install or upgrade Anki on macOS, see: * [Install & Upgrade](./installing) ## Problems If you encounter any issues when installing or starting Anki, please see the subsections in the table of contents. # Copy and paste issues Source: https://docs.ankiweb.net/manual/platform/windows/copy-and-paste If you are experiencing problems with copying and pasting, please check if you are running other programs on your computer that monitor the clipboard, such as dictionary programs, clipboard managers or clipping tools. The toolkit Anki uses can have trouble when such programs are running. # Windows Display Issues Source: https://docs.ankiweb.net/manual/platform/windows/display-issues Display Issues On Windows, there are three ways of content being displayed on screen. The default is *software*, which is slower, but the most compatible. There are two other options that are faster: *OpenGL* and *ANGLE*. They are faster, but they may not work, or may cause display issues such as missing menubars, blank windows, and so on. Which one works best will depend on your computer. ## Changing the Driver From the Preferences Screen In Anki 23.10+, you can change the graphics driver from preferences screen by navigating to **Tools → Preferences** and then selecting the driver from the dropdown menu. ## Changing the Driver From the Command Line If you run into display issues, you can try switching to software mode via cmd: ```bat theme={null} echo software > %APPDATA%\Anki2\gldriver6 ``` Or you can do it via PowerShell: ```powershell theme={null} echo software > $env:APPDATA\Anki2\gldriver6 ``` It will not print anything. You can then start Anki again. To revert to the default behaviour, change `software` to `auto`, or delete that file. ## Full Screen Anki 2.1.50+ comes with a full screen mode, but due to various issues, it had to be disabled while `OpenGL` is used. Turning on software rendering as described above will allow the full screen option to be used, though please bear in mind that rendering performance may suffer. In Anki 23.10+, full screen mode is supported with the default Direct3D driver. # Windows installation issues Source: https://docs.ankiweb.net/manual/platform/windows/installation-issues Installation Issues Some error messages you may encounter when installing Anki: Also see [startup issues](./startup-issues). ## "Error opening file for writing" If closing Anki and your browser does not help, please try restarting your computer, then running the installer again. ## Antivirus issues Antivirus programs may sometimes report a [false positive](/faqs/my-antivirus-program-says-anki-is-infected). # Installing & Upgrading Anki on Windows Source: https://docs.ankiweb.net/manual/platform/windows/installing Install & Upgrade ## Requirements Recent Anki releases support the following Windows configurations: | Processor architecture | Required Windows version | | - | - | | x64 (Intel or AMD) | 64-bit Windows 10 (version 1703 or newer) or 11 | | ARM64 | Windows 11 | To check your processor architecture, open **Settings > System > About** and look for **System type** under **Device specifications**. An **x64-based processor** uses the x64 installer; an **ARM-based processor** uses the ARM installer. * The last Anki release that supported Windows 7 and 8.1 was Anki 2.1.49. * The last Anki release that supported 32 bit Windows was [Anki 2.1.35-alternate](https://github.com/ankitects/anki/releases/tag/2.1.35). If you're on an old machine, you can obtain old releases from the [releases page](https://github.com/ankitects/anki/releases). ## Installing To install Anki: 1. Download Anki from [https://apps.ankiweb.net](https://apps.ankiweb.net), choosing **Windows 10+ (x64)** or **Windows 11 (ARM)** to match your processor architecture. 2. Save the installer to your desktop or downloads folder. 3. Double-click on the installer to run it. If you see an error message, please see the [installation issues page](./installation-issues). 4. Once Anki is installed, double-click on the new star icon on your desktop to start Anki. ## Upgrading If upgrading from Anki 2.1.6+, there is no need to uninstall the previous version first. All you need to do is close Anki if it is open, and then follow the installation steps above. Your cards will be preserved when you upgrade. If upgrading from an Anki version before 2.1.6, or switching from the standard to the alternate version or vice versa, we recommend uninstalling the old version first, which will remove Anki's program data, but not delete your card data. If you wish to downgrade to a previous version, make sure you [downgrade first](http://changes.ankiweb.net). ## Add-on Compatibility Some add-ons may not always work with the latest Anki release. If you upgrade to the latest Anki version and find an add-on you cannot live without stops working, you can download older Anki versions from the [releases page](https://github.com/ankitects/anki/releases). ## Problems If you encounter any issues when installing or starting Anki, please see the following pages: * [Installation Issues](./installation-issues) * [Startup Issues](./startup-issues) * [Display Issues](./display-issues) * [Permission Problems](./permission-problems) If you encounter any interface issues when using Anki, please see the following pages: * [Copy and Paste Issues](./copy-and-paste) * [Text Size Issues](./text-size) # Windows Source: https://docs.ankiweb.net/manual/platform/windows/intro ## Installing & Upgrading Anki on Windows For instructions on how to install or upgrade Anki on Windows, see: * [Install & Upgrade](./installing) ## Problems If you encounter any issues when installing or starting Anki, please see the subsections in the table of contents. # Windows permission problems Source: https://docs.ankiweb.net/manual/platform/windows/permission-problems Permission Problems ## Permission Problems If you receive "access denied" messages, some of Anki's files may be set to read only mode, meaning Anki is not able to write to them. To fix the problem, you can do the following: * in the search area of the start bar, type `cmd.exe` and hit Enter * in the window that opens, type the following and hit Enter to see your username: whoami * type the following, hitting Enter after each line, and replacing \_\_\_\_ (and keeping the :F part) with your username from the previous command cd %APPDATA% icacls Anki2 /grant \_\_\_\_:F /t That command should fix the permissions on Anki's data folder, and you should now be able to start the program. ## Antivirus/Firewall/Anti-Malware Some users have experienced "permission denied" or "readonly" errors that were caused by security software installed on their machine. You may need to add an exception for Anki, or try temporarily disabling the software to rule it out as the cause. Some users have reported that simply turning off their software did not fix the problem, and they either had to add an exception for Anki or uninstall the software. ## Debugging Permission Problems If problems persist after you've ruled out Antivirus and related programs, have performed the steps above to fix permissions, and don't use OneDrive, please run the following commands in `cmd.exe`, pressing Enter after each one. whoami cd %APPDATA% icacls Anki2 /t Then copy & paste or screenshot what you see, and post it to us in a support ticket. # Windows startup issues Source: https://docs.ankiweb.net/manual/platform/windows/startup-issues Startup Issues ## No error, but app does not appear If you start Anki and it fails to appear, without any error message, you can try the following: * Disconnect multiple/external displays. * Install the [latest Anki version](https://apps.ankiweb.net/). * Adjust [your decimal separator](https://forums.ankiweb.net/t/windows-update-broke-anki/1822/75), if it is not a period. * Install the old [2.1.35-alternate build](https://github.com/ankitects/anki/releases/tag/2.1.35) of Anki. ## Windows updates When starting Anki, you may receive a message like the following: * *Error loading Python DLL* * *The program can't start because api-ms-win.... is missing* * *Failed to execute script runanki* * *Failed to execute script pyi\_rth\_multiprocessing* * *Failed to execute script pyi\_rth\_win32comgenpy* These errors are usually because your computer is missing a Windows update or Windows library. Open Windows update, and ensure your system has all updates installed. If any needed to be installed, restart your device after installing. ## Windows 7/8 On Windows 7/8, you may need to manually install extra updates. Try: * [https://www.microsoft.com/en-us/download/details.aspx?id=48234](https://www.microsoft.com/en-us/download/details.aspx?id=48234) * [https://aka.ms/vs/15/release/vc\_redist.x64.exe](https://aka.ms/vs/15/release/vc_redist.x64.exe) * [http://www.catalog.update.microsoft.com/Search.aspx?q=kb4474419](http://www.catalog.update.microsoft.com/Search.aspx?q=kb4474419) * [http://www.catalog.update.microsoft.com/Search.aspx?q=kb4490628](http://www.catalog.update.microsoft.com/Search.aspx?q=kb4490628) ## Video driver issues Please see [display issues](./display-issues). ## Multiple displays If you get a *LoadLibrary failed with error 126*, this may be caused by the toolkit Anki is built on having trouble with [multiple displays](https://forums.ankiweb.net/t/error-126-on-open-anki-desktop/13967). ## Antivirus/firewall software Third-party software on your machine may prevent Anki from loading. You can try adding an exception for Anki, or temporarily disabling your antivirus/firewall to see if it helps. ## Admin access Some users have reported that Anki did not run for them until they right-clicked on the Anki icon and chose "Run as administrator". Anki stores all of its data in your user folder, and should not need administrator privileges, but it's something you can try if you've exhausted other options. ## Multiple Anki installations present after updating If the update process leaves you with multiple Anki installs (such as within `C:\Program Files\Anki` and `C:\Program Files (x86)\Anki`), they may be left in a non-working state, and Anki may refuse to start without showing an error message. Try uninstalling all copies of Anki from your computer. To do this, find them in Windows Settings > Apps & features (or Apps > Installed apps) and uninstall, or run `uninstall.exe` in each Anki program folder. Afterward, install Anki again. ## Debugging Starting Anki from a terminal may reveal a bit more information about some errors. After installing the latest Anki version and ensuring all Windows updates are installed, instead of running Anki directly, press the Windows key (or open the Start menu), type `cmd`, and launch Command Prompt. When the terminal window opens, paste the following command, and press Enter. (The path will be different if Anki is installed in a location that is not the default.) ``` %LocalAppData%\Programs\Anki\anki-console.bat ``` For Anki versions 25.07 to 25.09.4, paste ``` %LocalAppData%\Programs\Anki\anki-console.exe ``` Presumably Anki will fail to open like before, but the output in the terminal window may reveal something about what is causing the problem. ## If all else fails If you are unable to start Anki after trying the above workarounds, you have two remaining options: * You can try [running from Python](/faqs/running-from-python). * You can try an older Anki version built with an older toolkit, such as [2.1.35-alternate](https://github.com/ankitects/anki/releases/tag/2.1.35), or [2.1.15](https://github.com/ankitects/anki/releases/tag/2.1.15). # Text Size Source: https://docs.ankiweb.net/manual/platform/windows/text-size If you find the text is the wrong size, there are two environment variables you can try: * ANKI\_NOHIGHDPI=1 will turn off some of Qt’s high dpi support * ANKI\_WEBSCALE=1 will alter the scale of Anki’s web views (like the deck list, study screen, etc), while leaving interface elements like the menu bar alone. Replace 1 with the desired scale, such as 1.5 or 0.75. On Windows you can add these to a batch file to make it easier to start Anki. For example, create a file called startanki.bat on your desktop with the following text: ```text theme={null} set ANKI_WEBSCALE=0.75 start "Anki" "%LocalAppData%\Programs\Anki\anki.exe" ``` After saving, you can double click on the file to start Anki with that setting. # Preferences Source: https://docs.ankiweb.net/manual/preferences The preferences are available from the **Tools** menu on Windows/Linux, or the **Anki** menu on a Mac. ## Appearance ### General **Language**\ Change your display language. You can help to improve translations [here](https://translating.ankiweb.net/) ### User Interface **Theme**\ Dark (night) mode will make Anki's interface dark, and will cause cards to be shown as white text on a black background. Some card templates may need to be modified to work properly with this option enabled - see [night mode styling](./templates/styling#night-mode) for more information. From 2.1.50+ there is an option to switch to day or night mode automatically. **User interface size**\ If you find that the interface elements are too small for you, you can try to increase this setting. **Reset Window Sizes**\ This will reset all window sizes and locations to the default settings. **Video driver**\ Anki's libraries need a video driver to draw content on the screen. Due to different hardware and software configurations, the driver that works best on your machine may vary. Software tends to be slower, but will work on some systems where the other options do not. Note: If you're on Windows, check [this page](./platform/windows/display-issues) as well. ### Distractions These options allow you to remove some unnecessary elements from the screen during reviews. You can: * Hide the top and bottom bar during reviews. * Enable the "minimalist" mode, making the interface more compact/less fancy. * Reduce motion, to disable some transitions/animations. * Switching between native styling and the Anki theme (only on Mac/Linux). ## Review ### Scheduler **Next day starts at**\ Controls when Anki should start showing the next day’s cards. The default setting of 4AM ensures that if you’re studying around midnight, you won’t have two days' worth of cards shown to you in one session. If you stay up very late or wake up very early, you may want to adjust this to a time you’re usually sleeping. Note that the start of the next day is relative to your current time zone. Also note that any cards that cross a day boundary [will appear at the start of the day they are scheduled for](./deck-options#day-boundaries), just like review cards do. **Learn ahead limit**\ Tells Anki how to behave when there is nothing left to study in the current deck but cards in learning. The default setting of 20 minutes tells Anki that cards should be shown early if they have a delay of less than 20 minutes and there’s nothing else to do. If you set this to 0, Anki will always wait the full delay, showing the congratulations screen until the remaining cards are ready to be reviewed. **Timebox time limit**\ Timeboxing is a technique to help you focus by dividing a longer activity (such as a 30 minute study session) into smaller blocks. If you set the timebox time limit to a non-zero number of minutes, Anki will periodically show you how many cards you’ve managed to study during the prescribed time limit. ### Review **Show play buttons on cards with audio**\ Whether a clickable (re)play button will be shown in the study screen for cards with audio. **Interrupt current audio when answering**\ Whether a currently playing audio file should be stopped when answering a card. **Show remaining card count**\ Disable this option to hide the card count at the bottom of the screen. **Show next review time above answer buttons**\ Useful to know how far in the future your cards are being pushed. **Spacebar (or enter) also answers card**\ Defines whether a press on Space or Enter answers cards. ## Editing ### Editing **Paste clipboard images as PNG**\ By default Anki pastes images on the clipboard as JPG files, to save disk space. You can use the option to paste as PNG images instead. PNG images support transparent backgrounds and are lossless, but they usually result in much larger file sizes. **Paste without Shift strips formatting**\ By default, formatting like bold and colors are kept when pasting, unless the Shift key is held down. This option reverses the behaviour. **Default deck**\ Controls how note types and decks interact. The default option **When adding, default to current deck** means that Anki saves the last-used note type for each deck and selects it again the next time you choose the deck (and, in addition, will start with the current deck selected when choosing **Add** from anywhere). The other option, **Change deck depending on note type**, saves the last-used deck for each note type (and opens the add window to the last-used note type when you choose **Add**). This may be more convenient if you always use a single note type for each deck. The last used deck/note type is updated when you add a card. If you change the deck and close the add window without adding a card, it won't be saved. ### Browsing **Default search text**\ Allows you to customize the starting search text in the browser (eg, to start with "deck:current"). **Ignore accents in search (slower)**\ When enabled, simple text searches automatically [ignore accents](./searching#ignoring-accentscombining-characters). ## Syncing This tab contains options related to syncing with AnkiWeb. ### Synchronisation **Synchronize audio and images too**\ When enabled, media will also be synced with AnkiWeb. **Automatically sync on profile open/close**\ Disable this if you don't want an automatic sync with AnkiWeb when opening / closing a [profile](./profiles). **Periodically sync media**\ Enable this setting if you want to automatically sync your media every 15 minutes. Without this preference enabled, media would sync in bulk during normal syncs. You might want to enable this to avoid large media download / upload on normal syncs, e.g. if you have a slower internet connection. > [!NOTE] > > Let's say you create new anki cards and many of those cards contain media files. If > you add cards for an hour and have this setting turned on, then there will be 4 > smaller media uploads in total. Without this setting, you would have to upload the > entire media with the next normal sync, which might take more time. **On next sync, force changes in one direction**\ When this option is enabled, the next sync will ask you whether you wish to upload or download. This is useful if you have made some changes accidentally, and wish to overwrite them with an older version that is on AnkiWeb. ### AnkiWeb Account When logged in, clicking on **Log Out** will log you out. ### Self-hosted Sync Server For info on the custom sync server option, see [this section](./sync-server). ## Backups See [this](./backups#automatic-backups) section of the manual. # Profiles Source: https://docs.ankiweb.net/manual/profiles If more than one person wants to use Anki on your computer, you can set up a separate profile for each user. Each user profile has their own collection, and own program settings. Add-ons are shared across profiles. Profiles are configured by going to the File menu and choosing "Switch Profile". > [!WARNING] > > Only a single profile can be synced to an AnkiWeb account. > > If you have different users on your computer, each user will > need to set up a separate AnkiWeb account for their profile. If you attempt > to link two or more profiles to the same AnkiWeb account, you will overwrite > the data from one profile with the data from the other. Profiles are primarily intended to be used by different people, and are not recommended for splitting up your own content. If you have created multiple profiles for yourself, the best option is to merge them into a single profile. You can do so by exporting one deck from profile A, and then importing it into profile B, repeating for any other decks in profile A, until everything is in profile B. AnkiDroid does not support profiles. ## Profiles window From the Profiles window (accessible via File>Switch Profile from the main window), you can: * Open / Add / Rename / Delete user profiles. * Quit the program. * Restore an [automatic backup.](./backups) * Downgrade your collection, which is necessary if you want to open it with an earlier Anki release. If you skip this step, you may get an error message when opening your collection in an older Anki version, and you will need to return to this version, downgrade, then try again. # Resources Source: https://docs.ankiweb.net/manual/resources You can find guides, templates, custom schedulers and other resources in [this resource list](https://forums.ankiweb.net/t/collection-of-anki-resources/60044). # Searching Source: https://docs.ankiweb.net/manual/searching Anki's Browse screen and the Filtered Deck feature use a common method of searching for specific cards/notes. This method can also be used to adjust the scope of FSRS optimization. ## Simple searches When you type some text into the search box, Anki finds matching notes and displays their cards. Anki searches in all fields of the notes, but does not search for tags (see [later in this section](./#tags-decks-cards-and-notes) to search for tags). Some examples: `dog`\ searches for "dog" - will match words like "doggy" and "underdog" too. `dog cat`\ finds notes that have both "dog" and "cat" on them, such as "raining cats and dogs". `dog or cat`\ finds notes with either "dog" or "cat". `dog (cat or mouse)`\ finds notes with "dog" and "cat", or "dog" and "mouse". `-cat`\ finds notes without "cat". `-cat -mouse`\ finds notes with neither "cat" nor "mouse". `-(cat or mouse)`\ same as the above. `"a dog"`\ finds notes with the exact sequence of characters "a dog" in them, such as "atta dog", but not "dog a" or "adog". `-"a dog"`\ finds notes without the exact sequence of characters "a dog" in them. `d_g`\ finds notes with d, \, g, like dog, dig, dug, and so on. `d*g`\ finds notes with d, \, g, like dg, dog, dung, etc. `w:dog`\ searches for the word "dog" as opposed to a sequence of characters - will match "dog", but not "doggy" or "underdog". Requires Anki 2.1.24+, AnkiMobile 2.1.61+, or AnkiDroid 2.17+. Note that formatting changes may be interpreted as word boundaries, e.g. searching for `w:exam` will match **exam**ple, as the "exam" part of example is in bold format. `w:dog*`\ will match "dog" and "doggy", but not "underdog". `w:*dog`\ will match "dog" and "underdog", but not "doggy". Things to note from the above: * Search terms are separated by spaces. * When multiple search terms are provided, Anki looks for notes that match all of the terms - an implicit `and` is inserted between each term. On Anki 2.1.24+, AnkiMobile 2.0.60+, and AnkiDroid 2.17+ you can be explicit if you like (`dog and cat` is the same as `dog cat`), but older Anki versions will treat `and` as just another word to search for. * You can use `or` if you only need one of the terms to match. * You can prepend a minus sign (`-`) to a term to find notes that don’t match the term. * You can group search terms by placing them in parentheses, as in the `dog (cat or mouse)` example. This becomes important when combining OR and AND searches — in the example, with the parentheses, it matches either "dog cat" or "dog mouse", whereas without them it would match either "dog and cat" or "mouse". * Anki is only able to search within formatting in the [sort field](./editing#customizing-fields) you’ve configured. For example, if you add "**exa**mple" to one of your fields, with the "exa" part in bold, this will not be matched when searching for `example` unless that field is the sort field. If a word is not formatted, or the formatting does not change in the middle of the word, then Anki will be able to find it in any field. * Standard searches are case insensitive for Latin characters - a-z will match A-Z, and vice versa. Other characters such as Cyrillic are case sensitive in a standard search, but can be made case insensitive by searching on a word boundary or regular expression (`w:`, `re:`). ## Limiting to a field You can also ask Anki to match only if a particular field contains some text. Unlike the previous search examples, searching in fields requires an exact match by default. `front:dog`\ finds notes with a Front field of exactly "dog". A field that says "a dog" will not match. `"animal front:a dog"`\ finds notes where the "Animal Front" field is exactly "a dog". The double quotes are mandatory: see [later in this section](./#matching-special-characters). `front:*dog*`\ finds notes where the Front field contains dog somewhere. `front:`\ finds notes that have an empty Front field. `front:_*`\ finds notes that have a non-empty Front field. `front:*`\ finds notes that have a Front field, empty or not. `fr*:text`\ finds notes in a field starting with "fr". Requires Anki 2.1.24+, AnkiMobile 2.1.60+, or AnkiDroid 2.17+. ## Tags, decks, cards and notes `tag:animal`\ finds notes with the tag "animal", or subtags like "animal::mammal". `tag:none`\ finds notes with no tags. `tag:ani*`\ finds notes with tags starting with "ani". `deck:french`\ find cards in a top-level deck called "French", or its subdecks like "French::Words". It will not match subdecks with that name, such as "Languages::French". `deck:french::words`\ find cards in the "French::Words" subdeck. `deck:french -deck:french::*`\ finds cards in "French", but not its subdecks. `deck:"french words"`\ searching when the deck name has a space. `"deck:french words"`\ same as earlier. `deck:filtered`\ filtered decks only. `-deck:filtered`\ normal decks only. `preset:"Default"`\ cards in all decks that use the "Default" deck options preset. Requires Anki 23.10+, AnkiMobile 23.10+ or AnkiDroid 2.17+. `card:forward`\ finds cards created by a card type named "Forward". `card:1`\ searches for cards by card type number, e.g. to find the second cloze deletion for a note, you’d use `card:2` `note:basic`\ searches for cards created with a note type named "Basic". ## Ignoring accents/combining characters Requires Anki 2.1.24+, AnkiMobile 2.0.60+ or AnkiDroid 2.17+. You can use `nc:` (nc stands for "no combining") to make Anki ignore combining characters. For example: `nc:uber`\ matches notes with "uber", "über", "Über" and so on. `nc:は`\ matches "は", "ば", and "ぱ". `nc:heisen` or `nc:heißen`\ matches notes with "heißen" and with "heisen", since ß is treated as s (not ss) and s is treated as ß. Searches that ignore combining characters are slower than regular searches. ## Searching in cloze deletions Requires Anki 25.07+. You can use `sc:` (sc stands for “strip clozes”) to search through the full text of notes with cloze deletions, ignoring the cloze markup. For example: `sc:mnemonic`\ matches a note containing `{{c1::mn}}{{c2::e}}monic`. `sc:capital of France`\ matches a note containing `The {{c1::capital}} of {{c2::France}}`. Searches that strip cloze deletions are slower than regular searches. ## Regular expressions Anki 2.1.24+, AnkiMobile 2.0.60+ and AnkiDroid 2.17+ support searching in notes with "regular expressions", a standard and powerful way of searching in text. Start a search with `re:` to search using regular expressions. To make things easier, Anki will treat the following as [raw input](./#raw-input), so bear in mind the rules listed there. Some examples: `"re:(some|another).*thing"`\ finds notes that have "some" or "another" on them, followed by 0 or more characters, and then "thing". `re:\d{3}`\ finds notes that have 3 digits in a row. Regular expressions can also be limited to a specific field. Note that unlike the normal searches in a specific field, regular expressions in fields don't require an exact match: `front:re:[a-c]1`\ matches uppercase or lowercase a1, B1 or c1 that occurs anywhere in the "Front" field. `front:re:^[a-c]1$`\ same as the previous example, but will not match if any other text falls before or after a1/b1/c1. Anki 2.1.50+ supports regular expressions for tags: `tag:re:^parent$`\ finds notes with the exact tag "parent", disregarding any child tags like "parent::child". `"tag:re:lesson-(1[7-9]|2[0-5])"`\ finds notes with tags "lesson-17" through "lesson-25". For more information on regular expressions, see [this website](https://regexone.com/lesson/introduction_abcs). Some things to be aware of: * The search is case-insensitive by default; use `(?-i)` at the start to turn on case sensitivity. * Some text like spaces and newlines may be represented differently in HTML - you can use the HTML editor in the editing screen to see the underlying HTML contents. * For the specifics of Anki's regex support, see the [regex crate documentation](https://docs.rs/regex/1.3.9/regex/#syntax). ## Card state `is:due`\ review cards and learning cards waiting to be studied. `is:new`\ new cards. `is:learn`\ cards in learning. `is:review`\ reviews (both due and not due) and lapsed cards. `is:suspended`\ cards that have been [automatically](./leeches) or manually suspended. `is:buried`\ cards that have been either [automatically](./studying#siblings-and-burying) or manually buried. `is:buried-sibling`\ cards that have been buried automatically. `is:buried-manually`\ cards that have been manually buried. Cards that have [lapsed](./deck-options#lapses) fall into several of the previous categories, so it may be useful to combine different search terms to get more precise results: `is:learn is:review`\ cards that have lapsed and are awaiting relearning. `-is:learn is:review`\ review cards, not including lapsed cards. `is:learn -is:review`\ cards that are in learning for the first time. ## Flags `flag:0`\ cards without a flag. `flag:1`\ cards with a red flag. `flag:2`\ cards with an orange flag. `flag:3`\ cards with a green flag. `flag:4`\ cards with a blue flag. `flag:5`\ cards with a pink flag. `flag:6`\ cards with a turquoise flag. `flag:7`\ cards with a purple flag. ## Card properties `prop:ivl>=10`\ cards with interval of 10 days or more. `prop:due=1`\ cards due tomorrow. `prop:due=-1`\ cards due yesterday that haven’t been answered yet. `prop:due>=1`\ all cards due in the future, including tomorrow. `prop:due<=-1`\ all overdue cards. `prop:due>=-1 prop:due<=1`\ cards due yesterday, today and tomorrow. `prop:reps<10`\ cards that have been answered less than 10 times. `prop:lapses>3`\ cards that have lapsed more than 3 times. `prop:ease!=2.5`\ cards easier or harder than default ease. `prop:pos<=100`\ new cards with a position in the queue less than or equal to 100. The following searches require Anki 23.10+ and FSRS enabled: `prop:s>21`\ cards with stability greater than 21 days. `prop:d>0.3`\ cards with difficulty greater than 0.3. `prop:r<0.9`\ cards with retrievability less than 0.9. ## Recent Events ### Added `added:1`\ cards added today. `added:7`\ cards added in the last 7 days. The check is made against card creation time rather than note creation time, so cards that were generated within the time frame will be included even if their notes were added a long time ago. ### Edited `edited:n`\ cards where the note text was added/edited in the last n days. This requires Anki 2.1.28+ or AnkiMobile 2.0.64+. ### Answered `rated:1`\ cards answered today. `rated:1:2`\ cards answered Hard (2) today. `rated:7:1`\ cards answered Again (1) in the last 7 days. `rated:31:4`\ cards answered Easy (4) in the last 31 days. Anki 2.1.39+ supports rating searches over 31 days. Note that, to search for cards answered at a particular day, `rated:n -rated:(n-1)` might not work every time. Use the following instead: `prop:rated=0`\ cards answered today. `prop:rated=-1`\ cards answered one day ago. `prop:rated=-7`\ cards answered 7 days ago. ### First Answered Requires Anki 2.1.45+. `introduced:1`\ cards answered for the first time today. `introduced:365`\ cards answered for the first time within the last 365 days. ## Matching special characters If you're using a version earlier than Anki 2.1.36 the following searches may not work. As shown in the previous section, some characters like `*`, `_` and `"` have a special meaning in search. If you need to locate those characters in a search, you need to tell Anki not to treat them specially. This is called "escaping a character" and is primarily done by using double quotes and backslashes. * *Space*\ To match something that includes spaces, enclose the `"entire term"` in double quotes. If it is a colon search, you also have the option to only quote the `part:"after the colon"`. * `And`/`Or`\ To search for these words, wrap them with double quotes. For example, `dog "and" cat` searches for "dog", "cat" and the word "and". If you wrap the entire search term with quotes like in the previous example, you do not need to escape `and` or `or`. * `"`, `*` and `_`\ Add a backslash before these characters to treat them literally. For example, `_` will match any single character, but `\_` matches only an actual underscore. * `\`\ Because a backslash is used to remove the special meaning from other characters, it too is treated specially. If you need to search for an actual backslash, use `\\` instead of `\`. * `(` and `)`\ You can search for parentheses by enclosing the entire term in quotes, by using a backslash, or both at the same time. For example, `"(text)"`, `\(text\)` and `"\(text\)"` are all equivalent searches, and search for `(text)`. * `-`\ Starting a search term with `-` usually inverts it: `-dog` matches everything except dog for example. If you instead wish to include an actual hyphen, you can either use a backslash, or include the text in quotes. For example, `\-free` or `"-free"` will match "guilt-free" and "cruelty-free". * `:`\ Colons have to be escaped using backslashes unless they are preceded by another, unescaped colon. For example, `w:3:30` searches for "3:30" on word boundary and doesn't require you to use a backslash. However, if you don't use a colon search, the colons need to be escaped like this: `3\:30`. * `&`, `<`, and `>`\ `&`, `<`, and `>` are treated as HTML when searching in Anki, and as such, searches containing them don't work as expected. However, you can search for them by using their corresponding HTML entity names (`&` for `&`, `<` for `<`, and `>` for `>`). For example, searching `&text` searches for a note with `&text` in a field. ### Raw input Text preceded by certain keywords (like `re:`) will be treated as raw input. That is, the characters listed above largely lose their special meaning. In such a context, only a minimum of escaping is required to prevent ambiguity: * Double quotes (`"`) must be escaped. * Spaces and unescaped parentheses require the search term to be quoted. * The search term must not end in an odd number of backslashes. ## Object IDs `nid:123`\ the note with note id 123. `cid:123,456,789`\ all cards with card ids 123, 456, or 789. Note and card IDs can be found in the [card info](./stats) dialog in the browser. These searches may also be helpful when doing add-on development or otherwise working closely with the database. ## Custom Data Anki allows small amounts of custom data to be stored on cards, enabling advanced use cases such as custom schedulers. One of the notable applications of this feature was in earlier implementations of FSRS. In Anki 23.10+, there are some ways to search it: `has-cd:v`\ cards having the property `v` in custom data. `prop:cdn:d>5`\ cards with the value of `d` in custom data (usually refers to difficulty in FSRS) greater than 5. `prop:cds:v=reschedule`\ cards with the string `v` in custom data equal to `reschedule`. ## Other Searches `prop:due=1 is:learn`\ interday learning cards due for tomorrow. `prop:due=0 is:learn -introduced:1`\ interday learning cards due today. `prop:resched=0`\ cards rescheduled today, either using **Set due date** or **Reschedule cards on change**. # Card Info, Graphs and Statistics Source: https://docs.ankiweb.net/manual/stats Statistics ## Card Info You can display information about a card by using the Cards>Info menu item, by right-clicking on the card and then selecting **Info**, or by pressing I on the study screen. ![Card Info](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/card_info.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=c8cbdb3f229cc7dc93beb5f86d12912c) A few notes: **Position**\ It shows the order the card will appear in relative to other new cards. The position can be changed in the browser. Once a card has been studied, the position is not used, unless the card is manually reset to new again. **Interval**\ The delay from one review to the next. Times are abbreviated; "0s, 1m, 3h, 4d, 5mo, 6y" refers to seconds, minutes, hours, days, months and years respectively. **Ease**\ The approximate amount the interval will grow when you answer a review card with the "Good" button. The bottom section shows the review history for the card. Rating denotes the button (1 = Again, 4 = Easy). When cards are manually rescheduled using the "reset" or "set due date" actions, the type will be listed as Manual and the rating as 0. ## Statistics The statistics window is accessed by clicking on **Stats** button at the top of the main window, or by pressing T. ![Statistics screen](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/Statistics.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=3bf89a735c59f150e62714bda9c80c40) ## Selecting Decks / Collection ### Deck By default, the statistics window will show statistics from the currently selected deck and any subdecks it may contain, but you can select any deck from your collection by typing its name in the text box at the top of the screen or (from Anki 2.1.61), by using the deck selector at the bottom. ### Collection 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+). ### History 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.) ### More * Clicking on "Save PDF" at the bottom will save a PDF document of the statistics to a file on your desktop to make it easy to share your statistics with others. * When you delete notes, their review history is maintained in Anki. It will not be included when looking at statistics for a specific deck (as Anki has no way of knowing which deck the deleted cards belonged to), but will be included when you look at statistics for the whole collection. * Anki 2.1.28+ introduced redesigned graphs. The old graphs are still accessible with a Shift-click on the Stats button. ## Today At the top of the statistics window is a brief list of textual statistics about the reviews that you have completed today. A “review” in this context is "one answering of a card", so a card might count as multiple reviews if it needed to be seen multiple times, and a learning card answered also counts as a “review.” A couple of the stats whose meaning may not be immediately obvious: ### Again Count This is the number of reviews that you have failed (i.e., pressed Again on). The correct percentage listed afterwards is the number of cards you did "not" fail divided by the total number of cards you studied. ### Learn, Review, Relearn, Filtered The number of reviews that were learning cards, review cards, relearning cards, or studied in a filtered deck when not due. The stats for the current day are not a good overall indicator of your learning progress; everyone has bad days and good days, and seeing that you got a lower percentage correct on a particular day should not be cause for concern. The remainder of the stats, which take longer periods of time into account, will give more useful information if you wish to try to change your study habits or scheduling settings based on your performance. The “today” statistics are unaffected by the time period selected at the bottom of the window. ## The Graphs ### Future Due This graph shows an estimated number of reviews that will be due on a given day in the future if you learn no new cards and fail no cards. The bars and the left axis show the number of cards due on each day if you study all cards each day, while the gray shaded region and the right axis show the number of cards due on that day if you don’t study at all until then. Note that the forecast graph does not count reviews that are currently overdue, so if you have a large backlog, the overdue cards will not be displayed. Daily load is an estimate of the average number of cards to be reviewed daily. If you don't have a backlog, daily load should be approximately equal to your number of due cards. It is calculated as follows: $$ \frac\{1\}\{I_1\} + \frac\{1\}\{I_2\} + \frac\{1\}\{I_3\} + \dots + \frac\{1\}\{I_n\} $$ Here, \\(I\_n\\) is the interval of the n-th card. If the interval is less than one day, the summation term is 1. This prevents cards with short intervals from unrealistically skewing the value of daily load. Example: you have a card with an interval of 10 days and a card with an interval of 50 days. Daily load = \\(\frac\{1}\{10} + \frac\{1}\{50} = 0.12\\), meaning that, *on average*, you will have 0.12 due cards per day. ### Calendar This graph shows past card review activity. Hovering the mouse over a specific item allows you to view the number of revisions made that day. Click on a day of the week to make that the starting day. ### Reviews This graph counts the number of card reviews you have done. The bars may correspond to days, weeks, or months, depending on the time period you’ve selected at the bottom of the screen. The differently colored blocks show how many of the cards you answered on each day were [mature](./getting-started#card-states), young, relearning, or learning cards. There is also a separate group for cards answered in a filtered/cram deck while they were not due. The gray shaded region and the right axis show the cumulative total for each type of review as time progresses across the graph (so at 0 days, it would display the number for the entire time period displayed on the graph). ### Card Counts This pie chart shows what percentage of your deck or collection consists of mature, unseen, young/learn, and suspended cards. If you wish to calculate a more precise percentage, the key shows the exact number of cards in each section, and the total number of cards is displayed to the side. ### Review Time This graph works exactly like Review Count, except that it deals with the amount of time you spent on each card rather than the number of cards answered. ### Review Intervals This graph displays the number of cards that have a given interval (the delay between two reviews). The gray shaded region and the right axis tell you what percentage of your cards have an interval of less than or equal to the time below that point. The time scope has a different effect on this graph than other graphs: rather than changing which cards or period of studying is included, it limits how far out the intervals are displayed to (so 14-month intervals are not displayed at all on a 1-year graph). ### Card Ease This graph shows the number of cards that have a specific ease factor. Average ease of the selected deck / collection is also displayed here. ### Card Stability Only shown if FSRS is enabled. Stability is defined as the amount of time required for the probability of recall to decrease from 100% to 90%. ### Card Difficulty Only shown if FSRS is enabled. Difficulty determines how quickly a card's interval grows after each review. ### Card Retrievability Only shown if FSRS is enabled. "Retrievability" is synonymous with "probability of recall". Estimated total knowledge is the total number of cards you are likely to currently remember, calculated by multiplying average retrievability by the number of cards that have been reviewed at least once. ### Hourly Breakdown This graph shows the percentage of total reviews you have passed during given hours. 1. x-axis (bottom): Time of day (at given hour). 2. y-axis (right): Amount of cards studied. 3. secondary y-axis (left): Success rate in percent. The blue bars thus show you the number of reviews you’ve made at that hour (so that you know how significant the results are). The gray shaded region shows the percentage of the total reviews you have passed (i.e., not pressed *Again* on) at that hour. ### Answer Buttons This graph shows how many times you’ve chosen the Again, Hard, Good, or Easy button while studying learning/new, young, and [mature](./getting-started#card-states) cards. Anki also displays the percentage of correct reviews for each type of card. ### True Retention Table This table shows your retention across different cards and different time frames. A card is defined as "mature" if its interval is ≥21 days. Only one review per day - the first one - counts. Again counts as "Fail"; Hard, Good, and Easy count as "Pass". This table can be used to check how well [Anki's spaced repetition algorithm](/faqs/what-spaced-repetition-algorithm) is working for you. If you are using FSRS, your true retention is expected to be close to your [desired retention](./deck-options#desired-retention). Keep in mind that data for a single day is noisy, so it's better to look at monthly data. If your true retention doesn't match your desired retention very well, here are some general recommendations: 1. Optimize your FSRS parameters. 2. Use different presets with their own parameters for different material. 3. Suspend/reformulate [leeches](./leeches). 4. Make sure you are [using the answer buttons as intended](./studying#answer-buttons). ## Manual Analysis If you’re interested in getting information from your statistics other than what Anki provides, it is possible to access the data directly. Because of the complexity involved, this is not something we can provide any support for. One option is to [write an add-on](./addons) that adds another graph or more details to the statistics window. There are several add-ons of this sort on AnkiWeb already, which you can look at to get an idea of how it works. A more powerful and more complex option is to extract the review log information directly from Anki’s database and analyze it in an external program. Anki uses a database format called SQLite. There are many tools available for working with SQLite databases; one of the easiest to start with is called [SQLite Browser](http://sqlitebrowser.org/), which will allow you to look around the database as well as export a CSV version of tables for import into another program. The most important table for statistics is the "revlog" table, which stores an entry for each review that you conduct. The columns are as follows: **id**\ The time at which the review was conducted, as the number of milliseconds that had passed since midnight UTC on January 1, 1970. (This is sometimes known as "Unix epoch time", especially when in straight seconds instead of milliseconds.) **cid**\ The ID of the card that was reviewed. You can look up this value in the id field of the "cards" table to get more information about the card, although note that the card could have changed between when the revlog entry was recorded and when you are looking it up. It is also the millisecond timestamp of the card’s creation time. **usn**\ This column is used to keep track of the sync state of reviews and provides no useful information for analysis. **ease**\ Which button you pressed at the end of the review (1 for Again, 4 for Easy). **ivl**\ The new interval that the card was pushed to after the review. Positive values are in days; negative values are in seconds (for learning cards). **lastIvl**\ The interval the card had before the review. Cards introduced for the first time have a last interval equal to the Again delay. **factor**\ The new ease factor of the card in permille (parts per thousand). If the ease factor is 2500, the card’s interval will be multiplied by 2.5 the next time you press Good. **time**\ The amount of time (in milliseconds) you spent on the question and answer sides of the card before selecting an ease button. **type**\ This is 0 for learning cards, 1 for review cards, 2 for relearning cards, and 3 for early "cram" cards (cards being studied in a filtered deck when they are not due). # Studying Source: https://docs.ankiweb.net/manual/studying When you have found a deck you like or entered some notes in, it’s time to start studying. ## Decks Study in Anki is limited to the currently selected deck as well as any subdecks it contains. On the decks screen, your decks and subdecks will be displayed in a list. [New, Learn, and Due (To Review)](./getting-started#card-states) cards for that day will be also displayed here. ![Decks screen](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/decks_screen.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=0aeb856cb609d012ea7037643f58bfaf) When you click on a deck, it will become the "current deck", and Anki will change to the study screen. You can return to the deck list at any time by clicking on “Decks” at the top of the main window. (You can also use the Study Deck action in the menu to select a new deck from the keyboard, or you can press the S key to study the currently selected deck.) You can click the gears button to the right of a deck to rename or delete the deck, change its [options](./deck-options), or [export](./exporting) it. ## Study Overview After clicking on a deck to study, you’ll see a screen that shows you how many cards are due today. This is called the "deck overview" screen: ![Overview screen](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/study_overview.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=958c889c78ddd52dd3f902c9d4ac51fa) The cards are split into [three types](./getting-started#card-states): New, Learning, and To Review. If you have [Bury siblings](./#siblings-and-burying) activated in your deck options, you may see how many cards will be buried in grey: ![Buried cards in the Overview screen](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/study_overview_buried_cards.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=d9900b5a6c532cf761f5513507fb22e2) To start a study session, click the **Study Now** button. Anki will proceed to show you cards until the cards to be shown for the day have run out. While studying, you can return to the overview by pressing the S key on your keyboard. ## Questions When a card is shown, only the question is shown at first. After thinking about the answer, either click the **Show Answer** button, or press the Space. The answer will then be shown. It’s okay if it takes you a little while to recall the answer, but as a general rule if you can’t answer within about 10 seconds, it’s probably better to move on and show the answer than keep struggling to remember. ## Answer Buttons After the answer is shown, compare the answer you thought of with the answer that is shown and select any of the following buttons. * **Again**: Select this when your answer is incorrect or when you couldn't recall the answer. If your answer is partially correct, you should be strict with yourself: if it counts as a fail in a real-life context outside of Anki, then it counts as a fail in Anki as well. You'll typically use this button about 5-20% of the time. Keyboard Shortcut: 1 * **Hard**: Select this button when your answer is correct, but you had doubts about it or it took a long time to recall. Keyboard Shortcut: 2 * **Good**: Select this when your answer is correct, but it took some mental effort to recall it. When Anki is used properly, this should be the most commonly used button. You'll typically use this button about 80-95% of the time. Keyboard Shortcut: 3, Space, Enter * **Easy**: Select this if your answer is correct and it took no mental effort to recall it. Keyboard Shortcut: 4 If you find it hard to use four answer buttons, you can also use only **Again** and **Good** buttons. Use **Again** for incorrect answers and use **Good** for correct answers. Each answer button shows the next time a card will be reviewed again if you select that button. To learn about the settings that control the next review intervals, see the topics [Learning Steps](./deck-options#learning-steps), [Lapses](./deck-options#lapses), [FSRS](./deck-options#fsrs) and [Advanced](./deck-options#advanced) in the Deck Options section. ## Fuzz Factor When you select an answer button on a review card, Anki also applies a small amount of random “fuzz” to prevent cards that were introduced at the same time and given the same ratings from sticking together and always coming up for review on the same day. Learning cards are also given up to 5 minutes of extra delay so that they don’t always appear in the same order, but answer buttons won't reflect that. It is not possible to turn this feature off. ## Editing and More You can click the **Edit** button in the bottom left to edit the current note. When you finish editing, you’ll be returned to study. The editing screen works very similarly to the [add notes](./editing) screen. At the bottom right of the study screen is a button labeled **More**. This button provides some other operations you can do on the current card or note: * [**Flag Card**](./editing#using-flags): Adds a colored marker to the card, or toggles it off. Flags will appear during study, and you can search for flagged cards in the Browse screen. This is useful when you want to take some action on the card at a later date, such as looking up a word when you get home. If you're using Anki 2.1.45+, you can also rename flags from the [browser](./browsing). * **Bury Card / Note**: Hides a card or all of the note’s cards from review until the next day. (If you want to unbury cards before then, you can click the “unbury” button on the [deck overview](./studying#study-overview) screen.) This is useful if you cannot answer the card at the moment or you want to come back to it another time. Burying can also [happen automatically](./studying#siblings-and-burying) for cards of the same note. * **Reset card**: Moves the current card to [the end of the new queue](./browsing#cards). The "Restore original position" option allows you to reset the card back to its original position when you reset it. The "Reset repetition and lapse count" option, if enabled, will set the review and failure counters for the card back to zero. It does not remove the review history that is shown at the bottom of the card info screen. * **Set Due Date**: Puts cards in the review queue, and [makes them due on a certain date.](./browsing#cards) * **Suspend Card / Note**: Hides a card or all of the note’s cards from review until they are manually unsuspended (by clicking the suspend button in the browser). This is useful if you want to avoid reviewing the note for some time, but don’t want to delete it. * **Options**: Edit the [options](./deck-options) for the current deck. * **Card Info**: Displays [statistical information](./stats#card-info) about the card. * **Previous Card Info**: Displays [statistical information](./stats#card-info) about the previous card. * [**Mark Note**](./editing#the-marked-tag): Adds a “marked” tag to the current note, so it can be easily found in the browser. This is similar to flagging individual cards, but works with a tag instead, so if the note has multiple cards, all cards will appear in a search for the marked tag. Most users will want to use flags instead. * **Create Copy**: Opens a [duplicate](./browsing#finding-duplicates) of the current note in the editor, which can be slightly modified to easily obtain variations of your cards. By default, the duplicate card will be created in the same deck as the original. * **Delete Note**: Deletes the note and all of its cards. * **Replay Audio**: If the card has audio on the front or back, play it again. * **Pause Audio**: Pauses the audio if it is playing. * **Audio -5s / +5s**: Jump backwards / forward 5 seconds in the currently playing audio. * **Record Own Voice**: Record from your microphone for the purposes of checking your pronunciation. This recording is temporary and will go away when you move to the next card. If you want to add audio to a card permanently, you can do that in the edit window. * **Replay Own Voice**: Replay the previous recording of your voice (presumably after showing the answer). ## Display Order Studying will show cards from the selected deck and any decks it contains. Thus, if you select your “French” deck, the subdecks “French::Vocab” and “French::My Textbook::Lesson 1” will be shown as well. By default, for new cards, Anki gathers cards from the decks in alphabetical order. So in the above example, you would get cards first from “French”, then “My Textbook”, and finally “Vocab”. You can use this to control the order cards appear in, placing high priority cards in decks that appear higher in the list. When computers sort text alphabetically, the “-” character comes before alphabetical characters, and “\~” comes after them. So you could call the deck “-Vocab” to make them appear first, and you could call the other deck “\~My Textbook” to force it to appear after everything else. New cards and reviews are gathered separately, and Anki won’t wait until both queues are empty before moving on to the next deck, so it’s possible you’ll be exposed to new cards from one deck while seeing reviews from another deck, or vice versa. If you don’t want this, click directly on the deck you want to study instead of one of the parent decks. Since cards in learning are somewhat time-critical, they are fetched from all decks at once and shown in the order they are due. To control the order cards appear in, see [Display Order](./deck-options#display-order). For more fine-grained ordering of new cards, you can change the order in the [browser](./browsing). ## Siblings and Burying Recall from [the basics](./getting-started) that Anki can create more than one card for each thing you input, such as a front→back card and a back→front card, or two different cloze deletions from the same text. These related cards are called "siblings". When you answer a card that has siblings, Anki can prevent the card’s siblings from being shown in the same session by automatically "burying" them. Buried cards are hidden from review until the clock rolls over to a new day or you manually unbury them using the “Unbury” button that’s visible at the bottom of the [deck overview](./studying#study-overview) screen. Anki will bury siblings even if the siblings are not in the same deck (for instance, if you use the [deck override](./templates/intro) feature). You can enable burying from the [deck options](./deck-options) screen - there are separate settings for new cards and reviews. Anki will only bury siblings that are new or review cards. It will not hide cards in learning, as time is of the essence for those cards. On 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. Suspended cards can't be buried. ## Keyboard Shortcuts Most of the common operations in Anki have keyboard shortcuts. Most of them are discoverable in the interface: menu items list their shortcuts next to them, and hovering the mouse cursor over a button will generally show its shortcut in a tooltip. When studying, either Space or Enter will show the answer. When the answer is shown, you can use Space or Enter to select the Good button. You can use the 1-4 keys to select a specific ease button. Many people find it convenient to answer most cards with Space and keep one finger on 1 for when they forget. The "Study Deck" item in the Tools menu allows you to quickly switch to a deck with the keyboard. You can trigger it with the / key. When opened, it will display all of your decks and show a filter area at the top. As you type characters, Anki will display only decks matching the characters you type. You can add a space to separate multiple search terms, and Anki will show only decks that match all the terms. So “ja 1” or “on1 ja” would both match a deck called “Japanese::Lesson1”. ## Falling Behind When you fall behind in your reviews, Anki by default prioritizes cards that have been waiting the longest. This ordering ensures that no cards will be left waiting indefinitely, but it means that if you introduce new cards, their reviews won’t appear until you’ve gotten through your backlog. When you answer cards that have been waiting for a while, Anki factors in that delay when determining the next time a card should be shown. This means if you are returning to Anki after a long break, you don't have to start anew and can just start back from where you left. # Self-Hosted Sync Server Source: https://docs.ankiweb.net/manual/sync-server Sync Server Advanced users who cannot or do not wish to use AnkiWeb can use a self-hosted sync server instead. Things to be aware of: * This is an advanced feature, targeted at users who are comfortable with networking and the command line. If you use this, the expectation is you can resolve any setup/network/firewall issues you run into yourself, and use of this is entirely at your own risk. * Newer clients may depend on changes to the sync protocol, so syncing may stop working if you update your Anki clients without also updating the server. * Third-party sync servers also exist. No testing is done against them, and they tend to take time to catch up when the sync protocol changes, so they are not recommended. * The messages inside Anki will use the term "AnkiWeb" even if a custom server has been configured, (e.g. "Cannot connect to AnkiWeb" when your server is down). ## Installing/Running There are various ways you can install and run the server. You can use either: * the sync server bundled with the desktop version of Anki * a separate minimal sync server that doesn't include Anki's GUI dependencies. Python and Rust implementations are available. ### From a Packaged Build This uses the sync server built into the desktop version of Anki as of version 2.1.57+. On Windows in a cmd.exe session: ``` set SYNC_USER1=user:pass "\Program Files\anki\anki-console" --syncserver ``` Or MacOS, in Terminal.app: ``` SYNC_USER1=user:pass /Applications/Anki.app/Contents/MacOS/anki --syncserver ``` > [!NOTE] > > Replace 'anki' with 'launcher' for versions 25.07 to 25.09.4. Or Linux: ``` SYNC_USER1=user:pass anki --syncserver ``` ### With Pip To avoid downloading desktop Anki's GUI dependencies, you can run a standalone Anki sync server using a Python package downloaded from PyPI instead. Make sure you have Python 3.9+ installed. ``` python3 -m venv ~/syncserver ~/syncserver/bin/pip install anki SYNC_USER1=user:pass ~/syncserver/bin/python -m anki.syncserver ``` ### With Cargo From Anki 2.1.66+, you can alternatively build a Rust implementation of the standalone sync server using the below command. Make sure you have Rustup installed. ``` cargo install --locked --git https://github.com/ankitects/anki.git --tag 25.02.5 anki-sync-server ``` Replace 25.02.5 with whatever the latest Anki version is. Protobuf (protoc) will need to be installed. After building, you can run it with: ``` SYNC_USER1=user:pass anki-sync-server ``` ### From a source checkout If you've cloned the Anki repo from GitHub, you can install from there: ``` ./ninja extract:protoc ftl_repo cargo install --path rslib/sync ``` ### With Docker You can find a user-contributed Dockerfile and some instructions [here](https://github.com/ankitects/anki/tree/main/docs/syncserver). ## Multiple Users `SYNC_USER1` declares the first user and password, and must be set. You can optionally declare `SYNC_USER2`, `SYNC_USER3` and so on, if you wish to set up multiple accounts. ## Hashed Passwords Advanced users may wish to use hashed passwords instead of plain text passwords. If you wish to do this, you'll need to use a separate tool (such as [this one](https://git.sr.ht/~laalsaas/pbkdf2-password-hash)) to generate a password hash. You can then tell the server to expect hashed passwords by setting the env var PASSWORDS\_HASHED to 1 (or any other value). When hashed passwords are used, SYNC\_USER variables are expected to be in username:password\_hash format, where password\_hash is a hash of the password in the PHC Format. ## Storage Location The server needs to store a copy of your collection and media in a folder. By default it is \~/.syncserver; you can change this by defining a `SYNC_BASE` environment variable. * This must not be the same location as your normal Anki data folder, as the server and client must store separate copies. * You must sync your data to the server, not manually copy files into the server folder. ## Public Access The server listens on an unencrypted HTTP connection, so it's not a good idea to expose it directly to the internet. You'll want to either restrict usage to your local network, or place some form of encryption in front of the server, such as a VPN (Tailscale is apparently easy), or a HTTPS reverse proxy. You can define `SYNC_HOST` and `SYNC_PORT` to change the host and port that the server binds to. ## Client Setup ### Server URL You'll need to determine your computer's network IP address, and then point each of your Anki clients to the address, e.g something like `http://192.168.1.200:8080/`. The URL can be configured in the preferences. If you're using AnkiMobile and are unable to connect to a server on your local network, please go into the iOS settings, locate Anki near the bottom, and toggle "Allow Anki to access local network" off and then on again. Older desktop clients required you to define `SYNC_ENDPOINT` and `SYNC_ENDPOINT_MEDIA`. If using an older client, you'd put it as e.g. `http://192.168.1.200:8080/sync/` and `http://192.168.1.200:8080/msync/` respectively. AnkiDroid clients before 2.16 require separate configuration for the two endpoints. ### Credentials To be able to synchronize, put your user credential (`SYNC_USER1` for example) in the **AnkiWeb account** section of the preferences. ## Reverse Proxies If using a reverse proxy to provide HTTPS access (e.g. nginx), and binding to a subpath (e.g. `http://example.com/custom/` -> `http://localhost:8080/`), you must make sure to include a trailing slash when configuring Anki. If you put `http://example.com/custom` instead, it will not work. If you are using a caddy, increase [the http read buffer size](https://caddyserver.com/docs/caddyfile/directives/reverse_proxy#read_buffer) to avoid connection problems when downloading media files. ```caddyfile theme={null} reverse_proxy http://127.0.0.1:8080 { transport http { read_buffer 512k } } ``` On iOS, TLS 1.3 is not supported, so your reverse proxy will need to have TLS 1.2 enabled, or you'll get an "error code -9836". ## Large Requests The standard AnkiWeb limit on uploads is applied by default. You can optionally set `MAX_SYNC_PAYLOAD_MEGS` to something greater than 100 if you wish to increase the limit. Bear in mind that if you're using a reverse proxy, you may need to adjust the limit there as well. ## Contributing Changes Because this server is bundled with Anki, simplicity is a design goal - it is targeted at individual/family use, and PRs that add things like a REST API or external databases are unlikely to be accepted at this time. If in doubt, please reach out before starting work on a PR. If you're looking for an existing API solution, the AnkiConnect add-on may meet your needs. # Syncing with AnkiWeb Source: https://docs.ankiweb.net/manual/syncing AnkiWeb is a service that allows you to keep your collection synchronized across multiple devices, and to study online. Sign up for a [free account](https://ankiweb.net/) before following the steps below. ## Intro Videos For a quick introduction to syncing, check out the [syncing intro videos](https://www.youtube.com/watch?v=YkiM4DPzSVc\&list=PLGgmaKOIHykFoomqkBJAyGiDQ2kyiuTao\&yt:cc=on). ## Setup To start syncing your collection across devices, click the sync button (the top right one on the [main screen](./studying#decks), or press Y on your keyboard. You’ll be prompted for your AnkiWeb ID and password, which you created in the signup process. When you synchronize your collection for the first time, Anki will ask you if you want to upload or download. If you have cards on your computer and your AnkiWeb account is empty, choose **Upload** to send your data to AnkiWeb. If you have cards on AnkiWeb from another device, and no cards on your computer, choose **Download** to replace the empty local collection with the cards that are on AnkiWeb. If you have different cards on both devices, [more work is required](./#merging-conflicts) to avoid losing data. Once the initial one-way sync is completed, Anki will be able to merge changes from multiple locations with a few exceptions. If you have multiple people using Anki on one machine and have created a profile for each user, each user will need to create their own AnkiWeb account to sync with. If you attempt to synchronize multiple profiles with a single AnkiWeb account, you will lose data. ## Automatic Syncing Once syncing is enabled, Anki will automatically sync each time your collection is closed or opened. If you would prefer to synchronize manually, you can disable automatic syncing in Anki’s [preferences.](./preferences#syncing) ## Button Color The sync button will change to blue when a normal sync is required, and red when a full sync is required. ## Media You can watch a [related video](https://www.youtube.com/watch?v=phP9GGG-PxY) on this topic. Anki will synchronize any sounds and images used by your notes. It will notice when media has been added, removed or replaced in your [media folder](./files#user-data), but will not notice if you have made edits to existing files. To get your edits synced, you need to add, remove or replace a file as well. One-way syncs (where you're prompted to upload or download) have no influence over how media syncs - media changes are always merged. To prevent accidental data loss, deletions will only sync to other devices if they are made after media is fully in sync. If you delete files before your device is fully in sync, and the deleted files are already on AnkiWeb, they will be downloaded the next time you sync. If you have accidentally deleted media files, and want to restore them, open the preferences and log out. The next time you sync, Anki will restore any deleted files, if they are available on AnkiWeb still. If you’re running Anki off a [USB flash drive](./files#running-from-a-flash-drive), you should use an NTFS file system, as Anki may not be able to detect media changes on a FAT32 filesystem. ## Conflicts You can watch a [related video](https://www.youtube.com/watch?v=UEAcpfMQnjo) on this topic. Under normal circumstances, reviews and note edits can be merged, so if you review or edit on two different devices before syncing, Anki will preserve your changes from both locations. If the same card has been reviewed in two different locations, both reviews will be marked in the revision history, and the card will be kept in the state it was when it was most recently answered. There are certain changes that Anki is unable to merge. These mainly relate to the format of notes: things like adding a new field, or removing a card template. When you perform an operation that can’t be merged, Anki will warn you, and give you the option of aborting the operation. If you choose to continue, you’ll be asked to choose whether to keep the local copy or the copy on AnkiWeb when your collection is next synchronized. If certain problems are detected while syncing, Anki forces a one-way sync. If you find this consistently happening, post on our [support site](https://forums.ankiweb.net). When a one-way sync is required, you need to choose whether you wish to keep the collection on your local device, or the collection on AnkiWeb. If changes have been made on both ends, only changes on one end can be preserved. If you choose **Upload**, the content on your local device will be sent to AnkiWeb. You then need to sync your other devices, and choose **Download** to have them grab a copy of that content. If you choose **Download**, it will replace any local changes you’ve made with the data that is on AnkiWeb. Once all devices are in sync, future syncs will return to the normal behaviour of merging changes from both ends. If you wish to force a full upload or download (for example, because you accidentally deleted a deck on one side and want to restore the deck rather than having its deletion synchronized), you can check the "On next sync, force changes in one direction" box in **Tools > Preferences > Network**, then sync as usual. (You’ll be given the option to choose which side you want to use.) Forcing a one way sync only affects card syncing - media is synced as normal. If you have files that you want to remove from AnkiWeb, ensure your client is fully in sync first. After syncing is up to date, any files you remove (e.g. via the **Check Media** function) will be removed from AnkiWeb on the following sync. ## Merging Conflicts Because the [first sync](./#setup) can only sync changes in one direction, if you have added different content to different devices or profiles before setting syncing up, content on one device will be lost if you overwrite it with the content from the other device. With some work, it is possible to manually merge data into a single collection. Start by taking a backup on each device/profile, in case something goes wrong. With the computer version you can use **File > Export** to export "all decks" with scheduling information and media files included, and save the file somewhere safe. In AnkiMobile, the Add/Export button on the decks list screen will let you export all decks with media. Next, if one of your devices is a mobile device, synchronize it first. If there’s a conflict, choose **Upload** to overwrite any existing data on AnkiWeb with the data from your mobile device. If both devices/profiles are on your computer, synchronize the device/profile with the most number of decks first. Now return to the other device/profile. If automatic syncing is enabled, a message may pop up asking if you want to upload or download. Click the cancel button - we don’t want to sync yet. Once you’re looking at the deck list, click the cog icon next to the first deck, and choose **Export**. Export the content with scheduling information and media included, and save the `.apkg` file somewhere. Now you’ll need to repeat this for each top-level deck. Once all top-level decks have been exported, click the sync button at the top right, and choose **Download**, which will overwrite the local content with the content you synced from your other device. You can now use **File > Import** to import the `.apkg` files you exported earlier, which will merge the exported content with the existing content, so everything will be in one place. ## AnkiWeb Data Deletion As AnkiWeb is a free service, we need to periodically delete unused account data to keep costs down. If you haven't accessed your account or synced in the last 6 months, the data on your account might get deleted. ### What Gets Deleted Only your data stored on AnkiWeb is deleted. Your account itself will remain and can be used again. Any cards you have stored on your computer, phone or tablet will remain on those devices. Items shared from your account, including decks and add-ons will also remain on AnkiWeb. ### Returning to AnkiWeb Once your deck data has expired, it is not possible for us to recover your data from AnkiWeb, but you may be able to recover it if you have a local copy or a [backup](./backups). ### Avoiding Data Deletion Each time you visit ankiweb.net, or use the synchronization feature in Anki, AnkiMobile or AnkiDroid, your account will automatically be marked as active. If your account has been inactive for 6 months or more, and you used the service for a week or longer, we will send you an email notifying you that deletion is pending. If you'd like to keep your account active, log in to ankiweb.net and study a card, or sync one of your devices within 30 days. ## Firewalls Anki needs to be able to make outbound HTTPS connections to sync. It must be able to connect to ankiweb.net, sync.ankiweb.net, sync2.ankiweb.net, and so on. These domains may change over time, and the IP addresses they point to may also change, so we recommend you allow wildcard access to \*.ankiweb.net to reduce the chance of the firewall rules needing to be updated in the future. If you have a firewall on your machine, you should add an exception for Anki. If you are on a work or school network, contact your network administrator for assistance - it is not something we can help you with. ## Proxies If you need a proxy to access the internet, Anki should automatically pick up your system proxy settings if you’re on Windows or macOS, and will honour the HTTP\_PROXY environment variable if you’re on another platform. Anki will only be able to pick up your system settings if a proxy is manually configured, and does not require a password. If your system uses automatic proxy setup, or uses a proxy that requires a username and password, you will need to manually tell Anki the proxy configuration. To tell Anki your proxy settings, define a HTTPS\_PROXY environment variable that points to the proxy server. It will look like: ```text theme={null} http://user:pass@proxy.company.com:8080 ``` If your username or password contains an @ (e.g `user@workdomain.com`), you need to change it to %40, like so: ```text theme={null} http://user%40workdomain.com:pass@proxy.company.com:8080 ``` Anki 2.0 expects to find HTTP\_PROXY instead of HTTPS\_PROXY. To set environment variables on Windows, see [https://duckduckgo.com/?q=windows+set+environment+variable](https://duckduckgo.com/?q=windows+set+environment+variable) If you’re on a Mac, see [http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x](http://stackoverflow.com/questions/135688/setting-environment-variables-in-os-x) Heavily locked down networks that intercept secure connections and present their own certificates may cause Anki to throw up SSL errors. In such environments, you may be able to work around the errors using [this add-on](https://ankiweb.net/shared/info/1332261690). An alternative solution is to install a local proxy server, and point that proxy server at your normal proxy server. You can then tell Anki to use the local proxy, which will redirect requests to the proxy you normally use. # Checks and Errors Source: https://docs.ankiweb.net/manual/templates/errors When you save changes to a note type or export a deck, Anki 2.1.45+ checks for some common errors. These errors will cause issues later on when anyone studies the affected cards, so Anki won't let you proceed before you have fixed them. ## Basics See [Key Concepts](../getting-started#key-concepts) before reading further. Most of the errors below will require you to modify your note type/card template. To do so: * Open the Browse screen, and look at the items on the left. * Locate the note type mentioned in error message. You can use the search bar at the top left if necessary. * Click on the note type, to show its cards/notes on the right. * Click the Cards... button at the top of the editing area to open the [templates screen](./intro#the-templates-screen). ## Specific Issues ### Template Syntax Error This kind of error indicates an incorrect usage of the [field replacement](./fields) syntax. You can correct mistakes on the template by opening the card templates screen: * On the computer version, edit a problem card, and then click on the Cards... button * On AnkiMobile, while viewing a problem card in the study screen, tap the cog/gear, then Card Template. When you correct a mistake, it will update all cards of that type - you do not need to make the same change for every card that uses the template. What needs changing will depend on the message you are getting. **Found '\{\{Field}}', but there is no field called 'Field'** This indicates your template includes the name of a field that doesn't exist. To fix the problem, locate the `{{Field}}` inside the card template, and remove it. **Missing }} in \{\{Field** This message is shown when \{\{ is found in the template without a matching }}. For example, if you have ``` {{Field ``` then this needs to be changed to ``` {{Field}} ``` **Missing \{\{/Field}}** This means Anki found `{{#Field}}` or `{{^Field}}` in your card template, without a matching `{{/Field}}`. Removing `{{#Field}}` or `{{^Field}}` from the template will fix the error. **Found \{\{/One}}, but expected \{\{/Two}}** Conditional replacements need to be closed in the same order they are opened. For example, the following template is incorrect: ``` {{#One}} {{#Two}} {{Three}} {{/One}} {{/Two}} ``` To fix the problem, the template should be changed like so: ``` {{#One}} {{#Two}} {{Three}} {{/Two}} {{/One}} ``` **Found \{\{/Field}}, but missing '\{\{#Field}}' or '\{\{^Field}}'** Closing tags must be matched by opening tags. For example, the following is invalid, because there is no `{{#Two}}` or `{{^Two}}` at the start: ``` {{Field}} {{/Two}} ``` It can be fixed by removing the closing tag: ``` {{Field}} ``` ### Identical Front Sides You have Anki configured to create two identical questions for each input. This can happen if you add a new card type without making any adjustments to it. Identical cards double your workload, and make Anki's scheduling less effective. To fix this, open the [templates screen](./intro#the-templates-screen), and select one of the duplicates at the top. Then use the button on the top right to remove the selected card type. This will delete all the duplicate cards/notes that were using the card type as well. ### Front of Card is Blank Anki displays cards by combining the fields you've entered with a template that says which fields should appear on the front and back of your cards. If you receive a message that a card has a blank front, it means either none of the fields included on your front template have any text in them, or you have fields that have text, but none are included on the front template. You can fix this problem by editing the card on the computer version, clicking on **Cards...**, and checking to make sure at least one field with some text on it is included on the front template. You can add extra fields with the Add Field button. If you are using the Cloze note type, make sure you've included one or more cloze deletions in the Text field, e.g. \{\{c1::some cloze-deleted text}}. If you're using the type-in-the-answer functionality, make sure you've included another field on the front side as well. ### No Cloze Filter on Cloze Note Type A Cloze note type's front and back templates should have a [cloze](../editing#cloze-deletion) filter. If one is missing, you will need to add it back so that Anki can create cloze cards correctly. #### Single empty cards When making clozes, each cloze number is turned into a separate card. For example, the following will create three cards: ``` {{c1::This}} is a {{c2::sample}} {{c3::sentence}}. ``` If you later edit the text, and either remove or change a cloze number, the previously created card may become blank. For example: ``` {{c1::This}} is a {{c2::sample}} ``` and ``` {{c1::This}} is a {{c2::sample}} {{c1::sentence}}. ``` are both changes that would make card 3 blank. When you view card 3, you'll see a message indicating that the card is blank, and can be cleaned up with the Empty Cards function. You can access that function via the Tools menu of the computer version's main window, and use it to remove blank cards. Check the reported empty cards first, and if in doubt, create a backup with the File>Export menu item before proceeding. #### All cloze cards empty If you accidentally modify your card template, it may prevent any cloze deletions from appearing. If that has happened, edit one such problem card, and note down the name of the first field - it is usually called "Text". Then: * Click on the Cards... button * Replace the front text with ``` {{cloze:Text}} ``` * Replace the back text with the same. If your field was called something other than Text, replace Text with the name of the field. # Field Replacements Source: https://docs.ankiweb.net/manual/templates/fields ## Basic Replacements The most basic template looks something like this: ```text theme={null} {{Front}} ``` When you place text within curly brackets, Anki looks for a field by that name, and replaces the text with the actual content of the field. Field names are case sensitive. If you have a field named `Front`, writing `{{front}}` will not work properly. Your templates are not limited to a list of fields. You can also include arbitrary text on your templates. For example, if you’re studying capital cities, and you’ve created a note type with a “Country” field, you might create a front template like this: ```text theme={null} What's the capital city of {{Country}}? ``` The default back template will look something like this: ```text theme={null} {{FrontSide}}
{{Back}} ``` This means “show me the text that’s on the front side, then a divider line, and then the Back field”. The "id=answer" part tells Anki where the divider is between the question and the answer. This allows Anki to automatically scroll to the spot where the answer starts when you press **show answer** on a long card (especially useful on mobile devices with small screens). If you don’t want a horizontal line at the beginning of the answer, you can use another HTML element such as a paragraph or div instead. ## Newlines Card templates are like web pages, which means a special command is required to create a new line. For example, if you wrote the following in the template: ```text theme={null} one two ``` In the preview, you’d actually see: ```text theme={null} one two ``` To add a new line, you need to add a \
code to the end of a line, like so: ```text theme={null} one
two ``` The br code stands for "(line) br(eak)". The same applies for fields. If you want to display two fields, one on each line, you would use ```text theme={null} {{Field 1}}
{{Field 2}} ``` ## Text to Speech for individual fields This feature requires Anki 2.1.20, AnkiMobile 2.0.56 or AnkiDroid 2.17. To have Anki read the Front field in a US English voice, you can place the following in your card template: ```text theme={null} {{tts en_US:Front}} ``` On Windows, macOS, and iOS, Anki will use the OS’s built-in voices. On Linux, Anki does not ship a TTS engine. Cards with `{{tts}}` tags will show `no players found for TTSTag(...)` until you install a TTS add-on. The sample [gTTS text to speech support](https://ankiweb.net/shared/info/391644525) add-on is enough for many people: 1. **Tools → Add-ons → Get Add-ons…** 2. Paste `391644525` and click OK. 3. Restart Anki. After installing the add-on, restart Anki. TTS tags can then use the languages supported by the add-on. To see a list of all available languages/voices, place the following on your card template: ```text theme={null} {{tts-voices:}} ``` If there are multiple voices that support your chosen language, you can specify desired voices in a list, and Anki will choose the first available voice. For example: ```text theme={null} {{tts ja_JP voices=Apple_Otoya,Microsoft_Haruka:Field}} ``` This would use Otoya when on an Apple device, and Haruka when on a Windows PC. Specifying a different speed is possible in some TTS implementations: ```text theme={null} {{tts fr_FR speed=0.8:SomeField}} ``` Both speed and voices are optional, but the language must be included. On a Mac, you can customize the available voices: * Open the System Preferences screen. * Click on Accessibility. * Click on Speech. * Click on the system voice dropdown, and choose Customize. Some voices sound better than others, so experiment to choose the one you prefer. Note that the Siri voice can only be used by Apple apps. Once you’ve installed new voices, you’ll need to restart Anki for the new voices to become available. On Windows, some voices like Cortana can not be selected, as Microsoft does not make those voices available to other applications. On a cloze note type, you can make Anki read only the elided sections using the `cloze-only` filter, like so: ```text theme={null} {{tts en_US:cloze-only:Text}} ``` The cloze-only filter is supported in Anki 2.1.29+, AnkiMobile 2.0.65+, and AnkiDroid 2.17+. ## Text to Speech for multiple fields and static text This feature requires Anki 2.1.50+, AnkiMobile 2.0.84+, or AnkiDroid 2.17+. If you want TTS to read multiple fields or static text included in the template, you can use the following: ``` [anki:tts lang=en_US] This text should be read. Here is {{Field1}} and {{Field2}}[/anki:tts] This is other text on the template. It is outside of the tags so it should not be read. ``` ## Special Fields There are some special fields you can include in your templates: ```text theme={null} The note's tags: {{Tags}} The type of note: {{Type}} The card's deck: {{Deck}} The card's subdeck: {{Subdeck}} The card's flag: {{CardFlag}} The type of card ("Forward", etc): {{Card}} The content of the front template (only valid in back template): {{FrontSide}} ``` FrontSide will not automatically play any audio that was on the front side of the card. If you wish to have the same audio play automatically on both the front and back of the card, you’ll need to manually include the audio fields on the back as well. As with other fields, special field names are case sensitive - you must use `{{Tags}}` rather than `{{tags}}` for example. ## Hint Fields It’s possible to add a field to the front or back of a card, but make it hidden until you explicitly show it. We call this a *hint field*. Before adding a hint, bear in mind that the easier you make it to answer a question in Anki, the less likely you are to remember that question when you encounter it in real life. Have a read about the "minimum information principle" on [https://super-memory.com/articles/20rules.htm](https://super-memory.com/articles/20rules.htm) before proceeding. First, you’ll need to add a field to store the hint in if you have not already. See the [fields](../editing#customizing-fields) section if you’re not sure how to do this. Assuming you’ve created a field called MyField, you can tell Anki to include it on the card but hide it by default by adding the following to your template: ```text theme={null} {{hint:MyField}} ``` This will show a link labeled “show hint”; when you click it, the content of the field will be displayed on the card. (If MyField is empty, nothing will be shown.) If you show the hint on the question and then reveal the answer, the hint will be hidden again. If you want to have the hint always revealed when the answer is shown, you will need to remove `{{FrontSide}}` from your back template and manually add the fields you wish to appear. It is not currently possible to use a hint field for audio — the audio will play regardless of whether you’ve clicked on the hint link. If you want to customize the appearance or behaviour, you’ll need to implement the hint field yourself. We can not provide any support for doing so, but the following code should get you started: ```text theme={null} {{#Back}} Show Back {{/Back}} ``` ## Dictionary Links You can also use field replacement to create dictionary links. Imagine you’re studying a language and your favourite online dictionary allows you to search for text using a web URL like: ```text theme={null} http://example.com/search?q=myword ``` You could add an automatic link by doing the following in your template: ```text theme={null} {{Expression}} check in dictionary ``` The template above would allow you to search for each note’s expression by clicking on the link while reviewing. There is a caveat however, so please see the next section. ## HTML Stripping Like templates, fields are stored in HTML. In the dictionary link example above, if the expression contained the word "myword" without any formatting, then the HTML would be the same: "myword". But when you include formatting in your fields, extra HTML is included. If "myword" was bolded for example, the actual HTML would be "\myword\". This can present a problem for things like dictionary links. In the above example, the dictionary link would end up being: ```text theme={null} check in dictionary ``` The extra characters in the link would likely confuse the dictionary site, and you’re likely not to get any matches. To solve this, Anki provides the ability to strip formatting from fields when they are replaced. If you prefix a field name with text:, Anki will not include any formatting. So a dictionary link that worked even with formatted text would be: ```text theme={null} check in dictionary ``` ## Right To Left Text If you’re using a language that reads from right to left, you’ll need to adjust the template like so: ```text theme={null}
{{FieldThatHasRTLTextInIt}}
``` ## Ruby Characters Some languages commonly use annotations above the text to display the pronunciation of characters. These annotations are known as [ruby characters](https://en.wikipedia.org/wiki/Ruby_character). In Japanese, these are known as [furigana](https://en.wikipedia.org/wiki/Furigana). In Anki, you can display ruby characters by using the following syntax: ```text theme={null} Text[Ruby] ``` Suppose the text above is written in MyField. By default, if you simply use `{{Myfield}}`, the field will be displayed as is. To properly position the ruby characters above the text, use the `furigana` filter in the templates like so: ```text theme={null} {{furigana:MyField}} ``` Here are some examples: | Raw Text | Rendered Text | | - | - | | `Text[Ruby]` | TextRuby | | `日本語[にほんご]` | 日本語にほんご | | `世[よ]の 中[なか]` | 世よの中なか | | `世[よ]の中[なか]` | 世よの中なか *(incorrect!)* | Notice how the third example has a space before the 中 character. This is necessary to specify that the ruby text applies only to that character. If there was no space, the ruby text will be misplaced above the の character, as shown in the fourth example. ### Additional Ruby Character Filters In addition to the `furigana` filter, you can also only show certain parts of the ruby text, with the `kana` and `kanji` filters. The `kana` filter will only show the ruby text, while the `kanji` filter removes the ruby text entirely. | Raw Text | Field Filter | Rendered Text | | - | - | - | | `日本語[にほんご]` | `{{furigana:MyField}}` | 日本語にほんご | | `日本語[にほんご]` | `{{kana:MyField}}` | にほんご | | `日本語[にほんご]` | `{{kanji:MyField}}` | 日本語 | These names are, again, borrowed from Japanese. The term [kana](https://en.wikipedia.org/wiki/Kana) represents the phonetic system used to describe how words are pronounced, whereas the term [kanji](https://en.wikipedia.org/wiki/Kanji) represents its Chinese characters. ## Media & LaTeX Anki does not scan templates for media references, because it is slow to do so. This has implications for including media on the template. ### Static Sounds/Images If you wish to include images or sounds on your cards that are the same for every card (e.g. a company logo at the top of each card): 1. Rename the file so it starts with an underscore, e.g "\_logo.jpg". The underscore tells Anki that the file is used by the template and it should be exported when sharing the deck. 2. Add a reference to the media on your front or back template, like: ```text theme={null} ``` ### Field References Media references to fields are not supported. They may or may not display during review, and will not work when checking for unused media, importing/exporting, and so on. Examples that won’t work: ```text theme={null} [sound:{{Word}}] [latex]{{Field 1}}[/latex] ``` Instead, you should include the media references in the field. See the [importing section](../importing/text-files#importing-media) for more information. ## Checking Your Answer You can watch [a video about this feature](http://www.youtube.com/watch?v=5tYObQ3ocrw\&yt:cc=on) on YouTube. The easiest way to check your answer is to click "Basic" at the top left of the card adding screen, and select "Basic (type in the answer)". If you have downloaded a shared deck and would like to type in the answer with it, you can modify its card template. If it has a template like: ```text theme={null} {{Native Word}} {{FrontSide}}
{{Foreign Word}} ``` To type in the foreign word and check if you are correct, you need to edit your front template so that it looks like this: ```text theme={null} {{Native Word}} {{type:Foreign Word}} ``` Here, we have added `type:` in front of the field we want to compare. Since FrontSide is on the back of the card, the type answer box will appear on the back as well. When reviewing, Anki will display a text box where you can type in the answer, and upon hitting Enter or showing the answer, Anki will show you which parts you got right and which parts you got wrong. The text box’s font size will be the size you configured for that field (via the “Fields” button when editing). Note that the type answer boxes don't appear in the preview dialog or in AnkiWeb. This feature does not change how the cards are answered, so it’s still up to you to decide how well you remembered or not. Only one typing comparison can be used on a card. If you add the above text multiple times, it will not work. It also only supports a single line, so it is not useful for comparing against a field that is comprised of multiple lines. Anki uses a monospaced font for the answer comparison so that the “provided” and “correct” sections line up. If you wish to override the font for the answer comparison, you can put the following at the bottom of your styling section: ```text theme={null} code#typeans { font-family: "myfontname"; } ``` Which will affect the following HTML for the answer comparison: ```text theme={null} ... ``` 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: ```python theme={null} #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: ```text theme={null} {{cloze:Text}} {{type:cloze:Text}} {{Extra}} ``` If there are multiple sections elided, you can separate the answers in the text box with a comma. ### Ignoring Diacritics If you don't want Anki to compare accents on characters in your typed input with the correct answer, you can do so by using `type:nc` in your fields. ```text theme={null} {{type:nc:Front}} ``` This makes sure a difference in accents isn't marked as incorrect by Anki. For example, `بطيخ` would be treated the same as `بَطِّيخ` or `elite` would be treated same as `élite`. ### Ignoring Capitalization If capitalization isn't what you're testing, you can use `type:ci` to make the comparison case-insensitive. ```text theme={null} {{type:ci:Front}} ``` With this, typing `paris` when the field contains `Paris` is not marked as incorrect. The correct answer is still shown with its original capitalization. The modifiers can be combined, in any order, so that both accents and capitalization are ignored: ```text theme={null} {{type:nc:ci:Front}} ``` They can be combined with `cloze` as well, e.g. `{{type:cloze:ci:Text}}`. # Card Generation Source: https://docs.ankiweb.net/manual/templates/generation ## Reverse Cards You can watch [a video about reversing cards](http://www.youtube.com/watch?v=DnbKwHEQ1mA\&yt:cc=on) 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. ## Card Generation & Deletion 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: ```text theme={null} Where is {{Country}} on the map? ``` ## Selective Card Generation 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, see the conditional replacement section below. ## Conditional Replacement It is possible to include certain text, fields, or HTML on your cards only if a field is empty or not empty. An example: ```text theme={null} This text is always shown. {{#FieldName}} This text is only shown if FieldName has text in it {{/FieldName}} {{^FieldName}} This text is only shown if FieldName is empty {{/FieldName}} ``` A real life example is only showing a label if the field is not empty: ```text theme={null} {{#Tags}} Tags: {{Tags}} {{/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: ```text theme={null} {{#Notes}} {{/Notes}} {{FieldToFormat}} {{#Notes}} {{/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: ```text theme={null} {{Expression}} {{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: ```text theme={null} {{#Expression}} {{Expression}} {{Notes}} {{/Expression}} ``` And if you wanted to require both fields, you could use two conditional replacements: ```text theme={null} {{#Expression}} {{#Notes}} {{Expression}} {{Notes}} {{/Notes}} {{/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: ```text theme={null} {{#Expression}} {{Expression}} {{/Expression}} {{Notes}} ``` ## Blank Back Sides Card generation only looks at the front side of the card. For example, if you have a front template: ```text theme={null} {{Field 1}} ``` and a back template: ```text theme={null} {{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: ```text theme={null} {{#Field 2}} {{Field 1}} {{/Field 2}} ``` This will ensure the card is generated only if both Field 2 and Field 1 are non-empty. ## Adding Empty Notes 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. ## Cloze Templates See the [cloze deletion](../editing#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: ```text theme={null} {{cloze:Text}} {{#c1}} {{Hint1}} {{/c1}} {{#c2}} {{Hint2}} {{/c2}} ``` # Card Templates Source: https://docs.ankiweb.net/manual/templates/intro Card templates tell Anki which fields should appear on the front and back of your card, and control which cards will be generated when certain fields have text in them. By adjusting your card templates, you can alter the design and styling of many of your cards at once. Card templates are covered in some of the intro videos: * [Switching Card Order](http://www.youtube.com/watch?v=DnbKwHEQ1mA\&yt:cc=on) * [Styling Cards](http://www.youtube.com/watch?v=F1j1Zx0mXME\&yt:cc=on) * [Typing in the Answer](http://www.youtube.com/watch?v=5tYObQ3ocrw\&yt:cc=on) ## The Templates Screen You can modify card templates by clicking the **Cards...** button inside the editing screen. 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. On the right is a preview of the front and back of the currently selected card. If you opened the window while adding notes, the preview will be based on the text you had typed into the Add Notes window. If you opened the window while editing a note, the preview will be based on the content of that note. If you opened the window from Tools → Manage Note Types, Anki will display each field’s name in parentheses in place of content. At the top right of the window is an Options button that gives you options to rename or reorder the cards, as well as the following two options: * The **Deck Override** option allows you to change the deck that cards generated from the current card type will be placed into. By default, cards are placed into the deck you provide in the Add Notes window. If you set a deck here, that card type will be placed into the deck you specified, instead of the deck listed in the Add Notes window. This can be useful if you want to separate cards into different decks (for instance, when studying a language, to put production cards in one deck and recognition cards in another). You can check which deck the cards are currently going to by choosing Deck Override again. * The **Browser Appearance** option allows you to set different (perhaps simplified) templates for display in the Question and Answer columns of the browser; see [browser appearance](./styling#browser-appearance) for more information. # Styling & HTML Source: https://docs.ankiweb.net/manual/templates/styling ## Card Styling You can watch [a video about styling cards](http://www.youtube.com/watch?v=F1j1Zx0mXME\&yt:cc=on) 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, like `font-family: "MS Unicode";`. It is also possible to use multiple fonts on one card; for information on that, 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. See [this webpage](https://htmlcolorcodes.com/) 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, 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: ```css theme={null} .card { background-color: yellow; } .card1 { background-color: blue; } ``` ## Image Resizing 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 { ... }`): ```css theme={null} img { max-width: none; max-height: none; } ``` AnkiDroid sometimes has [trouble scaling images to fit the screen](https://github.com/ankidroid/Anki-Android/issues/3612). 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: ```css theme={null} img { max-width: 300px !important; max-height: 300px !important; } ``` 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: ```css theme={null} img#star { ...; } ``` You can explore the styling of cards interactively by using Chrome: [webview changes](/addons/porting2.0#webview-changes) Anki 2.1.50+ supports image resizing within the editor natively. ## Field Styling 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 macOS Thai font “Ayuthaya”. Imagine your template already reads: ```text theme={null} 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: ```text theme={null}
``` And the following behind it: ```text theme={null}
``` By wrapping the text like the above, we tell Anki to style the wrapped text with a custom style called “mystyle1”, which we will create later. Thus if we wanted the entire “What is …​?” expression to use the Thai font, we would use: ```text theme={null}
What is {{Expression}}?
{{Notes}} ``` And if we wanted only the expression field itself to use the Thai font, we’d use: ```text theme={null} What is
{{Expression}}
? {{Notes}} ``` After we’ve edited the template, we now need to move to the Styling section between the templates. Before editing it, it should look something like: ```css theme={null} .card { font-family: arial; font-size: 20px; text-align: center; color: black; background-color: white; } ``` Add your new style to the bottom, so it looks like: ```css theme={null} .card { font-family: arial; font-size: 20px; text-align: center; color: black; background-color: white; } .mystyle1 { font-family: ayuthaya; } ``` You can include any styling you want in the style. If you wanted to increase the font size too, you’d change the mystyle1 section to look like: ```css theme={null} .mystyle1 { font-family: ayuthaya; font-size: 30px; } ``` It’s also possible to bundle custom fonts with your deck, so you don’t need to install them on your computer or mobile device. See the [installing fonts](./#installing-fonts) section for more info. ## Audio Replay Buttons When audio or text to speech is included on your cards, Anki will show buttons you can click on to replay the audio. If you prefer not to see the buttons, you can hide them in the preferences screen. You can customize their appearance in your card styling, for example, to make them smaller and colored, you could use the following: ```css theme={null} .replay-button svg { width: 20px; height: 20px; } .replay-button svg circle { fill: blue; } .replay-button svg path { stroke: white; fill: green; } ``` ## Text Direction If you use a language that is written right-to-left, such as Arabic or Hebrew, you can add the CSS `direction` property to the .card section for correct display during review: ```css theme={null} .card { direction: rtl; } ``` This will change the direction of the entire card. You can change the direction of only certain fields by wrapping their references in some HTML: ```text theme={null}
{{Front}}
``` To change the direction of fields in the editor, see the [editing](../editing#customizing-fields) section. ## Displaying Code Snippets If you want to include code in your Anki cards, you can use HTML tags to format text as code. For that, you need to open the [HTML view](../editing#editing-features). ### Inline code Wrap your text with the `` tag: ```html theme={null} console.log("Hello World!"); ``` ### Code blocks Use `
` for multi-line code:

```html theme={null}

function square(number) {
  return number * number;
};
``` ## Other HTML Your templates can contain arbitrary HTML, which means that all the layout possibilities used on internet web pages can also be used on your cards. Things like tables, lists, images, links to external pages and so on are all supported. With tables for example, you could change the layout so that the front and back of a card appear on the left and right instead of the top and bottom. Covering all of HTML’s features is outside the scope of this manual, but there are plenty of good introductory guides to HTML available on the web if you’d like to learn more. ## Browser Appearance If your card templates are complex, it may be difficult to read the question and answer columns (called "Front" and "Back") in the [card list](../browsing#cardnote-table). The "browser appearance" option allows you to define a custom template to be used only in the browser, so you can include only the important fields and change the order if you desire. The syntax is the same as in standard card templates. When using this option, if the text in the question column is repeated at the beginning of the answer column, Anki will display the text only in the question column. For example, if the question column text is "People in Ladakh speak", and the answer is "People in Ladakh speak Ladakhi", the answer column will only display "Ladakhi", omitting the rest. ## Platform-Specific CSS Anki defines some special CSS classes that allow you to define different styling for different platforms. The example below shows how to vary the font depending on where you’re reviewing: ```css theme={null} /* Windows */ .win .example { font-family: "Example1"; } /* macOS */ .mac .example { font-family: "Example2"; } /* Linux desktops */ .linux:not(.android) .example { font-family: "Example3"; } /* both Linux desktops, and Android devices */ .linux .example { font-family: "Example4"; } /* both Android and iOS */ .mobile .example { font-family: "Example5"; } /* iOS */ .iphone .example, .ipad .example { font-family: "Example6"; } /* Android */ .android .example { font-family: "Example7"; } ``` And in the template: ```html theme={null}
{{Field}}
``` You can also use properties like .gecko, .opera, and .ie to select particular browsers when using AnkiWeb. See [http://rafael.adm.br/css\_browser\_selector/](http://rafael.adm.br/css_browser_selector/) for a full list of options. ## Installing Fonts You can install fonts directly to Anki. This is useful if you’re using Anki on a work or school computer where you don’t have permission to install new fonts, or if you’re using Anki on a mobile device. Anki supports the most widely used font formats, such as TrueType (.ttf), OpenType (.otf), Web Open Font Format (.woff) and others. ### Add Font to Media Folder Once you have downloaded a supported font, such as "Arial.ttf", you have to add it to the media folder. 1. Rename the file, adding an underscore at the start, so it becomes like "\_arial.ttf". Adding an underscore will tell Anki that this file will be used on a template, and should not be deleted when checking for unused media. 2. In your computer’s file browser, go to your Anki application data folder (see [File Locations](../files#file-locations) for details), and then into your profile folder (e.g., "User 1"). 3. Inside the folder, you should see a folder called collection.media. Drag the renamed file to that folder. ### Update Template to Use That Font After the font has been added to the media folder, you need to update the template. 1. Click **Add** at the top of the main screen, and then select the note type you want to change with the top left button. 2. Click **Cards**. 3. In the styling section, add the following text to the bottom (after the last "}" character), replacing "\_arial.ttf" with the name of the file you copied into your media folder: ```css theme={null} @font-face { font-family: myfont; src: url("_arial.ttf"); } ``` Only change the "arial" part, not the "myfont" part. After that, you can either change the font for the entire card, or for individual fields. To change the font for the entire card, simply locate the font-family: line in the .card section and change the font to "myfont". To change the font for only certain fields, see the [Field Styling](./#field-styling) instructions above. Make sure the filenames match exactly. If the file is called arial.TTF and you write arial.ttf in your card templates, it will not work. ## Night Mode You can customize the way templates appear when night mode is enabled in the preferences screen. If you wanted a lighter grey background, you could use something like: ```css theme={null} .card.nightMode { background-color: #555; } ``` If you have a "myclass" style, the following would show the text in yellow when night mode is enabled: ```css theme={null} .nightMode .myclass { color: yellow; } ``` ## Fading and Scrolling Anki will automatically scroll to the answer by default. It looks for an HTML element with id=answer, and scrolls to that. You can place the id on a different element to adjust the scrolling position, or remove the id=answer to turn off scrolling. The question side of a card fades in by default. If you wish to adjust this delay, you can place the following at the top of your front card template: ```html theme={null} ``` 100 (milliseconds) is the default; set to 0 to disable fading. ## Javascript As Anki cards are treated like web pages, it is possible to embed some Javascript on your cards via the card template. For a good reference read [this post](https://forums.ankiweb.net/t/card-templates-user-input-101-buttons-keyboard-shortcuts-etc-guide/13756) in the forums. Because Javascript is an advanced feature and so many things can go wrong, **Javascript functionality is provided without any support or warranty**. We can not provide any assistance with writing Javascript, and can not guarantee any code you have written will continue to work without modification in future Anki updates. If you are not comfortable addressing any issues you encounter on your own, then please avoid using Javascript. Each Anki client may implement card display differently, so you will need to test the behaviour across platforms. A number of clients are implemented by keeping a long running webpage and dynamically updating parts of it as cards are reviewed, so your Javascript will need to update sections of the document using things like document.getElementById() rather than doing things like document.write(). Functions like window\.alert may not be available. Anki will write javascript errors to the terminal, so you'll need to [view the console](/addons/console-output#console-output) to see them. To debug issues with JavaScript, you can use Chrome's [inspector](/addons/debugging#webviews). # Troubleshooting Source: https://docs.ankiweb.net/manual/troubleshooting If you encounter a problem with Anki, please try the following steps in order: ### 1. Restart Anki Close Anki, then start it again. If you are unable to close Anki because of an error message, you can either terminate Anki using your task manager, or restart your computer. Anki saves periodically, so you should not lose more than a few minutes of work in most circumstances. If the problem does not occur again, you can skip the following steps. ### 2. Check add-ons Close Anki, then open it in safe mode by holding down the Shift key while starting Anki. Keep holding Shift down until the on-screen message informs you that Anki has started in safe mode. If you're on Linux and that didn't work, run `anki --safemode`. If the problem goes away, that indicates an add-on is causing the problem. Remove any add-ons you don't need, and disable half of the others. If the problem continues, try the other half. Repeat the process until you've figured out which add-on is causing the problem. Then please report the issue to the add-on author, using the Copy Debug Info button, and pasting that into the report. ### 3. Check your Anki version You can find the version you're using in the **Help → About** or **Anki → About** menu. If the version you're using is not the latest version published on [https://apps.ankiweb.net](https://apps.ankiweb.net), please close Anki, install the latest version, and then start Anki again to see if the problem has gone away. If you're using Linux, make sure you can reproduce the error using the packaged version on the Anki website, as distros often distribute [broken versions](./platform/linux/distro-packages). ### 4. Check your database After restarting Anki, try the **Tools → Check Database** menu item to make sure your collection doesn't have any problems. ### 5. Restart your computer Sometimes restarting your computer may help. ### 6. Change the Video Driver Crashes and display issues can be caused by the video driver. Changing to a different video driver may help. Make sure you try all the driver options and restart Anki after each change. If you're using Anki version 23.10 or above, the easiest way is to open **Tools → Preferences** (or **Anki → Preferences** if you're on a Mac) and change the driver from the dropdown menu. If you are on an older Anki version or if you cannot access the preferences for some reason, you can use the command-line instructions instead and manually change the gldriver file: * [Windows](/manual/platform/windows/display-issues) * [Mac](/manual/platform/mac/display-issues) * [Linux](/manual/platform/linux/display-issues) ### 7. Reset window sizes Sometimes pressing **reset window sizes** button in the preferences screen immediately after starting Anki will help. ### 8. If the problem remains If you've confirmed you are using the latest Anki version, and are still receiving errors even with add-ons disabled, please [report the problem](./getting-help), including the next error you receive in your post. # A Basic Add-on Source: https://docs.ankiweb.net/addons/a-basic-addon Add the following to `myaddon/__init__.py` in your add-ons folder: ```python theme={null} # import the main window object (mw) from aqt from aqt import mw # import the "show info" tool from utils.py from aqt.utils import showInfo, qconnect # import all of the Qt GUI library from aqt.qt import * # We're going to add a menu item below. First we want to create a function to # be called when the menu item is activated. def testFunction() -> None: # get the number of cards in the current collection, which is stored in # the main window cardCount = mw.col.card_count() # show a message box showInfo("Card count: %d" % cardCount) # create a new menu item, "test" action = QAction("test", mw) # set it to call testFunction when it's clicked qconnect(action.triggered, testFunction) # and add it to the tools menu mw.form.menuTools.addAction(action) ``` Restart Anki, and you should find a 'test' item in the tools menu. Running it will display a dialog with the card count. If you make a mistake when entering in the plugin, Anki will show an error message on startup indicating where the problem is. # Add-on Config Source: https://docs.ankiweb.net/addons/addon-config ## Config JSON Add-ons can store config data in a JSON dictionary. You provide the default values by shipping a file called `config.json`. A simple example: ```text theme={null} {"myvar": 5} ``` In config.md: ```text theme={null} This is documentation for this add-on's configuration, in *markdown* format. ``` In your add-on’s code: ```python theme={null} from aqt import mw config = mw.addonManager.getConfig(__name__) print("var is", config['myvar']) ``` If the config hasn't been customized, the default values from that file will be used. If you need to programmatically modify the config, you can save your changes with: ```python theme={null} mw.addonManager.writeConfig(__name__, config) ``` Users are also able to edit the config inside the GUI. The edited config is stored in `meta.json`. When `getConfig()` is used after edits, meta.json is used preferentially. If a key is missing from meta.json's config, Anki will fall back on the default config. If you change the value of existing keys in config.json, users who have customized their configuration will continue to see the old values unless they use the "restore defaults" button. If no config.json file exists, getConfig() will return None - even if you have called writeConfig(). Add-ons that manage options in their own GUI can have that GUI displayed when the config button is clicked: ```python theme={null} mw.addonManager.setConfigAction(__name__, myOptionsFunc) ``` Avoid key names starting with an underscore - they are reserved for future use by Anki. ## User Files When your add-on needs configuration data other than simple keys and values, it can use a special folder called user\_files in the root of your add-on’s folder. Any files placed in this folder will be preserved when the add-on is upgraded. All other files in the add-on folder are removed on upgrade. To ensure the user\_files folder is created for the user, you can put a README.txt or similar file inside it before zipping up your add-on. When Anki upgrades an add-on, it will ignore any files in the .zip that already exist in the user\_files folder. # Add-on Folders Source: https://docs.ankiweb.net/addons/addon-folders You can access the top level add-ons folder by going to the Tools>Add-ons menu item in the main Anki window. Click on the View Files button, and a folder will pop up. If you had no add-ons installed, the top level add-ons folder will be shown. If you had an add-on selected, the add-on’s module folder will be shown, and you will need to go up one level. The add-ons folder is named "addons21", corresponding to Anki 2.1. If you have an "addons" folder, it is because you have previously used Anki 2.0.x. Each add-on uses one folder inside the add-on folder. Anki looks for a file called `__init__.py` file inside the folder, eg: ```text theme={null} addons21/myaddon/__init__.py ``` If `__init__.py` does not exist, Anki will ignore the folder. When choosing a folder name, it is recommended to stick to a-z and 0-9 characters to avoid problems with Python’s module system. While you can use whatever folder name you wish for folders you create yourself, when you download an add-on from AnkiWeb, Anki will use the item’s ID as the folder name, such as: ```text theme={null} addons21/48927303923/__init__.py ``` Anki will also place a meta.json file in the folder, which keeps track of the original add-on name, when it was downloaded, and whether it’s enabled or not. You should not store user data in the add-on folder, as it’s [deleted when the user upgrades an add-on](./addon-config#config-json). If you followed the steps in the [editor setup](./editor-setup) section, you can either copy your myaddon folder into Anki’s add-on folder to test it, or on Mac or Linux, create a symlink from the folder’s original location into your add-ons folder. # Background Operations Source: https://docs.ankiweb.net/addons/background-ops If your add-on performs a long-running operation directly, the user interface will freeze until the operation completes - no progress window will be shown, and the app will look as if it's stuck. This is annoying for users, so care should be taken to avoid it happening. The reason it happens is because the user interface runs on the "main thread". When your add-on performs a long-running operation directly, it also runs on the main thread, and it prevents the UI code from running again until your operation completes. The solution is to run your add-on code in a background thread, so that the UI can continue to function. A complicating factor is that any code you write that interacts with the UI also needs to be run on the main thread. If your add-on only ran in the background, and it attempted to access the UI, it would cause Anki to crash. So selectivity is required - UI operations should be run on the main thread, and long-running operations like collection and network access should be run in the background. Anki provides some tools to make this easier. ## Read-Only/Non-Undoable Operations For long-running operations like gathering a group of notes, or things like network access, `QueryOp` is recommended. For the latter, make sure to read about serialization further below. In the following example, my\_ui\_action() will return quickly, and the operation will continue to run in the background until it completes. If it finishes successfully, on\_success will be called. ```python theme={null} from anki.collection import Collection from aqt.operations import QueryOp from aqt.utils import showInfo from aqt import mw def my_background_op(col: Collection, note_ids: list[int]) -> int: # some long-running op, eg for id in note_ids: note = col.get_note(note_id) # ... return 123 def on_success(count: int) -> None: showInfo(f"my_background_op() returned {count}") def my_ui_action(note_ids: list[int]): op = QueryOp( # the active window (main window in this case) parent=mw, # the operation is passed the collection for convenience; you can # ignore it if you wish op=lambda col: my_background_op(col, note_ids), # this function will be called if op completes successfully, # and it is given the return value of the op success=on_success, ) # if with_progress() is not called, no progress window will be shown. # note: QueryOp.with_progress() was broken until Anki 2.1.50 op.with_progress().run_in_background() ``` **Be careful not to directly call any Qt/UI routines inside the background operation!** * If you need to modify the UI after an operation completes (e.g.show a tooltip), you should do it from the success function. * If the operation needs data from the UI (e.g.a combo box value), that data should be gathered prior to executing the operation. * If you need to update the UI during the background operation (e.g.to update the text of the progress window), your operation needs to perform that update on the main thread. For example, in a loop: ```python theme={null} if time.time() - last_progress >= 0.1: aqt.mw.taskman.run_on_main( lambda: aqt.mw.progress.update( label=f"Remaining: {remaining}", value=total - remaining, max=total, ) ) last_progress = time.time() ``` **Operations are serialized by default** By default, only a single operation can run at once, to ensure multiple read operations on the collection don't interleave with another write operation. If your operation does not touch the collection (e.g., it is a network request), then you can opt out of this serialization so that the operation runs concurrently to other ops: ```python theme={null} op.without_collection().run_in_background() ``` ## Collection Operations A separate `CollectionOp` is provided for undoable operations that modify the collection. It functions similarly to QueryOp, but will also update the UI as changes are made (e.g.refresh the Browse screen if any notes are changed). Many undoable ops already have a `CollectionOp` defined in [aqt/operations/\*.py](https://github.com/ankitects/anki/tree/main/qt/aqt/operations). You can often use one of them directly rather than having to create your own. For example: ```python theme={null} from aqt.operations.note import remove_notes def my_ui_action(note_ids: list[int]) -> None: remove_notes(parent=mw, note_ids=note_ids).run_in_background() ``` By default that routine will show a tooltip on success. You can call .success() or .failure() on it to provide an alternative routine. For more information on undo handling, including combining multiple operations into a single undo step, please see [this forum page](https://forums.ankiweb.net/t/add-on-porting-notes-for-anki-2-1-45/11212#undoredo-4). # Command-Line Use Source: https://docs.ankiweb.net/addons/command-line-use The `anki` module can be used separately from Anki's GUI. It is strongly recommended you use it instead of attempting to read or write a .anki2 file directly. Install it with pip: ```shell theme={null} $ pip install anki ``` Then you can use it in a .py file, like so: ```python theme={null} from anki.collection import Collection col = Collection("/path/to/collection.anki2") print(col.sched.deck_due_tree()) ``` See [the Anki module](./the-anki-module) for more. # Console Output Source: https://docs.ankiweb.net/addons/console-output Because Anki is a GUI app, text output to stdout (e.g.`print("foo")`) is not usually visible to the user. You can optionally reveal text printed to stdout, and it is recommended that you do so while developing your add-on. ## Warnings Anki uses stdout to print warnings about API deprecations, eg: ``` addons21/mytest/__init__.py:10:getNote is deprecated: please use 'get_note' ``` If these warnings are occurring in a loop, please address them promptly, as they can slow Anki down even if the console is not shown. ## Printing text You may find it useful to print text to stdout to aid in debugging your add-on. Please avoid printing large amounts of text (e.g.in a loop that deals with hundreds or thousands of items), as that may slow Anki down, even if the console is not shown. ## Showing the Console ### Windows If you start Anki via the `anki-console.bat` file in `C:\Users\user\AppData\Local\Programs\Anki` (or `C:\Program Files\Anki`), a separate console window will appear. ### macOS Open Terminal.app, then enter the following text and hit enter: ``` /Applications/Anki.app/Contents/MacOS/anki ``` ### Linux Open a terminal/xterm, then run Anki with `anki` # Debugging Source: https://docs.ankiweb.net/addons/debugging ## Exceptions and Stdout/Stderr If your code throws an uncaught exception, it will be caught by Anki’s standard exception handler, and an error will be presented to the user. The handler catches anything that is printed to stderr, so you should avoid logging text to stderr unless you want the user to see it in a popup. Text printed to standard output is covered in [this section](./console-output). ## Webviews If you set the env var QTWEBENGINE\_REMOTE\_DEBUGGING to 8080 prior to starting Anki, you can surf to [http://localhost:8080](http://localhost:8080) in Chrome to debug the visible webpages. Alternatively, you can use [this add-on](https://ankiweb.net/shared/info/31746032) to open the inspector inside Anki. ## Debug Console Anki also includes a REPL. From within the program, press the [shortcut key](/manual/misc#debug-console) and a window will open up. You can enter expressions or statements into the top area, and then press ctrl+return/command+return to evaluate them. An example session follows: ```text theme={null} >>> mw >>> print(mw) >>> invalidName Traceback (most recent call last): File "/Users/dae/Lib/anki/qt/aqt/main.py", line 933, in onDebugRet exec text File "", line 1, in NameError: name 'invalidName' is not defined >>> a = [a for a in dir(mw.form) if a.startswith("action")] ... print(a) ... print() ... pp(a) ['actionAbout', 'actionCheckMediaDatabase', ...] ['actionAbout', 'actionCheckMediaDatabase', 'actionDocumentation', 'actionDonate', ...] >>> pp(mw.reviewer.card) >>> pp(card()) # shortcut for mw.reviewer.card.__dict__ {'_note': , '_qa': [...] 'col': , 'data': u'', 'did': 1, 'due': -1, 'factor': 2350, 'flags': 0, 'id': 1307820012852L, [...] } >>> pp(bcard()) # shortcut for selected card in browser ``` Note that you need to explicitly print an expression in order to see what it evaluates to. Anki exports pp() (pretty print) in the scope to make it easier to quickly dump the details of objects, and the shortcut ctrl+shift+return will wrap the current text in the upper area with pp() and execute the result. ## PDB If you’re on Linux or are running Anki from source, it’s also possible to debug your script with pdb. Place the following line somewhere in your code, and when Anki reaches that point it will kick into the debugger in the terminal: ```python theme={null} from aqt.qt import debug; debug() ``` Alternatively you can export DEBUG=1 in your shell and it will kick into the debugger on an uncaught exception. ## Python Assertions Runtime checks using Python's `assert` statement are not evaluated in Anki's release builds, even when running in debug mode. If you want to use `assert` for testing you can use the [packaged versions from PyPI](https://betas.ankiweb.net/#via-pypipip) or [run Anki from source](https://github.com/ankitects/anki/blob/main/docs/development.md). # Editor Setup Source: https://docs.ankiweb.net/addons/editor-setup While you can write an add-on with a basic text editor such as Notepad, setting up a proper Python editor/development environment (IDE) will make your life considerably easier. ## PyCharm setup The free community edition of PyCharm has good out of the box support for Python: [https://www.jetbrains.com/pycharm/](https://www.jetbrains.com/pycharm/). You can also use other editors like Visual Studio Code, but we find PyCharm gives the best results. Over the last year, Anki’s codebase has been updated to add type hints to almost all of the code. These type hints make development easier, by providing better code completion, and by catching errors using tools like mypy. As an add-on author, you can take advantage of this type hinting as well. To get started with your first add-on: * Open PyCharm and create a new project. * Right click/ctrl+click on your project on the left and create a new Python package called "myaddon" Now you’ll need to fetch Anki’s bundled source code so you can get type completion. As of Anki 2.1.24, these are available on PyPI. **You will need to be using a 64 bit version of Python, and your Python version must match a version the Anki version you are fetching supports.** To install Anki via PyCharm, click on Python Console in the bottom left and type the following in: ```python theme={null} import subprocess subprocess.check_call(["pip3", "install", "--upgrade", "pip"]) subprocess.check_call(["pip3", "install", "mypy", "aqt[qt6]"]) ``` Hit enter and wait. Once it completes, you should now have code completion. If you get an error, you are probably not using a 64 bit version of Python, or your Python version is not one the latest Anki version supports. Try running the commands above with "-vvv" to get more info. After installing, try out the code completion by double clicking on the `__init__.py` file. If you see a spinner down the bottom, wait for it to complete. Then type in: ```python theme={null} from anki import hooks hooks. ``` and you should see completions pop up. **Please note that you can not run your add-on from within PyCharm - you will get errors.** Add-ons need to be run from within Anki, which is covered in the [A Basic Add-on](./a-basic-addon) section. # Hooks & Filters Source: https://docs.ankiweb.net/addons/hooks-and-filters Hooks and Filters Hooks are the way you should connect your add-on code to Anki. If the function you want to alter doesn’t already have a hook, please see the section below about adding new hooks. There are two different kinds of "hooks": * Regular hooks are functions that don’t return anything. They are run for their side effects, and may sometimes alter the objects they have been passed, such as inserting an extra item in a list. * "Filters" are functions that return their first argument, after maybe changing it. An example filter is one that takes the text of a field during card display, and returns an altered version. The distinction is necessary because some data types in Python can be modified directly, and others can only be modified by creating a changed copy (such as strings). ## New Style Hooks A new style of hook was added in Anki 2.1.20. Imagine you wish to show a message each time the front side of a card is shown in the review screen. You’ve looked at the source code in reviewer.py, and seen the following line in the showQuestion() function: ```python theme={null} gui_hooks.reviewer_did_show_question(card) ``` To register a function to be called when this hook is run, you can do the following in your add-on: ```python theme={null} from aqt import gui_hooks def myfunc(card): print("question shown, card question is:", card.q()) gui_hooks.reviewer_did_show_question.append(myfunc) ``` Multiple add-ons can register for the same hook or filter - they will all be called in turn. To remove a hook, use code like: ``` gui_hooks.reviewer_did_show_question.remove(myfunc) ``` :warning: Functions you attach to a hook should not modify the hook while they are executing, as it will break things: ``` def myfunc(card): # DON'T DO THIS! gui_hooks.reviewer_did_show_question.remove(myfunc) gui_hooks.reviewer_did_show_question.append(myfunc) ``` An easy way to see all hooks at a glance is to look at the [Hooks Reference](/addons/hooks-reference) page. If you have set up type completion as described in an earlier section, you can also see the hooks in your IDE: In the above video, holding the command/ctrl key down while hovering will show a tooltip, including arguments and documentation if it exists. The argument names and types for the callback can be seen on the bottom line. For some examples of how the new hooks are used, please see [https://github.com/ankitects/anki-addons/blob/master/demos/](https://github.com/ankitects/anki-addons/blob/master/demos/). Most of the new style hooks will also call the legacy hooks (described further below), so old add-ons will continue to work for now, but add-on authors are encouraged to update to the new style as it allows for code completion, and better error checking. ## Notable Hooks For a full list of hooks, and their documentation, please see * [The GUI hooks](https://github.com/ankitects/anki/blob/master/qt/tools/genhooks_gui.py) * [The pylib hooks](https://github.com/ankitects/anki/blob/master/pylib/tools/genhooks.py) ### Webview Many of Anki's screens are built with one or more webviews, and there are some hooks you can use to intercept their use. From Anki 2.1.22: * `gui_hooks.webview_will_set_content()` allows you to modify the HTML that various screens send to the webview. You can use this for adding your own HTML/CSS/Javascript to particular screens. This will not work for external pages - see the Anki 2.1.36 section below. * `gui_hooks.webview_did_receive_js_message()` allows you to intercept messages sent from Javascript. Anki provides a `pycmd(string)` function in Javascript which sends a message back to Python, and various screens such as reviewer.py respond to the messages. By using this hook, you can respond to your own messages as well. From Anki 2.1.36: * `webview_did_inject_style_into_page()` gives you an opportunity to inject styling or content into external pages like the graphs screen and congratulations page that are loaded with load\_ts\_page(). #### Managing External Resources in Webviews Add-ons may expose their own web assets by utilizing `aqt.addons.AddonManager.setWebExports()`. Web exports registered in this manner may then be accessed under the `/_addons` subpath. For example, to allow access to a `my-addon.js` and `my-addon.css` residing in a "web" subfolder in your add-on package, first register the corresponding web export: ```python theme={null} from aqt import mw mw.addonManager.setWebExports(__name__, r"web/.*(css|js)") ``` Then, append the subpaths to the corresponding web\_content fields within a function subscribing to `gui_hooks.webview_will_set_content`: ```python theme={null} def on_webview_will_set_content(web_content: WebContent, context) -> None: addon_package = mw.addonManager.addonFromModule(__name__) web_content.css.append(f"/_addons/{addon_package}/web/my-addon.css") web_content.js.append(f"/_addons/{addon_package}/web/my-addon.js") ``` Note that '/' will also match the os specific path separator. ## Legacy Hook Handling Older versions of Anki used a different hook system, using the functions runHook(), addHook() and runFilter(). For example, when the scheduler (anki/sched.py) discovers a leech, it calls: ```python theme={null} runHook("leech", card) ``` If you wished to perform a special operation when a leech was discovered, such as moving the card to a "Difficult" deck, you could do it with the following code: ```python theme={null} from anki.hooks import addHook from aqt import mw def onLeech(card): # can modify without .flush(), as scheduler will do it for us card.did = mw.col.decks.id("Difficult") # if the card was in a cram deck, we have to put back the original due # time and original deck card.odid = 0 if card.odue: card.due = card.odue card.odue = 0 addHook("leech", onLeech) ``` An example of a filter is in [aqt/editor.py](https://github.com/ankitects/anki/blob/main/qt/aqt/editor.py). The editor calls the "editFocusLost" filter each time a field loses focus, so that add-ons can apply changes to the note: ```python theme={null} if runFilter( "editFocusLost", False, self.note, self.currentField): # something updated the note; schedule reload def onUpdate(): self.loadNote() self.checkValid() self.mw.progress.timer(100, onUpdate, False) ``` Each filter in this example accepts three arguments: a modified flag, the note, and the current field. If a filter makes no changes it returns the modified flag the same as it received it; if it makes a change it returns True. In this way, if any single add-on makes a change, the UI will reload the note to show updates. The Japanese Support add-on uses this hook to automatically generate one field from another. A slightly simplified version is presented below: ```python theme={null} def onFocusLost(flag, n, fidx): from aqt import mw # japanese model? if "japanese" not in n.model()['name'].lower(): return flag # have src and dst fields? for c, name in enumerate(mw.col.models.fieldNames(n.model())): for f in srcFields: if name == f: src = f srcIdx = c for f in dstFields: if name == f: dst = f if not src or not dst: return flag # dst field already filled? if n[dst]: return flag # event coming from src field? if fidx != srcIdx: return flag # grab source text srcTxt = mw.col.media.strip(n[src]) if not srcTxt: return flag # update field try: n[dst] = mecab.reading(srcTxt) except Exception, e: mecab = None raise return True addHook('editFocusLost', onFocusLost) ``` The first argument of a filter is the argument that should be returned. In the focus lost filter this is a flag, but in other cases it may be some other object. For example, in anki/collection.py, \_renderQA() calls the "mungeQA" filter which contains the generated HTML for the front and back of cards. latex.py uses this filter to convert text in LaTeX tags into images. In Anki 2.1, a hook was added for adding buttons to the editor. It can be used like so: ```python theme={null} from aqt.utils import showInfo from anki.hooks import addHook # cross out the currently selected text def onStrike(editor): editor.web.eval("wrap('', '');") def addMyButton(buttons, editor): editor._links['strike'] = onStrike return buttons + [editor._addButton( "iconname", # "/full/path/to/icon.png", "strike", # link name "tooltip")] addHook("setupEditorButtons", addMyButton) ``` ## Adding Hooks If you want to modify a function that doesn’t already have a hook, please submit a pull request that adds the hooks you need. In your PR, please describe the use-case you're trying to solve. Hooks that are general in nature will typically be approved; hooks that target a very specific use case may need to be refactored to be more general first. For an example of what this might look like, please see [this PR](https://github.com/ankitects/anki/pull/2340). The hook definitions are located in [pylib/tools/genhooks.py](https://github.com/ankitects/anki/tree/main/pylib/tools/genhooks.py) and [qt/tools/genhooks\_gui.py](https://github.com/ankitects/anki/blob/main/qt/tools/genhooks_gui.py). When building Anki, the build scripts will automatically update the hook files with the definitions listed there. Please see the [docs/](https://github.com/ankitects/anki/tree/main/docs) folder in the source tree for more information. # Hooks Reference Source: https://docs.ankiweb.net/addons/hooks-reference A generated reference of all hooks and filters available in Anki for add-on development. This page lists all available hooks in Anki. It is generated from [`pylib/tools/genhooks.py`](https://github.com/ankitects/anki/blob/main/pylib/tools/genhooks.py) and [`qt/tools/genhooks_gui.py`](https://github.com/ankitects/anki/blob/main/qt/tools/genhooks_gui.py). See [Hooks & Filters](/addons/hooks-and-filters) for usage instructions. ## Backend Hooks (`anki.hooks`) ### `card_odue_was_invalid` No arguments. No docstring. *** ### `schema_will_change` **Args:** `proceed: bool`\ **Returns:** `bool` No docstring. *** ### `notes_will_be_deleted` **Args:** `col: anki.collection.Collection`, `ids: Sequence[anki.notes.NoteId]` No docstring. *** ### `note_will_be_added` **Args:** `col: anki.collection.Collection`, `note: anki.notes.Note`, `deck_id: anki.decks.DeckId` Allows modifying a note before it's added to the collection. This hook may be called both when users use the Add screen, and when add-ons like AnkiConnect add notes. It is not called when importing. If you wish to alter the Add screen, use gui\_hooks.add\_cards\_will\_add\_note instead. *** ### `media_files_did_export` *(Obsolete)* **Args:** `count: int` > [!WARNING] > > Obsolete, do not use. *** ### `legacy_export_progress` *(Obsolete)* **Args:** `progress: str` > [!WARNING] > > Obsolete, do not use. *** ### `exporters_list_created` **Args:** `exporters: list[tuple[str, Any]]` No docstring. *** ### `media_file_filter` **Args:** `txt: str`\ **Returns:** `str` Allows manipulating the file path that media will be read from *** ### `field_filter` **Args:** `field_text: str`, `field_name: str`, `filter_name: str`, `ctx: anki.template.TemplateRenderContext`\ **Returns:** `str` Allows you to define custom `{{filters:..}}` Your add-on can check filter\_name to decide whether it should modify field\_text or not before returning it. *** ### `note_will_flush` **Args:** `note: Note` Allow to change a note before it is added/updated in the database. *** ### `card_will_flush` **Args:** `card: Card` Allow to change a card before it is added/updated in the database. *** ### `card_did_render` **Args:** `output: anki.template.TemplateRenderOutput`, `ctx: anki.template.TemplateRenderContext` Can modify the resulting text after rendering completes. *** ### `importing_importers` *(Obsolete)* **Args:** `importers: list[tuple[str, Any]]` > [!WARNING] > > Obsolete, do not use. *** ### `deck_added` *(Obsolete)* **Args:** `deck: anki.decks.DeckDict` > [!WARNING] > > Obsolete, do not use. *** ### `note_type_added` *(Obsolete)* **Args:** `notetype: anki.models.NotetypeDict` > [!WARNING] > > Obsolete, do not use. *** ### `sync_stage_did_change` *(Obsolete)* **Args:** `stage: str` > [!WARNING] > > Obsolete, do not use. *** ### `sync_progress_did_change` *(Obsolete)* **Args:** `msg: str` > [!WARNING] > > Obsolete, do not use. # Introduction Source: https://docs.ankiweb.net/addons/intro ## Translations * 日本語: * [https://t-cool.github.io/anki-addon-docs-ja/](https://t-cool.github.io/anki-addon-docs-ja/) * [http://rs.luminousspice.com/ankiaddons21/](http://rs.luminousspice.com/ankiaddons21/) ## Overview Anki's UI is primarily written in Python/PyQt. A number of screens, such as the review screen and editor, also make use of TypeScript and Svelte. To write add-ons, you will need some basic programming experience, and some familiarity with Python. The [Python tutorial](http://docs.python.org/tutorial/) is a good place to start. Add-ons in Anki are implemented as Python modules, which Anki loads at startup. They can register themselves to be notified when certain actions take place (eg, a hook that runs when the browse screen is loaded), and can make changes to the UI (e.g.adding a new menu item) when those actions take place. There is a [brief overview of Anki's architecture](https://github.com/ankitects/anki/blob/main/docs/architecture.md) available. While it is possible to develop Anki add-ons with just a plain text editor, you can make your life much easier by using a proper code editor/IDE. Please see the [Editor Setup](/addons/editor-setup) section for more information. # Monkey Patching and Method Wrapping Source: https://docs.ankiweb.net/addons/monkey-patching Monkey Patching If you want to modify a function that doesn’t already have a hook, it’s possible to overwrite that function with a custom version instead. This is sometimes referred to as 'monkey patching'. Monkey patching is useful in the testing stage, and while waiting for new hooks to be integrated into Anki. But please don’t rely on it long term, as monkey patching is very fragile, and will tend to break as Anki is updated in the future. The only exception to the above is if you’re making extensive changes to Anki where adding new hooks would be impractical. In that case, you may unfortunately need to modify your add-on periodically as Anki is updated. In [aqt/editor.py](https://github.com/ankitects/anki/blob/main/qt/aqt/editor.py) there is a function setupButtons() which creates the buttons like bold, italics and so on that you see in the editor. Let’s imagine you want to add another button in your add-on. Anki 2.1 no longer uses setupButtons(). The code below is still useful to understand how monkey patching works, but for adding buttons to the editor please see the setupEditorButtons hook described in the previous section. The simplest way is to copy and paste the function from the Anki source code, add your text to the bottom, and then overwrite the original, like so: ```python theme={null} from aqt.editor import Editor def mySetupButtons(self): Editor.setupButtons = mySetupButtons ``` This approach is fragile however, as if the original code is updated in a future version of Anki, you would also have to update your add-on. A better approach would be to save the original, and call it in our custom version: ```python theme={null} from aqt.editor import Editor def mySetupButtons(self): origSetupButtons(self) origSetupButtons = Editor.setupButtons Editor.setupButtons = mySetupButtons ``` Because this is a common operation, Anki provides a function called wrap() which makes this a little more convenient. A real example: ```python theme={null} from anki.hooks import wrap from aqt.editor import Editor from aqt.utils import showInfo def buttonPressed(self): showInfo("pressed " + `self`) def mySetupButtons(self): # - size=False tells Anki not to use a small button # - the lambda is necessary to pass the editor instance to the # callback, as we're passing in a function rather than a bound # method self._addButton("mybutton", lambda s=self: buttonPressed(self), text="PressMe", size=False) Editor.setupButtons = wrap(Editor.setupButtons, mySetupButtons) ``` By default, wrap() runs your custom code after the original code. You can pass a third argument, "before", to reverse this. If you need to run code both before and after the original version, you can do so like so: ```python theme={null} from anki.hooks import wrap from aqt.editor import Editor def mySetupButtons(self, _old): ret = _old(self) return ret Editor.setupButtons = wrap(Editor.setupButtons, mySetupButtons, "around") ``` # MyPy Source: https://docs.ankiweb.net/addons/mypy ## Using MyPy The type hints you installed when [setting up PyCharm](./editor-setup) can also be used to check your code is correct, using a tool called MyPy. My Py will catch some cases where you’ve called Anki functions incorrectly, such as when you've typed a function name in incorrectly, or passed a string when an integer was expected. In PyCharm, click on Terminal in the bottom left, and type `mypy myaddon`. After some processing, it will show a success or tell you any mistakes you’ve made. For example, if you specified a hook incorrectly: ```python theme={null} from aqt import gui_hooks def myfunc() -> None: print("myfunc") gui_hooks.reviewer_did_show_answer.append(myfunc) ``` Then mypy will report: ```text theme={null} myaddon/__init__.py:5: error: Argument 1 to "append" of "list" has incompatible type "Callable[[], Any]"; expected "Callable[[Card], None]" Found 1 error in 1 file (checked 1 source file) ``` ..which is telling you that the hook expects a function which takes a card as the first argument, eg ```python theme={null} from anki.cards import Card def myfunc(card: Card) -> None: print("myfunc") ``` ## Checking Existing Add-Ons Mypy has a "check\_untyped\_defs" option that will give you some type checking even if your own code lacks type hints, but to get the most out of it, you will need to add type hints to your own code. This can take some initial time, but pays off in the long term, as it becomes easier to navigate your own code, and allows you to catch errors in parts of the code you might not regularly exercise yourself. It is also makes it easier to check for any problems caused by updating to a newer Anki version. If you have a large existing add-on, you may wish to look into tools like monkeytype to automatically add types to your code.
Monkeytype To use monkeytype with an add-on called 'test', you could do something like the following: ```shell theme={null} % /usr/local/bin/python3.8 -m venv pyenv % cd pyenv && . bin/activate (pyenv) % pip install aqt monkeytype (pyenv) % monkeytype run bin/anki ``` Then click around in your add-on to gather the runtime type information, and close Anki when you're done. After doing so, you'll need to comment out any top-level actions (such as code modifying menus outside of a function), as that will trip up monkeytype. Finally, you can generate the modified files with: ```shell theme={null} (pyenv) % PYTHONPATH=~/Library/Application\ Support/Anki2/addons21 monkeytype apply test ```
Here are some example add-ons that use type hints: [https://github.com/ankitects/anki-addons/blob/master/demos/](https://github.com/ankitects/anki-addons/blob/master/demos/) # Porting Anki 2.0 add-ons Source: https://docs.ankiweb.net/addons/porting2.0 ## Python 3 Anki 2.1 requires Python 3 or later. After installing Python 3 on your machine, you can use the 2to3 tool to automatically convert your existing scripts to Python 3 code on a folder by folder basis, like: ```text theme={null} 2to3-3.8 --output-dir=aqt3 -W -n aqt mv aqt aqt-old mv aqt3 aqt ``` Most simple code can be converted automatically, but there may be parts of the code that you need to manually modify. ## Qt5 / PyQt5 The syntax for connecting signals and slots has changed in PyQt5. Recent PyQt4 versions support the new syntax as well, so the same syntax can be used for both Anki 2.0 and 2.1 add-ons. More info is available at [http://pyqt.sourceforge.net/Docs/PyQt4/new\_style\_signals\_slots.html](http://pyqt.sourceforge.net/Docs/PyQt4/new_style_signals_slots.html) One add-on author reported that the following tool was useful to automatically convert the code: [https://github.com/rferrazz/pyqt4topyqt5](https://github.com/rferrazz/pyqt4topyqt5) The Qt modules are in 'PyQt5' instead of 'PyQt4'. You can do a conditional import, but an easier way is to import from aqt.qt - eg ```python theme={null} from aqt.qt import * ``` That will import all the Qt objects like QDialog without having to specify the Qt version. ## Single .py add-ons need their own folder Each add-on is now stored in its own folder. If your add-on was previously called `demo.py`, you’ll need to create a `demo` folder with an `__init__.py` file. If you don’t care about 2.0 compatibility, you can just rename `demo.py` to `demo/__init__.py`. If you plan to support 2.0 with the same file, you can copy your original file into the folder (`demo.py` → `demo/demo.py`), and then import it relatively by adding the following to `demo/__init__.py`: ```python theme={null} from . import demo ``` The folder needs to be zipped up when uploading to AnkiWeb. For more info, please see [sharing add-ons](./sharing). ## Folders are deleted when upgrading When an add-on is upgraded, all files in the add-on folder are deleted. The only exception is the special [user\_files folder](./addon-config#user-files). If your add-on requires more than simple key/value configuration, make sure you store the associated files in the user\_files folder, or they will be lost on upgrade. ## Supporting both 2.0 and 2.1 in one codebase Most Python 3 code will run on Python 2 as well, so it is possible to update your add-ons in such a way that they run on both Anki 2.0 and 2.1. Whether this is worth it depends on the changes you need to make. Most add-ons that affect the scheduler should require only minor changes to work on 2.1. Add-ons that alter the behaviour of the reviewer, browser or editor may require more work. The most difficult part is the change from the unsupported QtWebKit to QtWebEngine. If you do any non-trivial work with webviews, some work will be required to port your code to Anki 2.1, and you may find it difficult to support both Anki versions in the one codebase. If you find your add-on runs without modification, or requires only minor changes, you may find it easiest to add some if statements to your code and upload the same file for both 2.0.x and 2.1.x. If your add-on requires more significant changes, you may find it easier to stop providing updates for 2.0.x, or to maintain separate files for the two Anki versions. ## Webview Changes Qt 5 has dropped WebKit in favour of the Chromium-based WebEngine, so Anki’s webviews are now using WebEngine. Of note: * You can now debug the webviews using an external Chrome instance, by setting the env var QTWEBENGINE\_REMOTE\_DEBUGGING to 8080 prior to starting Anki, then surfing to localhost:8080 in Chrome. * WebEngine uses a different method of communicating back to Python. AnkiWebView() is a wrapper for webviews which provides a pycmd(str) function in Javascript which will call the ankiwebview’s onBridgeCmd(str) method. Various parts of Anki’s UI like reviewer.py and deckbrowser.py have had to be modified to use this. * Javascript is evaluated asynchronously, so if you need the result of a JS expression you can use ankiwebview’s evalWithCallback(). * As a result of this asynchronous behaviour, editor.saveNow() now requires a callback. If your add-on performs actions in the browser, you likely need to call editor.saveNow() first and then run the rest of your code in the callback. Calls to .onSearch() will need to be changed to .search()/.onSearchActivated() as well. See the browser’s .deleteNotes() for an example. * Various operations that were supported by WebKit like setScrollPosition() now need to be implemented in javascript. * Page actions like mw\.web.triggerPageAction(QWebEnginePage.Copy) are also asynchronous, and need to be rewritten to use javascript or a delay. * WebEngine doesn’t provide a keyPressEvent() like WebKit did, so the code that catches shortcuts not attached to a menu or button has had to be changed. setStateShortcuts() fires a hook that can be used to adjust the shortcuts for a given state. ## Reviewer Changes Anki now fades the previous card out before fading the next card in, so the next card won’t be available in the DOM when the showQuestion hook fires. There are some new hooks you can use to run Javascript at the appropriate time - see [here](./reviewer-javascript) for more. ## Add-on Configuration Many small 2.0 add-ons relied on users editing the sourcecode to customize them. This is no longer a good idea in 2.1, because changes made by the user will be overwritten when they check for and download updates. 2.1 provides a [Configuration](./addon-config#config-json) system to work around this. If you need to continue supporting 2.0 as well, you could use code like the following: ```python theme={null} if getattr(getattr(mw, "addonManager", None), "getConfig", None): config = mw.addonManager.getConfig(__name__) else: config = dict(optionA=123, optionB=456) ``` # Porting 2.1.x Add-ons Source: https://docs.ankiweb.net/addons/porting2.1.x Please see [https://forums.ankiweb.net/t/porting-tips-for-anki-23-10/35916](https://forums.ankiweb.net/t/porting-tips-for-anki-23-10/35916) # Python Modules Source: https://docs.ankiweb.net/addons/python-modules From Anki 2.1.50, the packaged builds include most built-in Python modules. Earlier versions ship with only the standard modules necessary to run Anki. If your add-on uses a standard Python module that has not been included, or a package from PyPI, then your add-on will need to bundle the module. For pure Python modules, this is usually as simple as putting them in a subfolder, and adjusting sys.path. For modules that require C extensions such as numpy, things get a fair bit more complicated, as you'll need to bundle the different module versions for each platform, and ensure you're bundling a version that is compatible with the version of Python Anki is packaged with. # Qt and PyQt Source: https://docs.ankiweb.net/addons/qt As mentioned in the overview, Anki uses PyQt for a lot of its UI, and the Qt documentation and [PyQt documentation](https://www.riverbankcomputing.com/static/Docs/PyQt6/sip-classes.html) are invaluable for learning how to display different GUI widgets. ## Qt Versions From Anki 2.1.50, separate builds are provided for PyQt5 and PyQt6. Generally speaking, if you write code that works in Qt6, and make sure to import any Qt classes from aqt.qt instead of directly from PyQt6, your code should also work in Qt5. ## Designer Files Parts of Anki's UI are defined in .ui files, located in `qt/aqt/forms`. Anki's build process converts them into .py files. If you wish to build your add-on's UI in a similar way, you will need to install Python, and install a program called Qt Designer (Designer.app on macOS). On Linux, it may be available in your distro's packages; on Windows and Mac, you'll need to install it as part of a [Qt install](https://download.qt.io/). Once installed, you will need to use a program provided in the pyqt6 pip package to compile the .ui files. Generated Python files for PyQt6 won't work with PyQt5 and vice versa, so if you wish to support both versions, you will need to build the .ui files twice, once with pyuic5, and once with pyuic6. ## Garbage Collection One particular thing to bear in mind is that objects are garbage collected in Python, so if you do something like: ```python theme={null} def myfunc(): widget = QWidget() widget.show() ``` …​then the widget will disappear as soon as the function exits. To prevent this, assign top level widgets to an existing object, like: ```python theme={null} def myfunc(): mw.myWidget = widget = QWidget() widget.show() ``` This is often not required when you create a Qt object and give it an existing object as the parent, as the parent will keep a reference to the object. # Reviewer Javascript Source: https://docs.ankiweb.net/addons/reviewer-javascript For a general solution not specific to card review, see [the webview section](./hooks-and-filters#webview). Anki provides a hook to modify the question and answer HTML before it is displayed in the review screen, preview dialog, and card layout screen. This can be useful for adding Javascript to the card. If you wish to load external resources in your card, please see [managing external resources in webviews](./hooks-and-filters#managing-external-resources-in-webviews). An example: ```python theme={null} from aqt import gui_hooks def prepare(html, card, context): return html + """ """ gui_hooks.card_will_show.append(prepare) ``` The hook takes three arguments: the HTML of the question or answer, the current card object (so you can limit your add-on to specific note types for example), and a string representing the context the hook is running in. Make sure you return the modified HTML. Context is one of: "reviewQuestion", "reviewAnswer", "clayoutQuestion", "clayoutAnswer", "previewQuestion" or "previewAnswer". The answer preview in the card layout screen, and the previewer set to "show both sides" will only use the "Answer" context. This means Javascript you append on the back side of the card should not depend on Javascript that is only added on the front. Because Anki fades the previous text out before revealing the new text, Javascript hooks are required to perform actions like scrolling at the correct time. You can use them like so: ```python theme={null} from aqt import gui_hooks def prepare(html, card, context): return html + """ """ gui_hooks.card_will_show.append(prepare) ``` * onUpdateHook fires after the new card has been placed in the DOM, but before it is shown. * onShownHook fires after the card has faded in. The hooks are reset each time the question or answer is shown. # Sharing Add-ons Source: https://docs.ankiweb.net/addons/sharing ## Sharing via AnkiWeb You can package up an add-on for distribution by zipping it up, and giving it a name ending in .ankiaddon. The top level folder should not be included in the zip file. For example, if you have a module like the following: ```text theme={null} addons21/myaddon/__init__.py addons21/myaddon/my.data ``` Then the zip file contents should be: ```text theme={null} __init__.py my.data ``` If you include the folder name in the zip like the following, AnkiWeb will not accept the zip file: ```text theme={null} myaddon/__init__.py myaddon/my.data ``` On Unix-based machines, you can create a properly-formed file with the following command: ```text theme={null} $ cd myaddon && zip -r ../myaddon.ankiaddon * ``` Python automatically creates `pycache` folders when your add-on is run. Please make sure you delete these prior to creating the zip file, as AnkiWeb can not accept zip files that contain `pycache` folders. Once you’ve created a .ankiaddon file, you can use the Upload button on [https://ankiweb.net/shared/addons](https://ankiweb.net/shared/addons) to share the add-on with others. If an add-on downloaded from AnkiWeb includes a valid 'manifest.json' with a non-empty 'name', Anki uses that name. Otherwise, it uses a name derived from the add-on's title on AnkiWeb. ## Sharing outside AnkiWeb If you wish to distribute .ankiaddon files outside of AnkiWeb, your add-on folder needs to contain a 'manifest.json' file. The file should contain at least two keys: 'package' specifies the folder name the add-on will be stored in, and 'name' specifies the name that will be shown to the user. You can optionally include a 'conflicts' key which is a list of other packages that conflict with the add-on, and a 'mod' key which specifies when the add-on was updated. # Support Source: https://docs.ankiweb.net/addons/support This document contains some hints to get you started, but it is not a comprehensive guide. To actually write an add-on, you will need to familiarize yourself with Anki’s source code, and the source code of other add-ons that do similar things to what you are trying to accomplish. Because of our limited resources, **no official support is available for add-on writing**. If you have any questions, you will either need to find the answers yourself in the source code, or post your questions on the [development forum](https://forums.ankiweb.net/c/anki/development/12). You can also use the add-on forum to request someone write an add-on for you. You may need to offer some money before anyone becomes interested in helping you. # The 'anki' Module Source: https://docs.ankiweb.net/addons/the-anki-module All access to your collection and associated media go through a Python package called `anki`, located in [pylib/anki](https://github.com/ankitects/anki/tree/main/pylib/anki) in Anki's source repo. ## The Collection All operations on a collection file are accessed via a `Collection` object. The currently-open Collection is accessible via a global `mw.col`, where `mw` stands for `main window`. When using the `anki` module outside of Anki, you will need to create your own Collection object. Some basic examples of what you can do follow. Please note that you should put these in something like [testFunction()](./a-basic-addon). You can’t run them directly in an add-on, as add-ons are initialized during Anki startup, before any collection or profile has been loaded. Also please note that accessing the collection directly can lead to the UI temporarily freezing if the operation doesn't complete quickly - in practice you would typically run the code below in a background thread. **Get a due card:** ```python theme={null} card = mw.col.sched.getCard() if not card: # current deck is finished ``` **Answer the card:** ```python theme={null} mw.col.sched.answerCard(card, ease) ``` **Edit a note (append " new" to the end of each field):** ```python theme={null} note = card.note() for (name, value) in note.items(): note[name] = value + " new" mw.col.update_note(note) ``` **Get card IDs for notes with tag x:** ```python theme={null} ids = mw.col.find_cards("tag:x") ``` **Get question and answer for each of those ids:** ```python theme={null} for id in ids: card = mw.col.get_card(id) question = card.question() answer = card.answer() ``` **Make reviews due tomorrow** ```python theme={null} ids = mw.col.find_cards("is:due") mw.col.sched.set_due_date(ids, "1") ``` **Import a text file into the collection** Requires Anki 2.1.55+. ```python theme={null} from anki.collection import ImportCsvRequest from aqt import mw col = mw.col path = "/home/dae/foo.csv" metadata = col.get_csv_metadata(path=path, delimiter=None) request = ImportCsvRequest(path=path, metadata=metadata) response = col.import_csv(request) print(response.log.found_notes, list(response.log.updated), list(response.log.new)) ``` **Import an .apkg file** Requires Anki 23.10+. ```python theme={null} from anki.collection import ImportAnkiPackageRequest, ImportAnkiPackageOptions from aqt import mw col = mw.col col.import_anki_package( ImportAnkiPackageRequest( package_path="/path/to/deck.apkg", options=ImportAnkiPackageOptions( merge_notetypes=True, with_scheduling=False, with_deck_configs=True, ), ) ) ``` Options can be adjusted as needed. **Export an .apkg file** Requires Anki 23.12+. ```python theme={null} from anki.collection import ExportAnkiPackageOptions, DeckIdLimit from aqt import mw col = mw.col col.export_anki_package( out_path="/path/to/deck.apkg", options=ExportAnkiPackageOptions( with_scheduling=False, with_deck_configs=False, with_media=True, legacy=False, ), limit=DeckIdLimit(deck_id=col.decks.id("My Deck")), ) ``` Options can be adjusted as needed. Pass `limit=None` to export the whole collection. Other limit types are `NoteIdsLimit` and `CardIdsLimit`. Almost every GUI operation has an associated function in anki, so any of the operations that Anki makes available can also be called in an add-on. ## Reading/Writing Objects Most objects in Anki can be read and written via methods in pylib. ```python theme={null} card = col.get_card(card_id) card.ivl += 1 col.update_card(card) ``` ```python theme={null} note = col.get_note(note_id) note["Front"] += " hello" col.update_note(note) ``` ```python theme={null} deck = col.decks.get(deck_id) deck["name"] += " hello" col.decks.save(deck) deck = col.decks.by_name("Default hello") ... ``` ```python theme={null} config = col.decks.get_config(config_id) config["new"]["perDay"] = 20 col.decks.save(config) ``` ```python theme={null} notetype = col.models.get(notetype_id) notetype["css"] += "\nbody { background: grey; }\n" col.models.save(note) notetype = col.models.by_name("Basic") ... ``` You should prefer these methods over directly accessing the database, as they take care of marking items as requiring a sync, and they prevent some forms of invalid data from being written to the database. For locating specific cards and notes, col.find\_cards() and col.find\_notes() are useful. ## The Database :warning: You can easily cause problems by writing directly to the database. Where possible, please use methods such as the ones mentioned above instead. Anki’s DB object supports the following functions: **scalar() returns a single item:** ```python theme={null} showInfo("card count: %d" % mw.col.db.scalar("select count() from cards")) ``` **list() returns a list of the first column in each row, e.g.\[1, 2, 3]:** ```python theme={null} ids = mw.col.db.list("select id from cards limit 3") ``` **all() returns a list of rows, where each row is a list:** ```python theme={null} ids_and_ivl = mw.col.db.all("select id, ivl from cards") ``` **execute() can also be used to iterate over a result set without building an intermediate list. eg:** ```python theme={null} for id, ivl in mw.col.db.execute("select id, ivl from cards limit 3"): showInfo("card id %d has ivl %d" % (id, ivl)) ``` **execute() allows you to perform an insert or update operation. Use named arguments with ?. eg:** ```python theme={null} mw.col.db.execute("update cards set ivl = ? where id = ?", newIvl, cardId) ``` Note that these changes won't sync, as they would if you used the functions mentioned in the previous section. **executemany() allows you to perform bulk update or insert operations. For large updates, this is much faster than calling execute() for each data point. eg:** ```python theme={null} data = [[newIvl1, cardId1], [newIvl2, cardId2]] mw.col.db.executemany(same_sql_as_above, data) ``` As above, these changes won't sync. Add-ons should never modify the schema of existing tables, as that may break future versions of Anki. If you need to store addon-specific data, consider using Anki’s [Configuration](./addon-config#config-json) support. If you need the data to sync across devices, small options can be stored within mw\.col.conf. Please don’t store large amounts of data there, as it’s currently sent on every sync. # Python API Source: https://docs.ankiweb.net/developers/api-python Find the documentation for the python API here: * [https://dev-docs.ankiweb.net/en/latest/api-python.html](https://dev-docs.ankiweb.net/en/latest/api-python.html) # Rust API Source: https://docs.ankiweb.net/developers/api-rust Anki's Rust API documentation is generated from doc comments in the `rslib/` crates using `cargo doc`. To browse the docs locally: ``` cargo doc --open ``` The main crates are: * **anki** (`rslib/`) - Core library * **anki\_io** (`rslib/io/`) - I/O utilities # Anki Architecture Source: https://docs.ankiweb.net/developers/architecture Very brief notes for now. ## Backend/GUI At the highest level, Anki is logically separated into two parts. A neat visualization of the file layout is available here: [https://mango-dune-07a8b7110.1.azurestaticapps.net/?repo=ankitects%2Fanki](https://mango-dune-07a8b7110.1.azurestaticapps.net/?repo=ankitects%2Fanki) (or go to [https://githubnext.com/projects/repo-visualization#explore-for-yourself](https://githubnext.com/projects/repo-visualization#explore-for-yourself) and enter `ankitects/anki`). ### Library (rslib & pylib) The Python library (pylib) exports "backend" methods - opening collections, fetching and answering cards, and so on. It is used by Anki’s GUI, and can also be included in command line programs to access Anki decks without the GUI. The library is accessible in Python with "import anki". Its code lives in the `pylib/anki/` folder. These days, the majority of backend logic lives in a Rust library (rslib, located in `rslib/`). Calls to pylib proxy requests to rslib, and return the results. pylib contains a private Python module called rsbridge (`pylib/rsbridge/`) that wraps the Rust code, making it accessible in Python. ### GUI (aqt & ts) Anki's *GUI* is a mix of Qt (via the PyQt Python bindings for Qt), and TypeScript/HTML/CSS. The Qt code lives in `qt/aqt/`, and is importable in Python with "import aqt". The web code is split between `qt/aqt/data/web/` and `ts/`, with the majority of new code being placed in the latter, and copied into the former at build time. ## Protobuf Anki uses Protocol Buffers to define backend methods, and the storage format of some items in a collection file. The definitions live in `proto/anki/`. The Python/Rust bridge uses them to pass data back and forth, and some of the TypeScript code also makes use of them, allowing data to be communicated in a type-safe manner between the different languages. At the moment, the protobuf is not considered public API. Some pylib methods expose a protobuf object directly to callers, but when they do so, they use a type alias, so callers outside pylib should never need to import a generated \_pb2.py file. # The build system Source: https://docs.ankiweb.net/developers/build ## Basic use Basic use is described in [development.md](/developers/development). ## Architecture The build/ folder is made up of 4 packages: * build/configure defines the actions and inputs/outputs of the build graph - this is where you add new build steps or modify existing ones. The defined actions are converted at build time to a build.ninja file that Ninja executes. * build/ninja\_gen is a library for writing a build.ninja file, and includes various rules like "build a Rust crate" or "run a command". * build/archives is a helper to download/checksum/extract a dependency as part of the build process. * build/runner serves a number of purposes: * it's the entrypoint to the build process, taking care of generating the build file and then invoking Ninja * it wraps executable invocations in the build file, swallowing their output if they exit successfully * it provides a few helpers for multi-step processes that can't be easily described in a cross-platform manner thanks to differences on Windows. ## Tracing build problems If you run into trouble with the build process: * You can see the executed commands with e.g. `./ninja pylib -v` * You can see the output of successful commands by defining N2\_OUTPUT\_SUCCESS=1 * You can see what's triggering a rebuild of a target with e.g. `./ninja qt/anki -d explain`. * You can browse the build graph via e.g. `./ninja -- -t browse wheels` * You can profile build performance with [https://discourse.cmake.org/t/profiling-build-performance/2443/3](https://discourse.cmake.org/t/profiling-build-performance/2443/3). ## Packaging considerations See [this page](/developers/linux). # Contributing Code Source: https://docs.ankiweb.net/developers/contributing For info on contributing things other than code, such as translations, decks and add-ons, please see [the contribution guide](/manual/contrib). ## Help wanted If you'd like to contribute but don't know what to work on, please take a look at the [issues tab](https://github.com/ankitects/anki/issues) of the Anki repo on GitHub. ## Larger changes Before starting work on larger changes, especially ones that aren't listed on the issue tracker, please reach out on the forums before you begin work, so we can let you know whether they're likely to be accepted or not. When you spent a bunch of time on a PR that ends up getting rejected, it's no fun for either you or us. ## Consider an Add-on First Before submitting a PR for a new feature, please consider whether it could be implemented as an add-on instead. We aim to keep the core Anki codebase lean and maintainable. Many great ideas are better served as add-ons, where they can iterate faster and serve specific user needs without affecting all users. See the [Add-on API documentation](https://addon-docs.ankiweb.net/) for guidance on building add-ons. ## Pull Request Description When opening a pull request, fill in the provided template (`.github/pull_request_template.md`). It covers the required fields: linked issue, summary/motivation, how to test, and UI evidence for visual changes. ## Linked Issues Every pull request, except hotfixes and dependency updates, must be linked to an existing open issue. If no issue exists, please open one to describe the problem before submitting a PR. This helps us ensure we're solving the right problems and prevents wasted effort on both sides. PRs without a linked issue may be automatically closed after a short period. ## Dependency updates Dependabot PRs do not need a linked issue. Maintainers should follow [Dependabot updates](/developers/dependabot) when reviewing or landing them. ## Refactoring Please avoid PRs that focus on refactoring. Every PR has a cost to review, and a chance of introducing accidental regressions, and often these costs are not worth it for slightly more elegant code. That's not to say there's no value in refactoring. But such changes are usually better done in a PR that happens to be working in the same area - for example, making small changes to the code as part of fixing a bug, or a larger refactor when introducing a new feature. ## Type hints Most of Anki's Python code now has type hints, which improve code completion, and make it easier to discover errors during development. When adding new code, please make sure you add type hints as well, or the tests will fail. Qt's stubs are not perfect, so you may sometimes need to use cast(), or silence a type error. When connecting signals, there's a qconnect() helper in aqt.utils that can be used to work around the type warnings without obscuring other errors such as a mistyped variable. In cases where you have two modules that reference each other, you can fix the import cycle by using fully qualified names in the types, and enabling annotations. For example, instead of ``` from aqt.browser import Browser def myfunc(b: Browser) -> None: pass ``` use the following instead: ``` from __future__ import annotations import aqt def myfunc(b: aqt.browser.Browser) -> None: pass ``` ## Hooks If you're writing an add-on and would like to extend a function that doesn't currently have a hook, a pull request that adds the required hooks would be welcome. If you could mention your use case in the pull request, that would be appreciated. The hooks try to follow one of two formats: \[subject] \[verb] - eg, note\_type\_added, card\_will\_render \[module] \[verb] \[subject] - eg, browser\_did\_change\_row, editor\_did\_update\_tags The qt code tends to use the second form, as the hooks tend to focus on particular screens. The pylib code tends to use the first form, as the focus is usually subjects like cards, notes, etc. Using "did change" instead of the past tense "changed" can seem awkward, but makes it consistent with "will", and is similar to the naming style used in iOS's libraries. In most cases, hooks are better added in the GUI code than in pylib. The hook code is automatically generated using the definitions in pylib/tools/genhooks.py and qt/tools/genhooks\_gui.py. Adding a new definition in one of those files will update the generated files. If you want to change an existing hook to, for example, receive an additional argument, you must leave the existing hook unchanged to preserve backwards compatibility. Create a new definition for your hook with a similar name and include the properties `replaces="name_of_old_hook"` and `replaced_hook_args=["..."]` in the definition of the new hook. If the old hook has a legacy hook, you must not add the legacy hook to the definition of the new hook. ## Translations For information on adding new translatable strings to Anki, please see [the translation guide](/translators/anki/developers). For information on translating the documentation, please see [translating the manual](/translators/anki/manual). ## Tests Must Pass Please make sure 'ninja check' completes successfully before submitting code. [pre-commit](https://pre-commit.com/) is used to run that check from a Git hook. It is configured in `.pre-commit-config.yaml` at the repository root. After installing the dev dependencies (for example `uv sync --group dev`), run one of: ``` uv run pre-commit install --hook-type pre-push ``` ``` python3 -m pre_commit install --hook-type pre-push ``` (`pre-commit` alone only works if that executable is on your `PATH`, for example after `pip install --user pre-commit` or with your virtual environment activated.) The bundled hook runs `./ninja check` on **pre-push** (not on every commit), because the full check suite can take a long time. You can still run `./ninja check` manually at any time. You may need to ensure your usual shell `PATH` is visible to the hook (for example if tools such as `ninja` are installed outside standard locations), because pre-commit does not use a login shell and a different path can cause extra rebuilds. New or changed behavior must be covered by tests. Exceptions where tests are not required: version bumps, documentation-only changes, translation updates, dependency updates, and CI/build housekeeping (chore). ## Code Style Please use standard Python snake\_case variable names and functions in newly introduced code. Because add-ons often rely on existing function names, if renaming an existing function, please add a legacy alias to the old function. ## Do One Thing A patch or pull request should be the minimum necessary to address one issue. Please don't make a pull request for a bunch of unrelated changes, as they are difficult to review and will be rejected - split them up into separate requests instead. ## AI-Assisted Contributions Using AI tools to help write or review code is permitted. However, you must understand every change you submit. If you cannot explain what your changes do and how they interact with the rest of the system, your PR will be closed. Please review AI-generated code carefully before submitting. PRs that appear to have been submitted without human review — e.g., irrelevant code, duplicate logic, or comments that don't match the implementation — may be closed without further discussion. ## License Please add yourself to the [CONTRIBUTORS](https://github.com/ankitects/anki/blob/main/CONTRIBUTORS) file in your first pull request. # Dependabot updates Source: https://docs.ankiweb.net/developers/dependabot Config lives in [`.github/dependabot.yml`](https://github.com/ankitects/anki/blob/main/.github/dependabot.yml). This page is for maintainers: how PRs are grouped, which ones to merge, and how to clear Rust advisories that Dependabot cannot fix on its own. ## Goals Version updates were accumulating faster than anyone reviewed them. Our solution is to fix grouping and slow the schedule, not turn updates off. Security updates stay **individual**. Each advisory needs its own review (false positives are common, so we need to know which CVE actually matters). GitHub also does not apply `open-pull-requests-limit` to security PRs. ## What gets opened Four ecosystems: Cargo, npm (Yarn), Python (`uv`), GitHub Actions. | Kind | When | Shape | What to do | | - | - | - | - | | Security | As soon as GitHub publishes an advisory. Ignores the schedule. | One PR per advisory | Review and land promptly, or close if it does not apply | | Minor / patch | Quarterly | One grouped PR per ecosystem (`*-minor-patch`) | Merge if CI is green | | Major | Quarterly, after a 30-day cooldown | One grouped PR per ecosystem (`*-major`) | **Do not merge.** Treat as a notification. If a bump is wanted, open a human PR for that package | | GitHub Actions | Quarterly | One grouped PR (`actions`) | Merge if CI is green | `open-pull-requests-limit` is 2 for Cargo / npm / Python (one slot for minor/patch, one for major) and 1 for Actions. That limit applies only to **version** updates. Security PRs are unlimited. Cooldown is 7 days for ordinary version bumps (a short supply-chain window) and 30 days for majors (`semver-major-days`). Security updates skip cooldown. Dependabot PRs are exempt from the linked-issue requirement. ## Reviewing a PR 1. Read the title / group name and put it in the table above; 2. CI must be green. Dependency PRs do not need new tests, but `format`, `cargo deny`, and the existing suites still run; 3. **npm:** if CI fails with `YN0028` / `yarn install --immutable`, Dependabot updated `package.json` and left `yarn.lock` stale. Check out the branch, run Yarn so the lockfile matches, and push; 4. Close older individual version PRs that a newer grouped PR already covers. Dependabot often does this itself when it opens a replacement. ### Security PRs Land these first. Confirm the advisory actually affects this repo: Dependabot matches on version, not on whether we call the vulnerable API. If the bump is a major, or CI fails, do not force the Dependabot PR through. Open a normal PR with whatever code or lockfile changes are required. If we cannot bump yet, say so in the PR and follow the Rust ignore path below when `cargo-deny` is the failing check. ### Minor / patch grouped PRs Low risk. Merge when CI is green. If one crate in the group breaks the build, do not merge the bundle, we should split or skip that crate. ### Major grouped PRs Majors often need code changes. The grouped PR exists so we are not flooded with one PR per package. *It is not meant to be merged as-is*. Pick the package we actually want, open a dedicated PR, and leave the rest. ### GitHub Actions Actions are pinned by SHA. Dependabot **security alerts are not generated for SHA-pinned actions** but Dependabot still opens the quarterly grouped version PR and bumps those SHAs to the latest release. So there is no immediate security PR for a vulnerable action. That is an accepted trade-off: SHA pins stop tag-rewrite supply-chain attacks, at the cost of losing action alerts. ## Rust advisories (`cargo-deny`) CI runs `cargo deny check` on pushes and on PRs that touch `Cargo.lock`, `Cargo.toml`, or `.deny.toml`. Failures often look like Dependabot work but are not something Dependabot can finish, especially when the crate sits behind a git dependency. Worked example: [RUSTSEC-2026-0258](https://github.com/ankitects/anki/issues/5364) needed a `reqwest` bump inside the [ankitects/linkcheck](https://github.com/ankitects/linkcheck) fork, not a one-line change in this repo. 1. Open the `RUSTSEC-…` advisory and note the crate and patched versions. 2. See whether Dependabot already opened a security PR that bumps a crate we depend on directly. If CI is green, merge it. 3. If the crate is **transitive through a git dep** (`linkcheck`, `percent-encoding-iri`, …): * Land the bump in the fork. * Point `Cargo.toml` at the new `rev`. * Run `cargo update -p ` (and any other crates the advisory names) so `Cargo.lock` moves. 4. Run `cargo deny check` locally before pushing. 5. Only if a bump is not feasible, add the id to `.deny.toml` `[advisories] ignore` with a comment stating why and what the alternative is. Existing ignores follow that pattern. Do not silence an advisory without a comment. Dependabot cannot update git `rev` pins. Those bumps are always manual. ## Changing the config * Do not group security updates; * Do not put majors in the minor/patch group; * `open-pull-requests-limit` cannot cap security PRs; * Cooldown keys are `default-days` and `semver-major-days`. # Anki development Source: https://docs.ankiweb.net/developers/development ## Packaged betas For non-developers who want to try beta versions, the easiest way is to use a packaged version - please see: [https://betas.ankiweb.net/](https://betas.ankiweb.net/) ## Pre-built Python wheels Pre-built Python packages are available on PyPI. They are useful if you wish to: * Run Anki from a local Python installation without building it yourself * Get code completion when developing add-ons * Make command line scripts that modify .anki2 files via Anki's Python libraries You will need the 64 bit version of Python 3.10 or later installed. You can install Python from python.org or from your distro. For further instructions, please see [https://betas.ankiweb.net/#via-pypipip](https://betas.ankiweb.net/#via-pypipip). Note that in the provided commands, `--pre` tells pip to fetch alpha/beta versions. If you remove `--pre`, it will download the latest stable version instead. ## Building from source Clone the git repo into a folder of your choosing. The folder path must not contain spaces, and should not be too long if you are on Windows. On all platforms, you will need to install: * Rustup ([https://rustup.rs/](https://rustup.rs/)). The Rust version pinned in rust-toolchain.toml will be automatically downloaded if not yet installed. If removing that file to use a distro-provided Rust, newer Rust versions will typically work for building but may fail tests; older Rust versions may not work at all. * N2 or Ninja. N2 gives better status output. You can install it with `tools/install-n2`, or `bash tools\install-n2` on Windows. If you want to use Ninja, it can be downloaded from [https://github.com/ninja-build/ninja/releases/tag/v1.11.1](https://github.com/ninja-build/ninja/releases/tag/v1.11.1) and placed on your path, or from your distro/homebrew if it's 1.10+. * On Windows, if you have WSL installed, it may conflict with MSYS2 bash. If you are getting an error, try running `C:\msys64\usr\bin\bash.exe tools/install-n2` instead. * (Optional) [just](https://just.systems/man/en/packages.html) command runner. Install with `brew install just` or `uv tool install rust-just`. We are experimenting with `just` as the official tool for running Anki-specific commands, and it will likely become the source of truth in the future. Platform-specific requirements: * [Windows](/developers/windows) * [Mac](/developers/mac) * [Linux](/developers/linux) ## Running Anki during development From the top level of Anki's source folder: ``` ./run ``` (`.\run` on Windows) This will build Anki and run it in place. The first build will take a while, as it downloads and builds a bunch of dependencies. When the build is complete, Anki will automatically start. If Anki fails to start, you may need to install [extra libraries](/manual/platform/linux/missing-libraries). ## Running tests/checks To run all tests at once, from the top-level folder: ``` ./ninja check ``` (`tools\ninja check` on Windows). You can also run specific checks. For example, if you see during the checks that `check:svelte:editor` is failing, you can use `./ninja check:svelte:editor` to re-run that check, or `./ninja check:svelte` to re-run all Svelte checks. ## Fixing formatting When formatting issues are reported, they can be fixed with ``` ./ninja format ``` ## Fixing ruff/eslint/copyright header issues ``` ./ninja fix ``` ## Fixing clippy issues ``` cargo clippy --fix ``` ## Excluding your own untracked files from formatting and checks If you want to add files or folders to the project tree that should be excluded from version tracking and not be matched by formatters and checks, place them in an `extra` folder and they will automatically be ignored. ## Optimized builds The `./run` command will create a non-optimized build by default. This is faster to compile, but will mean Anki will run slower. To run Anki in optimized mode, use: ``` ./tools/runopt ``` Or set RELEASE=1 or RELEASE=2. The latter will further optimize the output, but make the build much slower. ## Building redistributable wheels The `./run` method described in the platform-specific instructions is a shortcut for starting Anki directly from the build folder. For regular study, it's recommended you build Python wheels and then install them into your own python venv. This is also a good idea if you wish to install extra tools from PyPi that Anki's build process does not use. To build wheels on Mac/Linux: ``` ./tools/build ``` (on Windows, `.\tools\build.bat`) The generated wheels are in out/wheels. You can then install them by copying the paths into a pip install command. Follow the steps [on the beta site](https://betas.ankiweb.net/#via-pypipip), but replace the `pip install --upgrade --pre aqt` line with something like: ``` /my/pyenv/bin/pip install --upgrade out/wheels/*.whl ``` (On Windows you'll need to list out the filenames manually instead of using a wildcard). ## Cleaning up build files Apart from submodule checkouts, most build files go into the `out/` folder (and `node_modules` on Windows). You can delete that folder for a clean build, or to free space. Cargo, yarn and pip all cache downloads of dependencies in a shared cache that other builds on your system may use as well. If you wish to clear up those caches, they can be found in `~/.rustup`, `~/.cargo` and `~/.cache/{yarn,pip}`. On Windows, Yarn cache can be found in `%LOCALAPPDATA%\Yarn`. If you invoke Rust outside of the build scripts (eg by running cargo, or with Rust Analyzer), output files will go into `target/` unless you have overridden the default output location. ## Storage and Performance Most editors use rust-analyzer for Rust support, which runs `cargo check` in the background whenever you save a file, so that problems are surfaced before you try to build. This is useful, but on lower-end machines, it can noticeably increase disk usage and CPU load. If that's a problem for you, consider disabling "check on save" (e.g. set `rust-analyzer.checkOnSave` to `false` in VS Code) as a trade-off — you'll lose real-time error checking, but rust-analyzer can still be used for code completion, go-to-definition, etc. If you chose to disable "check on save" and don't run `cargo` commands manually, you may delete the `target/` folder (if any) as that's no longer used. ## IDEs Please see [this separate page](/developers/editing) for setting up an editor/IDE. ## Making changes to the build See [this page](/developers/build) ## Generating documentation Build and view the documentation site: ``` just docs ``` For Rust API docs: ``` just docs-rust ``` ## Environmental Variables If ANKIDEV is set before starting Anki, some extra log messages will be printed on stdout, and automatic backups will be disabled - so please don't use this except on a test profile. It is automatically enabled when using ./run. If TRACESQL is set, all SQL statements will be printed as they are executed. If LOGTERM is set before starting Anki, warnings and error messages that are normally placed in the collection2.log file will also be printed on stdout. If ANKI\_PROFILE\_CODE is set, Python profiling data will be written on exit. ## Installer Run `tools/build-installer` to build the installer. Depending on your operating system, this produces a file under `out/installer/dist`: * An MSI installer on Windows. * A .dmg file on macOS. * A tarball on Linux. ### Issues During Building If you are experiencing issues building the installer, make sure that all dependencies are installed. See [Building from source](./#building-from-source) for more info. ## Releasing See [Releasing](/developers/releasing). # Mixing development and study You may wish to create a separate profile with File>Switch Profile for use during development. You can pass the arguments "-p \[profile name]" when starting Anki to load a specific profile. If you're using PyCharm: * right click on the "run" file in the root of the PyCharm Anki folder * click "Edit 'run'..." - in Script options and enter: "-p \[dev profile name]" without the quotes * click "Ok" # Building and running Anki in Docker Source: https://docs.ankiweb.net/developers/docker This is an example Dockerfile contributed by an Anki user, which shows how Anki can be both built and run from within a container. It works by streaming the GUI over an X11 socket. Building and running Anki within a container has the advantage of fully isolating the build products and runtime dependencies from the rest of your system, but it is a somewhat niche approach, with some downsides such as an inability to display natively on Wayland, and a lack of integration with desktop icons/filetypes. But even if you do not use this Dockerfile as-is, you may find it useful as a reference. Anki's Linux CI runs on GitHub Actions. You can use, as references, the [`setup-anki`](https://github.com/ankitects/anki/blob/main/.github/actions/setup-anki/action.yml) to see the lists of packages CI installs, and [`ci.yml`](https://github.com/ankitects/anki/blob/main/.github/workflows/ci.yml) to see the build steps that follow. # Build the Docker image For best results, enable BuildKit (`export DOCKER_BUILDKIT=1`). When in this current directory, one can build the Docker image like this: ```bash theme={null} docker build --tag anki --file Dockerfile ../../ ``` When this is done, run `docker image ls` to see that the image has been created. If one wants to build from the project's root directory, use this command: ```bash theme={null} docker build --tag anki --file docs/docker/Dockerfile . ``` # Run the Docker image Anki starts a graphical user interface, and this requires some extra setup on the user's end. These instructions were tested on Linux (Debian 11) and will have to be adapted for other operating systems. To allow the Docker container to pull up a graphical user interface, we need to run the following: ```bash theme={null} xhost +local:root ``` Once done using Anki, undo this with ```bash theme={null} xhost -local:root ``` Then, we will construct our `docker run` command: ```bash theme={null} docker run --rm -it \ --name anki \ --volume $HOME/.local/share:$HOME/.local/share:rw \ --volume /etc/passwd:/etc/passwd:ro \ --user $(id -u):$(id -g) \ --volume /tmp/.X11-unix:/tmp/.X11-unix:rw \ --env DISPLAY=$DISPLAY \ anki ``` Here is a breakdown of some of the arguments: * Mount the current user's `~/.local/share` directory onto the container. Anki saves things into this directory, and if we don't mount it, we will lose any changes once the container exits. We mount this as read-write (`rw`) because we want to make changes here. ```bash theme={null} --volume $HOME/.local/share:$HOME/.local/share:rw ``` * Mount `/etc/passwd` so we can enter the container as ourselves. We mount this as read-only because we definitely do not want to modify this. ```bash theme={null} --volume /etc/passwd:/etc/passwd:ro ``` * Enter the container with our user ID and group ID, so we stay as ourselves. ```bash theme={null} --user $(id -u):$(id -g) ``` * Mount the X11 directory that allows us to open displays. ```bash theme={null} --volume /tmp/.X11-unix:/tmp/.X11-unix:rw ``` * Pass the `DISPLAY` variable to the container, so it knows where to display graphics. ```bash theme={null} --env DISPLAY=$DISPLAY ``` # Running Dockerized Anki easily from the command line One can create a shell function that executes the `docker run` command. Then one can simply run `anki` on the command line, and Anki will open in Docker. Make sure to change the image name to whatever you used when building Anki. ```bash theme={null} anki() { docker run --rm -it \ --name anki \ --volume $HOME/.local/share:$HOME/.local/share:rw \ --volume /etc/passwd:/etc/passwd:ro \ --user $(id -u):$(id -g) \ --volume /tmp/.X11-unix:/tmp/.X11-unix:rw \ --env DISPLAY=$DISPLAY \ anki "$@" } ``` # End-to-End Testing with Playwright Source: https://docs.ankiweb.net/developers/e2e-testing Playwright drives a real headless Anki instance via its mediasrv HTTP API. Tests live in `ts/tests/e2e/` and are entirely separate from the Vitest unit tests. ## Prerequisites Build Anki at least once before running e2e tests: ```shell theme={null} just build ``` That's it. `just test-e2e` automatically installs Playwright's Chromium browser into `out/playwright-browsers/` on the first run (idempotent on subsequent runs). ## Running tests ### Managed mode (CI-style) Playwright starts and stops a throwaway Anki instance automatically: ```shell theme={null} just test-e2e ``` The first run can be slow (\~60 s) because Anki must fully initialise before tests start. ### Reuse-server mode (recommended for development) Start Anki once in a separate terminal, then reuse it across multiple test runs: ```shell theme={null} # Terminal 1 — keep running ./run # Terminal 2 — fast iteration ANKI_E2E_REUSE_SERVER=1 just test-e2e ``` ### Interactive UI mode Open Playwright's browser UI to inspect each test step with snapshots: ```shell theme={null} ANKI_E2E_REUSE_SERVER=1 just test-e2e --ui ``` ## Writing tests Add test files to `ts/tests/e2e/` with the `.test.ts` suffix and import from `./fixtures` instead of directly from `@playwright/test`: ```typescript theme={null} import { expect, test } from "./fixtures"; test("my feature works", async ({ page }) => { await page.goto("/some-anki-page"); await expect(page.locator("#some-element")).toBeVisible(); }); ``` `fixtures.ts` re-exports `expect` and a pre-configured `test` object. Add shared fixtures there as new features require them. ## Calling the Anki API from tests Anki's `/_anki/` endpoints accept and return protobuf-encoded binary payloads (`Content-Type: application/binary`). Use `page.request.post` with `Buffer.from(protoMsg.toBinary())` and decode the response with the matching generated type from `ts/lib/generated/`. ## Accessing Anki pages Anki's mediasrv serves the following pages over HTTP (non-exhaustive): | URL pattern | Description | | - | - | | `/graphs` | Statistics graphs (SvelteKit) | | `/deck-options/[deckId]` | Deck options (SvelteKit) | | `/congrats` | Post-study screen (SvelteKit) | | `/card-info/[cardId]` | Card info (SvelteKit) | | `/editor/?mode=[mode]` | Editor (SvelteKit) | | `/congrats` | Congrats page (SvelteKit) | | `/favicon.ico` | Mediasrv liveness probe | ## CI The e2e tests run as part of the `check-linux` job in `.github/workflows/ci.yml`, after the regular build and test steps. Screenshots and traces from failed runs are uploaded as artifacts and kept for 7 days. ## See also * [Writing Unit Tests for Anki](/developers/unit-testing) # Editing/IDEs Source: https://docs.ankiweb.net/developers/editing Visual Studio Code is recommended, since it provides decent support for all the languages Anki uses. To set up the recommended workspace settings for VS Code, please see below. For editing Python, PyCharm/IntelliJ's type checking/completion is a bit nicer than VS Code, but VS Code has improved considerably in a short span of time. There are a few steps you'll want to take before you start using an IDE. ## Initial Setup ### Python Environment For code completion of external Python modules, you can use the venv that is generated as part of the build process. After building Anki, the venv will be in `out/pyenv`. In VS Code, use ctrl/cmd+shift+p, then 'python: select interpreter'. ### Rust You'll need Rust to be installed, which is required as part of the build process. ### Build First Code completion partly depends on files that are generated as part of the regular build process, so for things to work correctly, use './run' or 'tools/build' prior to using code completion. ## Visual Studio Code ### Setting up Recommended Workspace Settings To start off with some default workspace settings that are optimized for Anki development, please head to the project root and then run: ``` mkdir .vscode && cd .vscode ln -sf ../.vscode.dist/* . ``` ### Installing Recommended Extensions Once the workspace settings are set up, open the root of the repo in VS Code to see and install a number of recommended extensions. ## PyCharm/IntelliJ ### Setting up Python environment To make PyCharm recognize `anki` and `aqt` imports, you need to add source paths to *Settings > Project Structure*. You can copy the provided .idea.dist directory to set up the paths automatically: ``` mkdir .idea && cd .idea ln -sf ../.idea.dist/* . ``` You also need to add a new Python interpreter under *Settings > Python > Interpreter* pointing to the Python executable under `out/pyenv` (available after building Anki). # Language Bridge Source: https://docs.ankiweb.net/developers/language_bridge Anki's codebase uses three layers. 1. The web frontend, created in Svelte and typescript, 2. The Python layer and 3. The core Rust layer. Each layer can can makes RPC (Remote Procedure Call) to the layers below it. While it should be avoided, Python can also invoke Typescript functions. The Rust layers never make calls to the other layers. Note that it can make RPC to AnkiWeb and other servers, which is out of scope of this document. In this document we'll provide examples of bridge between languages, explaining: * where the RPC is declared, * where it is called (with the appropriate imports) and * where it is implemented. Imitating those examples should allow you to make call and create new RPCs. ## Declaring RPCs Let's consider the method `NewDeck` of `DecksServices`. It's declared in [decks.proto](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/proto/anki/decks.proto#L14) as `rpc NewDeck(generic.Empty) returns (Deck);`. This means this methods takes no argument (technically, an argument containing no information), and returns a [`Deck`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/proto/anki/decks.proto#L54). Read [protobuf](/developers/protobuf) to learn more about how those input and output types are defined. If the RPC implementation is in Python, it should be declared in the service [frontend.proto](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/proto/anki/frontend.proto#L24C3-L24C66)'s `FrontendService`. RPCs declared in any other services are implemented in Rust. ## Making a Remote Procedure Call In this section we'll consider how to make Remote Procedure Call (RPC) from languages used in Anki. Languages used for AnkiDroid and AnkiMobile are out of scope of this document. ### Making a RPC from Python Python can invoke the `NewDeck` method with [`col._backend.new_deck()`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/pylib/anki/decks.py#L168). This python method takes no argument and returns a `Deck` value. However, most Python code should not call this method directly. Instead it should call [`col.decks.new_deck()`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/pylib/anki/decks.py#L166). Generally speaking, all back-end functions called from Python should be called through a helper method defined in `pylib/anki/`. The `_backend` part is an implementation detail that most callers should ignore. This is especially important because add-ons should expect a relatively stable API independent of the implementation details of the RPC. ### Invoking method from TypeScript Let's consider the method [`rpc GetCsvMetadata(CsvMetadataRequest) returns (CsvMetadata);`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/proto/anki/import_export.proto#L20) from `ImportExportService`.. It's used in the TypeScript class [`ImportCsvState`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/ts/routes/import-csv/lib.ts#L102), as an asynchronous function. It's argument is a single javascript object, whose keys are as in [`CsvMetadataRequest`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/proto/anki/import_export.proto#L138) and it returns a `CsvMetadata`. The method was imported with `import { getCsvMetadata } from "@generated/backend";` and the types were imported with `import type { CsvMetadata } from "@generated/anki/import_export_pb";`. Note that it was not necessary to import the input type given that it's simply an untyped javascript object. ## Implementation Let's now look at implementations of those RPCs. ### Implementation in Rust The method NewDeck is implemented in Rust's [DecksService](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/rslib/src/decks/service.rs#L21) as `fn new_deck(&mut self) -> error::Result`. It should be noted that the method name was changed from Pascal case to snake case, and the rps's argument of type `generic.Empty` is ignored. ### Implementation in Python Let's consider the implementation of the method [DeckOptionsRequireClose](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/qt/aqt/mediasrv.py#L578). It's defined as `def deck_options_require_close() -> bytes:`. In this case, there should be a returned value. However, it'll be ignored, so returning `b""` is perfectly fine. Note that the incoming HTTP request is not processed on the main thread. In order to do any work with the GUI, we should call `aqt.mw.taskman.run_on_main`. ## Invoking a TypeScript method from Python This case should be avoided if possible, as we generally should avoid calls to the upper layer. Contrary to the previous cases, we don't use protobuf. ### Calling a TS function. Let's take as Example [`export function getTypedAnswer(): string | null`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/ts/reviewer/index.ts#L35). It's an exported function, and its return type can be encoded in JSON. It's called in the Reviewer class through [`self.web.evalWithCallback("getTypedAnswer();", self._onTypedAnswer)`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/qt/aqt/reviewer.py#L785). The result is then sent to [`_onTypedAnswer`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/qt/aqt/reviewer.py#L787). If no return value is needed, `web.eval` would have been sufficient. ### Calling a Svelte method Let's now consider the case where the method we want to call is implemented in a Svelte library. Let's take as example [`deckOptionsPendingChanges`](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/ts/routes/deck-options/%5BdeckId%5D/%2Bpage.svelte#L17). We define it with: ```js theme={null} globalThis.anki || = {}; globalThis.anki.methodName = async (): Promise=>{body} ``` Note that if the function is asynchronous, you can't directly send the result to a callback. Instead your function will have to call a post method that will be sent to Python or Rust. This method is called in [deckoptions.py](https://github.com/ankitects/anki/blob/acaeee91fa853e4a7a78dcddbb832d009ec3529a/qt/aqt/deckoptions.py#L68) with `self.web.eval("anki.deckOptionsPendingChanges();"`. # Linux-specific notes Source: https://docs.ankiweb.net/developers/linux ## Requirements These instructions are written for Debian/Ubuntu; adjust for your distribution. Some extra notes have been provided by a forum member, though some of the things mentioned there no longer apply: [https://forums.ankiweb.net/t/guide-how-to-build-and-run-anki-from-source-with-xubuntu-20-04/12865](https://forums.ankiweb.net/t/guide-how-to-build-and-run-anki-from-source-with-xubuntu-20-04/12865) You can see a full list of buildtime and runtime requirements by looking at the `apt-get install` step in the [`setup-anki` composite action](https://github.com/ankitects/anki/blob/main/.github/actions/setup-anki/action.yml), used by the workflows under [`.github/workflows/`](https://github.com/ankitects/anki/tree/main/.github/workflows). **Ensure some basic tools are installed**: ``` $ sudo apt install bash grep findutils curl gcc gcc-12 g++ make git rsync ``` * The 'find' utility is 'findutils' on Debian. ## Missing Libraries If you get errors during build or startup, try starting with QT\_DEBUG\_PLUGINS=1 ./run It will likely complain about missing libraries, which you can install with your package manager. Some of the libraries that might be required on Debian for example: ``` sudo apt install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \ libxcb-randr0 libxcb-render-util0 libxkbfile1 ``` The libraries that might be required on Arch Linux: ``` sudo pacman -S nss libxkbfile ``` On some distros such as Fedora, you may need to install the `libxcrypt-compat` package if you get an error like this: ``` error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory ``` ## Audio To play and record audio during development, install mpv and lame. ## Glibc and Qt Anki requires a recent glibc. If you are using a distro that uses musl, Anki will not work. You can use your system's Qt libraries if they are Qt 6.2 or later, if you wish. After installing the system libraries (eg: 'sudo apt install python3-pyqt6.qt\{quick,webengine} python3-venv pyqt6-dev-tools'), find the place they are installed (eg '/usr/lib/python3/dist-packages'). On modern Ubuntu, you'll also need 'sudo apt remove python3-protobuf'. Then before running any commands like './run', tell Anki where the packages can be found: ``` export PYTHONPATH=/usr/lib/python3/dist-packages export PYTHON_BINARY=/usr/bin/python3 ``` ## Packaging considerations Python, node and protoc are downloaded as part of the build. You can optionally define PYTHON\_BINARY, NODE\_BINARY, YARN\_BINARY and/or PROTOC\_BINARY to use locally-installed versions instead. If rust-toolchain.toml is removed, newer Rust versions can be used. Older versions may or may not compile the code. To build Anki fully offline, set the following environment variables: * OFFLINE\_BUILD: If set, the build does not run tools that may access the network. * NODE\_BINARY, YARN\_BINARY and PROTOC\_BINARY must also be set. With OFFLINE\_BUILD defined, manual intervention is required for the offline build to succeed. The following conditions must be met: 1. All required dependencies (node, Python, rust, yarn, etc.) must be present in the build environment. 2. The offline repositories for the translation files must be copied/linked to ftl/qt-repo and ftl/core-repo. 3. The Python pseudo venv must be set up: ``` mkdir out/pyenv/bin ln -s /path/to/python out/pyenv/bin/python ln -s /path/to/protoc-gen-mypy out/pyenv/bin/protoc-gen-mypy ``` Optionally, set up your environment to generate Sphinx documentation: ``` ln -s /path/to/sphinx-apidoc out/pyenv/bin/sphinx-apidoc ln -s /path/to/sphinx-build out/pyenv/bin/sphinx-build ``` Note that the PYTHON\_BINARY environment variable need not be set, since it is only used when OFFLINE\_BUILD is unset to automatically create a network-dependent Python venv. 4. Create the offline cache for yarn and use its own environment variable YARN\_CACHE\_FOLDER to it: ``` YARN_CACHE_FOLDER=/path/to/the/yarn/cache /path/to/yarn install --ignore-scripts ``` You are now ready to build wheels and Sphinx documentation fully offline. ## More For info on running tests, building wheels and so on, please see [Development](/developers/development). # Mac-specific notes Source: https://docs.ankiweb.net/developers/mac ## Requirements **Xcode**: Install the latest XCode from the App Store. Open it at least once so it installs the command line tools. **Git/rsync** Install via Homebrew or similar tool. ## More For info on running tests, building wheels and so on, please see [Development](/developers/development). # Ninja Source: https://docs.ankiweb.net/developers/ninja Brief notes for people used to the existing Bazel build system: * Put the ninja binary on your path: [https://github.com/ninja-build/ninja/releases/tag/v1.11.1](https://github.com/ninja-build/ninja/releases/tag/v1.11.1) (on Windows, if you have it installed in msys, make sure the native binary occurs earlier on the path) * Ensure Rust is installed via rustup: [https://rustup.rs/](https://rustup.rs/) * Remove the .bazel and node\_modules folders from your existing checkout * Run with ./run * Run tests with './ninja check' (tools\ninja on Windows) * Format files with './ninja format' * Fix eslint/copyright issues with './ninja fix' * Targets are hierarchical, so './ninja check:jest:deck-options' will run the Jest tests for ts/deck-options, and './ninja check:jest' will run all Jest tests. # Protocol Buffers Source: https://docs.ankiweb.net/developers/protobuf ProtoBuf is a format used both to save data in storage and transmit data between services. You can think of it as similar to JSON with schemas, given that you can use basic types, list and records. Except that it's usually transmitted and saved in an efficient byteform and not in a human readable way. # Protocol Buffers Anki uses [different implementations of Protocol Buffers](/developers/architecture#protobuf) and each has its own peculiarities. This document highlights some aspects relevant to Anki and hopefully helps to avoid some common pitfalls. For information about Protobuf's types and syntax, please see the official [language guide](https://developers.google.com/protocol-buffers/docs/proto3). ## General Notes ### Names Generated code follows the naming conventions of the targeted language. So to access the message field `foo_bar` you need to use `fooBar` in Typescript and the namespace created by the message `FooBar` is called `foo_bar` in Rust. ### Optional Values In Python and Typescript, unset optional values will contain the type's default value rather than `None`, `null` or `undefined`. Here's an example: ```protobuf theme={null} message Foo { optional string name = 1; optional int32 number = 2; } ``` ```python theme={null} message = Foo() assert message.number == 0 assert message name == "" ``` In Python, we can use the message's `HasField()` method to check whether a field is actually set: ```python theme={null} message = Foo(name="") assert message.HasField("name") assert not message.HasField("number") ``` In Typescript, this is even less ergonomic and it can be easier to avoid using the default values in active fields. E.g. the `CsvMetadata` message uses 1-based indices instead of optional 0-based ones to avoid ambiguity when an index is `0`. ### Oneofs All fields in a oneof are implicitly optional, so the caveats [above](./#optional-values) apply just as much to a message like this: ```protobuf theme={null} message Foo { oneof bar { string name = 1; int32 number = 2; } } ``` In addition to `HasField()`, `WhichOneof()` can be used to get the name of the set field: ```python theme={null} message = Foo(name="") assert message.WhichOneof("bar") == "name" ``` ### Backwards Compatibility The official [language guide](https://developers.google.com/protocol-buffers/docs/proto3) makes a lot of notes about backwards compatibility, but as Anki usually doesn't use Protobuf to communicate between different clients, things like shuffling around field numbers are usually not a concern. However, there are some messages, like `Deck`, which get stored in the database. If these are modified in an incompatible way, this can lead to serious issues if clients with a different protocol try to read them. Such modifications are only safe to make as part of a schema upgrade, because schema 11 (the targeted schema when choosing *Downgrade*), does not make use of Protobuf messages. ### Field Numbers Field numbers larger than 15 need an additional byte to encode, so `repeated` fields should preferably be assigned a number between 1 and 15. If a message contains `reserved` fields, this is usually to accommodate potential future `repeated` fields. ## Implementation-Specific Notes ### Python Protobuf has an official Python implementation with an extensive [reference](https://developers.google.com/protocol-buffers/docs/reference/python-generated). ### Typescript Anki uses [protobuf-es](https://github.com/bufbuild/protobuf-es), which offers some documentation. ### Rust Anki uses the [prost crate](https://docs.rs/prost/latest/prost/). Its documentation has some useful hints, but for working with the generated code, there is a better option: From within `anki/rslib` run `cargo doc --open --document-private-items`. Inside the `pb` module you will find all generated Rust types and their implementations. * Given an enum field `Foo foo = 1;`, `message.foo` is an `i32`. Use the accessor `message.foo()` instead to avoid having to manually convert to a `Foo`. * Protobuf does not guarantee any oneof field to be set or an enum field to contain a valid variant, so the Rust code needs to deal with a lot of `Option`s. As we don't expect other parts of Anki to send invalid messages, using an `InvalidInput` error or `unwrap_or_default()` is usually fine. # Releasing Source: https://docs.ankiweb.net/developers/releasing Releases are prepared with a script that a maintainer runs locally, then built and published by a GitHub Actions workflow: 1. **`tools/prepare_release.py`** — Run first, on your own machine. Validates the version, checks out the matching `release/YY.MM` branch, checks that CI passed, makes sure no duplicate tag or release exists, syncs translations, then commits the updated `.version` and pushes the branch. CI then runs automatically on the resulting commit (for `release/**` branches). The CI check can be skipped with `--skip-ci-check`. 2. **`.github/workflows/release.yml`** — Dispatch after CI passes on the prepared commit. Builds installers and wheels for all platforms (Linux x86/ARM, macOS Intel/ARM, Windows), and can optionally sign macOS/Windows artifacts, create a draft GitHub release, publish wheels to TestPyPI, and publish wheels to PyPI. `release.yml` is `workflow_dispatch` and uses a `release` concurrency group, so two release builds cannot run simultaneously. ## Prepare script requirements The prepare script runs on your machine, so it needs: * A clean working tree. The script stops if there are uncommitted changes. * An authenticated `gh` CLI, with push access to `ankitects/anki` and to the two translation repos. * `rsync` on the `PATH`. It copies the translation templates. * A Python interpreter with the `packaging` module, which the project's `uv` environment provides. The script pushes translation template commits to the translation repos before it commits `.version`, so a failure after that point leaves those pushes in place. Re-running the script is safe: the translation step is a no-op when there is nothing new to copy. ## Version format Versions follow calendar versioning with PEP 440: `YY.MM` for stable releases (e.g. `26.04`), with optional `.patch` (e.g. `26.04.1`) and pre-release suffixes (`b1`, `rc1`, `a1`). Months must be zero-padded. Examples: `26.05b1` (beta), `26.05rc1` (release candidate), `26.05` (stable), `26.05.1` (patch). ## Release branch workflow All releases are cut from a `release/YY.MM` branch. The branch name uses only the major version (`YY.MM`), not the full pre-release suffix — betas, release candidates, and the stable release all come from the same branch. ### Standard release 1. Create a release branch from `main`: ``` git checkout -b release/26.05 main git push origin release/26.05 ``` 2. CI runs automatically on push to `release/**` branches. 3. Prepare the release (updates `.version` on the branch): ``` just release::prepare --version 26.05b1 ``` 4. Verify on TestPyPI: ``` just release::testpypi --ref release/26.05 ``` 5. Publish the full release: ``` just release::public --ref release/26.05 ``` 6. For subsequent pre-releases or the stable release from the same cycle, repeat steps 3-5 with the new version (e.g. `26.05b2`, `26.05rc1`, `26.05`). 7. After the stable release, merge the release branch back to `main` to pick up the `.version` bump and any cherry-picked fixes: ``` git checkout main git merge release/26.05 git push origin main ``` 8. Delete the release branch after the stable release is published. 9. Submit the Flathub update. When a stable release is published, `.github/workflows/sync-release.yml` makes a patch that moves [flathub/net.ankiweb.Anki](https://github.com/flathub/net.ankiweb.Anki) to the new version. The workflow uploads the patch as an artifact, and comments on the release PR with a report and the commands to open the Flathub PR. Fix the problems in the report's "Needs attention" section, if there are any. See [updating-anki.md](https://github.com/flathub/net.ankiweb.Anki/blob/master/updating-anki.md) for the manual steps. ### Security and hotfix releases For security fixes, an admin should first create a [security advisory](https://github.com/ankitects/anki/security/advisories) with a temporary private fork. Work on the fix in the private fork via the normal PR workflow. Do not open a public PR or publish the advisory until the fix is ready for release. Once the fix is ready: 1. Create a release branch from the latest release tag: ``` git checkout -b release/26.05 26.05 ``` 2. Cherry-pick the fix onto the release branch. 3. Push the branch and wait for CI: ``` git push origin release/26.05 ``` 4. Prepare and publish: ``` just release::prepare --version 26.05.1 just release::public --ref release/26.05 ``` 5. Merge the release branch back to `main`. 6. For security patches, publish the advisory and credit the reporter if applicable. ## Release process overview ```{mermaid} theme={null} flowchart LR A["prepare_release.py
local
validate version
check out release branch
check CI
check duplicate tag
sync translations
update .version
push to branch"] --> B["CI (ci.yml)
runs automatically
on release/** branches"] B --> C["release.yml
build all platforms
optionally sign macOS/Windows
optionally create draft GitHub release
optionally publish to TestPyPI/PyPI"] style A fill:#2d333b,stroke:#539bf5,color:#adbac7 style B fill:#2d333b,stroke:#e5c07b,color:#adbac7 style C fill:#2d333b,stroke:#7ee787,color:#adbac7 ``` ## Release workflow jobs ```{mermaid} theme={null} flowchart TD prepare[prepare
validate version,
check CI, check duplicates
] prepare --> mac["build-and-sign-mac
ARM"] prepare --> macint["build-and-sign-mac-intel
Intel"] prepare --> win["build-and-sign-windows"] prepare --> lin[build-linux-x86
installer + wheels] prepare --> linarmw[build-linux-arm-wheels] prepare --> linarmi[build-linux-arm-installer] mac --> release macint --> release win --> release lin --> release linarmw --> release linarmi --> release release["release
draft GitHub release
if draft-release"] mac --> testpypi macint --> testpypi win --> testpypi lin --> testpypi linarmw --> testpypi linarmi --> testpypi testpypi["publish-testpypi
TestPyPI
if publish-testpypi or publish-pypi"] release --> pypi testpypi --> pypi pypi["publish-pypi
PyPI
if publish-pypi"] style prepare fill:#2d333b,stroke:#539bf5,color:#adbac7 style mac fill:#2d333b,stroke:#e5c07b,color:#adbac7 style macint fill:#2d333b,stroke:#e5c07b,color:#adbac7 style win fill:#2d333b,stroke:#e5c07b,color:#adbac7 style lin fill:#2d333b,stroke:#e5c07b,color:#adbac7 style linarmw fill:#2d333b,stroke:#e5c07b,color:#adbac7 style linarmi fill:#2d333b,stroke:#e5c07b,color:#adbac7 style release fill:#2d333b,stroke:#7ee787,color:#adbac7 style testpypi fill:#2d333b,stroke:#7ee787,color:#adbac7 style pypi fill:#2d333b,stroke:#7ee787,color:#adbac7 ``` ## Inputs **prepare\_release.py:** takes a `version` argument and an optional `--skip-ci-check` flag. The release branch is derived from the version, so there is no branch argument. **release:** takes a `version` (must match `.version` for public release operations) and five boolean inputs: * `sign` signs macOS and Windows artifacts. * `draft-release` creates the draft GitHub release. * `publish-testpypi` publishes wheels to TestPyPI. * `publish-pypi` publishes wheels to PyPI. * `skip-ci-check` skips the CI status check. All booleans default to `false`. Non-release runs use the `.version` already in the repo, so builds work without a prepare step. For a normal public release, enable the first four booleans: `sign=true`, `draft-release=true`, `publish-testpypi=true`, and `publish-pypi=true`. ## Environment gates The release workflow uses GitHub [environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment) as manual approval gates. Jobs that access signing credentials or publish artifacts require a reviewer to approve the deployment before they run: * **`release`** — Required when `sign`, `draft-release`, `publish-testpypi`, or `publish-pypi` is enabled. Protects code-signing secrets, the release token, and PyPI/TestPyPI trusted publishing/OIDC. When `sign` is disabled, the macOS and Windows build jobs run without the `release` environment so they do not require approval and cannot access signing secrets. ## Workflow input behavior The `release.yml` workflow uses independent boolean inputs to control what gets signed and published: | Input | Effect | | - | - | | `sign` | Signs macOS and Windows artifacts. Requires the `release` environment. When false, those jobs upload unsigned artifacts and do not access signing secrets. | | `draft-release` | Creates a draft GitHub release with generated release notes and installer artifacts. Requires `sign=true`, the `release` environment, passing CI (unless skipped), no duplicate tag/release, and `version` matching `.version`. | | `publish-testpypi` | Publishes wheels to TestPyPI. Requires the `release` environment. | | `publish-pypi` | Publishes wheels to PyPI. Requires the `release` environment, passing CI (unless skipped), and `version` matching `.version`. It also runs and waits for the TestPyPI publish job first. It does not require signing unless `draft-release=true`. | | `skip-ci-check` | Skips the CI status check. Useful for hotfix releases. | | `version` | For `draft-release` or `publish-pypi`: must match `.version`. For build-only, signed-only, or TestPyPI-only runs: ignored (`.version` from the branch is used automatically). | ## Running releases with just The `release` module defined in `release.just` wraps both the prepare script and the `release.yml` dispatches. `release::prepare` runs locally and takes no `--ref`. Every other recipe dispatches `release.yml` and requires an explicit `--ref` argument pointing to the release branch. Run `just --list --list-submodules` to see all available recipes and their arguments. ## Testing the release workflow from a feature branch `release.yml` can be dispatched from any branch for testing. The release guards only apply when `draft-release` or `publish-pypi` is enabled. To run a test build: 1. Dispatch `release.yml` from your branch with all boolean inputs left false: ``` just release::build --ref ``` 2. The workflow reads `.version` from the branch as-is (the version input is ignored for non-release runs), so no prepare step is needed. 3. All release guards (CI check, duplicate tag check) are skipped. 4. Artifacts are uploaded to the workflow run but nothing is published or tagged. ### Testing with code signing To test the signing flow from a feature branch: 1. In the repo's Settings → Environments → `release`, temporarily add your branch to the allowed deployment branches. 2. Dispatch the workflow: ``` just release::sign --ref ``` 3. Approve the environment deployment when prompted. 4. After testing, remove your branch from the environment's allowed branches. > **Note:** `workflow_dispatch` workflows only appear in the GitHub Actions UI > if the workflow file exists on the default branch. If `release.yml` is new or > modified on your branch, use `gh workflow run` to trigger it — the UI > dropdown won't show it until it's merged to main. ## Important notes * The release workflow builds the exact commit at `github.sha`. It does not write `.version` — that is done by the prepare script. If you dispatch release before the prepare commit has been pushed, the build will use whatever `.version` was HEAD at dispatch time. * `draft-release=true` with `sign=false` is rejected — draft releases must use signed installer artifacts. * When `publish-pypi=true`, wheels are published to TestPyPI first, then to PyPI after the TestPyPI job succeeds. If `draft-release=true` is also set, PyPI publishing waits for the draft GitHub release to succeed too. * Pre-release versions (e.g. `26.05b1`) are automatically marked as pre-releases on the GitHub draft release. ## Announcements * Once a GitHub release draft is created, modify the generated changelog if necessary then click **Publish release**. * Create a forum topic on the [Beta Testing](https://forums.ankiweb.net/c/anki/beta-testing/13) category. For stable releases, lock the topic and ask users to report issues on a new topic. * For stable releases, update the version in [ankitects/anki-landing-page](https://github.com/ankitects/anki-landing-page) (See [example](https://github.com/ankitects/anki-landing-page/commit/2362eb2202f174df2aad1dc5336e1b5195a7af85)). ## Audio package Audio playback and recording is handled by the `anki-audio` package under **`qt/audio`**, which bundles mpv and lame for Windows and macOS. To update: 1. Update the archive links in **`build/configure/src/audio.rs`** if you're updating the Windows pre-built binaries to new versions, then run `./tools/ninja audio_wheel` to test. 2. Update the macOS build script at **`qt/audio/mpv.rb`** and test the Homebrew build locally by running the **`qt/audio/build.sh`** script. 3. Bump the version at **`qt/audio/.version`**. 4. Submit a PR with the changes. 5. Once the PR is merged to main, run the **`.github/workflows/publish-audio-package.yml`** workflow to publish the package to PyPI: ``` gh workflow run publish-audio-package.yml -f sign-macos=true -f publish-testpypi=true -f publish-pypi=true ``` 6. Once the package is published, update the pinned `anki-audio` version in **`qt/pyproject.toml`** to the new version. # SonarCloud analysis Source: https://docs.ankiweb.net/developers/sonarcloud SonarCloud provides informative static-analysis and coverage results. Its Quality Gate is not a required merge check, so findings guide review without blocking maintainers. Automatic Analysis must remain disabled because this project uses CI-based analysis. For the test commands and coverage thresholds enforced by CI, see [Testing and Coverage](/developers/testing-coverage). ## Analysis matrix | Event | Static analysis | Coverage in CI | Coverage in SonarCloud | | - | - | - | - | | Internal pull request | Yes | Yes | Yes | | Push to `main` or `release/**` | Yes | Yes | Yes | | Fork pull request | Yes | Yes | No | Fork pull requests still run the complete test coverage and coverage-regression checks in the unprivileged CI workflow. Their reports are not imported by the privileged SonarCloud workflow, so SonarCloud does not calculate a coverage metric for those pull requests. The fork scan still reports static bugs, vulnerabilities, security hotspots, and code smells. Scanner-side Clippy and software composition analysis are disabled; Clippy remains part of the regular CI checks. ## How it runs `.github/workflows/sonar.yml` runs after the complete CI workflow succeeds. Keeping it separate prevents `SONAR_TOKEN` from being available to jobs that build or test contributor code. 1. The workflow validates the pull request number, state, head SHA, repositories, and branches against the GitHub API. Invalid or stale context fails closed instead of becoming a branch analysis. 2. It checks out the exact commit tested by CI. Fork source is read only by the scanner and is never built, installed, or used as tooling. 3. It replaces `sonar-project.properties` with the default branch's trusted copy, preventing a fork from changing the server or enabling build tools. The analysed version comes from the same trusted checkout of `.version`, so that new code is measured since the previous release rather than since a constant version. 4. For a pull request, it fetches the target branch from the trusted upstream repository and pins it locally under the name passed as `sonar.pullrequest.base`. SonarCloud derives the changed-file set from git, so without the correct upstream base reference it may attribute unrelated changes to the pull request. A fork's local base reference may be outdated. The step logs the analysed commit, base repository and branch, base commit, and merge-base, and fails closed if the reference cannot be resolved. 5. For internal changes, it downloads the coverage artifact from the triggering CI run. For forks, report paths are cleared and all sources are excluded only from the coverage calculation. 6. Only the scanner step receives `SONAR_TOKEN`. ## Trust boundary > [!WARNING] > > This workflow has access to the base repository's `SONAR_TOKEN`. Never add a build, > test, package install, PR-provided configuration, local Action from the PR, or > restored CI cache to it. In particular, do not invoke `just`, `cargo`, `npm`, `pip`, > or repository scripts in this workflow. * Keep Automatic Analysis disabled and SonarCloud checks non-required. * Restrict `SONAR_TOKEN` to analysis of this project. * Keep scanner-side Clippy and software composition analysis disabled. * Do not import artifacts produced by a fork into the privileged scan. The scanner necessarily parses untrusted source when analyzing a fork. These constraints prevent direct execution of contributor code and reduce the token's exposure, but they do not eliminate vulnerabilities in third-party Actions or analyzers. # Building and running Anki sync server in Docker Source: https://docs.ankiweb.net/developers/syncserver This is an example Dockerfile contributed by an Anki user, which shows how you can run a self-hosted sync server, similar to what AnkiWeb.net offers. Building and running the sync server within a container has the advantage of fully isolating the build products and runtime dependencies from the rest of your system. ## Requirements * [x] [Docker](https://docs.docker.com/get-started/) | **Aspect** | **Dockerfile** | **Dockerfile.distroless** | | - | - | - | | **Shell & Tools** | ✅ Includes shell and tools | ❌ Minimal, no shell or tools | | **Debugging** | ✅ Easier debugging with shell and tools | ❌ Harder to debug due to minimal environment | | **Health Checks** | ✅ Supports complex health checks | ❌ Health checks need to be simple or directly executable | | **Image Size** | ❌ Larger image size | ✅ Smaller image size | | **Customization** | ✅ Easier to customize with additional packages | ❌ Limited customization options | | **Attack Surface** | ❌ Larger attack surface due to more installed packages | ✅ Reduced attack surface | | **Libraries** | ✅ More libraries available | ❌ Limited libraries | | **Start-up Time** | ❌ Slower start-up time due to larger image size | ✅ Faster start-up time | | **Tool Compatibility** | ✅ Compatible with more tools and libraries | ❌ Compatibility limitations with certain tools | | **Maintenance** | ❌ Higher maintenance due to larger image and dependencies | ✅ Lower maintenance with minimal base image | | **Custom uid/gid** | ✅ It's possible to pass in PUID and PGID | ❌ PUID and PGID are not supported | # Building image To proceed with building, you must specify the Anki version you want, by replacing `` with something like `24.11` and `` with the chosen Dockerfile (e.g., `Dockerfile` or `Dockerfile.distroless`) The `--platform` option specifies which systems the image will be able to run on after it has been built. This is helpful in scenarios where you are building the image on one architecture (eg: an M series Mac) but running the image on another architecture (eg: x86 Linux server). * `linux/amd64` is for x86 linux systems (Images built with this option will work on Windows as well through WSL2 which is included with Docker Desktop) * `linux/arm64` is for ARM systems (eg: M series Macs) On Linux systems, you will have to configure a custom builder which supports ARM builds first as shown below. You can then run the Mac build command in the next step. ```bash theme={null} # Configuring multiplatform builder and activating it docker buildx create --name multiplatform-builder --driver docker-container --driver-opt default-load=true --bootstrap --use ``` On M-series Macs running Docker Desktop, you can build for both platforms using the default builder by running the command below: ```bash theme={null} # Execute this command from this directory docker buildx build -f --platform linux/amd64,linux/arm64 --no-cache --build-arg ANKI_VERSION= -t anki-sync-server . ``` If the build fails with `Resource Exhausted:.... cannot allocate memory`, go to Docker Desktop > Settings > Resources and increase the memory limit. If you are unsure of what platform your system is, just run the command below without the platform option. ```bash theme={null} # Execute this command from this directory docker buildx build -f --no-cache --build-arg ANKI_VERSION= -t anki-sync-server . ``` # Run container Once done with build, you can proceed with running this image with the following command: ```bash theme={null} # this will create anki server docker run -d \ -e "SYNC_USER1=admin:admin" \ -p 8080:8080 \ --mount type=volume,src=anki-sync-server-data,dst=/anki_data \ --name anki-sync-server \ anki-sync-server ``` If the image you are using was built with `Dockerfile` you can specify the `PUID` and `PGID` env variables for the user and group id of the process that will run the anki-sync-server process. This is valuable when you want the files written and read from the `/anki_data` volume to belong to a particular user/group e.g. to access it from the host or another container. Note the the ids chosen for `PUID` and `PGID` must not already be in use inside the container (1000 and above is fine). For example add `-e "PUID=1050"` and `-e "PGID=1050"` to the above command. If you want to have multiple Anki users that can sync their devices, you can specify multiple `SYNC_USER` as follows: ```bash theme={null} # this will create anki server with multiple users docker run -d \ -e "SYNC_USER1=admin:admin" \ -e "SYNC_USER2=admin2:admin2" \ -p 8080:8080 \ --mount type=volume,src=anki-sync-server-data,dst=/anki_data \ --name anki-sync-server \ anki-sync-server ``` Moreover, you can pass additional env vars mentioned [here](/manual/sync-server). Note that `SYNC_BASE` and `SYNC_PORT` will be ignored. In the first case for safety reasons, to avoid accidentally placing data outside the volume and the second for simplicity since the internal port of the container does not matter given that you can change the external one. # Upgrading If your image was built after January 2025 then you can just build a new image and start a new container with the same configuration as the previous container. Everything should work as expected. If the image you were running was built **before January 2025** then it did not contain a volume, meaning all syncserver data was stored inside the container. If you discard the container, for example because you want to build a new container using an updated image, then your syncserver data will be lost. The easiest way of working around this is by ensuring at least one of your devices is fully in sync with your syncserver before upgrading the Docker container. Then after upgrading the container when you try to sync your device it will tell you that the server has no data. You will then be given the option of uploading all local data from the device to syncserver. # Testing and Coverage Source: https://docs.ankiweb.net/developers/testing-coverage CI runs Rust, Python, and TypeScript tests plus lint/type checks. Coverage is orchestrated in `justfile` with direct CLI calls, using ninja only to prepare generated build artifacts that the test commands need. ## Quick reference ```sh theme={null} just test # run all tests (no coverage) just test --coverage # run all tests + enforce coverage thresholds just test --coverage --html # same + generate HTML reports under out/coverage/ just test-rust # Rust only just test-rust --coverage just test-rust --coverage --html just test-py # Python (pylib + qt) only just test-py --coverage just test-py --coverage --html just test-ts # TypeScript/Svelte Vitest only just test-ts --coverage just test-ts --coverage --html ``` HTML reports are written under `out/coverage/` (gitignored). ## Coverage tools and thresholds | Stack | Test runner | Coverage tool | Minimum | | - | - | - | -: | | Rust workspace | `cargo nextest` via `cargo-llvm-cov` | `cargo-llvm-cov` | 60% | | Python `pylib/anki` | `pytest pylib/tests` | `coverage.py` | 63% | | Python `qt/aqt` | `pytest qt/tests` | `coverage.py` | 20% | | TypeScript/Svelte | `vitest run` | Vitest V8 | 5% | Linux pull requests run `just test --coverage` in CI. macOS and Windows jobs run `just test` (no coverage enforcement) for now. ## Notes * **Rust** — `cargo-llvm-cov` is installed on demand into `out/bin/` to avoid polluting the global cargo install. Coverage runs rebuild the workspace with instrumentation, so they are slower than plain `just test-rust`. **Windows ARM64 (`aarch64-pc-windows-msvc`) is not supported**: the Rust compiler produces malformed `.profraw` files on that target ([rust-lang/rust#150123](https://github.com/rust-lang/rust/issues/150123), [cargo-llvm-cov#436](https://github.com/taiki-e/cargo-llvm-cov/issues/436)). `just test-rust --coverage` exits with a clear message on ARM64 Windows; use `just test-rust` (no coverage) or rely on CI (Linux) for enforcement. * **Python** — coverage is split across two suites (`pylib` and `qt`) because they have different `PYTHONPATH` setups and test folders. * **TypeScript** — coverage is measured only over code reachable through Vitest's module graph. Svelte component rendering behavior is not covered. ## SonarCloud SonarCloud runs automatically after successful CI pushes and pull requests. It runs static analysis across Python, TypeScript, and Rust. For internal pull requests and trusted branch pushes, it also aggregates the coverage reports generated by the three stacks. * **Dashboard**: [https://sonarcloud.io/project/overview?id=ankitects\_anki](https://sonarcloud.io/project/overview?id=ankitects_anki) * **Internal coverage**: uses the same LCOV/XML reports produced by `just test --coverage` * **Fork coverage**: remains enforced in CI but is not imported into SonarCloud * **Analysis results**: SonarCloud reports quality gate status on each analyzed PR The quality gate is configured as non-blocking — a failing gate does not prevent merging, but the results are visible on the PR. See [SonarCloud analysis](/developers/sonarcloud) for the analysis matrix and the fork trust boundary. ## Gaps and future improvements * Raise thresholds gradually as the test suite grows and CI timings stabilise. * Exclude generated files from coverage denominators where appropriate. * Publish `out/coverage/` as a CI artifact so reviewers can browse HTML reports directly from a PR. * Consider diff/changed-file coverage once baselines are stable — it is a better enforcement mechanism for incremental improvement than whole-repo thresholds. * Add component or browser tests for Svelte UI surfaces if Svelte coverage is intended to cover rendered component behaviour. ## See also * [Writing Unit Tests for Anki](/developers/unit-testing) # Writing Unit Tests for Anki Source: https://docs.ankiweb.net/developers/unit-testing This guide helps maintainers, contributors, and coding assistants write unit and component tests for Anki. It is independent of any particular feature, module, or bug. Use it together with the behavior being changed, the surrounding production code, and nearby tests. This guide assumes basic familiarity with automated tests. If testing is new to you, start with one of the introductory resources in [References](#references-and-rationale), then return here for Anki-specific guidance. ## Quick summary When adding a test: 1. Describe what should happen from the user's point of view. 2. Add the test close to the code responsible for that behavior. 3. Consider normal input, errors, edge cases, and known regressions. 4. Prefer the smallest and fastest test that gives enough confidence. 5. Give the test a name that explains the behavior being checked. 6. Avoid dependencies on real time, network access, user data, or test order. 7. For a bug fix, confirm that the test fails before the fix when practical. 8. Run the relevant `just test-*` recipe and then `just check`. ## Purpose A useful test gives fast, trustworthy evidence about behavior that matters. It also acts as executable documentation: a reader should be able to understand the scenario, action, and expected result without reverse-engineering the implementation. A good unit test is: * **Behavioral:** it verifies an observable result, state transition, error, or required interaction. * **Focused:** it has one reason to fail. Multiple assertions are fine when they describe one behavior. * **Deterministic:** the same code and inputs produce the same result regardless of test order, wall-clock time, locale, network access, or machine speed. * **Isolated:** it does not depend on a user's profile, another test's state, or an unavailable external service. * **Fast:** it is cheap enough to run repeatedly while editing. * **Readable:** its name and test data explain the expected behavior and the failure. * **Sensitive:** a real regression in the behavior makes it fail; it does not keep passing when the expected behavior is broken. * **Stable:** a behavior-preserving refactor should usually leave it unchanged. Code coverage is useful for finding untested code, but a covered line is not necessarily a tested behavior. Do not add weak assertions merely to increase a coverage number. ## Choose the smallest useful test boundary Use the lowest-cost test that can prove the behavior: | Boundary | Use it for | Do not use it for | | - | - | - | | Pure unit | Calculations, parsing, validation, conversion, and deterministic state transitions | Framework wiring or cross-process behavior | | Unit with collaborators | A small group of fast, in-process collaborators | Network, real subprocesses, or a user's persistent data | | UI component | A Qt component's visible state, signals/events, and interaction; for Svelte, extracted logic and stores | Whole application workflows | | Integration | Database mappings, protobuf/language bridges, filesystem contracts, and framework integration that a unit test cannot prove | Repeating every unit-level branch | | End-to-end | A small number of critical workflows through a real Anki instance and browser | Exhaustive validation and edge cases | Most scenarios should be below the end-to-end layer. If a higher-level test discovers a defect, add a lower-level regression test when that level can reproduce the defect. Keep the higher-level test only when it proves additional behavior. For Svelte specifically, "UI component" means extracted logic and stores: the repository does not wire rendered-component tests into the unit suite (see [Svelte, TypeScript, and JavaScript](#svelte-typescript-and-javascript)). Anki spans several implementation layers. Test a rule at the layer that owns it: * Business rules implemented in Rust **should** normally be tested in Rust. * Python library tests should cover Python-owned behavior, compatibility surfaces, orchestration, and adaptations instead of duplicating Rust assertions. * Python/Qt tests should cover GUI-owned state, signals, callbacks, and backend orchestration. Move framework-independent logic into a form that can be tested without constructing the full GUI when practical. * TypeScript/JavaScript tests should cover web-owned logic, stores, DOM helpers, and component behavior. Use end-to-end tests only when a real browser/Anki boundary is essential. * Generated protobuf code does not need tests. Test custom conversion, validation, or bridge behavior at its owning layer; use an integration test if correctness depends on both sides of the bridge. ## Choose scenarios from expected behavior Before writing test code, describe what should happen in plain English. Identify the inputs, results a caller or user can observe, side effects, errors, and facts that must remain true. Then select the smallest set of scenarios that distinguishes a correct implementation from a plausible bug. Every meaningful behavior change should consider these categories: | Category | Question | Generic example | | - | - | - | | Happy path | Does valid, representative input produce the intended result? | An accepted value is normalized and stored. | | Unhappy/error path | Is invalid input rejected or recovered from as specified? | A malformed value returns the expected error and does not mutate state. | | Boundary | What happens at empty, minimum, maximum, transition, and Unicode cases? | An empty label uses the defined fallback; the maximum allowed value remains valid. | | State/invariant | What must remain true before and after the action? | A failed update leaves the previous value and unrelated records unchanged. | | Regression | What is the smallest input that reproduces a reported defect? | The exact shape that once crashed now produces the specified result. | Do not assume that every function needs one test from every category. Include a category when the expected behavior or implementation has that failure mode. Use equivalence classes rather than enumerating inputs that exercise the same rule. Use parameterization when several compact input/output pairs express one behavior; use separate tests when cases require different setup or should produce distinct failure explanations. ## Structure and naming Prefer a visible Arrange–Act–Assert flow: 1. **Arrange** only the state relevant to the scenario. 2. **Act** once on the behavior under test. 3. **Assert** the expected outcome, including important non-effects. The phases do not require comments when the structure is already obvious. Avoid hiding the act or the important assertion inside a helper. Name a test after the unit under test and the expected behavior, not an implementation method. Follow the convention of the tests already in that file; newer tests in the codebase put the condition last: ```text theme={null} _[_when_] ``` Real examples from the codebase: * Rust: `answer_easy_graduates_new_card_to_review_queue`, `bury_leaves_suspended_card_untouched`, `add_or_update_notetype_preserves_usn_when_flag_is_set` * Python/Qt: `test_update_collection_skips_backend_when_unchanged`, `test_is_audio_file_rejects_no_extension` Vitest names the behavior in the `test(...)` description string rather than in an identifier, e.g. `test("event handler attributes are stripped")`. Names such as `test_helper`, `works`, `basic`, or `case_1` do not explain the expected behavior. Assertions should be precise enough to diagnose the defect. Prefer comparing the meaningful value or structured result over a generic truthiness check. Assert an error's type or variant and, when stable and user-relevant, its message. Avoid asserting incidental formatting or a complete object when only one field defines the behavior. ## Test data, setup, and cleanup * Use the smallest realistic data and give it semantic names such as `existing_record` and `invalid_name`. * Prefer builders, factories, and fixtures already used by nearby tests. * Keep test-specific setup in the test. Extract a helper only when it removes noise without concealing the scenario. * Use temporary directories, temporary collections/databases, and in-memory values. Never read or modify a user's Anki profile. * Restore patched globals, environment variables, timers, DOM state, and callbacks. Prefer framework cleanup facilities that run even after an assertion fails. * Tests **must** pass independently, in any order, and when repeated. ## Test doubles and boundaries Prefer real, lightweight, deterministic collaborators. Use a stub, fake, spy, or mock to control an awkward boundary such as time, randomness, network, subprocess, clipboard, native dialog, or backend call, and patch it where the code looks it up. Return realistic values and errors. Assert interactions only when they affect expected behavior; avoid incidental calls and ordering. If every collaborator is mocked and only calls are asserted, the test probably describes the implementation rather than useful behavior. ## Time, randomness, concurrency, and asynchronous behavior * Inject or freeze time when the exact time affects behavior. Do not depend on the current date, local timezone, or rollover hour. * Seed or replace randomness and assert invariants rather than one accidental random result. * Never use an unconditional sleep to wait for correctness. Await the promise, callback, signal, task, or condition with a bounded safety timeout. * Avoid exact performance timings in unit tests. Put performance claims in a benchmark with appropriate tolerance and environment control. * Assume files and test cases may run in parallel. Do not share mutable globals, fixed ports, or fixed temporary paths. ## Regression tests A bug fix **should** normally include a test that would have caught the bug. 1. Reduce the report to the smallest representative input and state. 2. Place the test at the lowest layer that reproduces the defect and proves the intended behavior. 3. When practical, run it before the fix or against the buggy revision and confirm that it fails for the expected reason. 4. Apply the fix and confirm that the new test passes. 5. Run the relevant suite and check adjacent scenarios for the same class of defect. 6. Keep the regression test permanently. Name it after the behavior, not an issue number; add the issue link in a short comment only when it provides essential context that the test cannot express. Do not encode the buggy implementation in the expected result. A regression test should describe lasting expected behavior so that future refactoring can preserve it. ## Test-first workflow Writing the test before the implementation is encouraged when the expected behavior is clear. A test-first cycle can help verify that the test is sensitive to the defect: 1. Write a focused test for the intended behavior. 2. Confirm that it fails for the expected reason. 3. Make the smallest production change that satisfies the expected behavior. 4. Refactor while keeping the test suite green. Test-first development is not mandatory. For exploratory work or behavior that is not yet understood, investigate and describe the expected behavior before adding the test. For bug fixes, a failing regression test before the fix is strongly recommended whenever practical. ## Additional risk areas The scenario categories above apply to all behavior. Also consider risks specific to Anki: * serialization or conversion code written by the project; * permission, path, escaping, and untrusted-input boundaries; * callbacks, signals, events, and async completion when they are part of the API; * compatibility behavior intentionally supported for add-ons or older data. ## What not to test Do not spend test maintenance on: * private implementation details with no observable contract; * trivial code, compiler/type-checker guarantees, generated accessors, or third-party behavior; * the same rule exhaustively at every language layer; * snapshots so broad that reviewers cannot tell whether a change is correct; * real network services, user profiles, home-directory files, or machine-specific executables; * random input without a reproducible seed and reported failing case; * internal call counts used only because mocking makes them easy to observe; or * assertions that only prove the code ran, returned something truthy, or did not throw when a more specific result exists. ## UI testing scope and cost Qt and Svelte tests have a higher setup and maintenance cost than tests for pure logic. Do not attempt to test every widget, component, property, or markup detail. A UI test **should** protect behavior whose value and risk justify that cost. Prefer testing: * logic, view models, stores, state transitions, and error handling; * interactive states, signals, events, callbacks, and backend requests; * accessibility roles, labels, focus, and keyboard behavior when they are part of the user contract; and * regressions in stable, user-visible behavior. Avoid unit tests for styling, exact geometry, incidental DOM structure or CSS/Sass class names, animation timing, platform-native rendering, generated UI code, framework internals, and large UI snapshots. When possible, extract logic from the Qt widget or Svelte component and test it as ordinary Python or TypeScript/JavaScript. Keep only a small wiring test at the UI layer when it provides additional confidence. Check presentation during UI review, or with visual regression if appearance is a stable product contract and the project intentionally adopts such tooling. Volatile code is not automatically exempt: test its stable contract when one exists. If both implementation and expected presentation are temporary, omitting a brittle UI test may be the better trade-off. ## Stack-specific guidance The examples below are illustrative pseudocode. Names such as `State`, `Model`, and `normalize_value` are not Anki APIs and **must not** be copied without inspecting the actual code. ### Python library Python library tests live under `pylib/tests/` and use `pytest`. * Name files/functions `test_*` and use plain `assert` for diagnostic diffs. * Use `pytest.raises()` for expected errors; match a stable message only when the message is part of the contract or improves precision. * Use `pytest.mark.parametrize()` for compact equivalent cases. * Prefer typed fixtures, `tmp_path`, `monkeypatch`, and existing collection helpers; close resources through fixtures or context managers. * Mock the Rust backend only when testing Python-owned orchestration or an otherwise impractical failure. Do not mock it merely to make a domain-rule test appear unit sized. Generic example: ```python theme={null} import pytest @pytest.mark.parametrize( ("raw_value", "expected"), [(" valid ", "valid"), ("", "default")], ) def test_normalization_returns_the_documented_value( raw_value: str, expected: str ) -> None: assert normalize_value(raw_value) == expected def test_invalid_value_is_rejected_without_mutating_state() -> None: state = State(value="existing") with pytest.raises(ValueError, match="invalid value"): state.update("invalid") assert state.value == "existing" ``` ### Python/Qt Python/Qt tests live under `qt/tests/` and also use `pytest`. * Test framework-independent decisions as ordinary Python first. * Construct the smallest useful Qt object; do not launch a complete Anki window for a unit test. * Trigger public actions or realistic input, then assert meaningful state, signals, callbacks, or backend requests. Use `QSignalSpy` or a callback recorder when signal arguments/count are the contract. * Await the event loop through a condition or signal with a bounded timeout; avoid fixed sleeps. * Replace native dialogs, clipboard access, web requests, audio, and backend operations at their boundary. * Keep `QApplication`, main-window state, and global hooks isolated and cleaned up. Generic example: ```python theme={null} from unittest.mock import MagicMock def test_submit_with_invalid_input_shows_error_without_saving() -> None: save = MagicMock() dialog = make_minimal_dialog(save=save) dialog.form.value.setText("invalid") dialog.accept() assert dialog.form.error.isVisible() save.assert_not_called() ``` ### Rust Rust unit tests normally live beside the code in a `#[cfg(test)]` module. Follow the nearby crate's existing helpers and conventions. * Prefer inputs and assertions over extensive mocking. * Use `assert_eq!`/`assert_ne!` for diagnostic diffs and include a message when the invariant is otherwise unclear. * Match the expected error variant or structured value instead of only calling `is_err()` when the distinction matters. * Cover variants and transitions with distinct behavior, not properties guaranteed by the type system. * Use a collection only when persistence is part of the unit; use pure domain values otherwise. * Use small table-driven loops for one contract and include the input in assertion messages. * `unwrap()` and `expect()` **may** be used in setup and when an unexpected error should fail the test; do not use them to inspect the error path being tested. Generic example: ```rust theme={null} #[cfg(test)] mod tests { use super::*; #[test] fn empty_input_uses_the_default() { assert_eq!(normalize_value(""), "default"); } #[test] fn invalid_input_preserves_existing_state() { let mut state = State::new("existing"); let error = state.update("invalid").unwrap_err(); assert!(matches!(error, UpdateError::InvalidValue)); assert_eq!(state.value(), "existing"); } } ``` ### Svelte, TypeScript, and JavaScript Web unit tests use Vitest. The current configuration discovers colocated `*.test.ts`, `*.spec.ts`, `*.test.js`, and `*.spec.js` files, excluding `ts/tests/e2e/`. * Test TypeScript/JavaScript logic and Svelte stores without a DOM unless rendering and interaction prove an additional contract. * Add `// @vitest-environment jsdom` only when the test needs DOM APIs, and restore any document/global state after the test. * Use `vi.fn()`/`vi.spyOn()` at external boundaries, fake timers for timer-driven behavior, and restore both after the test. * Await promises/reactive updates instead of real time. For rendered behavior, interact through the public UI and query by accessible role, label, or visible text rather than internal state. * Prefer focused value/DOM assertions. Use snapshots only for small, stable output whose entire structure is intentionally reviewed. * The repository does not currently configure a dedicated Svelte component-rendering harness in the unit suite. If a behavior cannot be tested through extracted logic or the existing DOM setup, agree on the appropriate harness or place the essential browser contract in the existing Playwright suite rather than inventing a private test setup. Generic TypeScript example: ```typescript theme={null} import { expect, test, vi } from "vitest"; test("invalid input reports the error without saving", async () => { const save = vi.fn(); const model = new Model({ save }); const result = await model.submit("invalid"); expect(result).toEqual({ ok: false, reason: "invalid-value" }); expect(save).not.toHaveBeenCalled(); }); ``` For a Svelte component, the equivalent contract is expressed as a user action and a visible/accessibility result: enter invalid input, activate Submit, observe the error, and verify that saving did not occur. Do not call a component's private handler directly. ## Running and validating tests Use the repository's `just` recipes: ```sh theme={null} just test-rust # Rust just test-py # Python library and Python/Qt just test-ts # TypeScript/JavaScript/Svelte unit tests just test # every stack (Rust, Python, TS) just check # required final formatting, build, lint, and test validation ``` During development, run the relevant stack frequently. Before considering a code change complete, run `just check`. See [Testing and Coverage](/developers/testing-coverage) for coverage commands and [End-to-End Testing](/developers/e2e-testing) when the selected boundary requires Playwright. ## Review checklist A test is ready when the answer to each relevant question is yes: * Does the test name explain the behavior being checked? * Does the test clearly show when that behavior works and when it does not? * Were the relevant scenario categories considered at the lowest useful layer, without duplication? * Is Arrange–Act–Assert clear, with minimal data and doubles only at meaningful boundaries? * Is it deterministic, independent, cleaned up, and stable under behavior-preserving refactoring? * For a bug fix, did the regression test fail before and pass after the fix when practical? * Do the relevant `just` test recipe and `just check` pass? ## Instructions for coding assistants When this document is supplied to a coding assistant, the assistant must also inspect the production behavior, issue/diff, neighboring tests, available helpers, and test runner configuration. This guide does not replace repository context. Before editing, it should follow the quick summary, describe the expected behavior, identify the responsible layer, list the scenarios and selected test level, then follow local naming, fixtures, builders, and file placement. It **must not** invent APIs, dependencies, fixtures, or runner capabilities; change production visibility solely to reach private implementation; or weaken an assertion to make it pass. It should finish by reporting what was tested, intentionally omitted, and not validated. ## References and rationale This guide adapts these references to Anki's architecture: * Beginner introductions: [Getting Started With Testing in Python](https://realpython.com/python-testing/) and [How to Use pytest](https://www.freecodecamp.org/news/how-to-use-pytest-a-guide-to-testing-in-python/). * General principles: [behavior over implementation](https://testing.googleblog.com/2013/08/testing-on-toilet-test-behavior-not.html), [test sizes](https://testing.googleblog.com/2010/12/test-sizes.html), [unit-test characteristics and Arrange–Act–Assert](https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-best-practices), and the [practical test pyramid](https://martinfowler.com/articles/practical-test-pyramid.html). * Python: pytest [fixtures](https://docs.pytest.org/en/stable/explanation/fixtures.html), [parameterization](https://docs.pytest.org/en/stable/how-to/parametrize.html), and [assertions](https://docs.pytest.org/en/stable/how-to/assert.html). * Rust: [test organization in The Rust Book](https://doc.rust-lang.org/book/ch11-03-test-organization.html). * Qt: [QtTest](https://doc.qt.io/qtforpython-6/PySide6/QtTest/index.html) and [QSignalSpy](https://doc.qt.io/qt-6/qsignalspy.html). * Web: Vitest [mock functions](https://vitest.dev/guide/learn/mock-functions), [timers](https://vitest.dev/guide/mocking/timers), and [component testing](https://vitest.dev/guide/browser/component-testing), plus Testing Library's [accessible query priority](https://testing-library.com/docs/queries/about/). # Windows Source: https://docs.ankiweb.net/developers/windows ## Minimum Requirements * **64-bit Windows 10** (version 1703 or newer) * Administrator access to install software *** ## Install Rust 1. Visit the official Rust website ([https://rustup.rs/](https://rustup.rs/)) 2. Download and install **rustup** 3. During installation, accept the default options > [!NOTE] > > The Rust installer will offer to automatically download and install the required > MSVC build tools. If you prefer a minimal install without the full Visual > Studio IDE, do the following before installing Rust: > > 1. Install **Visual Studio Build Tools** via winget: > ``` > winget install Microsoft.VisualStudio.BuildTools > ``` > 2. Open the **Visual Studio Installer**, select **Build Tools**, click > **Modify**, then under **Individual components**, install: > * **MSVC Build Tools for x64/x86 (Latest)** > * **Windows 11 SDK** (or Windows 10 SDK if you're on Windows 10) > > Then proceed with the Rust installation above. > [!IMPORTANT] > > **Windows ARM users**: After installing rustup, run the following command in a terminal, inside the project folder: > > ```bash theme={null} > rustup target add x86_64-pc-windows-msvc > ``` ## Install MSYS2 1. Visit the [MSYS2](https://www.msys2.org/) website 2. Install it in the default location 3. After installation, open the MSYS2 UCRT64 terminal 4. Run the following command: ```bash theme={null} pacman -S git rsync ``` *** ### Configure the PATH environment variable 1. Search for and open **Edit the system environment variables** in the Start menu 2. Click **Environment Variables** 3. Edit the **Path** variable under **System Variables** 4. Add the following path then reboot your computer: `C:\msys64\usr\bin` > [!NOTE] > > If you have native Windows apps relying on Git, e.g. the PowerShell extension > [posh-git](https://github.com/dahlbyk/posh-git), you may want to install > [Git for Windows](https://gitforwindows.org/) and put it on the path instead, > as msys Git may cause issues with them. You'll need to make sure rsync is > available some other way. ## Choose a good source code location Anki's source files do not need to be in a specific location, but it's best to avoid long paths, as they can cause problems. Spaces in the path may cause problems. ## More For info on running tests, building wheels and so on, please see [Development](/developers/development). # Anki 2.0 add-ons Source: https://docs.ankiweb.net/faqs/anki-2.0-add-ons **Due to the libraries Anki 2.0 uses no longer being supported, [Anki 2.0 has been discontinued](/faqs/anki-2.0-support-has-ended), and may stop working in a future OS update. Please consider updating to Anki 2.1 instead.** If the add-on you want has a 2.0 download link on AnkiWeb, you can download the add-on's .py or .zip file. * If it's a .py file, place it in your add-on folder. * If it's a .zip file, unzip the contents into your add-on folder. Your add-on folder is inside your data folder: [file locations](/manual/files#file-locations) An archive of the old 2.0 add-ons has also been made available. To use it: * Download the add-on archive from [https://apps.ankiweb.net/downloads/archive/addons-2.0.zip](https://apps.ankiweb.net/downloads/archive/addons-2.0.zip) * Extract the zip. * Search through the README file to locate the add-on ID you want. * If it's a .py file, place it in your add-on folder. * If it's a .zip file, unzip the contents into your add-on folder. Your add-on folder is inside your data folder: [file locations](/manual/files#file-locations) **These add-ons are provided as-is, and no support can be provided for them.** # Anki 2.0 support has ended Source: https://docs.ankiweb.net/faqs/anki-2.0-support-has-ended ## Anki Update 1 Jun 2020: An upstream SSL certificate has expired, and this has broken syncing for the remaining users on 2.0. On Feb 1 2020, AnkiWeb received a security update that broke syncing for some Anki 2.0 users. The tools Anki 2.0 was built on are no longer receiving bugfixes or security updates, and there is a risk that Anki 2.0 will stop working without warning. For this reason, we highly recommend you start migrating to Anki 2.1. Syncing with Anki 2.1.x will continue to function. If you have not updated to Anki 2.1.x yet, upgrading is as simple as installing it on your computer, as Anki 2.0.x and 2.1.x use the same file format. You can even switch back and forth if you install 2.0 and 2.1 in separate locations - though please make sure to use the [Downgrade](https://changes.ankiweb.net) button if you're using the latest Anki. For information on the changes in Anki 2.1, please see [https://changes.ankiweb.net/changes/2.1.html](https://changes.ankiweb.net/changes/2.1.html) You can download Anki 2.1 from [https://apps.ankiweb.net](https://apps.ankiweb.net) ## AnkiDroid This change will affect devices running Android 4.4 or below. There is a beta build of AnkiDroid available that should fix syncing on devices running 4.1+: [https://groups.google.com/g/anki-android/c/f9ikzWikjjk](https://groups.google.com/g/anki-android/c/f9ikzWikjjk) ## AnkiMobile Any iOS version from 5 onwards should be fine. # Anki's not showing me all my cards! Source: https://docs.ankiweb.net/faqs/anki-is-not-showing-me-all-my-cards ## Anki decides which cards you see Anki was designed to help you remember large amounts of material for a long time. To do this, it operates differently to a traditional flashcard program. In a conventional flashcard program, you see the same set of cards over and over again, and decide when you want to stop. Repeatedly reviewing material in this way - "cramming" - tends to be what we're used to, and for many people it feels like the natural way to study. There's just one problem with this approach - it's not terribly effective! Studies have shown that you can achieve better results by adding a delay between each review of an item, instead of reviewing it multiple times in a short period. This delay between reviews is called "spaced repetition". In Anki, instead of going over material until you decide to stop, Anki chooses which cards you need to see. If you press the Again button on a card because you've forgotten it, it will be shown again soon. Once you've remembered the card correctly for 10 minutes, Anki will not show the card again until the next day - and if you answer it correctly then, the delay will grow larger each time. If you are new to spaced repetition, you may well be skeptical, and you may still feel that cramming would help you more. You are not alone - studies have shown that people tend to assume that cramming will be more effective, even when results show that spaced repetition actually works better. Please keep an open mind, and try it for a few weeks before you decide which approach is best for you. If you have a test due in a few days, it's probably not the best time to be starting with Anki. While Anki does have tools to bypass the regular scheduling for things like upcoming tests, they take some time to learn how to use, and they are awkward to use on a daily basis. If you have an imminent test, you may want to consider studying as you have done previously, and then picking Anki back up when you're not under as much pressure. ## New cards By default, Anki will show you a maximum of 20 new cards each day. The reason for this limit is because those cards will need to be reviewed in the coming days - such as the next day, and then a few days after, and so on. Each day you use Anki, another 20 cards will be introduced, and the reviews will start to add up - if you're adding 20 new cards each day, you can expect the daily reviews in the early stages to build up to around 200 cards/day. It is possible to increase the number of new cards that are presented each day by adjusting the deck options or using the custom study feature, but please be careful - if you try to learn too many new cards at once, you'll find the follow-up reviews overwhelming, and you'll end up forgetting the material again. While you're no doubt eager to get stuck into your material, it's a good idea to try Anki with the default options for a week or two before you think about changing the limits. ## Reviews Anki will show cards you've previously reviewed when it thinks you will forget them. The delays will start from a single day, but can grow into months or years if you repeatedly answer a card correctly. Unless you have a test coming up soon, it's best to review cards as Anki schedules them. Try to resist the urge to review material multiple times to reinforce it - it is more efficient to just wait a while than to view the same content over and over again. If you do find yourself with free time, consider adding some more new cards to Anki instead, or doing some other studies. If you have a test coming up and need to review the material before it is due, you can tell Anki you'd like to [review outside of the regular schedule](/manual/filtered-decks). If you just want to quickly flip through some cards to check for mistakes after creating them or get a general idea of what's there, you can use the **Preview** button in the upper-right corner of the Browse screen. ## Card counts dropping down by more than one If you're seeing the card count drop down by more than one after certain operations like an undo, please see [https://anki.tenderapp.com/kb/problems/i-created-reversed-cards-but-theyre-not-showing-up](https://anki.tenderapp.com/kb/problems/i-created-reversed-cards-but-theyre-not-showing-up). ## Related [Settings for using Anki to prepare for a large exam](/faqs/settings-for-using-anki-to-prepare-for-a-large-exam) # Anki knockoffs Source: https://docs.ankiweb.net/faqs/anki-knockoffs The Anki ecosystem is made up of Anki, AnkiMobile, AnkiDroid, and AnkiWeb, all of which are linked from our official website: [https://apps.ankiweb.net](https://apps.ankiweb.net) *AnkiApp* (now *AlgoApp*), *Anki Pro* (now *Noji*), and other similarly named apps were developed by separate groups of people, and they are not related to the rest of the Anki ecosystem. They were released years after Anki was already established in the marketplace, and we suspect the names were deliberately chosen to take advantage of the brand recognition we have built up. Using Anki in the name implies that they will function with the other Anki clients, which they do not. If you have downloaded any of these apps in error, please consider leaving a review on the App/Play Store alerting people to the fact that they are not the real Anki. If you purchased a subscription from them, you could try contacting Apple or Google to see if they can refund your money. **Importing from AnkiApp/Anki Pro** Abdo has kindly published [an add-on](https://ankiweb.net/shared/info/2072125761) to help you import decks from AnkiApp (AlgoApp) and Anki Pro (Noji) into Anki. # Anki must be able to connect to a local port Source: https://docs.ankiweb.net/faqs/anki-must-be-able-to-connect-to-a-local-port When Anki 2.1 starts up, it listens on a port on localhost for requests from the user interface. If you have a proxy server configured on your machine, please go into your proxy settings and make sure that "bypass proxy server for local addresses" is enabled - otherwise Anki's user interface will have its local communication redirected through the proxy, which will prevent Anki from functioning. More info: [https://superuser.com/a/261434](https://superuser.com/a/261434) This problem may also occur if you have a firewall running on your machine that blocks local connections, or are using a VPN that is incorrectly redirecting local traffic. # Anki says my clock is wrong Source: https://docs.ankiweb.net/faqs/anki-says-my-clock-is-wrong To ensure your scheduling doesn't get messed up, Anki requires that your device's clock is set correctly. This means all of the following must be set correctly: * the time (including AM/PM) * the date * the timezone * daylight savings If you receive an error about the clock being wrong, please check to ensure all of the above are set correctly. Please note that even if your system is showing you what looks like the correct time, if the above settings are not correct, the computer's internal idea of the correct time may be wrong. **"What should I do if my country has just changed its handling of daylight savings?"** When politicians change the handling of daylight savings time, it can take companies like Windows and Apple time to update their operating systems to reflect the new handling. To work around the problem, you can select a different timezone that has the same UTC offset as your current location, and then update the clock to make sure it is correct. For example: * it's 10AM where you are * you've checked Google for the current standard time, and it's currently midnight: [https://www.google.com/search?q=utc+time](https://www.google.com/search?q=utc+time) * this means you are ten hours ahead of standard time, so your UTC offset is +10:00 * in your system settings, look for a timezone that is +10:00 * after adjusting the time zone, adjust the clock so it shows the correct time **"Why doesn't Anki let me ignore the error?"** If you study while the clock is incorrect, then your progress is likely to be messed up when any of the following happen: * the clock is automatically reset to the correct time in an OS upgrade * you decide to start using AnkiWeb for backups or deck sharing * you decide to start studying on multiple devices * you move to a new machine after the old one breaks * you manually change the time because other apps also notice the clock is wrong Anki refuses to start up because an incorrect clock will also cause issues like file modification times to be wrong, and it's better to address the issue than hide it away and risk issues in the future. # AnkiDroid has a separate support site Source: https://docs.ankiweb.net/faqs/ankidroid-has-a-separate-support-site AnkiDroid is developed by a separate group of people, and has its own support site. Please see this page: [https://ankidroid.org/docs/help.html](https://ankidroid.org/docs/help.html) # AnkiUniversal is not supported here Source: https://docs.ankiweb.net/faqs/ankiuniversal-is-not-supported-here AnkiUniversal is by a separate group of developers and is not fully compatible with the rest of the Anki ecosystem - it does not support things like syncing of media, creating LaTeX images, and so on. You may wish to consider using the official Anki version from [https://apps.ankiweb.net](https://apps.ankiweb.net) instead. If you wish to continue using AnkiUniversal, please direct any questions you have to the AnkiUniversal authors: [ankiuniversal@gmail.com](mailto:ankiuniversal@gmail.com) # AnkiWeb account removal Source: https://docs.ankiweb.net/faqs/ankiweb-account-removal As AnkiWeb is a free service, we need to periodically delete unused account data in order to keep costs down. As mentioned in our terms of service, your data may be deleted if you have not accessed your account or synced in the last 6 months. Once your deck data has expired, it is not possible for us to recover your data from AnkiWeb, but you may be able to recover it if you have a local copy. ## What gets deleted If your AnkiWeb account expires, only the AnkiWeb copy of your data is deleted. Any cards you have stored on your computer, phone or tablet will remain on those devices. ## Returning to AnkiWeb after your data has expired If your account data was deleted due to inactivity, you may still be able to recover that data if you have a copy on your computer or mobile device. You can confirm this by opening Anki or AnkiMobile/AnkiDroid to see if your data is still there. If you had data on your device but accidentally overwrote it in a sync, you may be able to recover it from an [automatic backup](/faqs/restoring-an-automatic-backup-recovering-from-data-loss) If you'd like to start syncing that data with AnkiWeb again, please start by logging in to ankiweb.net using your Email. If your account details are correct, you will find you have 0 cards. Once you have a valid AnkiWeb login, you can sync your computer or mobile device, enter your details, and then choose "Upload" to send your data back to AnkiWeb. Please make sure to upload, as choosing download would overwrite your local content with your empty AnkiWeb collection. ## Avoiding account deletion Each time you visit ankiweb.net, or use the synchronisation feature in Anki, AnkiMobile or AnkiDroid, your account will automatically be marked as active. The mobile clients do not sync automatically, so simply using them to study will not result in your AnkiWeb account being marked active unless you use the sync button. If your account has been inactive for 6 months or more, and you used the service for a week or longer, we will send you an email notifying you that deletion is pending. If you'd like to keep your account active, please log in to ankiweb.net and study a card, or sync one of your devices within 30 days. ## Backing up your collection If you're not planning to study for a while, or if you receive an inactivity notice and don't wish to renew your account immediately, please ensure that you have a copy of your collection on your local computer or mobile device. Your data should already be on your device if you've used Anki's synchronisation feature. If you've only used AnkiWeb before, please install the computer version or a mobile client and sync with AnkiWeb in order to download your data. ## Shared items When you share a deck, a copy of the deck without scheduling information is made, and that copy along with any add-ons you share are not subject to the usual data expiry. Please note however that shared decks will expire if they average less than a few downloads a month, so deck sharing is not a backup mechanism. # Are there limits on file sizes on AnkiWeb? Source: https://docs.ankiweb.net/faqs/are-there-limits-on-file-sizes-on-ankiweb Collections on AnkiWeb are limited to a compressed size of 100MB, and an uncompressed size of 250MB. This includes the text on your cards and the scheduling information, but does not include sounds/images, as they are stored separately. Most users will never reach the limit. 25,000 average-sized cards and several years of review history will take up about 25MB, so to hit the limit you usually need to either be copying large amounts of text into each card, or filling your collection with hundreds of thousands of new cards that you aren't actually studying. At the moment there are no limits on the size of your media, although the size of individual media files is limited to 100MB. As the usage of Anki and AnkiWeb increases, at some point a pricing system may be introduced where basic, low-capacity accounts are free and heavier users can pay more for more space. If you have hit the collection size limit, you will see messages about the collection being in an inconsistent state when you do a one way upload to AnkiWeb. It is not possible to increase the limit, because such large collections slow down AnkiWeb for other users. If you have imported a dictionary's worth of content, you will need to move some unused cards to a separate deck, export the deck, and then delete the deck from your collection. After doing so, Tools>Check Database can be used to free up space that was taken by the deleted cards. # Can I sync only some of my decks? Source: https://docs.ankiweb.net/faqs/can-i-sync-only-some-of-my-decks Anki stores all your decks in a single collection file, so there is no way to sync only part of a collection. However, there are several possible workarounds that may be useful: **Use two profiles.** You can store the decks you do not want to sync in a separate profile (you can create and manage profiles by choosing File → Switch Profile). This is useful if you have a lot of media that you have no need for on your mobile device, or if you cannot place some data on AnkiWeb because of security or confidentiality issues. However, it has the disadvantage that you will have to switch profiles to review all of your decks, and you will not be able to get combined statistics easily. If you decide to use two profiles, you can easily move data between them by exporting .apkg files with scheduling information and media. **Use subdecks.** If your primary objection to syncing all of your decks is that you simply don't need some of them on the mobile device and don't want to clutter up the screen, you may choose to keep them in your collection and sync them, but keep them out of the way in a separate deck. One way to do this is to create a deck called `~ Desktop Only` or something similar and drag all of your desktop-only decks underneath it (the tilde keeps it at the bottom of the deck list; you can use an underscore if you want it at the top or nothing if you want it to sort with the other decks). You can then keep this deck collapsed on your mobile device. While the information will still sync, you will not have to see it. # Can I use Anki in a company or school? Source: https://docs.ankiweb.net/faqs/can-i-use-anki-in-a-company-or-school The following is provided for your convenience. For the exact terms of the computer version license, please read the LICENSE file distributed in the Anki source package. You are free to use the computer version of Anki in a school or company. As per the terms of the license, if you modify Anki, you must make your modifications publicly available. A copy of AnkiMobile must be purchased for each user who wants to use it. Volume licensing is available for academic institutions. ## Sharing Decks The cards you create with Anki are your own, so you are free to license them as you please, and sell them if you wish. Anki does not include any DRM features to prevent users from sharing decks, as its open-source nature means any such protections could be bypassed easily. If your decks turn up on the Internet in violation of your copyright, you are of course free to send takedown notices. If you find your copyrighted content has been uploaded on AnkiWeb's list of shared decks, please let us know and we will remove it as soon as possible. ## Custom Versions We do not have the resources to create custom versions of Anki, AnkiMobile, or AnkiWeb at this time, whether to add DRM or other features. You are free to modify the desktop version of Anki yourself in accordance with the license. ## AnkiWeb AnkiWeb is intended for individual users. People in a school or company are welcome to sign up for their own accounts, but teachers or company staff should not create accounts in bulk for people. AnkiWeb does not currently provide any means of monitoring activity on students' accounts. Because AnkiWeb is a free service targeted at end users, we do not have the resources to sign data processing agreements and similar documents with schools or companies. If you require such documents, alternative products like Quizlet may be better able to accomodate you. AnkiWeb's privacy policy can be found here: [https://ankiweb.net/account/privacy](https://ankiweb.net/account/privacy) # Changing the font Source: https://docs.ankiweb.net/faqs/changing-the-font ## Anki * To change the font you see when reviewing, please see [here](/manual/templates/styling). * To change the font you see when adding or editing, please click the "Fields" button. * To change the font in rows of cards in the browser, please click the "Cards" button, then "More", and then "Browser Appearance". * For buttons, menus and so on, Anki uses your system font settings, so you can alter the size by adjusting the system font scale. If you wish to override the font only in Anki, you can install the [Change Interface Font](https://ankiweb.net/shared/info/1431333984) add-on. ## AnkiMobile * Any changes you make to your card templates will be reflected when studying in AnkiMobile. * You can also tap on the blue cog while reviewing to adjust the font scaling relative to the computer version. # Changing the interface language Source: https://docs.ankiweb.net/faqs/changing-the-interface-language By default, Anki displays interface text such as menus and dialog boxes in the language you selected when you ran Anki for the first time. If you selected wrong or want to use multiple languages, you can change the language in Anki's preferences screen (ctrl+p on Windows/Linux, cmd+, on OS X). After selecting a new language, restart Anki for the new language to take effect. If you've just started using Anki, after restarting, use File>Switch Profile to create a new profile that will use the language you've selected - otherwise things like field names will be in the previous language. # Due times after a break Source: https://docs.ankiweb.net/faqs/due-times-after-a-break When you use Anki every day, each time a card is answered correctly, it gets a bigger interval. Let’s assume that 'good' about doubles the interval. Thus you have a 5 day wait, then a 10 day wait, 20 days, 40 days, and so on. When people return to their deck after weeks or months of no study, they’re often surprised by the length intervals have grown to. This is because Anki considers the actual time the card was unseen, not just the time it was scheduled for. Thus if the card was scheduled for 5 days but you didn’t study for a month, the next interval will be closer to 60 days than 10 days. This is a good thing. If you have successfully remembered a card after a one month wait, chances are you’ll remember it again after a longer wait, too. The same principles which make SRS effective in normal use apply when you’re studying after a delay, too. It also makes little sense to schedule a card for 10 days in the future if you were able to easily answer it after a whole month’s wait - you’d be going backwards. Resetting the deck is an even worse solution. When returning to a deck after a long absence, you may have forgotten many of your cards, but chances are you haven’t forgotten them all. Resetting the entire deck means you have to waste time studying material you already know. Now you may find overdue cards that you were able to recall, but not comfortably, since they were not reviewed when they should have been. To counter this, Anki treats the delay differently depending on your answer. If you find a card easy, the last interval plus the full delay are added together, and then used to calculate the next interval. When you answer good, only half the delay is used. And when you answer hard, none of the extra delay is used. So if a card was due in 5 days, and it’s answered 20 days late, the next times you’d end up with are approximately: * Hard: 5 \* 1.2 = 6 days * Good: (5 + 20/2) \* 2.5 = 37.5 days * Easy: (5 + 20) \* 3.25 = 81.25 days The exact numbers will depend on your past performance with the card, and your deck settings. If you find a card hard, the next interval is conservative and any extra delay is discarded. If you find it good, the next interval is only about 50% higher. And easy increases the interval aggressively as usual. So it is recommended that you study as normal when you return to Anki after a period of absence. But if you absolutely must reset the deck, you can select the cards to reset in the browser, and use **Cards**->**Reset** (or **Cards**->**Forget** in older versions). # Email verification Source: https://docs.ankiweb.net/faqs/email-verification AnkiWeb was previously lax about verifying your email address, sending a message out when you sign up for an account but not requiring that it be responded to. The problem with this is that email hosts don't like it when email is sent to invalid addresses, and we risk the messages we send about the service landing in the spam folder or being dropped completely if the email providers decide the valid/invalid ratio is not good enough. So to address this, we've had to start verifying your email address is valid once a year. Once you click the link in the verify email message, it tells us your address is current and we are known to you, so we can send you service-related mails in the future (like when you reset your password) with a reasonable degree of certainty that the mails will not bounce back. Please note our privacy policy has not changed - we will only use your email address for messages related to Anki. # Emails not being received due to "spam" Source: https://docs.ankiweb.net/faqs/emails-not-being-received Emails not being received Some email providers (typically school or business email) outsource spam checking to external companies. Some of these external companies can be heavy-handed when fighting spam, and collateral damage unfortunately happens - innocent parties such as AnkiWeb can end up getting blocked when a different customer on the same network has sent inappropriate mail. If you have access to an email address at another provider, the fastest solution is to use the Account tab of AnkiWeb to change to your other email address. If you do not have access to another email address, you could try asking your email provider to remove 23.249.217.77 from the block list they are using. It is a dedicated IP used only by AnkiWeb, hosted in Amazon's network. If your email provider are not able to fix the problem for you, please sign up for a free email address at somewhere like gmail.com instead, as they reliably accept the email we send. # "Error establishing a secure connection." when syncing Source: https://docs.ankiweb.net/faqs/error-establishing-a-secure-connection-when-syncing This error happens when Anki tries to make a connection to AnkiWeb, and receives an invalid response. It can be caused by: * antivirus or firewall software on your machine * a filtered network connection, common on work and school networks * an unreliable network connection **Antivirus/firewall/VPN/proxy** Antivirus, firewall and VPN programs can often cause problems when they filter network traffic. The first thing to try is to add an exception for Anki. If that doesn't work, try disabling your antivirus temporarily. Unfortunately some antivirus programs do not completely stop themselves when disabled. We have seen cases where the only way to resolve the problem was to completely uninstall the antivirus program. We do not expect you to stop using your antivirus program just to run Anki, but if the previous suggestions have not helped, it is worth uninstalling and restarting your computer to see if it resolves the problem. If it does, then please contact your antivirus company to report the issue to them. **Unreliable internet** If your wifi or internet connection is experiencing troubles, the messages from AnkiWeb may arrive corrupted or not at all, which can cause this error message to occur. It may be worth checking for packet loss: [syncing failed connection timed out errors when syncing](/faqs/syncing-failed-connection-timed-out-errors-when-syncing) # Extra copies of a card are coming up Source: https://docs.ankiweb.net/faqs/extra-copies-of-a-card-are-coming-up Occasionally you may have been editing a note type and later discover that a number of cards are duplicated (sometimes there may even be more copies). You can fix this as follows: 1. Find one of the duplicated cards in the browser. 2. Click the Cards button. 3. Select each card type in the top drop-down box in turn, and compare the contents of the template fields and card preview pane. If the card types are identical, delete one of them (Options → Delete). This should remove all the duplicate cards that use this note type. (If you are still having problems, it's possible that multiple note types have the issue, in which case you can repeat these steps with a card of the other note type.) # Frequently asked questions about FSRS Source: https://docs.ankiweb.net/faqs/frequently-asked-questions-about-fsrs *** Q1: My first interval for **Good** is 3-5 days, and my first interval for **Easy** is over a week long! Is this normal? A1: Yes. FSRS tends to give longer first intervals than SM-2, but for mature cards the opposite is true - FSRS is more conservative. If you wish to make the intervals shorter, you can increase your desired retention. But note that this will shorten all the intervals, not just the first intervals. *** Q2: I only use **Again** and **Good**, will FSRS work fine? A2: Yes. In some cases, FSRS may even be more accurate if you only use **Again** and **Good**. *** Q3: Is it better to use the same parameters for all my decks or make several different presets with different parameters? A3: The answer to this question depends entirely on how similar your material is. For example, if you are learning Japanese and geography, it is recommended to use two different presets with different parameters. If you have two decks with Japanese vocabulary, you should use the same preset for both of them. Generally speaking, it's usually better to have different presets. *** Q4: How often should I re-optimize parameters? A4: Once per month should be more than enough. A more sophisticated rule is to optimize every time the number of reviews doubles: after you did 100 reviews, then after 200, then after 400, etc. But the "one month" rule is simpler. *** Q5: Does FSRS take into account the amount of time that I spend reviewing a card? A5: No, FSRS only uses interval lengths and grades. However, the amount of time you spend on reviews is used when calculating optimal retention using the "Compute minimum recommended retention" feature. *** Q6: Do I need 1000 reviews before I can optimize parameters? A6: That was the case in earlier versions of Anki. In Anki 24.06.3 (and newer versions), the optimizer can be used with any number of reviews. *** Q7: Is there an optimal number of new cards per day that I should be doing with FSRS? A7: No, FSRS works equally well regardless of whether you are learning 5 or 50 new cards/day. # Hard/good interval is longer than good/easy Source: https://docs.ankiweb.net/faqs/hard-good-interval-longer-than-good-easy When a card is in learning: * Again will be the first learning step * Hard will repeat the current learning step (except on the first step, where it is the average of first and second steps) * Good will the the next learning step, or the Graduating interval if learning steps are exhausted * Easy will be the Easy Interval If the [learning steps](/manual/deck-options#learning-steps) are set to be longer than the [graduating or easy interval](/manual/deck-options#graduating-interval), Hard/Good might show longer intervals than Good/Easy. # How can I donate / contribute? Source: https://docs.ankiweb.net/faqs/how-can-i-donate How can I donate? As Anki is run as a business, it is difficult to accept donations. Instead, we make available [AnkiMobile](https://apps.apple.com/us/app/ankimobile-flashcards/id373493387) to raise funds for development. You can purchase AnkiMobile on your Apple mobile device, and the proceeds from it go towards supporting Anki's development. If you use the Android app, you can also donate to [AnkiDroid](https://opencollective.com/ankidroid), which is developed by a different team. From time to time, people request other ways to contribute, such as by making donations via a site like Patreon, or via something like BitCoin. These would take time to set up and maintain, as we need to ensure no laws are being broken, and relevant taxes are being paid. At the moment we feel that the time is better spent working on Anki instead. If you're unable to purchase the app for yourself or a friend, there are still other ways you can contribute. Answering questions over on the [user forums](https://forums.ankiweb.net) is a big help, as every question the developers don't need to answer means more time that can be spent working on Anki. And if you don't feel comfortable answering questions, telling your friends about Anki helps out too. # I'm going on vacation. Can I pause the scheduler? Source: https://docs.ankiweb.net/faqs/i-am-going-on-vacation-can-i-pause-the-scheduler Being able to come back from a break to find Anki in exactly the same state you left it in may sound attractive, but unfortunately while it's easy to tell the computer to suspend its estimates of how quickly you are forgetting, it's not possible to suspend your memory, so memories will continue to decay if you don't review. If you paused the scheduler, you would be delaying the review of every card in your deck, increasing your chance of forgetting every one of them, even those that would normally have appeared after you returned from your break. Anki does have a "Set Due Date" feature in the Browse screen that can change the due date of cards. You can use this to either to move cards to an earlier due date (allowing you to study more before you take a break), or to push cards back to a later date. Conservative changes are recommended - if you alter the due date of cards by too much, there is a good chance you will forget them and need to relearn them again. # Learning steps are skipped or repeated Source: https://docs.ankiweb.net/faqs/learning-steps-skipped-or-repeated If you change the learning steps while cards are already in learning, you may find the cards skip or repeat steps until you mark them Again or they graduate the learning queue. This issue no longer exists if you change the learning steps in Anki 2.1.55+. # Media files may take time to sync Source: https://docs.ankiweb.net/faqs/media-files-may-take-time-to-sync Please take a look at the [media syncing intro video](https://www.youtube.com/watch?v=phP9GGG-PxY\&yt:cc=on). If you prefer not to watch a video, please read on. Recent Anki and AnkiMobile versions synchronize sounds and images in the background, allowing you to continue using the app while they are transferred. Until the media files have been transferred, audio may fail to play, and images may fail to appear if those files are not available yet. If you tap/click on the sync button when a spinner is shown next to it, it will reveal more details about the syncing progress. If you are waiting for sounds/images to start working, please wait for that window to show "media sync complete". Once that message has been displayed, it indicates all media files have been transferred to or from your device, and the media should then work during study. ## AnkiMobile If you turn your device's screen off, or you switch to a different app, it will interrupt the sync. When you sync again, the download will resume where it stopped. If you have a lot of media, the initial sync may take quite a while. AnkiMobile 2.0.64+ will keep the screen turned on while the media syncing screen is shown. Older AnkiMobile versions did not do this, so if you are on an older version and you leave your device unattented, the screen may turn off, interrupting the sync. You can check the version you're running in the Preferences>About screen. If you are on an older version, you can download the free update by searching for AnkiMobile in the app store. ## Monitoring progress The media sync screen will show increasing counts as progress is made. If you find the added/removed count does not change for an extended period, you can use the Abort button to interrupt the sync, then sync again to pick up where you left off. ## If problems persist If sounds or images fail to appear after "media sync complete" is shown, please check that you have syncing of sounds and images enabled in the preferences screen of each Anki version you use, and please use the "Check Media" function in the preferences screen or tools menu to check if you are missing files. # My antivirus program says Anki is infected! Source: https://docs.ankiweb.net/faqs/my-antivirus-program-says-anki-is-infected Antivirus programs sometimes get things wrong. This is especially so when we release a new version - some AV programs assume that because the new version has not been seen in the past that it must be dangerous. We are careful about security, and the chances of a virus making it into an Anki release are very slim. If you've received a message from your antivirus, please contact your AV vendor to let them know about the false positive. # Outlook.com silently discards email Source: https://docs.ankiweb.net/faqs/outlook-silently-discards-email Microsoft's email servers do not reliably deliver email. There are numerous reports on the web of email being successfully delivered to Microsoft's servers, but failing to show up in a user's inbox - even in the spam folder. You may be able to work around this by clicking on the cog icon in your inbox, going to "Safe and blocked senders", and adding `noreply@ankiweb.net` to the list of safe senders. You can then visit AnkiWeb's verification page and refresh it until another verification email is sent. If problems persist, you will need to use a different email provider (such as a free gmail.com account) that reliably delivers email. Verifying your email may be frustrating, but it is important to have a working contact method - without one, you would not be able to recover your account if you forgot your password. # Requesting a refund for AnkiMobile Source: https://docs.ankiweb.net/faqs/requesting-a-refund-for-ankimobile If you're having a problem with AnkiMobile, please let us know and we'll do our best to help you resolve it. The App Store is run by Apple. When you purchase an app on it, you pay money to Apple. They keep part of your money, and send the remainder to us about a month later. They do not tell us who has purchased the app, and do not give us any ability to confirm you've made a purchase, or to initiate a refund. For this reason, any refund requests need to be made to Apple directly. Please note that except when required by law, refunds are at Apple's discretion. If it's your first time requesting a refund, there's a good chance they'll refund your money, but this is not guaranteed. Please see the following page for more information: [https://support.apple.com/en-au/118223](https://support.apple.com/en-au/118223) We have heard reports that some Apple Support representatives, when refusing a refund, are suggesting you contact us instead. That is misleading, as they know we do not have access to your payment details, and cannot confirm you've purchased the app, or remove your access to it. If Apple have refused to refund you, unfortunately that is not something we can change. # Resetting progress in a deck Source: https://docs.ankiweb.net/faqs/resetting-progress-in-a-deck Sometimes you may want to "reset" part of your collection so that the cards become new again and the scheduling algorithm starts from the beginning. For instance, you might have completely changed a card or updated it so that you need to start learning it again, or you may have flipped through some cards without really studying if you were just trying to take a look at the cards or figure out how Anki works. **Resetting part of your collection because you are behind is not recommended.** While it can be tough to recover from a backlog of cards, erasing all the progress you have made is the worst possible thing you can do: you will still remember many of those cards, and you'll have to start them all over even though you could have pushed "easy." Instead, consider setting up a [daily review limit](/manual/deck-options#daily-limits) ("maximum reviews/day" in the options) and studying a set number of the overdue cards each day until you catch up. ## Resetting cards within Anki 1. Find the cards you want to reset in the browser. 2. Select all the cards and choose **Cards**->**Reset** (or **Cards**->**Forget** in older versions). When you do this, Anki will turn the cards back into new cards. If you click **Info** in the browser you'll see any previous reviews you've done listed there, but that history will not influence how the cards are scheduled: they will be treated just like new cards. ## Removing the review history If you accidentally imported the review history of someone else, because they shared their deck with scheduling, you can use the [Remove card history](https://ankiweb.net/shared/info/2089200096) add-on to remove the history of selected cards. # Retrieving AnkiMobile crash logs Source: https://docs.ankiweb.net/faqs/retrieving-ankimobile-crash-logs Crash logs help us identify what's going wrong when AnkiMobile crashes. To share your crash logs, please: * Go to the Settings app on the home screen, and tap on 'Privacy' * Then tap on 'Analytics Data' * Scroll down until you find 'anki' - there should be a report for each crash. * Tap on the latest 'anki' one. * Tap the share icon and mail the report to yourself * Grab the file from your email, and attach it to a support ticket here # Running from Python Source: https://docs.ankiweb.net/faqs/running-from-python If you experience startup problems or crashes with the packaged builds of Anki that you are unable to resolve, you can try running directly via Python as a last resort. The instructions below are provided for Windows users, as these problems seem most prevalent on Windows, but a similar approach can be taken on other platforms too. 1. Install [https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe](https://www.python.org/ftp/python/3.9.13/python-3.9.13-amd64.exe). Customize the install location, and choose `c:\python` 2. Open the Start menu, and open a Command Prompt. 3. Type in the following and hit enter: ``` \python\python -m venv \anki-venv ``` 4. And then the following, which will take a while: ``` \anki-venv\scripts\pip install aqt orjson pyqt6-webengine ``` 5. Finally: ``` \anki-venv\scripts\anki ``` If that solves your problem, you can start Anki again in the future by repeating steps 2 and 5. If you still experience problems, you can try changing the Qt version: ``` \anki-venv\scripts\pip install pyqt5==5.15 pyqtwebengine==5.15.0 ``` If that does not help either, and you have already followed all the steps on [when problems occur](/manual/troubleshooting), then you may unfortunately be out of luck. # Screenshots large and blurry on retina displays Source: https://docs.ankiweb.net/faqs/screenshots-large-and-blurry-on-retina-displays If you edit a card, click on Cards, and then place the following at the very bottom of the styling section, it will shrink screenshots down to the correct size: ``` img[src*="Screen"] { zoom: 50%; } ``` It works by targeting any filenames that have "Screen" in them - which applies to the default "Screen Shot" name that macOS uses. If your screenshots use a different but consistent name, you can adjust the line above. If your screenshots use names that don't have a consistent pattern, you can remove the square brackets and the text inside them, which will cause all images to be matched. Images from high resolution displays will now look correct, but images you obtain from other sources may now look too small. Unfortunately there is no good solution to this problem at the moment - the web technologies Anki uses do not have a way of detecting which images need to be resized. Resizing the images prior to adding them to Anki will allow you to mix and match other images, but it requires some setup: [https://www.quora.com/How-can-I-get-my-retina-Mac-to-not-take-screenshots-that-are-too-big](https://www.quora.com/How-can-I-get-my-retina-Mac-to-not-take-screenshots-that-are-too-big) # Settings for using Anki to prepare for a large exam Source: https://docs.ankiweb.net/faqs/settings-for-using-anki-to-prepare-for-a-large-exam If you have started using Anki to help prepare for a large exam some weeks or months in the future, you may wonder how you should best configure it to get you ready for the test. Anki’s default settings are primarily configured to be useful for learning and remembering information over the long term, but this is usually the best way to prepare for an exam as well – you just need to make sure that you finish the material in enough time to be ready for the exam when it comes. ## How many new cards per day? The most important question is how many new cards you need to study every day in order to be ready by the time the test comes around. A very simple way to calculate this is to divide the total number of cards you have by the number of days you have to study, but before doing this, you should usually make a couple of modifications to the number of days you have to study: * If you have the time, generally it is a good idea to leave 2–4 weeks between the time you will study the last new material and the time you will be tested on it. This way, you have time to consolidate all of the material so you will feel confident on it, as well as some time to do extra review right before the test. So you should subtract somewhere between 14 and 30 days from the number of days you have left. * If you’re like most people, you probably will miss a few days of study now and then, so it’s a good idea to plan to subtract a few days for this so that you won’t get further behind when you do. * If you anticipate adding more cards between now and the exam, you will need to account for the amount of extra material you plan to add. After making these modifications, you can divide the total number of cards in your deck by the adjusted number of days to get the number of new cards per day you should study; you can set this number on the **new cards** tab of the deck options screen. You can find out how many new cards are in the deck by selecting it in the deck list, choosing **Browse** at the top of the window, pressing Enter to search for the current deck, and looking at the title bar. ## Doing extra review If you get through all of your new cards with time to spare and your exam is in a couple of days, you may wish to run quickly through all of your cards or some subset of them to brush up on the ones that you’ve forgotten since your last review. You can use Anki’s [custom study](/manual/filtered-decks#custom-study) feature to study extra cards; please see the linked section of the manual for instructions and available options. # Shared decks with broken Javascript Source: https://docs.ankiweb.net/faqs/shared-decks-with-broken-javascript Some shared decks make use of a feature called 'Javascript', which allows them to dynamically modify the display of the card. Javascript can be fragile, which is why the Anki manual recommends deck authors avoid it. It may break when Anki is updated, or when the deck author has not tested their Javascript on the different Anki platforms. If you encounter a Javascript error in a shared deck, please post a review on the shared deck download page to let the deck author and other users know of the problem. If the deck author is active, they will hopefully address the issue in a future update. If the deck author is unable to help you, you can try edit your card template to remove the Javascript to prevent an error from showing. Depending on what the Javascript was doing, this may result in lost functionality. To do so, using the computer version of Anki: * Use File>Export to export your entire collection with scheduling information. This will give you a backup that you can restore to if anything goes wrong. * Edit a card, and click the Cards... button. * Look for areas in the front and back template that start with ``. Remove the start and end, and everything in between. * Confirm that the card displays in the review screen without error. If it's working ok, you can sync your changes to AnkiWeb and then to your other devices. * If removing the script has completely broken the card, use File>Import to restore to the backup you created. # A shortcut key is not working Source: https://docs.ankiweb.net/faqs/shortcut-not-working Some other program on your computer is likely capturing the shortcut. For example, some users have recently reported that their AMD/ATI video card software is stealing the cloze deletion shortcut key. When they disable the shortcut in that program's preferences, the key starts working in Anki again. If you run into similar problems, please try temporarily closing/turning off other software running on your machine, until you discover the cause. If you use add-ons in Anki, please also try disabling them to rule them out as the cause of the problem. In some cases, using a non-English keyboard layout may cause the problem. # Sounds/images are not appearing on AnkiWeb or the mobile clients Source: https://docs.ankiweb.net/faqs/sounds-or-images-are-not-appearing-on-ankiweb-or-the-mobile-clients If you created your deck by importing from a text file, or you downloaded a shared deck that was created in that way, it's possible the filenames in Anki do not match the filenames on the computer. Some computers treat "file.jpg", "file.JPG" and "FILE.JPG" all as the same file, but other computers do not. This means that if the deck contains a reference to "dog.jpg" but the file on disk is "dog.JPG", some devices (including AnkiWeb) will not be able to display the image. You can confirm this is a problem by editing a card that's not showing up correctly using the computer version. If audio isn't working, you'll see a link like `[sound:hello.mp3]`. If you see a broken image link, click on that field, then press the down arrow on the top right, choose "Edit HTML", and locate text that looks like: ```html theme={null} ``` Note down the name of the file. Then open your collection's media folder ([file locations](/manual/files#file-locations)) and locate the file that is referenced. If the file does not use exactly the same combination of lowercase or uppercase letters, you've found the problem. Please also make sure you [ran a media check](/manual/media#manually-adding-media). If it was a shared deck, please report the issue to the shared deck author. If the differences in case are regular, you can try fix the problem using Anki's find\&replace feature in the browser. For example, if the link is for "dog.JPG" but the file on disk is "dog.jpg", you can click browse, select all cards, and use find\&replace to replace JPG with jpg. If that doesn't explain your issue, please check that the computer you're on is not using a vfat/fat32 file system. Anki currently is unable to detect changes to the media folder when it's on such a filesystem, so media syncing will not work in this case. A workaround is planned for a future release. # Can I study my cards in a particular order? Source: https://docs.ankiweb.net/faqs/study-in-a-particular-order ## New cards By default, new cards are introduced by their due number. If you open the Browse screen and look at the due column, you'll see new cards have numbers like New #1, New #2, and so on. Anki will show the card with the smallest due number first. If you'd like to change the order, you can select one or more cards, then use the Reposition action in the Cards menu. The number of new cards that will be introduced each day depends on the daily limits you've set in the deck options. When you have multiple cards for a note (for example, both forward->backward and backward->forward cards, or multiple cloze deletions on a note), those cards will have the same new number, and you may want those cards to be shown on different days, or spaced apart, or shown one after the other depending on your preferences. * To have the cards shown on different days, enable burying in the deck options. * Sibling cards are spaced apart by default. * To have the cards shown next to each other, enable the [v3 scheduler](./the-2021-scheduler), and then change the sort order in the deck options, in the display order section. ## Reviews Because Anki is [designed to show you cards again when you're about to forget them](./anki-is-not-showing-me-all-my-cards), it is not possible to preserve the original order when cards come up again for review, as the cards may have been scheduled on different days. For this reason, you should design your cards so that they do not rely on context or certain other cards having been seen first, or you'll find it difficult to review them. If you have a backlog of reviews, there is some flexibility in the order review cards are presented. After enabling the [v3 scheduler](./the-2021-scheduler), please see the display options in the deck's options. While the regular review process will not show cards in order, you can use the [Browse screen](/manual/browsing) to sort your cards in a particular order, and then use the Preview button to go through the cards in that order. This bypasses Anki's usual learning process, and will not alter the scheduling of the cards or their review history. # Synchronizing multiple profiles Source: https://docs.ankiweb.net/faqs/synchronizing-multiple-profiles **Profiles** are a feature designed to allow multiple people to study with Anki on the same device. They may also be useful for testing and other similar purposes, but this is not their primary purpose. Profiles are *not* recommended for dividing up your content, as doing so is unnecessary and limits your options in terms of viewing statistics and moving content around. Profiles are also unsupported on AnkiDroid. Anki is designed so that each profile syncs with a single AnkiWeb account – this way, each user can have their own account and use it on whichever devices they want. If you have created multiple profiles for yourself, the best option is to merge them into a single profile. You can do so by exporting one deck from profile A, and then importing it into profile B, repeating for any other decks in profile A, until everything is in profile B. If you have different users on your computer, each user will need to set up a separate AnkiWeb account for their profile. Attempting to sync different profiles with the same AnkiWeb account will result in lost data. # 'Syncing failed: Connection timed out' errors when syncing Source: https://docs.ankiweb.net/faqs/syncing-failed-connection-timed-out-errors-when-syncing **Antivirus/firewall software on Windows and corporate/school networks** If syncing never appears to make any progress, it is possible that Anki is completely blocked from connecting to the internet. In that case, you may need to add an exception in your antivirus/firewall, or ask your network administrators for assistance. For more information, please see [error establishing a secure connection when syncing](/faqs/error-establishing-a-secure-connection-when-syncing) **If the sync appears to make some progress** When you sync, Anki sends messages to AnkiWeb, and these messages typically flow through a number of networks and countries before they reach AnkiWeb. If one of the networks between you and the AnkiWeb servers is experiencing issues, this can result in connections that run slowly or terminate abruptly. A typical cause of this is when your internet provider experiences a problem with one of their international links. When this happens, you may find you can access most other sites without any problems, because those sites are hosted in different geographical locations, and thus your connections to them use different networks. Such problems typically take a few hours to a few days to clear up. Sometimes the problems can be caused more locally. If you're on a distant or congested wifi network, that can also cause the connection to AnkiWeb to become unstable. Unstable connections tend to become more apparent the more data you transfer. If you are experiencing packet loss you may find you can load ankiweb.net fine most of the time, but still have issues when syncing - especially if you have a lot of data to transfer. **Working around the issue** The best thing to do is try syncing on a different network - using your phone's cellular connection for example, or using your work or school's wifi network. In many cases you will find that resolves the problem, and after waiting a few hours to a few days, the problem with your home network should have gone away. **Determining packet loss** A tool called 'mtr' can be useful for determining packet loss. * Windows: [https://sourceforge.net/projects/winmtr/](https://sourceforge.net/projects/winmtr/) * Mac: [https://www.reddit.com/r/TagPro/comments/2j6qx7/how\_to\_run\_an\_mtr\_on\_mac/](https://www.reddit.com/r/TagPro/comments/2j6qx7/how_to_run_an_mtr_on_mac/) * Linux: install 'mtr' from your package manager Once installed, you should use mtr to access 'ankiweb.net', and let it run for about 15 minutes. If any of the steps between your device and the AnkiWeb servers show a packet loss above 0%, it indicates instability. If you are seeing no packet loss at all but are still having problems syncing, you may be having a different problem - please contact us and let us know. # The Anki v3 Scheduler Source: https://docs.ankiweb.net/faqs/the-2021-scheduler The 2021 scheduler ("v3") is an update to the [Anki 2.1 scheduler](./the-anki-2.1-scheduler) ("v2"). ## Enabling As of Anki/AnkiMobile 23.10, and AnkiDroid 2.17, the v3 scheduler is the default and only option. On earlier versions, the scheduler can be changed from the preferences screen. ## Compatibility The v2 and v3 schedulers are compatible. You can switch between them without a full sync, and it will not cause scheduling issues if you use v3 on one device and sync with another device that is using v2. Client support: * Anki: 2.1.45+ * AnkiMobile: 2.0.75+ * AnkiWeb: yes * AnkiDroid: 2.17.0+ Because the v3 scheduler uses a different approach to gathering and sorting cards, a v2 and v3 client may show a different number of due cards on a given day, and may show them in a different order. ## Changes ### Undo The v3 scheduler uses Anki's new undo infrastructure: you can answer a card, bury another card, answer a different card, then undo each action in turn. Previous schedulers handled undo for review and non-review actions separately, so performing an action for one would clear the undo history for the other. ### Daily limits By default, the review limit in the v3 scheduler also applies to new cards, so that new card introduction is reduced/paused when you have a backlog of reviews. For example, if you have limits of 200 review cards and 20 new cards, and 190 review cards are due, only 10 new cards will be introduced. This prevents the backlog from getting worse. If you find this happening, the recommended solution is to increase your review limit, and work through the backlog before you add more new cards. If you're sure you want to add more new cards even though you have a backlog, you can enable the "New cards ignore review limit" option in deck options. The limits of each deck will control the number of cards that are gathered from that deck and its subdecks. Limits are applied from the deck you select, so if you select a child deck, its parents' limits will not apply. For example, if the following limits are set: * Parent: 100 * Parent::Child: 30 * Parent::Child::Grandchild1: 50 * Parent::Child::Grandchild2: 5 * Parent::Child::Grandchild3: 200 Then: * If you select Grandchild3, you'll get up to 200 cards. * If you select Grandchild2, you'll get up to 5 cards. * If you select Grandchild1, you'll get up to 50 cards. * If you select Child, you'll get up to 30 cards from the Child deck and its subdecks. No more than 5 cards will be taken from Grandchild2. * If you select Parent, you'll get up to 100 cards, with a maximum of 30 coming from Child and its subdecks. In earlier Anki releases, the v3 scheduler did not respect intermediate limits, so when clicking on parent, the limits of child did not influence how many cards were taken from the grandchild decks. ### Sorting Additional deck options have been added to control the order new cards and review cards are presented in. New cards can be mixed from multiple decks, and review cards can optionally be ordered by interval or subdeck. When burying is disabled, with the v3 scheduler it's possible to control whether siblings are shown together or not, by adjusting the display order. The options controlling the mixing of new cards and interday learning cards have been moved from the Preferences screen into the deck options. The options will be used from the deck you select to study. ### Burying When burying is enabled, cards are now excluded from the card counts at the start of a study session. Previously if you had 10 forward and 10 reversed cards, the counts would start at 20 and jump down as you review, but with v3 they'll start directly at 10. Because siblings are skipped when you click on a deck, the counts you see on the deck list will differ from the ones you see when you click on a deck. The overview screen will point out the number of cards that were waiting but have been skipped. Learning cards that cross a day boundary ("interday learning cards") can be buried like review and new cards. ### Fuzz The small random delay added to intervals is reflected on the answer buttons, instead of only being applied when answering. The way the delay is calculated has also been improved - cards with intervals under a week receive a more equally-weighted delay, and the delay amount increases more smoothly as intervals increase. ### Interday learning Interday learning cards are now subject to the review limit. When determining what fits within the limit, Anki gathers interday learning cards first, then review cards, and finally new cards. ### Filtered decks Filtered decks with rescheduling disabled show 4 answer buttons. You can configure a time delay for each button. Setting this delay to 0 for an answer button means that button will return the card to its home deck. In earlier releases, a delay could be configured for "Again". "Hard" used 1.5x that delay, whereas "Good" used 2x that delay, and "Easy" returned the card to its home deck. ## Add-ons and custom scheduling The v3 scheduler is a ground-up rewrite, so add-ons that modified the previous scheduler's card-gathering or answering routines will not work with it. It is no longer possible to selectively replace parts of the scheduler's code ("monkey patching"), so some add-ons may not be practical to port without significant effort. However, the v3 scheduler does provide more control over the scheduling. As each card is presented, the times and states associated with each answer button are calculated in advance, and it is possible to modify the calculated scheduling with some JavaScript code entered into the bottom of the deck options screen. The code you enter applies to the entire collection, and not just decks using the preset. Here's an example. Please note that it uses modern JavaScript that will need to be transpiled if you want to use it with the Qt5 version of Anki. For example: ```javascript theme={null} // print the existing states console.log(JSON.stringify(states, null, 4)); // load the debugger if the web inspector is open debugger; // if the hard button is a learning step, make it // a 123 minute delay if (states.hard.normal?.learning) { states.hard.normal.learning.scheduledSecs = 123 * 60; } // apply the same change in a rescheduling filtered deck if (states.hard.filtered?.rescheduling?.originalState?.learning) { states.hard.filtered.rescheduling.originalState.learning.scheduledSecs = 123 * 60; } // increase ease factor by 0.2 when Easy used on a review if (states.good.normal?.review) { states.easy.normal.review.easeFactor = states.good.normal.review.easeFactor + 0.2; } ``` Because this is implemented in JavaScript, it is not limited to the computer version. AnkiMobile and AnkiDroid both support it as well, and AnkiWeb may also support it in the future. This will allow advanced users to make adjustments to the standard scheduling behaviour, that apply on all platforms. The various scheduling states are described in [SchedulingStates](https://github.com/ankitects/anki/blob/main/proto/anki/scheduler.proto). # Old scheduler versions Source: https://docs.ankiweb.net/faqs/the-anki-2.1-scheduler The Anki 2.1 scheduler This section includes information about the currently outdated scheduler versions. ## v1 scheduler ### Review cards * When a deck has subdecks, the cards appear from each deck in turn. * The v1 scheduler applies parent limits to subdecks, regardless of which deck you click on to study. ### (Re)learning cards * The **Easy** button is not shown if the card is in relearning state. In learning state, both **Easy** and **Hard** isn't shown. * The card count shows reviews needed to finish all the cards in a queue, not the number of cards. Thus, one (re)learning card can be counted multiple times in the count. * Suspending or burying (re)learning cards move them back to the new card queue or review queue. ### New cards * The v1 scheduler applies parent limits to subdecks, regardless of which deck you click on to study. ### Filtered decks * Cards are presented more similarly to how they normally are, but studying cards have side effects, and the original position of new cards is lost when you study them. * The custom steps option allows you to override the home deck’s steps and provide your own steps instead. The provided steps apply to both cards being learnt, lapsed reviews, and reviews ahead of time. * If you create, rebuild, empty, or delete a filtered deck while cards are still in learning, they are turned into new cards. In the case of failed reviews in relearning, any remaining relearning steps are skipped. * Cards cannot be buried or suspended while remaining in filtered deck. * Filtered decks only have a single filter. * Filtered decks cannot pull in cards in (re)learning state. * Filtered decks don't show all 4 answer buttons when rescheduling is turned off. ### Fuzz factor * Fuzz factor isn't included in next review time shown above answer buttons. If you’re noticing a slight discrepancy between what you select and the intervals your cards actually get, this is probably the cause. ## v2 scheduler ### Review cards * When a deck has subdecks, review cards are gathered from all subdecks at once. * The review limit is taken from the deck you click to study. If you have a deck tree Parent::Child::Grandchild and you select Child, the limits you have set on Parent and Grandchild are ignored. ### New cards * The v2 scheduler applies parent limits to subdecks, regardless of which deck you click on to study. ### Filtered decks * Filtered decks don't show all 4 answer buttons when rescheduling is turned off. ### Fuzz factor * Fuzz factor isn't included in next review time shown above answer buttons. If you’re noticing a slight discrepancy between what you select and the intervals your cards actually get, this is probably the cause. ## Updating to v2 from v1 If you are syncing with AnkiWeb, updating requires a one-way upload to AnkiWeb. Please ensure all of your devices are in sync before you update, as otherwise you may accidentally overwrite changes made on your other devices. Before updating, it is recommended you export a backup. Using the computer version, you can use the **File > Export** menu item to create a `.colpkg` file containing all decks and scheduling. Using AnkiMobile, you can use the **Add/Export** option to export a `.colpkg` file. In the unlikely case that you run into problems, you will be able to restore from the backup. Once you have updated, please sync and choose **Upload** to send the upgraded collection to AnkiWeb. Then please sync any other devices you use, choosing **Download** on each of them, to bring things back into sync. ### Anki 2.1.41+/AnkiMobile 2.0.75+ To update, click the Update message shown in the deck list. Unlike previous Anki versions, cards in learning will not be reset, and cards in filtered decks will remain filtered. The new scheduler handles filtered decks differently, so custom steps you may have set will no longer apply, but filtered decks with rescheduling enabled will not reset learning cards. Once you've updated, there is no option to switch back to the old scheduler. While it is possible to switch back to an older version of Anki on your computer and then change the scheduler in the preferences, please bear in mind that it will require your learning cards and filtered decks to be reset. ### Earlier Anki versions Anki versions earlier than 2.1.41 reset all cards in learning prior to updating, and move all cards in filtered decks back to their original decks. This is problematic for people with longer learning steps. If you're in that situation, it is recommended you update with 2.1.41 or later. # Importing/exporting fails due to timestamps in the future Source: https://docs.ankiweb.net/faqs/timestamps-in-the-future Some shared decks include cards/notes with invalidate creation dates, eg they say cards were created in the year 40000 instead of the year 2023. This causes a variety of problems, and causes any cards created after importing such a deck to end up with similarly-invalid timestamps. To prevent this problem spreading, recent Anki versions will refuse to export decks that have invalid dates. ## When exporting If you receive this message when exporting, you can fix it using one of the following methods: * On a 2.1.61+ computer version, use the Tools>Check Database menu item. * On AnkiMobile 2.0.90+, use Check Database in the preferences screen. ## When importing The Anki versions mentioned in the previous section can now automatically fix problem decks when importing. # Timezone handling changes Source: https://docs.ankiweb.net/faqs/timezone-handling-changes Anki 2.1.22+, AnkiMobile 2.0.57+, and AnkiDroid 2.15+ contain an optional change to the way Anki calculates the elapsed number of days. This change addresses some corner cases where timezone changes (including daylight savings) could cause Anki to move back or forward a day, and addresses cards being unburied / daily counts being reset for some users when syncing with AnkiWeb. For most users, the new calculation should produce the same number of elapsed days as the old calculation. For some users, enabling this code may move Anki forward or back by one day, but this will only happen once, and Anki should be more robust against timezone changes afterwards. **Please make sure you are running the above-mentioned versions prior to enabling the new code.** If any of your Anki clients have not been updated yet, you won't be able to sync them while this feature is enabled. To enable the new calculation, please make sure: * your devices are in sync * you're running Anki 2.1.22+ * 2.1 scheduler or higher is enabled in the preferences screen Then to enable the new timezone code, please check the 'new timezone' checkbox. Please close the window and sync, then sync your other devices to complete the process. If you notice any problems with the new handling, please let us know. # We do not make robots Source: https://docs.ankiweb.net/faqs/we-do-not-make-robots We make a *flashcard program* called Anki. If you are having problems with a robot you bought from a *company* called Anki, please go to [https://support.digitaldreamlabs.com/](https://support.digitaldreamlabs.com/) # What spaced repetition algorithm does Anki use? Source: https://docs.ankiweb.net/faqs/what-spaced-repetition-algorithm ## SM-2 As of Anki 23.10, Anki has two available algorithms. The first one is based on the [SuperMemo 2 algorithm](http://www.supermemo.com/english/ol/sm2.htm), and the second one is called [FSRS](https://github.com/open-spaced-repetition). Anki’s algorithm differs from SM-2 in some respects. Notably: * SM-2 defines an initial interval of 1 day then 6 days. With Anki, you have full control over the length of the initial learning steps. Anki understands that it can be necessary to see a new card a number of times before you’re able to memorize it, and those initial "failures" don’t mean you need to be punished by being shown the failed card many times over the course of a few days. Performance during the learning stage does not reflect performance in the retaining stage. * Anki uses 4 choices for answering review cards, not 6. There is only one *fail* choice, not 3. The reason for this is that failure comprises a small amount of total reviews, and thus adjusting a card’s ease can be sufficiently done by simply varying the positive answers. * Answering cards later than scheduled will be factored into the next interval calculation, so you receive a boost to cards that you were late in answering but still remembered. * Like SM-2, Anki’s failure button resets the card interval by default. But the user can choose to have the card’s interval reduced instead of being reset completely. Also, you can elect to review failed mature cards on a different day, instead of the same day. * *Remembered easily* not only increments the ease factor, but adds an extra bonus to the current interval calculation. Thus, answering *remembered easily* is a little more aggressive than the standard SM-2 algorithm. * Successive failures while cards are in learning do not result in further decreases to the card’s ease. A common complaint with the standard SM-2 algorithm is that repeated failings of a card cause the card to get stuck in "low interval hell". In Anki, the initial acquisition process does not influence a card’s ease. ## FSRS FSRS aims to learn your memory patterns and schedule reviews more efficiently than SM-2. FSRS is based on the "Three Component Model of Memory". The model asserts that three variables are sufficient to describe the status of a unitary memory in a human brain. These three variables include: * Retrievability (R): The probability that the person can successfully recall a particular information at a given moment. It depends on the time elapsed since the last review and the memory stability (S). * Stability (S): The time, in days, required for R to decrease from 100% to 90%. For example, S = 365 means that an entire year will pass before the probability of recalling a particular card drops to 90%. * Difficulty (D): The inherent complexity of a particular information. It represents how difficult it is to increase memory stability after a review. In FSRS, these three values are collectively called the "memory state". The value of R changes daily, while D and S change only after a card has been reviewed. Each card has its own DSR values, in other words, each card has its own memory state. To accurately estimate the DSR values, FSRS analyzes the user's review history and uses machine learning to find parameters that provide the best fit to the review history. Note that the users should not tweak the parameters manually. If you want to adjust the scheduling, all you need to do is choose an appropriate value of desired retention. With FSRS, users can target a specific value of retention, allowing them to balance how much they remember and how many reviews they have to do. Higher retention leads to more reviews per day. Aside from allowing users to easily control their retention, FSRS has some other advantages when compared to Anki's default algorithm. With FSRS, users have to do fewer reviews than with Anki's default algorithm to achieve the same retention level. FSRS is also much better at scheduling cards that have been reviewed with a delay, for example, if the user took a break from Anki for a few weeks or months. The scheduling code can be found in `rslib/src/scheduler/states`. Here is a summary (see the [deck options](/manual/deck-options) section of the manual for the options that are mentioned in *italics*): ## Learning/Relearning Cards If you press…​ * Again\ Moves the card back to the first step set in [Learning/Relearning Steps.](/manual/deck-options?#learning-steps) * Hard\ Repeats the current step after the first step, and is the average of Again and Good. * Good\ Moves the card to the [next step](/manual/deck-options?#learning-steps). If the card was on the final step, the card is converted into a review card (it 'graduates'). * Easy Immediately converts the card into a review card. New cards have no ease, so no matter how many times you press 'Again' or 'Hard', the future ease factor of the card won't be affected. The same can be said about relearning cards: pressing 'Again' or 'Hard' won't have any effect over the card's ease. ## Review Cards In SM-2, once a card is graduated, it gets an ease factor. By default is 2.5, but you can set another value using the [Deck Options](/manual/deck-options?#starting-ease). If you press…​ * Again\ The card is placed into relearning mode, the ease is decreased by 20 percentage points (that is, 20 is subtracted from the *ease* value, which is in units of percentage points), and the current interval is multiplied by the value of *new interval* (this interval will be used when the card exits relearning mode). * Hard\ The card’s ease is decreased by 15 percentage points and the current interval is multiplied by the value of *hard interval* (1.2 by default) * Good\ The current interval is multiplied by the current ease. The ease is unchanged. * Easy\ The current interval is multiplied by the current ease times the *easy bonus* and the ease is increased by 15 percentage points. For Hard, Good, and Easy, the next interval is additionally multiplied by the *interval modifier*. If the card is being reviewed late, additional days will be added to the current interval, as described in a [previous FAQ.](/faqs/due-times-after-a-break) In FSRS, once a card is reviewed at least once, it gets assigned DSR values. If you press…​ * Again\ The card is placed into relearning mode, stability significantly decreases, and difficulty significantly increases. * Hard\ The card’s stability either increases or stays the same, and difficulty moderately increases. * Good\ The card’s stability increases, and difficulty may increase or decrease very slightly. * Easy\ The card’s stability significantly increases, and difficulty moderately decreases. ## Limitations When using SM-2, there are a few limitations on the scheduling values that cards can take. Eases will never be decreased below 130%; SuperMemo’s research has shown that eases below 130% tend to result in cards becoming due more often than is useful and annoying users. Intervals will never be increased beyond the value of *maximum interval*. Finally, all new intervals (except Again) will always be at least one day longer than the previous interval. ## Why doesn’t Anki use SuperMemo’s latest algorithm? The simple answer is that SuperMemo’s latest algorithm is proprietary, and requires licensing. As Anki is an open source application, it can only make use of algorithms that have been made freely available, such as FSRS. [Preliminary tests](https://github.com/open-spaced-repetition/fsrs-vs-sm17) seem to indicate FSRS is roughly on par with SM-17. # Why does AnkiMobile cost more than a typical mobile app? Source: https://docs.ankiweb.net/faqs/why-does-ankimobile-cost-more-than-a-typical-mobile-app AnkiMobile is not a standalone app - it is intended to be used in conjunction with the online synchronization service and open source computer version that I've made available for free for the last 10 years. Working on these three platforms is a full time job, and AnkiMobile is my way of putting food on the table and supporting future development. Because there are so many \$1 apps out there, some people are surprised by the price. But when you factor in the computer version, synchronization service, and free updates, AnkiMobile's price is quite competitive. At the time of writing (2013-10-04), SuperMemo's computer+iPhone version will set you back \$60, and MentalCase's combo will cost you \$29.95. Whether you find AnkiMobile's price to be a good deal will ultimately depend on your needs. If you're an existing Anki user that has invested many hours studying on the computer, AnkiMobile provides an easy way to do your studies anywhere while taking advantage of the advanced scheduling and formatting features that Anki provides. On the other hand, if you're looking for something inexpensive and simple and don't mind being restricted to your Apple device, there are cheaper alternatives out there that you may want to consider. One other thing to note is that once purchased, you can use AnkiMobile on up to 5 of your iOS devices, provided they use the same Apple ID. AnkiMobile also supports family sharing, for families that have that set up. Some frequently asked questions: **"You'd make more money if you priced it cheaper."** I have experimented with different price points in the past, and reducing the price resulted in a net decrease in income. Games like Angry Birds are able to make a profit because they appeal to a wide audience. Spaced repetition flashcard apps are quite a niche market in comparison. For this reason, neither a price change nor a sale is likely in the foreseeable future. **"It's too expensive in my country."** I appreciate that costs of living are different in different countries, but I'm afraid it's not practical to vary the price depending on where you live. The costs of building and supporting Anki are fixed, and they don't vary based on the country a person using Anki lives in. As for why the price might not be exactly the same as \$25 USD, please note that Apple sets the price in each country based on the local taxes and costs of doing business there. Please also bear in mind that the price in the US is the price before state sales taxes are applied, so the difference may not be as as much as you think. **"As a student, I think it's too expensive."** Please compare it to the price of the average textbook and then consider how many hours of use you get out of each. If you don't use Anki enough to justify the price, then you're welcome to use AnkiWeb instead or look into cheaper alternatives. **"Can I get a free copy for personal use, or for writing a review?"** Sorry, I do not offer promo codes, as preparing them takes time away from development. **"You should just rely on donations."** Unfortunately that would not be enough to live on. No matter how much people appreciate a product or service, if they're given the option of not paying, most people will choose not to. **"You should charge for AnkiWeb instead."** Apple's app store provides a safe and friction-free way of making purchases. Purchasing a subscription from a website requires considerably more effort, and many people are wary of making purchases online. **"Why is the Android version free?"** The Android version is developed by a different group of people, who based it off the computer version I wrote. Because they have day jobs and can only work on it in their free time, AnkiMobile is better supported: no questions or bug reports go unanswered, the app is more polished, and most bugs get fixed quickly. # Intro & Downloads Source: https://docs.ankiweb.net/releases/betas/intro ## Downgrading Beta versions may sometimes change your collection in a way that is not compatible with older Anki versions. If you wish to switch back to an older version, please go to the `File>Switch Profile` menu item, and click on `Downgrade & Quit` in the current version first. ## Problems If you run into any issues, please let us know on the [beta testing section](https://forums.ankiweb.net/c/anki/beta-testing/13) of the user forums. ## Packaged Builds Betas are posted on [https://github.com/ankitects/anki/releases](https://github.com/ankitects/anki/releases). ## Via PyPI/pip If you have a local Python 3.9+ installation, you can also install beta builds directly with pip. Anki will be installed in a local Python folder called 'pyenv'.
Mac (both Intel/Apple), and Linux (x86\_64) ``` $ python3 -m venv pyenv $ pyenv/bin/pip install --upgrade pip $ pyenv/bin/pip install --upgrade --pre 'aqt[qt6]' $ pyenv/bin/anki ``` * Repeat the last step if you wish to start the same Anki version again. * Repeat the last two steps to update to the latest beta and start it.
Linux (ARM) As there are no PyQt packages on PyPI for Linux/ARM, you will need to have your distro's PyQt5 packages already installed. Eg on Debian 12: ``` $ sudo apt install python3-pyqt6.qt{quick,webengine,multimedia} python3-venv ``` Or on Fedora: ``` $ sudo dnf install python3-qt5-webengine ``` Then run the following: ``` $ python3 -m venv --system-site-packages pyenv $ pyenv/bin/pip install --upgrade pip $ pyenv/bin/pip install --upgrade --pre aqt $ pyenv/bin/anki ``` * Repeat the last step if you wish to start the same Anki version again. * Repeat the last two steps to update to the latest beta and start it.
Windows ``` c:\> python -m venv \pyenv c:\> pyenv\scripts\pip install --upgrade pip c:\> pyenv\scripts\pip install --upgrade --pre aqt[qt6] c:\> pyenv\scripts\anki ``` Repeat the last step if you wish to start the same Anki version again. Repeat the last two steps to update to the latest beta and start it.
# Changes in 23.12+ Source: https://docs.ankiweb.net/releases/changes/changes/github Change notes have moved to GitHub: [https://github.com/ankitects/anki/releases](https://github.com/ankitects/anki/releases) # Changes Source: https://docs.ankiweb.net/releases/changes/changes/intro ⚠ After using the latest version, if you wish to open your collection with an earlier Anki release, please go to the File>Switch Profile menu item, and click on "Downgrade & Quit". If you skip this step, you may get an error message when opening your collection in an older Anki version, and you will need to return to this version, downgrade, then try again. # Known Issues Source: https://docs.ankiweb.net/releases/changes/known-issues Please see the notes for your platform on [/manual/platform/intro](/manual/platform/intro) # Core Interface Source: https://docs.ankiweb.net/translators/anki/core The `core` module in the [translation site](https://i18n.ankiweb.net/projects/) uses a translations system called [Fluent](https://projectfluent.org/). It is a recently-developed system that makes it easier for translators to deal with plurals, and makes it easier for developers to provide useful comments to help with translation. Translations in the `core` module are divided up into multiple files, with each file focusing on a particular topic, such as scheduling, deck options, and so on, as can be seen [here](https://i18n.ankiweb.net/en-GB/core/). ## Simple Replacements ![A simple translation string](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/simple-replacement@2x.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=f4bde5751893b10073ba1f0ab1d8a376) When the text is a simple string, all you need to do is write the text in your native language and click Save (or press the Enter key). Under the English text, many strings will contain a comment to help you understand where the string is being used, or to give an example of how it appears. "Context" is the short name for this string, and may sometimes give you a hint as to where it is used or what it is trying to represent. ## Variables ![A translation string with a variable](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/variable@2x.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=40873be72944084aca4e395d1b1e7f63) When you see `{$something}` in the English text, it means that that text will be replaced with something else. You can change the position of `{$something}` in your translation, but please don't change the text inside - you should not attempt to translate the text inside the `{...}` part. You can click on the `{$something}` part of the English text to automatically copy it into your translation. ## Plurals Many languages change words depending on number. For example, English uses "1 cat", but "3 cats". Some of the strings to translate will look like this: ![A translation string with plural forms](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/simple-plurals@2x.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=132b24a85da647a89b266fcb8a3e5b5f) In the top part, you can see there are two forms for English - the `one` case (second), and the `other` case (seconds). The bottom section shows the translation in Polish, which has four different plural forms. In this case, the `few` case and `many` case have been translated with the same translation. The translation website should automatically show the appropriate number of boxes for your language. Languages like Japanese that do not have separate plural forms will only need to enter in a translation once. ## Advanced Plurals The translation website supports an advanced mode for when you need more flexibility. You can access the advanced mode by clicking on the FTL icon on the bottom left. The previous example then looks like this: ![Editing translation strings with advanced plurals](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals@2x.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=bb9468cb34087769880c43fe5bf939ea) The first line is the unique identifier for this message - it can also be seen in the "CONTEXT" label near the comments. The rest of the text means the following: * Check the value of amount * If the amount is `one`, show `{$amount} sekunda` * If the amount is `few`, show `{$amount} sekundy` * If the amount is `many`, show `{$amount} sekund` * If the amount is `other`, show `{$amount} sekundy` The definitions of few, many and other depend on [your language](https://unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html). The `*` character before other means that any unknown value should match `other`. Since in this example `few` is the same as `other`, the text could thus be shortened to: ``` time-span-seconds = { $amount -> [one] { $amount } sekunda [many] { $amount } sekund *[other] { $amount } sekundy } ``` As `few` is not listed here, it will be covered in the `other` case. It's generally best to list out all cases however, as otherwise the translation website will shown a warning that you may have forgotten to translate a case. When writing these rules manually, please make sure to add at least one space to the start of each line except the first. While there was little benefit from rewriting the text in this case, this flexibility becomes useful when your language doesn't fit well with the structure of the original English string. For example, when viewing cards in the Browse screen in Anki, Anki shows new cards with a number, such as "New #1", or "New #532". The English doesn't use plurals in this case, but other languages may need to. If you were translating this into Spanish, you'd see the following screen: ![Editing a translation string to add plurals](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals2@2x.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=b4d1442a7945916af2b7281fa77b7a38) To add a plural form, click the FTL button, and then change the text to read: ``` due-for-new-card = { $number -> [one] Nueva #{ $number } *[other] Nuevas #{ $number } } ``` Here's another example. In this case the English text is using plurals as well, but only a small part needs to change. When translating to Polish, the "used by" portion needs to change as well. So the default editing screen is not sufficient: ![Another example of plural forms](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals3@2x.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=29887a0b3541200cbc41331efbb945fb) To fix this, we click on the FTL button to get a blank template: ![Template view of plural forms](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals4@2x.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=653adad58b8d07c5dd5a13dbbfc8b727) And then modify the template as required: ![Modifying the template view of plural forms](https://mintcdn.com/anki/4yLyWj6_UVW-sSDI/media/advanced-plurals5@2x.png?fit=max\&auto=format\&n=4yLyWj6_UVW-sSDI\&q=85\&s=90a893f825ccb67e244ee0e8bc16eac5) ## Other Languages If you're not sure how something should be translated, you can click on the Locales tab on the right. You can see a summary of the translation on that screen, or click on a particular language to see how it has translated all its plural forms. ## Special Characters When a translated string is more than one line long, please keep an eye out for lines that start with `.` or `[`. Strings can start with these characters on the first line, but if a translation stretches over multiple lines, these characters will cause problems. For example, the following is fine: ``` some-translation = This is a translation that occurs over ... two or three lines. ``` But the following will cause problems, because the second line starts with a `[`, and the third starts with a `.`: ``` some-translation = [This is a translation that occurs over ...two or three lines.] ``` When you need to use a `[` or `.` character at the start of a a line in a multi-line string, please escape it by wrapping it in `{"` and `"}` - for example: ``` some-translation = {"["}This is a translation that occurs over {"."}.. two or three lines.] ``` ## Testing Each time a new Anki beta is released, it will include any translation changes that were made since the last time. Please give the betas a try, so you can see how your translations appear in the app. There's a beta testing section on the support site that you can follow for beta updates. When translating, please try to keep the translations about the same length as the original English text. If it is not possible, and you find that text is not appearing properly in a beta (such as two labels overlapping), please report the issue on the support site. When testing the betas, if you notice that some text is not translatable, please report this on the support site so it can be fixed. # Desktop Interface Source: https://docs.ankiweb.net/translators/anki/desktop The majority of Anki's interface is now included in the `core` module. `desktop` contains some strings specific to the computer version, such add-ons. The strings were mostly automatically migrated from Anki's old translation system, so there may be some strings in core that only apply to the computer version, or vice versa. # For Developers Source: https://docs.ankiweb.net/translators/anki/developers When adding user-visible strings to Anki's codebase, extra work is required to make the strings translatable. Anki's codebase has recently migrated away from the old gettext system, and now only uses Fluent's `col.tr` and `aqt.utils.tr`. Please start by taking a look at the [core documentation](./core) to see how strings are presented to translators. Note how translators can not see the areas of the code where a string is used, so comments are often required to help the translators understand what they are translating. ## Adding New Strings As an example, imagine we want to add the string "You have x add-ons". To add a new translatable string to the codebase, we first need to identify whether it belongs in the `core` module (text likely to be used by all Anki clients), or whether it is specific to the computer version (the `desktop` module). Add-ons are only supported by the computer version, so we'll want to use the `desktop` module in this example. * The English `core` files are stored in `ftl/core` * The English `desktop` files are stored in `ftl/qt` We'll look for a file like `ftl/qt/addons.ftl`, and add one if no appropriate one exists. Then we need to add the string to the file. Each string needs a key that uniquely identifies it. It should start with the same text as the filename, and then contain at least a few words separated by hyphens. For example, we might add the following to the file: ```properties theme={null} addons-you-have-count = You have { $count } add-ons. ``` If `count` is 5, then the string will be "You have 5 add-ons.". This means it will look strange if `count` is 1 - we'd see "You have 1 add-ons." instead of "You have 1 add-on.". We'll need to add another string to cover the singular case: ```properties theme={null} addons-you-have-count = You have { $count -> [one] 1 add-on *[other] {$count} add-ons }. ``` The text above tells Fluent to use the first string in the singular case, and use the second string in all other cases. While an improvement, this can make it a bit hard for translators when the "you have" part needs to change depending on the number. So while more verbose, it is better to list out the alternatives in full where possible: ```properties theme={null} addons-you-have-count = { $count -> [one] You have { $count } add-on. *[other] You have { $count } add-ons. } ``` This leaves the most control in the hands of the translators to be able to translate the sentence with a natural structure. Note how the variable was used in the singular case as well. While in English $count will only be 1 in the singular case, in other languages, the singular case can be used for other numbers, such as 21. While translators could replace the `1` with `{ $count }\` in their translation, they sometimes do not realise they need to, so using the variable makes mistakes less likely. Please note that the bulk of the strings in the .ftl files were imported from the older gettext system, so many of them may not demonstrate best practice. The older system also encouraged constructs like: ```python theme={null} msg = "%s %d %s" % (_("Studied"), card_count, _("today")) ``` Please avoid constructing strings in Python like this, as it makes it hard for translators to translate, and not all languages use English spaces. The above example would be better made into a single translatable string that takes a count argument. Finally, we should also add one or more comments for translators: ```properties theme={null} ### Lines starting with three hashes are shown in the translation system ### for every string in the file. ### You can use it for a general summary of what a file is dealing with. Not ### all files will need this. ## Lines starting with two hashes are shown for every following string, until ## another set of two hashes is encountered, or the file ends. # This is a comment that will only apply to the following string. Eg: # Shown in the add-on management screen (Tools>Add-ons), in the title bar. addons-you-have-count = { $count -> [one] You have { $count } add-on. *[other] You have { $count } add-ons. } ``` ## Accessing the New String Once you've added one or more strings to the .ftl files, run Anki in the source tree as usual, which will compile the new strings, and make them accessible in Python/Typescript/Rust. ### Python To resolve a string, you can use the following code: ```python theme={null} from aqt.utils import tr msg = tr.addons_you_have_count(count=3) ``` * Note how a snake\_case() function has been automatically defined as part of the build process, with the correct arguments. These will be checked by the tests, to ensure you don't accidentally use a missing string, or omit an argument/pass the wrong one. * The generated function has a docstring based on the original text in the ftl file, so if you're using an editor like PyCharm, you can hover the mouse over a function to see the text it will resolve to. * Code in qt/ can use the `aqt.utils.tr()` function, but code in pylib should use `col.tr()` instead. If you'd like to test out the strings in the Python repl, make sure to call set\_lang() first. ```python theme={null} >>> from anki.lang import set_lang >>> from aqt.utils import tr >>> set_lang("en", "") >>> tr.addons_you_have_count(count=3) 'You have \u20683\u2069 add-ons.' ``` Note the unicode characters that were inserted. These ensure that when left-to-right and right-to-left languages are mixed, the text flows correctly. For debugging, you can strip the characters off: ```python theme={null} >>> from anki.lang import without_unicode_isolation as nosep >>> nosep(addons_you_have_count(count=3)) 'You have 3 add-ons.' >>> nosep(addons_you_have_count(count=1)) 'You have 1 add-on.' ``` ### TypeScript A global is available with automatically generated functions in camelCaps. Eg: ```typescript theme={null} import * as tr from "../lib/ftl"; console.log(tr.statisticsCardsPerDay({ count: 5 })); ``` The functions have docstrings that have the original text, so you can hover over them to see what the text says. To make use of the translations, they first need to be fetched from the backend. You'll need to specify the modules you want included, eg: ```typescript theme={null} import { setupI18n, ModuleName } from "../lib/i18n"; await setupI18n({ modules: [ModuleName.STATISTICS] }); ``` ### Rust The backend and collection structures have an I18n object in .tr, which can be called to get a translation, eg, in a Collection method: ```rust theme={null} println!("{}", self.tr.database_check_missing_templates(5)) ``` The docstring contains the original translation, and your editor can show you the names of each argument. The return value is a Cow - if you need a String, you can call `.to_string()` or `.into()` on it. ### Legacy style Anki versions before 2.1.44 used a single function and a separate constant instead. Eg, instead of ```python theme={null} from aqt.utils import tr msg = tr.addons_you_have_count(count=3) ``` they instead used: ```python theme={null} from aqt.utils import tr, TR msg = tr(TR.ADDONS_YOU_HAVE_COUNT, count=3) ``` This old style will still work for now, but will be removed in the future. ## Repeated Content Sometimes you will need multiple translations that have some text shared between them. For example, the search code has a list of separate error message, such as: ```properties theme={null} search-invalid-added = Invalid search: 'added:' must be followed by a positive number of days. search-invalid-edited = Invalid search: 'edited:' must be followed by a positive number of days. ``` Since there are a lot of separate messages with the same prefix, we can split it off into a separate string: ```properties theme={null} search-invalid-search = Invalid search: { $reason } search-invalid-added = 'added:' must be followed by a positive number reason. search-invalid-edited = 'edited:' must be followed by a positive number of days. ``` The code can then compose the message from two separate entries. Note that we're using a Fluent variable in the outer string, as some languages may want to place the reason first, not include a space after the colon, and so on. ## Avoid HTML where possible Translators may not have any development experience, and HTML can be difficult to read and translate correctly. Prefer plain text where possible, and when HTML is required or would make things much clearer, consider using markdown instead (see the search translations for an example of how this is done). ## Avoid Strings That Will Change Avoid doing things like listing out a series of options in a string, if there's any chance that list will change in the future. When the string later gets updated (and assuming people don't forget to update it), it will need to be given a new ID so that translators become aware of it, and doing so will mean all the existing translations get invalidated until a translator has a chance to update them, which may take months and sometimes even years. ## Avoid Excess Strings Please try to be conservative with the number of new strings you add, as translator time is precious, and the more strings included in Anki, the more overwhelming it can be for translators. If you need to display an error message for some obscure error that most people will never hit, it probably doesn't need a translation. ## Add-ons Add-ons can make use of existing strings in Anki, but if you wish to add new strings, you'll need to add them to your add-on rather than Anki. How you approach translations in your add-on(s) is up to you: * If you don't care about translations, the simplest solution is to use plain strings. * The next-easiest option is to place all strings in a dict or python module, and accept pull requests from users that add a new language. You can then select the appropriate dict by looking at what anki.lang.currentLang is set to. * If you want proper plural support, you'll want to consider using gettext, though it is considerably more involved than the above solution. It requires separate build steps to extract strings from your source and build compiled versions of the strings. You can have translators email you a completed .po file, or send you a PR. There are online translation services like Launchpad and Crowdin that support gettext, but you would need to either manually upload and download files, or spend some time setting up scripts to do so. Fluent is not currently recommended for add-ons. There is limited tooling support for it, and you would need to bundle the Fluent Python libraries with your add-on. # Translating Anki's User Interface Source: https://docs.ankiweb.net/translators/anki/intro Anki's translations are divided up into two parts: * The [core module](./core) contains text usable on all Anki platforms. * The [desktop module](./desktop) contains text only used in the computer version of Anki. # The Manual Source: https://docs.ankiweb.net/translators/anki/manual Translating the manual and other documentation is trickier than translating Anki's interface: the documentation is not translated on the [translation site](https://i18n.ankiweb.net/projects/). Instead, you edit Markdown files in [the main Anki repository](https://github.com/ankitects/anki) and submit a pull request. Some familiarity with Git is required, but you don't need to be able to build Anki or write code. The English source pages live in the [docs-site directory](https://github.com/ankitects/anki/tree/main/docs-site). The manual itself is located in `docs-site/manual`, and the other sections, such as the add-on and developer documentation, are in sibling directories. ## Getting Started 1. [Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo) the [Anki repository](https://github.com/ankitects/anki) and clone your fork locally. 2. If your language already has a subdirectory under `docs-site` (for example `docs-site/ru/`), you can start improving the existing `.mdx` pages in it. Otherwise, create a new subdirectory named after your language code, such as `docs-site/ko/manual/`. 3. Translate the pages you'd like to work on. The pages are written in MDX, a flavor of Markdown that supports embedded components. Please keep Markdown formatting such as links, images and code blocks intact, and translate the surrounding text only. 4. List your translated pages in [docs-site/docs.json](https://github.com/ankitects/anki/blob/main/docs-site/docs.json) so they show up in the navigation. Each language has an entry under `navigation.languages`: to add a page, append its path to your language's `pages` list; to add a new language, add a new entry following the existing pattern: ```json theme={null} { "language": "ko", "tabs": [ { "tab": "Manual", "groups": [ { "group": "Desktop Manual", "pages": ["ko/manual/intro"] } ] } ] } ``` For the supported language codes and the language switcher configuration, please see Mintlify's guide on [internationalization](https://www.mintlify.com/docs/guides/internationalization#configure-the-language-switcher). 5. Submit a pull request containing your changes. ## Notes * Partial translations are welcome: starting with the introduction page, like most of the existing languages, is perfectly fine. * Unless stated otherwise, documentation changes are licensed under the [CC BY-SA 4.0 license](https://creativecommons.org/licenses/by-sa/4.0/). * If you have questions about translating the documentation, please feel free to ask on [the forums](https://forums.ankiweb.net/). # Translating AnkiDroid Source: https://docs.ankiweb.net/translators/ankidroid AnkiDroid has its own translation site: [https://github.com/ankidroid/Anki-Android/wiki/Translating-AnkiDroid](https://github.com/ankidroid/Anki-Android/wiki/Translating-AnkiDroid) Work is currently underway to integrate Anki's `core` module and its translations into AnkiDroid, but for now, AnkiDroid only uses its own translations. # AnkiMobile Source: https://docs.ankiweb.net/translators/ankimobile AnkiMobile's translations are divided into two parts: * The `core` module contains text common to both the computer version and AnkiMobile. * The `mobile` module contains text only used in AnkiMobile. If you have not signed up to the translation site yet, please see [Getting Started](./intro). Please start with the `core` module, which is [documented here](./anki/core). Once the `core` module is mostly translated in your language, you can then move on to the `mobile` module. When translations are nearing completion, please reach out on the support site, as new languages need to be manually added to the build process. Once a new language has been added, your translations will be visible in subsequent beta builds and app store releases. Please give the betas a try, so you can see how your translations appear in the app. If you're not already a beta tester, please [request an invite](/ankimobile/beta-testing) on the support site. When translating, please try to keep the translations about the same length as the original English text. If it is not possible, and you find that text is not appearing properly in a beta (such as two labels overlapping), please report the issue on the support site. Thank you again for your help! # Getting Started Source: https://docs.ankiweb.net/translators/intro If you'd like to help translate Anki into your native language, your help would be most appreciated! Translations can be done through our [online translation interface](https://i18n.ankiweb.net). To make changes, you will need an account. Please post a private message on the [support site](https://anki.tenderapp.com/discussions/private) with the following information, and we can get an account created for you: * The language or languages you'd like to translate. * Your email address. Please note that the email address you provide will be visible to people browsing [GitHub](https://github.com/ankitects/anki-desktop-i18n/commits/master). * The username you'd like to use (for example, 'bob5') * Please include the following text in your message: "I license any translations I contribute under the [3-clause BSD license](https://opensource.org/licenses/BSD-3-Clause)." After you've contributed some translations, if you'd like to be added to Anki's About screen, please send a message and we'll gladly add you (or you can submit a PR if you know how). # 2021 Scheduler Source: https://docs.ankiweb.net/releases/betas/2021-scheduler Please see the [FAQ page](/faqs/the-2021-scheduler). # Changes in 2.1.41 Source: https://docs.ankiweb.net/releases/betas/anki2.1.41 ## Add-On Notes Add-on authors, please see [https://forums.ankiweb.net/t/add-on-porting-notes-for-anki-2-1-41/7390](https://forums.ankiweb.net/t/add-on-porting-notes-for-anki-2-1-41/7390) ## Beta 7 Build 3ba08d11 / 2021-03-04. * Fix a freeze when answering a card with a missing parent deck. * Fix an error that could occur when syncing between 2.1.41 and older clients, then downgrading. ## Beta 6 Build 92aaaf71 / 2021-03-02. * Fix 2.1 scheduler review counts not matching deck list. * Fix a focusing issue in the editor (thanks to Henrik). ## Beta 5 Build 14cc81f8 / 2021-03-01. * Filtered deck screen now has a link to show cards not matched by search (thanks to Rumo, Abdo). * Support Alt+number to switch between clozes in the card layout screen (thanks to Abdo). * Fix images not shrinking to fit editor field (thanks to Henrik). * Fix a focus handling issue in the editor (thanks to Henrik). * Fix incorrect review counts in the 2.1 scheduler when parent decks had a smaller limit than their children. * Fix early review cards remaining in new queue after upgrading to 2.1 scheduler. * Improve error message when trying to nest under a filtered deck (thanks to Rumo). * Use monospace font in HTML editor. ## Beta 4 Build 46e9720e / 2021-02-21. Scheduler updates: * The V1->V2 upgrade process no longer resets cards that are in learning, or removes cards from filtered decks. * Users on the old scheduler will now see a message at the top of the deck list prompting them to update to the Anki 2.1 scheduler. * New users will see the message too. Enabling it by default would be a smoother experience, but that needs to wait until AnkiDroid 2.15 is released as stable, with support for the newer timezone handling. * There is no option to downgrade to the V1 scheduler anymore, though you can still do so by downgrading to an older Anki version first. Fixes: * Fix tag replacement/deletion matching substrings (thanks to Abdo). * Fix images not shrinking to fit in fields (thanks to Henrik). * Fix "saved searches" getting selected when clicking in empty area of sidebar (thanks to BlueGreekMagick). * Reposition dialog's "shift cards" option now defaults to off. ## Beta 3 Build b3b40933 / 2021-02-12. * Sidebar: * Drop multiple selection, and switch back to the old clicking behaviour. ```text theme={null} Multiple selection can be tackled again in a future update. ``` * "Due" now shows only cards due that day. * Added "Overdue" item. * "Set due" now leaves the review intervals alone unless '!' is provided. * Fix stale preview in card layout screen (thanks to Henrik). * Ignore manually scheduled cards in hour graph. ## Beta 2 Build 599d4634 / 2021-02-09. * Sidebar changes: * Multiple selection. Currently only works with tag and deck drag\&drop. * Ctrl/Alt/Shift options to add/modify the search now require a right click ```text theme={null} instead of a left click, to avoid conflicts with multiple selection. ``` * Move "Current Deck" to Decks * Click on Decks to show whole collection. * Click on Flags to show any flag. * Click on Tags to show all non-empty tags. * Added "Untagged" under Tags. * "Set Due Date" changes: * Interval can optionally be reset for review cards. * Input now remembered. * Editor tweaks to make things easier for add-ons (thanks to Henrik). * Fix slowdown after large "check media" report. * Fix 'rsbackend' errors in some add-ons. * Fix compatibility with fastbar add-on. * Markdown rendering of deck config is now opt-in - once enabled, it will change the handling of both the overview and congrats screen. When not enabled, the congrats screen will not show the description. ## Beta 1 Build 704b5e58 / 2021-02-07. This beta includes all the changes from 2.1.39beta1 - please see its change notes as well. Changes since 2.1.39beta1: * The editor's code has been reworked, thanks to Henrik: * `
` tags will now be used by default instead of the previous `
` ```text theme={null} tags, which solves some issues with multiple lines in cloze deletions and MathJax. ``` * Invalid field content can no longer spill out into the editing area. * Other behind-the-scenes changes have been made at the same time, and some ```text theme={null} add-ons that alter the editor will need updating. ``` * Browser sidebar improvements: * Added a search bar, thanks to Abdo. * The remaining items in the Filter button have been moved into the sidebar, ```text theme={null} and the Filter button removed. ``` * Tags and decks can now be dragged and dropped. * Each section can now be expanded/collapsed. * Add-ons that were adjusting the sidebar or filter button may need updating. * Search improvements, thanks to Rumo: * Filtered decks can now be created from a browser search, and vice versa. * Better ergonomics for developers. * Reworked the Reschedule tool: * Split into separate "Forget" and "Set Due Date" actions * "Set Due Date" now ```text theme={null} [adjusts intervals](https://github.com/ankitects/anki/commit/704b5e581a70089798f0f4742640fde4a3f1a507) of review cards, instead of resetting them. ``` * Changed the "Delete Tags" shortcut; Ctrl+Shift+D now changes the due date. * Added the action to the review screen as well. Other changes: * The tags field in the editor now autocompletes from anywhere in a tag name, not only the start. * The title bar on Macs will now turn dark when night mode is activated. * Improvements to the graphs, thanks to Henrik. * Add deck description back to congrats screen, with [caveats](https://forums.ankiweb.net/t/anki-2-1-39-deck-descriptions-gone-after-finished-studying/7261). * Add opus to media list in editor. * Other improvements with thanks to Rumo, Henrik, Abdo, Arthur and Maksim. For developers: * Almost all of the Python codebase now has type hints. 🎉 # Changes in 2.1.43 Source: https://docs.ankiweb.net/releases/betas/anki2.1.43 ## Beta 1 Build 0fbae6bc / 2021-03-27. * The reviewing screen will now wait for up to 100ms for images to load before showing, and waits until images have been loaded before scrolling to the answer. * The default fade-in on the review screen has been removed. * Fix DB check incorrectly identifying an issue after lapsing a card with a non-zero interval % in the V1 scheduler. * Fix editing toolbar being initially active (thanks to Henrik). * Fix some error messages (thanks to Rumo). * Fix expand/collapse triggering click in sidebar (thanks to BlueGreenMagick). * Update translations, thanks to the translators. * Fix "Forgot Card" message. * Fix deck list not updating after deleting. # Changes in 2.1.44 Source: https://docs.ankiweb.net/releases/betas/anki2.1.44 ## Beta 1 Build b2b3275f / 2021-05-04. * Search text is no longer automatically quoted/interspersed with ANDs. * Fix two backslashes being treated as one in MathJax. # Changes in 2.1.45 Source: https://docs.ankiweb.net/releases/betas/anki2.1.45 ## Release Candidate 2 Build e7189f4a / 2021-07-24. * Fix numpad enter in type answer screen. * Avoid escaping non-Latin text in image filenames (thanks in part to Hikaru). * Find and replace / rename with parent options in the sidebar (thanks to Rumo). * F3/F4 in card layout screen go to next/previous template (thanks to Evandro). * Set due date uses the deck's configured starting ease (thanks to cyphar). * Fix preview shortcut when fields not focused (thanks to Henrik). * Strip invalid unicode from filenames in media check. * Fix skipped entry on mousedown in browser search history (thanks to Rumo). * Handle buggy hooks in the reviewer (thanks to Henrik & Hikaru). * Fix flags not being excluded on export (thanks to Alex). * Fix notes with missing cards causing a fatal browser error. * As always, thanks to the translators who've contributed translations. * Minor other changes. ## Release Candidate 1 Build 60f6fccc / 2021-07-13. * Fix red duplicate background being included in copy+paste (thanks to Hikaru). * Fix copy/cut affecting whole line in HTML editor (thanks to Hikaru). * Fix spurious error when importing v1 scheduling deck into v1 collection. * Tweaks to deck config/editor API (thanks to Henrik). * An add-on compat fix for the browser (thanks to Rumo). * More friendly message when importing v2 deck into v1 collection. * Allow cloze: in non-cloze notetypes for now. * Miscellaneous other changes. ## Beta 6 Build 6ffa7440 / 2021-07-04. * Pre-load images on answer side (thanks to Hikaru). * Updated sidebar and editor icons (thanks to Henrik). * Fixed revert confirmation sometimes getting stuck in deck options (thanks to Henrik). * Fixed unnecessary percent-escaping of images in HTML editor. ## Beta 5 Build 0f7a230f / 2021-06-29. * Fixed the packaging issue in beta 4 that was preventing startup. * Show deck options in two columns on wider screens (thanks to Matthias, Hikaru & Henrik). * Sidebar search now scrolls to first match (thanks to Abdo & Rumo). * Reverted a change that was causing some add-ons that modify the reviewing screen to break. * Show error before uploading if collection larger than AnkiWeb's limits. * Handle invalid card template numbers in DB check. * Fixed error message when confirming cloze deletion in normal note type. * Fixed expanding/collapsing tags triggering refresh (thanks to Rumo). * Fixed night mode preset dialogs in deck options (thanks to Henrik). * Fixed some issues with preserving selected item in sidebar (thanks to Rumo). ## Beta 3 Build 18843e71 / 2021-06-25. * Fixed remembered tags not being applied to subsequently added cards after actions like toggling a pin/deleting a deck/etc. * Fixed toggling of night mode preview in day mode (thanks to hkr). * Fixed incorrect field content issue with HTML editor (thanks to Henrik). * Exclude deck and tag expand/collapse from undo queue; fixes automatic scroll to Current Deck in Browser. * Fixed .apkg importer allowing import of V2 collection with scheduling into a V1 collection. * Disable cloze and math buttons in HTML editor. ## Beta 2 Build b693bdbf / 2021-06-24. Known issues: * If adding cards with tags, toggling a pin will clear the saved tags, but they will still be shown in the UI. To make sure the tags are still added, to subsequent cards, please click in the tags area after toggling a pin. Browser updates: * Added an option in the Preferences screen to customize the starting search text (eg, to start with "deck:current"). * More reliably scroll to the current card. * New tag icons and associated backend work (thanks to Henrik). HTML editor, thanks to Henrik: * Now appears inline, instead of in a separate pop-up. * Supports syntax highlighting, and showing opening/closing tags. Change notetype: * Supports multiple undo. * Can match old and new fields by name. * Allows mapping a source field to more than one destination fields, allowing you to clone the contents of a field. Other features: * Warn user when they attempt to use cloze markers inappropriately (thanks to Rumo). * Support system SSL certs on Linux. * Improved add-on support for the new deck options screen (thanks to Henrik). * Changed v3 scheduler label from "experimental" to "beta". Fixes: * Fixed resource leak in sound code (thanks to Kelciour). * Fixed incorrect font on Windows (thanks to Kelciour). * Fixed crash when pressing the copy shortcut with no active selection. * Make the color selector inactive when no field is selected (thanks to hkr), and make it apply color immediately (thanks to Henrik). * Fixed creation of filtered decks from Browser (thanks to Rumo). * Fixed escaping of hyphens in searches (thanks to Rumo). * Fixed 'Set Due Date' not remembering provided input. * Fixed incorrect card count when removing multiple templates. * Fixed an issue compiling on recent Python 3.9 installs. * Fixed field pin status being forgotten when opening Cards screen (thanks to Henrik). * Reduce chances of a flash when revealing answer on cards with images. * Miscellaneous other changes. ## Beta 1 Build 5bd2dc65 / 2021-06-08. Changes: * Added an option to the v3 scheduler to sort new cards in reverse order. * Added a Card Info option to the review screen. * Reduced editor toolbar size on Macs. * When opening the Browse screen with an active study card, the whole deck is now shown (thanks to Rumo). Fixes: * Fixed audio getting stuck when pausing near end (thanks to kelciour). * Fixed current review card sometimes changing when making edits. * Fixed deck options tooltip appearance (thanks to Matthias). * Fixed selected deck not being honored when importing text file. * Fixed styling changes not being reflected in preview. * Fixed timebox window getting stuck when it appeared at start of study. * Fixed various links to the manual (thanks to cherryblossom000). ## Alpha 4 Build be9bbf21 / 2021-06-02. Known issues: * Changes to styling section in card layout screen not reflected in preview. v3 scheduler changes: * The v3 scheduler can now be toggled in the Preferences screen. * Review cards can now optionally be shown in subdeck order. * Fixed 'deck priority' for new cards not following subdeck order. Other features/behaviour changes: * Updated text colour and highlight colour buttons, thanks to Henrik and Matthias. * Added 3 new flag colours, thanks to Rumo. * Sidebar items can be dragged onto the Saved Searches area to add them as a favourite, thanks to Rumo. * Added a new menu item to clone the current deck options. * Custom study now limits the tag selection to 100 tags or fewer. * Extra checks are now done when updating a card template, such as detecting when a cloze notetype is missing a cloze directive, or two templates have identical question sides, thanks to Rumo. * Editor toolbar styling improvements, thanks to Henrik and Matthias. * The "sync required" indicator is now updated immediately, and will turn off if you undo the first change made after a sync. * Removed the superfluous "keep input" option from the Fields dialog. * When opening deck option from the study screen, you'll now be asked which deck you want if the card is in a subdeck. * Support ctrl+numpad enter to add cards. Fixes: * Fixed an error/crash occurring when timeboxing was enabled. * Fixed deck options screen mishandling steps shorter a minute. * Fixed remembered tags not being applied to subsequently-added notes. * Fixed an error being shown when exporting cards/decks with a non-default deck configuration. * Fixed changes to the current field not being saved when saving the deck options. * Fixes for building on linux-arm64 (thanks to qubist-pixel-ux). * Force x11 mode when the packaged build is run on a system that tells Qt to use Wayland, as Wayland is not currently supported by the packaged build. * When a fatal error occurs, close Anki instead of allowing it to remain in a stuck state. * Fix formatting of some error messages, thanks to Rumo. * Various behinds-the-scenes changes thanks to Henrik and Rumo. * Miscellaneous other changes. ## Alpha 3 Build f91f00a5 / 2021-05-24. * Fix new ease not being applied when failing a review card in the v3 scheduler. * The `[...]` in cloze deletions is now read as "blank" by TTS (thanks to Rumo). * Flags can now be renamed in the sidebar (thanks to Rumo). * Improvements to the handling of shortcuts in the editor (thanks to Henrik). * Improve cards/notes switch appearance (thanks to Rumo & Kleinerpirat). * Various tweaks to the Deck Options screen. * When Browse screen is opened, default to the first sidebar mode. * Add night mode styling to 'type in the answer' box, and improve legibility of comparison. * Fix Find\&Replace searching in incorrect field. * Fix missing cumulative overlays in graphs. * Fix strange characters in Deck Options titlebar (thanks to Abdo). * Fix Unbury action missing cards in child decks. * Fix wrong stock note type being added (thanks to Abdo). * Horizontal scrolling in the browse screen is less jumpy (thanks to Rumo). * Report changed card count when changing deck/flag in Browse screen. * Fix actions like a sort column change clearing the undo history. ## Alpha 2 Build b9a4908b / 2021-05-19. * Fixed a bug that was causing the Undo action to force a full sync. * You can now redo undone actions. The Redo menu item will be hidden for actions that don't support the new undo code, including reviews in the v1/v2 scheduer. * Changed the shortcut for Undo in the Browse screen to match the main window. * Fixed an error when switching between cards and notes modes (thanks to Rumo). * Various tweaks to the appearance of the deck options screen (some thanks to Henrik). * Fixed Custom Study when the v3 scheduler is enabled. * Compatibility tweaks to fix the breakage of some add-ons. The Fields/Cards text in the editor is currently a bit large, and it'll likely be tweaked in the future. ## Alpha 1 Build 10bfb95f / 2021-05-17. There have been a lot of under-the-hood changes in this release, and there may be some rough edges at the moment. Undo handling: * Most actions now support multiple undo steps. You can change a card template, delete some notes, bury a card, then undo each of those steps if you wish. * Actions that support multiple undo steps will now save the changes immediately, meaning that if Anki crashes, the changes you made in the last few minutes will no longer be lost. * Actions that don't support the new undo handling (eg, Check Database), will clear the undo history. * Add-ons will clear the undo history if they modify the database directly, or use routines that don't support undoing. There are some new routines available to add-ons to make operations undoable, but add-ons may need to be updated to use them. Scheduling changes: * An [experimental new scheduler](./2021-scheduler). * The deck list now shows the learning count separately. * On new collections, the v2 scheduler is now the default. Browser changes, thanks to Rumo: * The sidebar now has two modes. The default allows clicking on items to search for them. The other mode allows you to select multiple items at once, so you can drag & drop or delete multiple items. * The browse screen can now be toggled between showing cards, and showing notes. * When showing notes, some columns will show an aggregate over all the cards of a note. * Added an introduced:x search to locate cards first studied in the last x days. * Column rendering has been moved into the backend, and will be faster than before (but is still limited by the speed of the graphics toolkit). * A fair bit of the browser code has been changed, and some add-ons like the "Advanced Browser" add-on will need to be updated to support the new approach. Editor changes, thanks to Henrik: * The editing toolbar has been reimplemented in a way that will allow easier improvements in the future. * The toolbar's icons and style have been updated. * The editor now provides bullet and numbered list buttons. * The editor now provides buttons to control text alignment and indent. * Sticky fields can now be toggled on/off from the editing screen. * Editor shortcuts are handled differently, and the current approach does not work well on non-QWERTY keymaps. This will likely change before a stable release. * A new API is available for add-ons, but this has not been finalized yet. State handling: * When you make changes, the user interface should update more consistently now. Adding a new tag to a note will update the sidebar in the Browse screen for example, and when you review a card that is shown there, the columns will update. * The Browse screen no longer refreshes a search automatically. When you make a change, the column text may update, but the number of rows will not change. Deleted cards show "(deleted)" until you search again. * The main window no longer shows a "waiting for editing to finish" screen. When you make changes such as editing a note, the main window will dim, and will automatically refresh when you return to it. The deck options screen has been reimplemented: * (Re)learning steps are now shown with units, eg 10m or 4d. * Deck options are now shown on one scrollable page. * Extra help is available for most options. * It is easy to see at a glance which options have been changed from the default, and individual options can be reverted to the default setting. * Warnings will be shown for some common issues (eg, review limit too low compared to new cards). * Some of the more advanced options have been moved to a separate "Advanced" section. * The old options can be accessed with a Shift+click, since it will take a while for add-ons to be updated to support the new screen. * The deck description is now accessible via a button in the overview screen, instead of via the deck options. Other changes: * Numerous behind-the-scenes improvements from Henrik and Rumo. * The Find\&Replace option in the Browse screen can now be used on tags as well. * You can now choose which add-ons you want to update (thanks to BlueGreenMagick). * Fix text with single quote not being escaped in export (thanks to Ryan). * Other fixes and improvements thanks to Abdo, Glutanimate, Arthur and Shaun. * The Card Info screen ignores manual rescheduling when calculating the average time. * Performance improvements and other miscellaneous fixes. # Changes in 2.1.47 Source: https://docs.ankiweb.net/releases/betas/anki2.1.47 ## Release Candidate 2 Build 3077a1f9 / 2021-08-25. * Fixed calendar graph day labels showing incorrectly in some timezones. For add-on developers: * The Svelte components Anki exports should now work correctly in add-ons, provided they exclude svelte when bundling. * WithShortcut is now also available. ## Release Candidate 1 Build dffa38c4 / 2021-08-22. Changes to the [v3 scheduler](/faqs/the-2021-scheduler): * Interday learning cards are included in the learning count again, instead of the review count. * Interday learning cards are still affected by the review limit. Interday learning cards are fetched first, then reviews, and finally new cards. * Filtered decks with rescheduling disabled now log reviews, so the reviews will appear in your graphs. * Added an option to sort reviews by ascending/descending ease. * Fixed an issue where an error message could appear after undoing/redoing a mix of reviews and other changes. * Fixed custom scheduling not working. Other changes: * The "timebox finished" message is now shown on card answer, instead of after revealing the next card. This should also address an issue where the message popped up outside of review. * Added shortcut for Forget in the Browse screen. * Fixed an error being shown when there was no current deck. * Fixed incorrect quoting in duplicate search (thanks to Abdo). * Fixed deck options inverting the "replay question when showing answer" option. * Fixed an issue with ampersands in the Add Cards history button (thanks to Arthur). * Fixed handling of audio/video tags (thanks to Hikaru). * Fixed errors playing audio when computer was slow to respond (thanks to Kelciour). * Fixed preferences screen not updating undo menu, and causing an error when subsequently reviewing a card in the v3 scheduler. * Fixed case changes being ignored in tag rename. * Fixed error shown when DB check run on corrupt collection. * Fixed deck options prompt showing the default deck, instead of the correct one. * Fixed reposition command ignoring suspended cards. # Changes in 2.1.48 Source: https://docs.ankiweb.net/releases/betas/anki2.1.48 ## Release Candidate 2 Build 466d67ca / 2021-09-16. * Possible fix for reported sound issues. * Wayland is off by default again, but can be enabled by starting Anki with ANKI\_WAYLAND=1 defined. ## Release Candidate 1 Build af2ec0b9 / 2021-09-13. * Add "Previous Card Info" action to review screen (thanks to Evandro). * Changes to the packaging to (hopefully) support Wayland. * Fix flag names not updating on profile switch (thanks to Rumo). * Hide "Rename with Parents" for top-level items (thanks to Rumo). * "Add Field" action now correctly handles multi-word font names. * Fix newline being added when coloring text (thanks to Henrik). * Fix incorrect system font when running Anki in some non-English languages. * Fix learning count sometimes jumping to a large number in the v3 scheduler. * Fix console warning when playing audio (thanks to Evandro). * Another fix for Reposition command not working on buried/suspended cards. * Preserve focus when changing notetype in the Add screen. * Miscellaneous other fixes. # Changes in 2.1.50 Source: https://docs.ankiweb.net/releases/betas/anki2.1.50 ## Release Candidate 4 Build 26d40c3a / 2022-04-06. * The editing speedup change has been pushed back to 2.1.51 due to a bug. * For Qt6, the video driver now defaults to OpenGL on Windows/Linux, like earlier betas. The option in the preferences has been hidden again, and a new file introduced for adjusting behaviour: /manual/platform/windows/display-issues#qt6 ## Release Candidate 3 Build c96ef8cd / 2022-04-05. * The editor loads faster now, especially with lots of fields (thanks to Henrik). * It is now possible to choose between OpenGL and software video drivers in the preferences on Qt6. * Fixed background color mismatch in the editing screen. * Fixed highlight color button using text color (thanks to Henrik). * Fixed invisible tag input in Qt5 (thanks to Hikaru). * Set caret inside chemical expression in MathJax (thanks to Henrik). * Minor change to prevent the Advanced Browser add-on breaking. ## Release Candidate 2 Build 6718e678 / 2022-03-31. * Added a separate cloze button to repeat the current cloze (thanks to Henrik). * Fixed an error when importing some colpkg files from older Anki versions that contained media. * Fixed an issue with adding items to the editor toolbar from an add-on (thanks to Henrik). * Fixed cloze shortcut on Windows. * Fixed invalid HTML in field causing Anki to hang (thanks to Henrik). * Force decimal separator to be a period in the deck options, to work around blank boxes in the Qt6 build. * New cards no longer have their position changed by the Forget action when "restore position" is enabled, and the cards don't have an original position (thanks to Rumo). ## Release Candidate 1 Build ebe33a99 / 2022-03-29. * Fixed a serious issue with repositioning/removing card templates in the card layout screen, that was present since beta 3 (thanks to Rumo for the fix). * Fixed "create cloze with same number" shortcut on Qt6/macOS (thanks to Henrik). * Fixed cursor sometimes not moving into MathJax editor, leading to accidental deletion (thanks to Henrik). * Colpkg imports now always require a full sync. * Fall back on regular file deletion when no recycling bin/trash folder is available on Linux. * Randomized card positions now start at 1, which avoids a corner case in filtered deck scheduling. * Rows with database inconsistencies in the browse screen now prompt you to use "check database" instead of saying they were deleted (thanks to Rumo). * The 'future due' graph no longer shows learning cards in a filtered deck as being due a long time ago. * When Anki encounters an issue with a card template, it now provides a link to a help page with more information (thanks to Rumo). ## Beta 9 Build 4515c41d / 2022-03-21. * Fixed a serious issue with changing card numbers in Change Notetype that was present since beta 3. (thanks to Arthur for the reproduction steps). * Anki can now create backups periodically, instead of only on close. The default is every 30 minutes; you can adjust this in the preferences screen. * The File menu now has an option to create a backup immediately. * When using Custom Study to extend deck limits in the V3 scheduler, parent/child limits of the selected deck are no longer adjusted (thanks to Rumo). * Fixed an error that could occur in the browser when switching profiles (thanks to Hikaru). * Improvements and optimizations to colpkg exports/imports (thanks to Rumo). ## Beta 8 Build 02c580e4 / 2022-03-17. * Various fixes for .colpkg importing and exporting. We're reasonably confident the bugs have been ironed out at this point, but would appreciate you giving them a try and confirming the new code works well for you. * .colpkg files created with the previous beta will not be importable into this build. If you created a .colpkg file with beta 7 and need to recover data from it, please get in touch and we can help you out. * Fixed addMedia() call used by some add-ons (thanks to Henrik). ## Beta 7 Build 02ba50f2 / 2022-03-15. This release has been yanked due to bugs in colpkg imports. Please wait for the next beta. * Reworked .colpkg import/export (thanks to Rumo): * When exporting, you can optionally target Anki 2.1.50+. When doing so, ```text theme={null} imports and exports are faster, and media files will be compressed, but the resulting .colpkg will not be readable by older Anki clients. ``` * Collections are now checked for corruption when importing. * Various fixes for the editor (thanks to Henrik): * Allow longer maximum answer times in the deck settings (thanks to Bruce). * The custom study screen no longer (sometimes incorrectly) limits the amount you can extend the daily limits by. * Fix an intermittent error when building on Windows. ## Beta 6 Build a495fbaa / 2022-03-09. * Reworked backup handling (thanks to Rumo): * Backups are created much faster than they were previously, which allows Anki ```text theme={null} to close faster when you have a large collection, while still compressing the backups. ``` * There are new options in the preferences to control the number of daily, ```text theme={null} weekly and monthly backups you'd like to retain. Anki will keep all backups made in the last 48 hours, but avoids making more than one every 5 minutes when you're rapidly opening and closing your profile. ``` * Because the backup storage format has changed, backups created with 2.1.50 ```text theme={null} will not be importable into older Anki versions. Manually-exported colpkg files are still compatible with older Anki versions. ``` * When exporting a shared deck with scheduling disabled, the original card position will be restored if it is available (thanks to Rumo). * The Forget action now gives you options to restore the original card position, and to reset the card's lapse and repetition counters (thanks to Rumo). * You can now search for tags by regular expression (thanks to Rumo). One use for this is locating notes that are tagged with a `parent` tag, while not matching ones tagged with `parent::child`: `tag:re:^parent$`. * Added a silent option (/s) for the Windows uninstaller (thanks to Patric). * Fixed add-on config screen failing to show in bundled build. * Fixed buried counts being shown when v2 scheduler enabled. * Fixed MathJax sometimes being deleted when it wasn't visibly selected (thanks to Henrik). * Fixed newline shortcut in MathJax editor (thanks to Henrik). * Fixed shortcut/button to add a new tag (thanks to Henrik). * Fixed some parts of the media handling code matching more HTML tags than it should have (thanks to Brayan). * Fixes for the bury count on the overview screen (thanks to Rumo). ## Beta 5 Build 3564ece6 / 2022-02-25. Editor fixes, thanks to Henrik: * Fixed `<` and `>` not working correctly in the MathJax editor. * Fixed media files not being inserted at cursor position on Windows. * Cloze shortcut correctly positions cursor. * Adjust color picker shortcut, and apply color when different color selected. * Make it easy for add-ons to adjust the HTML editor theme. Other changes: * Fixed the errors when using the preview button in the browser, and more work on memory leaks (thanks to Rumo). * Truncate deck names in the deck list if they are too long (thanks to Sachin). * Flags are undoable again, and should update correctly in the browser. * Hide the 'bury interday siblings' options when the V2 scheduler enabled. ## Beta 4 Build 4ed499fb / 2022-02-23. V3 scheduler changes, thanks to Rumo: * When new cards are answered for the first time, Anki will remember their original position, and it can be seen in the card info. An option to restore cards to their original position manually and on export will likely come in the next beta. * The overview screen now shows how many cards will be buried. Please report any inaccuricies, as it is possible a different approach will be needed. * Added a separate option to control burying of interday learning siblings. This is currently incorrectly shown when the V2 scheduler is enabled as well. * When a Hard learning step exceeds a day, it is now rounded to a full day, so the delay does not vary depending on the time of day you answer. Other new features: * The way bold/italics/etc is applied in the editor has been reworked to be more robust, thanks to Henrik. This has resulted in tweaks to the formatting button order, and the clear formatting button now lets you configure what formatting should be removed. * An option to ignore accents in searches by default has been added to preferences screen (thanks to Abdo). * Added a View menu to the main window and browse window (thanks to Rumo). Bugfixes: * Added a "Learn" label to the learning counts in the deck list. * Fixed an error loading the old deck options screen when using Python 3.10. * Fixed an error when an installed TTS voice on Windows supported multiple languages (thanks to Rumo). * Fixed an error when exporting a collection with media files in it with very old modification dates (thanks to gnnoh). * Fixed junk appearing in the clipboard when copy/pasting on Windows, by rolling Qt back to the previous version. * Fixed newly-added deck not being selected in the Add screen (thanks to Hikaru). * Fixed sound failing to play after exporting a collection (thanks to Rumo and Kelciour). * Fixed various memory leaks (thanks to Rumo and Hikaru). * Flag changes no longer add an undo entry, which fixes some potential errors and unpredictable undo behaviour. * Reduced flicker when opening browser in night mode (thanks to Rumo). * Some behind-the-scenes code improvements (thanks to Sam). For developers: * `mw.progress.timer()` should now be passed a `parent` argument, as the previous default of using `mw` prevents the timers from being freed after they are no longer active. * Improved Python code completion/type handling in VS Code (thanks to Rumo). ## Beta 3 Build 95dbf30f / 2022-02-10. V3 scheduler changes, thanks to Rumo: * Intermediate limits are now respected. For example, if you have a deck tree of A>B>C>D, and click on B, then deck C is limited by deck B, and deck D is limited by both deck B and deck C. This is similar to the way the previous schedulers behaved, except the decks above the one you click on do not contribute to the limit. * The gathering and sorting of new cards has been reworked, trading a little performance for more intuitive behaviour: * It is now possible to sort notes or cards randomly at gather time, ensuring ```text theme={null} a random selection is taken from all available new cards. ``` * The gather order and sort order options have been simplified, but should ```text theme={null} offer the same functionality as before. Please check your deck options after upgrading, as some users may need to adjust their display order settings to match what they were using before. ``` * If you have more than 2 learning steps, after the first step, Hard repeats the previous delay, instead of being the average of the previous and next step. * Review cards and new cards are now interspersed more evenly. Improvements to the editor, thanks to Henrik: * You can now use the keyboard left/right keys to move into/out of the MathJax editor. * The HTML editor now matches the current Anki theme. * Fixed an issue that could prevent image resizing. * Fixed IME input after pressing tab. * Fixed currently-focused field not updating contents after an undo operation or find\&replace. * Fixed leading HTML comments being stripped by the HTML editor. * Lots of other behind-the-scenes changes (see the developers section below) and fixes. New features: * Be smarter about mapping existing text to new fields when switching notetypes in the Add screen (thanks to Abdo). * A new TTS tag format that allows you to combine extra text and multiple fields, such as `[anki:tts lang=en_US]Here is {{Field1}} and {{Field2}}[/anki:tts]` (thanks to Rumo). There are no plans to deprecate the old TTS syntax - either can be used. * Apkg files can now be dragged on the main window to import them (thanks to Abdo). * "Create Copy" uses the current card's deck, and can be also accessed via shortcut from the review screen (thanks to Rumo) * Added Belarusian and Odia to available languages in the preferences. * When switching Anki versions, an add-on update check is run on startup (thanks to Rumo). * Make links with target=\_blank work (thanks to Danish). * Added "Forget Card" action to review screen (thanks to Araceli). Fixes and other improvements: * Compression on automatic backups has been turned off, which can make Anki much faster to shut down with large collections (eg 7.9s->0.45s). Compression will likely come back in the future when we can integrate a more efficient compression library. * Add back the missing "Show Duplicates" link in the editor (thanks to Matthias and Henrik). * Added shortcut keys for creating lists and indentation (thanks to Rumo). * Behind-the-scenes improvements to the deck and notetype selectors (thanks to Sam). * Change cards/notes toggle to Ctrl/Cmd+Alt+T to avoid conflict on macOS. * Deck creation in the custom study screen has been reworked, and now supports undo properly (thanks to Rumo). * Don't show error when gsettings exists but does not have a GNOME theme set (thanks to Spooghetti420). * Don't show error when Windows color scheme setting is missing (thanks to qxo). * Filtered decks in 'order added' now sort by card template. * Fixed a number of issues with the preview window (thanks to Hikaru). * Fixed AltGr triggering Ctrl+Alt shortcuts on Windows (thanks to Rumo) * Fixed an error that could appear when clicking on the sidebar (thanks to qxo). * Fixed error shown when double-tapping answer buttons on the v3 scheduler. * Fixed external scripts being executed out of order (thanks to Hikaru). * Fixed field content sometimes spilling outside container (thanks to Hikaru). * Fixed flicker in review screen when referencing external js, and preload css files (thanks to Hikaru). * Fixed interday learning siblings not being buried during review, causing them to reappear later after actions like an edit. * Fixed new card position appearing as a date when cards were in preview (thanks to Abdo). * Fixed unwanted `
` being left behind when deleting field contents (thanks to Hikaru). * Hide "open new window" action in GNOME (thanks to Fusion future & Felipe) * Improve search highlight color in templates screen (thanks to Abdo). * Improved display of the card info screen (thanks to Rumo). * Improved localization of large numbers in the graphs, and various layout tweaks (thanks to Vova). * Performance improvements for searching through many fields with a wildcard search (thanks to Rumo). * Report correct count in timebox screen with v2 scheduler (thanks to Abdo). * Support Markdown inside HTML tags in config.md (thanks to Abdo). * The `note:` and `card:` searches no longer do a substring match (thanks to Rumo). * The calendar graph uses consistent coloring as years are changed (thanks to Ryan). * The top and bottom bars will no longer zoom in/out, but the main area and editors can be zoomed in and out (thanks to Rumo). * Tweaks to the sidebar icons (thanks to Henrik). * Updated translations - thanks as always to all the translators. * Use white menubar on Windows (thanks to Rumo). * Various behind-the-scenes fixes (thanks to Arthur). Packaging changes: * The building of the Anki packages has been reworked. Everything should hopefully behave as before; if you notice any problems, please let us know. * Update to (Py)Qt 6.2.3. * Update mpv to 0.34 on Windows. * Fcitx5 support is now bundled with both the qt6 and qt5 Linux packages. * Drop the experimental arm64 Linux package. Notes for developers: Henrik has spent a lot of time working out how to smoothly provide an API for the editor, and investigating how we can provide types to make targeting the API easier. This has required a number of refactorings, and some add-ons that were accessing the editor will have broken again in this update. While the code is not set in stone yet, hopefully we're getting there. An example of using the latest API is available here: [https://github.com/hgiesel/anki\_new\_format\_pack/commits/master](https://github.com/hgiesel/anki_new_format_pack/commits/master) ## Beta 2 Build db804d95 / 2021-12-09. macOS: * The Apple Silicon build now supports recording, and is fully native - Rosetta is no longer required. * The Qt6 Intel build now has a minimum macOS requirement of 10.14.4. Linux: * Fixed not being able to run Anki after running install.sh. * Added an experimental arm64 packaged build. PyQt and Qt are not included, so you need to link in your distro's version of PyQt5.15. For example, after untarring the file and changing into the top level directory with the 'anki' executable: ``` # eg Debian 11: sudo apt install python3-pyqt5.{qtwebengine,qtmultimedia} ln -sf /usr/lib/python3/dist-packages/PyQt5 lib/ # eg Fedora 34: sudo dnf install python3-qt5-webengine ln -sf /usr/lib64/python3.9/site-packages/PyQt5 lib/ ``` You may also be able to use the above technique for switching the x86\_64 builds to your system's PyQt version - just delete the PyQt5 or 6 folder before linking your system version in. * Fcitx users: this build includes libraries that may allow the Qt5 build to work with Fcitx. Please let us know if they work for you or not. Features: * Added a "Create Copy" option in the browse screen, to copy selected note's contents into the Add window (thanks to Rumo). Fixes: * Make scrollbars dark again in night mode (thanks to Hikaru). * Various improvements to right-to-left display (thanks to Abdo). * Fixed an error being shown when gathering new cards in descending position in the v3 scheduler. * Fixed unwanted height/width settings when copying images between fields (thanks to Henrik). * Reduced editor button size on Windows/Linux (thanks to Mathtias). * Support autoplay in audio tags again (thanks to Andreas). * Don't save window position when they're full screen, as Qt doesn't handle it well (thanks to Rumo). * Fixed the main window sometimes failing to load properly when Anki starts (which could lead to blank windows, a giant sync icon, etc). * Miscellaneous other fixes, thanks to Abdo, Matthias, TheFeelTrain and Arthur. ## Beta 1 Build 43c41d76 / 2021-12-04. Toolkit changes: * The packaged builds now come in separate Qt5 and Qt6 versions. * Qt6 is a recently-updated version of the toolkit. It fixes some issues that existed in Qt5, but it may introduce new problems. We recommend you try it first. * Qt5 is the graphics toolkit used to build previous Anki releases. If you find that Qt5 works for you and Qt6 does not, please let us know. Windows: * Windows 10 or 11 is required. If you are still using Windows 7 or 8, 2.1.49 is the last build that will install on your system. macOS: * There is now a native build for Apple Silicon. It currently does not support recording, and the audio playback still uses Intel binaries, so you will still need Rosetta installed. Only Qt6 is available for Apple Silicon. * The Qt6 x86 build requires macOS 10.14. * The Qt5 x86 build requires macOS 10.13.4. Linux: * The Linux builds need zstd to decompress, eg: ```sh theme={null} sudo apt install zstd tar axf anki-2.1.50-linux-qt6.tar.zstd ``` * The x86 builds require glibc 2.27 or later. * A wheel is now provided for ARM64 Linux, and requires glibc 2.31 or greater. A packaged version is not currently possible. * No fcitx driver or gtk2 theme is bundled with the packaged builds at the moment. Major editor changes, mostly thanks to Henrik: * A redesigned tag editor. * MathJax has a live preview. * HTML and rendered text can be viewed at the same time. * Images can be resized within the editor. * Fields can now have an optional description/tooltip assigned to them (thanks to Matthias, Henrik & Rumo). * Lots of behind-the-scenes changes. Because of the extensive changes, some add-ons that modify the editing screen will have broken. Scheduler changes: * The V1 scheduler is no longer supported. If you have not yet updated to V2 or V3, you will be prompted to update when you attempt to review cards in 2.1.50. * The V3 scheduler will be declared stable when 2.1.50 is released. * The V3 scheduler applies fuzz more evenly now, especially with smaller intervals (thanks to Rumo). * Fixed new cards not decrementing the review limit in V3, which could lead to more new cards appearing after the review limit was reached. * Fixed new cards not appearing in the correct order in the V3 scheduler. Other new features: * Anki will now switch to day or night mode automatically depending on your system settings. You can force day or night mode in the Preferences screen. (thanks in large part to Rumo). * The Card Info screen now updates automatically as you change to a different card (thanks to Rumo). * Added a shortcut to make Anki full screen (F11 or Cmd+Ctrl+F, thanks to Rumo). * Added tooltips to some browser columns (thanks to Rumo). * Added an option to add/remove sidebar tag to selected notes (thanks to Rumo). Other improvements: * Improvements to the Change Notetype screen (thanks to Matthias). * Improved performance with large selections in the Browse screen (thanks to Rumo). * Fixed the deck list showing up blank in collections with many expanded decks. * Changed the "Previous Card Info" shortcut to avoid a conflict with language input. * Possible fix for intermittent UI glitch on initial startup (thanks to Evandro). * Flip sidebar location in RTL mode (thanks to Abdo). * Fix deck name not updating after deck/notetype renamed (thanks to Hikaru). * Fixed "tag duplicates" possibly operating on stale data (thanks to Ren). * The Add Cards screen will no longer allow accidental triggering of main window shortcuts when it is open on a Mac (thanks to Rumo). * Fixed incorrect card count in timebox after undo (thanks to Abdo). * Fixed quotation of "and" and "or" in search (thanks to Rumo). * Numerous other fixes and contributions, thanks to Rumo, Henrik, Abdo, Matthias, Evandro, Arthur, Soren, BlueGreenMagick, Yoshi, Jakub, Gesa, blue-putty, stopendy, and zjosua. For developers: * Anki now requires Python 3.9. * Anki contains some compatibility shims that should allow many add-ons written for PyQt5 to work with PyQt6 as well (thanks to Aristotelis). These shims will not remain forever, so it is recommended that you update your add-ons to be compatible with Qt6 without shims. The two main breakages are the renaming of PyQt5 to PyQt6 (you can support both by importing from aqt.qt instead), and the requirement that [enums are qualified](https://github.com/ankitects/anki/pull/1406/commits/a7812dedc096627692ab3d7e64b90be632f52134). * If you’re using Qt Designer to generate UI files, the Qt5 and Qt6 versions need to be generated and bundled separately if you want to support both at once. * PyQt6 does not support the Qt resource system (pyrcc was removed), so Anki now uses a different approach, and urls like `:/icons/foo.jpg` should become `icons:foo.jpg`. * The way Anki is packaged has changed. Most of the standard library should be available now. If you notice any problems importing standard libraries that previously worked, please let us know. * The aqt package no longer depends on PyQt, as either version 5 or 6 is supported. You can specify the major version you want when installing - eg `pip install 'aqt[qt6]'` * manifest.json now supports a 'homepage' argument (thanks to Abdo) # Changes in 2.1.51 Source: https://docs.ankiweb.net/releases/betas/anki2.1.51 ## Release Candidate 2 Build a7cb5e21 / 2022-04-19. * Fixed compatibility with older macOS versions. * Fixed formatting being turned off when pressing shift (thanks to Henrik). * Remember original card position when using 'set due date' on a card (thanks to Rumo). * Fixed compatibility with 'card info during review' and similar add-ons. * Fixed illegible calendar buttons in dark mode on Mac/Linux. * Fixed stats PDF being illegible when saving in dark mode after scrolling down (thanks to Luka). * Use `` and `` formatting tags, instead of `` and ``. * Fixed an issue with the search history when clicking on items in the sidebar (thanks to Rumo). * Anki now closes the Browse screen before full sync or colpkg import/export, so it doesn't show errors. ## Release Candidate 1 Build 51a0641b / 2022-04-10. * Reviews in the V3 scheduler can now optionally be sorted by relative overdueness (thanks to Abdo). * Improve editor startup time, especially with many fields (thanks to Henrik). * Automatically re-enable disabled add-ons when user explicitly reinstalls them, and improve conflict handling (thanks to Aristotelis). * Fixed an issue that was breaking some add-ons when running on Windows without using anki-console.bat * Fixed card layout screen opening too wide if card template name was long (thanks to Sam). * Fixed full sync not being triggered when changing sort field. # Changes in 2.1.52 Source: https://docs.ankiweb.net/releases/betas/anki2.1.52 ## Release Candidate 3 Build ab1c2395 / 2022-05-10. The Qt 6.3.1 release we were waiting on has been delayed by a month, so 2.1.52 is now expected to release as stable within the next week, if no important issues come up. Editor improvements: * Ctrl/Cmd+A in tag editing area now selects all tags (thanks to BlueGreenMagick). * Pressing tab on the last field now moves focus to tag area (thanks to Henrik). * Reduce size of editor buttons on Windows/Linux (thanks to Henrik). * Tags copied from the tag editor are no longer joined together when pasted into the add tags/remove tags dialogs (thanks to Henrik). * Fixed `&` showing up when using `&` in MathJax (thanks in part to Henrik). * Fixed various issues with tag editing (thanks to BlueGreenMagick and Henrik). Other fixes: * Fixed scrollbars showing in bottom area of review screen (thanks to Matthias). * Fixed v3 scheduler allowing one extra card when review limit reached (thanks to Rumo). * Fixed Anki needing to close when invalid modification times encountered by the browser on Windows. * Fixed new importer failing to import a subdeck export (thanks to Rumo). * Improve progress feedback when using the new importing and exporting code. * New import code supports .zip filenames, and runs on drag/drop + file double-click cases as well. For developers: * The `field_filter` hook can now check if it's running for the question or answer side (thanks to Abdo). * Added a `av_player_will_play_tags` hook (thanks to Abdo). ## Release Candidate 2 Build 63f05b2b / 2022-05-02. Bugfixes/tweaks: * The Qt5 Mac build now caps tag autocomplete matches to 10, as showing more is extremely slow in the old toolkit version. * Fix custom study applying the previously-input limit, instead of the current one. * Fix an error when previewing cards and selecting multiple cards (thanks to Rumo). * Removed the highlight on the Show Answer and Good buttons. * Make it easier to search in fields programmatically (thanks to Abdo). This build also includes a new implementation of apkg importing and exporting, thanks to Rumo. Some advantages: * Undo/redo is now supported. * Faster imports (especially for decks with a lot of note content). * Support for older clients can be optionally disabled, which results in smaller apkg files, and faster imports. * Flags are removed when scheduling is excluded. The new functionality is hidden behind a feature flag, and **not active by default**. You can try it out by using `mw.pm.set_new_import_export(True)` in the [debug console](/manual/misc#debug-console). To revert to the old behaviour, replace True with False. Things to note: * This is new code that has received limited testing so far, so please use `File>Create Backup` before trying it out. Any testing/feedback you can provide would be appreciated. * While active, it is not currently possible to export files other than apkg/colpkg. * The Special Fields add-on will not work while this functionality is enabled. ## Release Candidate 1 Build a989e508 / 2022-04-25. * Update Qt to 6.3, which fixes slow loading of large images, and inertial scrolling on macOS. * List text is now aligned to the left by default (thanks to Matthias). * Reset page zoom when moving between different screens. * Fixed backspace sometimes removing multiple images at once (thanks to Henrik). * Fixed colpkg imports not being cancellable (thanks to Rumo). * Fixed copying and pasting MathJax on Windows (Qt6). * Fixed current working directory changing on apkg export. * Fixed custom browser font not being honored (Qt6). * Fixed due graph showing wrong date for review cards in a filtered deck with rescheduling disabled. * Fixed some formatting being lost when copying between fields on Windows (Qt6). * Fixed grey background in type answer text + dark mode (thanks to Matthias). * Fixed handling of `<` and `>` symbols in MathJax (thanks to Henrik). * Fixed intermittent editor loading failures when add-ons have injected a large amount of code. * Fixed pasting of local files of unsupported types that contain spaces (thanks to Abdo). * The Qt6 Linux build now defaults to X11/XWayland instead of Wayland due to some [remaining issues](https://github.com/ankitects/anki/issues/1767); you can force-enable Wayland with ANKI\_WAYLAND=1. # Changes in 2.1.53 Source: https://docs.ankiweb.net/releases/betas/anki2.1.53 ## Release Candidate 2 Build 96bacf79 / 2022-05-26. * Possible fix for crashes on some machines when closing windows. * Fix automatic backups popping up progress window when Anki minimized. * Fix cards not being generated after template edits. * Fix deck options top bar disappearing as you scroll down. * Fix duplicate Anki icons appearing in dock on macOS. * Fix duplicate first character in certain ibus configurations (thanks to wisherhxl). * Fix some MathJax directives failing to render in editor. ## Release Candidate 1 Build f6ecddef / 2022-05-20. Editor changes: * Rework image resizing (thanks to Henrik). Images expand to the editor width by default now, and images that are resized for the editor will remain that way if you switch fields, or navigate to a different note and back. * Existing height constraints on images are stripped when resizing (thanks to BlueGreenMagick). * The MathJax editor now provides buttons/shortcuts to cloze-delete selected text (thanks to Henrik). * MathJax preview now hides cloze markers. * Style tags are no longer stripped when editing (thanks to Henrik). * `
` tags in MathJax are now handled correctly (thanks to Henrik). * MathJax in the review screen now supports mathtools, and available packages in editor and review screen match (thanks to Henrik). * Move focus into HTML editor when hiding normal editor (thanks to Henrik). * Image tags now have the alt property preserved when pasting. Other changes: * Fixed future due graph incorrectly including new cards. * Custom study reports counts of child decks separately in v3 scheduler. * Fixed initially-incorrect tooltip position in graphs (thanks to BlueGreenMagick). * Fixed an error sometimes appearing in the browser when deleting notes (thanks to Rumo). # Changes in 2.1.54 Source: https://docs.ankiweb.net/releases/betas/anki2.1.54 ## Release Candidate 3 Build a8e34ce4 / 2022-06-22. * Fixed fields sticking in add screen when they shouldn't (thanks to Henrik). * Fixed incorrect header text alignment in Qt 6.3.1 (thanks to Rumo). * Automatically map tags field in new import screen (thanks to Rumo). ## Release Candidate 2 Build 30c6bd58 / 2022-06-21. * Fixed broken column headers in Browse screen. You'll need to reconfigure your columns after updating. * Fixed undo history being cleared and error showing when double-tapping delete in Browse screen. * Fixed field descriptions appearing underneath field text (thanks to Hikaru). * Changing field delimiter in new import screen rebuilds field map. * Editor API improvements (thanks to Henrik). * Add ellipsis to Forget action. ## Release Candidate 1 Build 595c9273 / 2022-06-18. A new CSV importer & exporter, thanks to Rumo: * Shows a preview based on the selected field separator. * Column mapping includes field text for reference. * Multiple decks and notetypes can now be imported/exported at once, as columns can be mapped to deck or notetype name. * Supports exporting and importing a unique identifier for a note, to use instead of a matching first field. This removes the need for the 'add note id' add-on. * Extends the header syntax so that files can specify metadata such as the desired field separator, and the mapping of fields. * The new functionality is not enabled by default, and can be enabled with a checkbox in the preferences screen. This also enables the new apkg import/export code introduced in 2.1.52. If you use the Special Fields add-on, you will need to disable this option in order to use the add-on. Update to Qt 6.3.1: * Fixes complex-language input (eg Japanese, Hindi, etc) on macOS being flaky. * Fixes unwanted text when copying from the review screen on Windows. * Fixes a startup failure with certain Linux keyboard configurations. Other changes: * Accept .zip extension when importing add-ons (thanks to Abdo). * Add support for getting light/dark mode status with latest freedesktop standard (thanks to Bart). * Field descriptions in the editor are now shown inline, instead of in a tooltip (thanks to Matthias). * Fixed a rounding issue when describing time intervals of a year or more. * Fixed an error that occurred after a one-way download fetched a collection with a different scheduler version enabled. * Fixed desktop hanging when attempting to add a new notetype in KDE (kwin). * Fixed flag names not updating after sync until Anki restarted. * Fixed inability to enter underscore in tags area on some keyboard layouts (thanks to Henrik). * Provide a way for the review screen to support drop events (thanks to Abdo). * Other minor fixes and improvements. # Changes in 2.1.55 Source: https://docs.ankiweb.net/releases/betas/anki2.1.55 ## Release Candidate 2 Build e0c4ba4b / 2022-12-14. * Better hover feedback on top menu (thanks to Matthias). * Fix cursor moving to field start when closing MathJax editor. * Fix disabled state not being conveyed in dropdowns (thanks to Matthias). * Fix inability to choose black in editor. * Fix MathJax popup not appearing when activated via mouse (thanks to Hikaru). * Fix RTL issues on first run. * Hide description button for filtered decks (thanks to Matthias). * Improve dropdown arrow appearance (thanks to Matthias). * Revert to Qt 6.3 on macOS, which fixes a flickering issue. ## Release Candidate 1 Build f38c4e2f / 2022-12-09. * Close MathJax editor when Esc is pressed (thanks to Abdo). * Field collapse state and HTML editor no longer resets when card added (thanks to Matthias). * Fixed 'change notetype' starting with the wrong notetype selected. * Fixed MathJax editor not hiding as you select a different note. * Fixed more RTL issues (thanks to Matthias). * Fixed some dialogs failing to appear on new installs. * Fixed stuck animation when MathJax editor near edge of window (thanks to Matthias). * Fixed text color button not applying colors in some cases (thanks to Henrik). * Improve dropdown appearance and tweak change notetypes screen (thanks to Matthias). * Increased initial add-on dialog size. * Make up/down buttons in deck options more subtle (thanks to Matthias). * Pages like deck options now have a larger default size. * Possible fix for slow TTS on Windows. Developer-focused: * Fixed a 'git failed' message that could occur when building. * Fixes to work with the latest timing library (thanks to Rumo). * Make it easier to replace hooks (thanks to zjosua). ## Beta 7 Build fad1ff74 / 2022-12-04. * Fixed 'remove formatting' not handling formatting in the middle of a selection. * Fixed (or at least reduced) crashes on exit. * Fixed alternate table row color on macOS dark mode. * Fixed audio not playing on macOS. * Fixed glitchy animation of floating elements (thanks to Matthias). * Fixed incorrect field mapping in the change notetype screen. * Fixed interface being reversed on first run with RTL language. * Fixed some regressions in the tag editor. If you notice this causes empty tags to be added again, please let us know. * Fixed the current text input not being saved when clicking on the Save button without leaving the field first. * Fixed TTS throwing errors on Windows. * Give containers a brighter color than canvas (thanks to Matthias). * Improve button color/hover gradients (thanks to Matthias). * Improve the appearance of dropdowns, and fix layout in CSV import screen (thanks to Matthias). * MathJax preview is no longer subject to image shrinking. * Reduce flicker when showing congrats screen. * Slightly reduce padding in deck list (thanks to Matthias). * The Hard button on the first step is now capped to a maximum of 1 day greater than Again (thanks to Rumo). * The zoom level is no longer reset when moving between screens. * Tweak scrollbar colors for better visibility in dark theme (thanks to Matthias). * Tweak the appearance/behaviour of the increment/decrement buttons in deck options. * Use third grid column in graphs layout on wide screens (thanks to Matthias). * Added an option to force Windows/Linux-style appearance on Macs (thanks to Matthias). Enable with `mw.pm.set_force_custom_styles(True)` in the debug console, then restart. ## Beta 6 Build ca116699 / 2022-11-28. * Fixed a number of issues with the tag editor (thanks to Matthias). * Fixed shortcuts to select all/delete tags not working (thanks to Hikaru). * Fixed non-native scrollbar and rubber-band scrolling in some screens on macOS (thanks to Matthias). * Reduce size of dropdown text (thanks to Matthias). * Tweak default styling to avoid overriding some shared deck styling (thanks to Matthias). * Tweak button styling to improve restyle add-on behavior (thanks to BlueGreenMagick). For developers: * The build system has been switched from Bazel to Ninja. * Wheels are available on PyPI again. * Thanks to Stefan for a bunch of spelling/typo fixes to the code. ## Beta 5 Build b88a7394 / 2022-11-23. This beta is built with the new build system in PR #2022. The packages should behave as before, but if you notice any issues, please let us know. The wheels for this beta are missing from PyPi. More UI tweaks thanks to Matthias: * Fixed the editor freezing when expanding/collapsing images. * Fixed the double border when 'reduce motion' is on. * Don't show/hide the field icons on hover when 'reduce motion' is on. * Move the options button in the editor to the left. * Fixed some issues with field descriptions not updating. * Fixed bad answer button display when answer times disabled. * UI size tweaks. Other fixes: * Fixed inverted ctrl+right/left handling in RTL fields again (thanks to Abdo). * Add tooltip to More button (thanks to Hikaru). * Fixed incorrect location of tag completion pop-up (thanks to Hikaru). * Fixed a regression in some add-ons in the browser (thanks to Abdo). * Fixed an issue with the night theme class (thanks to BlueGreenMagick). * Improve handling of invalid UTF-8 in DB check. * Suppress the "Unknown error" message that the web toolkit can output on Windows. * Improve an add-on hook (thanks to zjosua). ## Beta 4 Build e3c3405f / 2022-11-05. Lots of UI fixes thanks to Matthias: * Add back thick field focus border. * Add margin to buttons in reviewer. * Duplicate outline in editor no longer gets hidden when field not active. * Fix a lack of styling in the review area. * Fix colors on things like flags changing unintentionally. * Fix dropdowns wrapping to the top. * Fix fields not showing with reduce motion active. * Fix HTML editor not showing content initially. * Fix issues with the reviewer answer button area. * Fix short deck options' help text appearing next to the title. * Fix some issues with displaying on the Qt5 build. * Fix various RTL issues. * Flatten buttons to match macOS style (thanks also to Hikaru). * Increasingly increment/decrement SpinBox value on long press. * Prevent deck options switches from toggling on label click. * Set same font size for all platforms and make editor UI a bit smaller. * Tweaks to browser column headers. * Use circle icon for radio box. * Use custom scrollbar in stats screen, use grid layout, and tweak styling. Other fixes/improvements: * Fixed Apple Silicon macOS build failing to start. * Double-click on browse panes to split evenly (thanks to Aristotelis). * Fix browser sidebars appearing in wrong order in RTL mode (thanks to Abdo). * Fix headers in importing screen overlapping section content. * Fix MathJax pop-up appearing at bottom of screen. * Fix wrong deck preset being selected by default in some cases. * Improve the appearance of the note/card switch toggle (thanks to Aristotelis). * Preload images on the front side of a card to reduce pop-in (thanks to Kelciour). * Remove untranslated 'see old deck options for add-ons' notice. ## Beta 3 Build e5c4ccf0 / 2022-10-29. More UI work, thanks to Matthias. The styling is not set in stone, so we'd appreciate you letting us know what you like better now, and anything you don't like. * Reworked the appearance of the main window. * Changes to the theming of things like buttons, particularly on Windows/Linux. * Improvements to the deck options screen. * Fixed field names appearing on top of field content, by finishing the work Henrik had previously done. * Improved appearance of add-on buttons in editor. * The tag area separator in the editor now snaps into place. * Improved the tag completion pop-up. * Lay some of the groundwork for custom color themes in the future. Known issues in this beta: * The 'reduce motion' option in the preferences breaks the editing window. Improvements/Fixes: * Fixed indent/outdent shortcuts not working properly. * Fixed maximized browser window not being restored (thanks to Hikaru). * Fixed some issues with dragging tags/decks onto other tags/decks (thanks to Abdo). * Improve Anki's error handling, including some more informative error messages (thanks to Rumo). * Preserve background color when copy+pasting between fields. ## Beta 2 Build e14f87ba / 2022-10-12. More UI improvements thanks to Matthias: * Improve visibility/appearance of duplicate warning. * Fix selected tag not being highlighted. * HTML tag auto-close can now be toggled via settings button in editor. * Move MathJax preview toggle to settings button. * When MathJax preview disabled, newly added equations no longer pop-up the preview. * Cards/notes selector now uses full label. * Improve layout for RTL languages. * Add left/right padding to buttons. * Ensure dropdowns are shown within window margins. * Fix vertical misalignment of bottom toolbar buttons. * Fix misaligned settings button. * Fix unreadable tooltips in dark mode on Windows. * Fix daily limits in deck options incorrectly starting from 1. * Tweak border color in dark mode. * Tweak appearance of menus on Windows/Linux. Other improvements/fixes: * Update Qt to 6.4, which performs better under Wayland. Please let us know of any improvements/regressions it brings. * Fix MathJax editor not being hidden when note added or switched. * Fix scrolling with keys/keyboard event listeners not working on answer side (thanks to Hikaru). * Fix styling of pop-over arrows (thanks to BlueGreekMagick). * Make it easier to read add-on errors (thanks to Abdo). * Fix type answer warning making text bold. * Fix font size not being removed when pasting between fields. ## Beta 1 Build f72570c or 6944210 / 2022-09-28. Various UI changes, thanks to Matthias: * The tags area can now be collapsed/expanded (thanks also to Henrik). * The editor in the browse screen can now be shown on the right. * Redesigned editor field appearance. * Fields can now be collapsed/expanded. The animation can be disabled in the preferences. * Added an option for fields to show the HTML editor by default. * Tweaks to the light and dark themes. * Tweaks to widget styling on Windows/Linux. * Ensure long words wrap in the editor. * Fix not being able to scroll when hovering over HTML editor. V3 scheduler improvements, thanks to Rumo: * Custom scheduling now supports per-card data, enabling things like [FSRS](https://forums.ankiweb.net/t/how-did-i-publish-a-paper-in-acmkdd-as-an-undergraduate-a-fantastic-research-experience-on-spaced-repetition-algorithm-open-source-the-code-and-dataset/23387). * Decks can now specify daily limits independently of the deck preset. You can either specify a permanent override, or one that will reset when the next day comes around. Import/export improvements, thanks to Rumo: * The new import/export code is now the default. * When scheduling is included, filtered decks are no longer converted to normal decks. * When a deck is specified in a CSV import, it's now created if missing. * Various other fixes. Other improvements: * You can now control whether images are automatically shrunk or not in the editor. * Improvements to the MathJax editor (thanks to Henrik). * The MathJax preview can now be turned off. * You no longer need to add or remove a file to the media folder for file changes to be picked up. * The way your typed text is compared with the correct answer has been tweaked. * Anki now opens to the previously-active profile (thanks to Sam). * Remember previous choices in reposition dialog (thanks to Sam). * Card info now refreshes as a card is reviewed (thanks to Rumo). * Make dvipng use transparent background by default (thanks to gnnoh). * `introduced:x` now ignores manual reschedulings (thanks to Rumo). * Updated to Qt 6.3.2 * The maximum answer time can now be set below 30 seconds. Fixes: * You should no longer see strange behaviour when changing learning steps while cards are in learning (thanks to Rumo). * Cmd+Shift+C cloze shortcut should be more responsive on macOS now. * Fix sidebar appearing as small window in some cases (thanks to Hikaru). * Add screen can be closed with Cmd+W on macOS (thanks to Sam). * Fix \{\{CardFlags}} not working with flags 5-7 * Fix an error showing when making network connections on macOS after leaving Anki open for a few days. * Fix certain installed TTS voices on Windows causing errors. * Fix daily counts being included in apkg import. * Fix fields sticking in add screen when they shouldn't (thanks to Henrik). * Fix flicker when remapping imported notetype field (thanks to Rumo). * Fix incorrect header text alignment in Qt 6.3.1 (thanks to Rumo). * Fix non-admin users having trouble with Anki on macOS. * Fix reviewer shortcuts being inaccessible due to IME * Fix scheduler change not reflected after normal sync. * Fix slow field pin/unpin with large notetype (thanks to Rumo). * Fix the UI getting stuck at startup when multiple pop-ups appear (thanks to Sam). * Keep content of unmapped fields when importing CSV (thanks to Rumo). * Possible fix for error when copying text in editor * Preserve background-color when pasting external content in light mode. * The HTML editor no longer automatically closes tags. # Changes in 2.1.56 Source: https://docs.ankiweb.net/releases/betas/anki2.1.56 ## Release Candidate 1 Build bc697597 / 2023-01-04. New features/improvements: * Cloze deletions can now be nested inside other cloze deletions (thanks to TRIAEIOU). * Inactive cloze deletions can now be styled with .cloze-inactive (thanks to TRIAEIOU). * Graphs in large collections now load approximately twice as quickly. * Add-on config help is now shown in a webview (thanks to Abdo). Fixes: * Fix error popping up 12 hours after starting Anki on macOS and some Linux machines. * Fix unreadable text when searching in sidebar. * Fix fcitx not working on Linux Qt6 package. * Fix old graphs failing to appear. * Fix dark mode display issues on macOS/Qt5. * Fix images not being constrained to window width when image shrinking disabled. * Fix incorrect macOS minimum version in Qt5 build. * Fix lack of highlight for marked cards in day mode. * Fix pop-up menu in editor sometimes flashing (thanks to Hikaru). * Fix some issues entering text via IME around MathJax area (thanks to Hikaru). * Fix some regressions with the graphs when saving to a PDF. * Fix truncated text on some buttons. * Fix two mpv issues on Windows (thanks to Kelciour). * Tweak focus highlight of some widgets (thanks to Abdo). For devs: * Improve web building/reloading experience (thanks to Aristotelis). * Fix an issue building the code with the latest git version. * Fix aqt type completion not working with PyPI wheel. # Changes in 2.1.57 Source: https://docs.ankiweb.net/releases/betas/anki2.1.57 ## Release Candidate 1 Build 14189a91 / 2023-01-26. * Fix non-Latin text wrapping in deck options dropdown (thanks to Fabricio). * Fix outer whitespace not being trimmed in type answer. * Fix style label being shown in preferences on Windows (thanks to Matthias). * Fix the future due graph counting learning cards on the wrong day. * HTML is now escaped in the deck list. * Improve styling of boxes in template editor (thanks to Matthias). * Fix 'View Files' not working with a relative base folder (thanks to Abdo). Dev related: * Make it easier to override node/protoc binaries during a build (thanks to Mani) ## Beta 1 Build 5cdfa7a6 / 2023-01-18. More UI improvements/fixes thanks to Matthias, including: * The top toolbar area can now take on the color/background of the main window. * The top toolbar appears more subtle during review. * A new option in the preferences to automatically hide the top and bottom bar during review. * A new option in the preferences to enable a "minimalist" mode that makes the UI more compact/less fancy. * A new option in the preferences to switch between native styling and the Anki theme (on Mac/Linux). * The preferences screen has been redesigned to be easier to navigate. Syncing has also been updated: * Tweaks to the sync protocol that should be transparent when syncing with AnkiWeb, but that will break syncing with third-party servers that haven't been updated yet. * The sync server bundled with Anki has been updated, and now supports syncing media as well. More information is available on [/manual/sync-server](/manual/sync-server). Other changes: * Switch to a different library for handling type-in-the-answer comparisons, which should give more reliable results, and not crash with certain inputs (thanks to Rumo). * Fix `introduced:x` not working correctly when negated (thanks to Rumo). * Fix ctrl+enter not working when importing screen first opened. * Fix image dimensions not being correctly constrained (thanks to Hikaru). * Fix incorrect total/average in added graph. * Fix newlines not appearing when importing a csv file with HTML disabled. * Fix quotes preventing field descriptions from showing. * Fix spaces not handled properly when entering text around MathJax (thanks to Hikaru). * Fix toolbar add-on breakages and introduce toolbar tray layout & API (thanks to Aristotelis). * Fix type-in-the-answer not supported nested cloze deletions. * Increase delay when adjusting clipboard, which may improve compatibility on some systems. * Update Windows/Linux builds to Qt 6.4.2. # Changes in 2.1.61 Source: https://docs.ankiweb.net/releases/betas/anki2.1.61 ## Release Candidate 1 Build 5613113f / 2023-03-28. * Add time of date to browser date. * Allow Shift+Tab to move focus from tag area to last field (thanks to Hikaru). * Ensure sync spinner spins when reduce motion is enabled. * Fix new ignore review limit help (thanks to Rumo). * Fix stats calendar incorrect due to daylight savings time (thanks to Kieran). * Prevent the top bar from hiding in the stats page as you scroll down (thanks to Fabricio). * Start debug console with text area focused. ## Beta 2 Build d0ab7acb / 2023-03-20. * You can now exclude certain fields from unqualified searches via the Fields screen (thanks to Abdo). * You can now import decks with broken timestamps - they'll automatically be fixed on import (thanks to Rumo). * A DB check will now fix broken timestamps (thanks to Rumo). * Reduce motion is now on by default, as it fixes an issue with the bottom bar failing to appear for some users. * Fix new limit in v3 decreasing more than it should (thanks to Rumo). * Fix current tag text not being saved when changing note via shortcut key (thanks to Hikaru). * Fix tags popover becoming separated from the tags field (thanks to Fabricio). * Custom schedulers now have the deck name and random seed passed in to them, so they don't need to extract the info from the DOM (thanks to Rumo). * Ensure the bottom buttons aren't displayed until the custom scheduling code has finished running (thanks to Rumo). * Refresh study screen if the user toggles the v3 scheduler (thanks to Rumo). * Fix notetypes screen not being closable after adding a notetype on Mac. * Improve debug console (thanks to Rumo). * Check for division by zero when calculating browser aspect ratio, which fixes an issue with i3 (thanks to Ben). * Fallback to Wayland if X11 is not available (thanks to Ingemar). * Tweaks to the build scripts to make packaging in distros easier (thanks to Euan). ## Beta 1 Build 5ad29c37 / 2023-03-11. Improvements to the V3 scheduler: * Added a global option to stop the review limit from limiting new cards (thanks to Rumo). * You can now enable review burying without new burying again (thanks to Rumo). There are some caveats - please see the bury tooltips in the deck options. * Ensure good is at least previous+1 even if low hard factor set. Other improvements: * The tag area in the editor is now shown with a dropdown instead of a splitter (thanks to Matthias). * Add a button in the preferences to reset window sizes (thanks to Abdo). * Passing an invalid profile name on the commandline will now show profile picker instead of an error. * You can shift-click on a deck to select it as the current deck (thanks to Tobias). Fixes: * Fix silent file save failures and bad default save path in Flatpak (thanks to Jack). * Fix HTML editor sometimes not properly sized when opening editor (thanks to Hikaru). * Fix error showing if user clicks in sidebar before it's rendered. * Fix backup creation for collections > 1 GiB (thanks to Rumo). * Fix black on grey minimalist buttons in Qt5 (thanks to Daniel). * Fix black on grey deck options on Qt5 (thanks to Daniel). * Export static references from sound tags (thanks to Rumo). * Fix packaged audio tools path on Windows (thanks to Abdo). * Fix a case where 'reduce motion' and 'minimalist mode' were switched (thanks to Daniel). * Fix panic with invalid sync server URL with port (thanks to Daniel). * Fix double scrollbars in deck options (thanks to Fabricio). * Fix images with non-Latin text and commas failing to display. * Fix editor text possibly being transfer to different notetypes (thanks to Fabricio). * Improve hover appearance of buttons (thanks to Matthias). * Fix inability to activate search in graphs screen on Android (thanks to yellowjello). # Changes in 2.1.62 Source: https://docs.ankiweb.net/releases/betas/anki2.1.62 ## Release Candidate 1 Build fd509efc / 2023-04-28. * Revert Windows build to Qt 6.4, due to the reports of slowdowns on 6.5. Upgrade from 6.4.2 to 6.4.3. * Add a new option to the card templates screen to restore a notetype to the default fields/templates/styling. * Add clearer tooltip to hourly breakdown graph (thanks to Rumo). * Fix focus loss when closing HTML editor (thanks to Hikaru). * Prevent MathJax editor from closing when you selected text with the mouse and released the mouse button outside the window (thanks to Hikaru). * Pass original deck name to custom scheduling code, instead of filtered deck name. * When importing an .apkg where notetypes have changed, display a clearer message, and only if the notes in the incoming collection are newer. ## Beta 1 Build b5fa47e3 or bf05fae9 / 2023-04-12. This build updates Qt6 on all platforms to the recently-released Qt6.5. Please report any regressions or improvements you notice. * The minimum macOS version for the Qt6 build is now macOS 11. * If you are on Linux and don't have ANKI\_WAYLAND set, you may need to install libxcb-cursor or Anki will fail to start. Eg on Debian/Ubuntu: sudo apt install libxcb-cursor0 Other changes: * Fix MathJax editor not being sized correctly (thanks to Hikaru). * Fix a flicker when dropdowns shown with reduce motion on (thanks to Hikaru). * Add an option to fully randomize reviews in the V3 scheduler. # Changes in 2.1.66 Source: https://docs.ankiweb.net/releases/betas/anki2.1.66 ## Release Candidate 1 Build 70506aeb / 2023-08-20. * The v3 scheduler is now the default for new users. * When imports complete, a summary window is now shown (thanks to Abdo). * Media check now automatically extracts images that have been embedded in fields. * Handle importing of legacy AnkiDroid backups. * Fixed a sporadic error in the review screen (thanks to mjuhanne). * Fixed an error that could occur when syncing between newer and older clients. * Fixed tab order in find\&replace screen (thanks to Gabriel). ## Beta 1 Build 46915605 / 2023-07-26. * Windows and Mac builds have been updated to the latest toolkit version, which will hopefully fix some crashes/bugs. Please report any improvements or regressions you notice. * Use a different approach for detecting copy+paste from Anki fields, which may fix some crashes. * The minimalist/reduce motion toggles should no longer affect card content. * The built-in sync server can now be built without Python if you prefer. * Add keyboard shortcut for legacy stats (thanks to Luc). * Accessibility improvements (thanks to Derek and Kenny). * Fix addon update dialog showing twice (thanks to Rumo). * Fix bold toggle not working in certain circumstances (thanks to mmjang). * Align code blocks to left (thanks to shunlog). * Make weekday font smaller for Chinese locale (thanks to mmjang). * Improve performance of invalid ID fix in DB check. * Fix main window geometry/state not being restored in some cases (thanks to Abdo). * Handle invalid float mtimes in DB check. * Fix total note count not being logged in apkg import. * Report actual error when DbError occurs. * Fix two issues with MathJax editor (thanks to Hikaru). * Don't fail silently when an empty csv is imported. * Fix two issues that can cause editor fields to behave incorrectly (thanks to Hikaru). * When cards are in intraday learning queue, don't use original due. * Fix "Add-ons possibly involved" message never appearing on Windows (thanks to Abdo). * Add partial support for Hangul keyboard shortcuts during review (thanks to Christopher). * Disable add-on buttons when no field is focused by default (thanks to Abdo). * Fix toggleable editor button styles (thanks to Abdo). * Various other minor fixes and behind-the-scenes changes. Dev related: * Fix incorrect handling of locals in debug console (thanks to Rumo). * Add did-add-field-hook analogous to did-delete-field (thanks to 3ter). * Fix run-qt5.15.bat (thanks to Hikaru). * Support more mime types for add\_extension\_based\_on\_mime (thanks to BenYip). * Make set\_config\_help\_action work with submodules (thanks to Abdo). * Exclude Fabric's large canvas dependency (thanks to Kavel). # Changes in 2.1.66 Source: https://docs.ankiweb.net/releases/betas/anki23.10 ## Release Candidate 1 Build 70506aeb / 2023-08-20. # Changes in 23.12+ Source: https://docs.ankiweb.net/releases/betas/github Beta release notes and downloads are now posted on the GitHub releases page: [https://github.com/ankitects/anki/releases/tag/23.12.1](https://github.com/ankitects/anki/releases/tag/23.12.1) They are removed when a stable release is made. # Older Source: https://docs.ankiweb.net/releases/betas/older ### Changes in 2.1.39beta2 Build 576f0043 / 2021-01-30. This beta is closer to 2.1.38 than the previous beta - it contains a bunch of bugfixes from beta 1, but feature changes have been cut, and will come back in 2.1.40. This is expected to be released as stable without further changes, if no issues are found in the next couple of days. Please make sure to [downgrade](https://changes.ankiweb.net/) with beta 1, before opening beta 2. Changes since 2.1.38 stable: * Fix the Reposition command not preserving the browser sort order. * Fix some issues causing the sync indicator to show unnecessarily (thanks to Rumo). * Fix a spurious warning about a full sync when renaming card templates. * Fix Anki not working after installing on Linux over a previous install. * Don't log card resets when exporting. * Fix congrats screen not showing when learning cards were due soon. * Updated bundled lame and mpv on Windows and Mac builds. * Other fixes and improvements, with thanks to Henrik, Rumo, Abdo, Arthur, Guillem, Meredith, Gustavo and Daniel. ### Changes in 2.1.39beta1 Build 32278813 / 2021-01-26. New features: * Browser improvements: * Tags now show in a tree (thanks to Abdo). * New context menu actions to rename or remove tags and their children, rename ```text theme={null} decks, manage notetypes, and rename/remove saved searches (thanks to Abdo and BlueGreenMagick). ``` * The preview button in the browse screen has moved into the editing area ```text theme={null} (thanks to Henrik). ``` * With the improved sidebar, a number of options have been removed from the ```text theme={null} Filter button. ``` * Search improvements: * Searches are new rewritten into a canonical format (eg `one two` becomes ```text theme={null} `"one" AND "two"`) (thanks to Rumo). ``` * Search error messages are now much more specific (thanks to Rumo). * is:learn, is:due and prop:due now handle more cases, such as suspended cards ```text theme={null} (thanks to Henrik). ``` * Added prop:pos search to search for new card position (thanks to Abdo). * Added a shortcut to replace part of a search with a different search (eg ```text theme={null} changing the selected deck) (thanks to Rumo). ``` * Support resched:x for searching for cards that were manually rescheduled in ```text theme={null} x days (thanks to Henrik). ``` * Support prop:rated/resched to search for rated/rescheduled cards over ```text theme={null} specific time periods (thanks to Henrik). ``` * Graph improvements: * A number of the graphs can now be clicked on to search for the cards ```text theme={null} displayed by the graph (thanks to Henrik). ``` * The starting day of week can now be altered in the Calendar graph (thanks to ```text theme={null} Henrik). ``` * The Card Counts graph now supports toggling separate suspended/buried counts ```text theme={null} (thanks to Henrik). ``` * The intervals and ease graphs now covers more cases, such as suspended cards ```text theme={null} (thanks to Henrik). ``` * Place less emphasis on outliers in the Calendar graph (thanks to Henrik). * Edit/More buttons auto-hide when window is small (thanks to Henrik). * The editor will now favour BR tags over DIVs (thanks to Henrik). * A basic sync server is now built into Anki. It does not yet support media. Docs are in the docs/ folder of the source tree. Bugfixes: * Fix the Reposition command not preserving the browser sort order. * Fix some issues causing the sync indicator to show unnecessarily (thanks to Rumo). * Fix a spurious warning about a full sync when renaming card templates. * Fix Anki not working after installing on Linux over a previous install. * Don't log card resets when exporting. * Fix congrats screen not showing when learning cards were due soon. * Updated bundled lame and mpv on Windows and Mac builds. * Other fixes and improvements thanks to Henrik, Rumo, Abdo, Arthur, Guillem, stayingpeachy, Daniel, khonkhortisan and Kerrick. For developers: * JS libraries like jQuery have been updated (thanks to Henrik). * Add (untested) support for ARM64 Linux. * orjson is turned back into an optional requirement (though is still recommended, as it's faster). * The sidebar code has been moved from from browser.py into sidebar.py, which may break some add-ons. ### Changes in 2.1.38beta4 Build 355e4cd5 / 2020-12-23. If no issues are discovered, this will likely be released as 2.1.38 stable in a few days. * Reduce the default fade time in the review screen. * The ANGLE video driver can now be selected in the Preferences on Windows. * Fix some instances of sync indicator remaining on after sync. For developers: * Protobuf binaries are now used to speed up the initial build. * Fix Windows build on Python 3.9 (but 3.8 is still recommended). ### Changes in 2.1.38beta3 Build d600bd58 / 2020-12-21. * All built-in Windows TTS voices should now be supported on recent Windows 10 releases (thanks to Ryan). * Work around --text-fg appearing in fields. * Record a short amount of extra time when stopping recording with the new recording driver, and remove the qtrecorder option. * Fix link in about screen (thanks to Abdo). * Possible fix for sync button becoming blue without changes (thanks to Rumo). * Don't throw error when computer hostname is invalid. * Other minor changes (thanks to Henrik & k12sh) ### Changes in 2.1.38beta2 Build 38406862 / 2020-12-18. * Add another approach for recording audio that should avoid the leading 300ms silence that was in beta1. * You can now choose between recording drivers in the preferences screen, with 'qtrecorder' being similar to the beta1 approach, and 'pyaudio' being similar to previous Anki versions. If you find some work better than others, please let us know. No restart is required after changing the option and closing the preferences screen. * Fix '1' being shown instead of the correct number in some Russian translations. ### Changes in 2.1.38beta1 Build 56ac71ff / 2020-12-16. * Switch audio recording libraries. Please try recording audio on a card and let us know if there are any issues. * Fix the Reposition tool in the Browse screen not following the sort order. * Fixed invisible characters when adding new card templates (thanks to Henrik). * Fixed duplicate check getting confused by non-breaking spaces (thanks to abdo). For developers: * Fixed Python code completion, and added some info to docs/development.md * ./run now runs Anki with Python warnings enabled - PRs that fix any that come up would be welcome (thanks cecini for the first!) * PyAudio is no longer required for recording. ### Changes in 2.1.37rc1 Build fe4fda70 / 2020-12-10. Will become the next stable release in a few days if no further issues are found. * Fix filtered decks not respecting sort order. * Fix automatic scrolling to the answer (thanks to Henrik). * Ease in the deck options now has a 131% minimum. ### Changes in 2.1.36beta5 Build c505894b / 2020-12-07. This is expected to be released as stable in a day or two without further changes, if no issues are discovered. * Support building with Python 3.9 on Mac/Linux. * Make it a bit easier to run Anki from source, and run it with optimizations. ### Changes in 2.1.36beta4 Build 5313447c / 2020-11-30. This is nearing a stable release, so if you encounter any issues please let us know on the forums. * The handling of wildcards and escape characters in search [has been reworked](/manual/searching) to be more consistent, thanks to Rumo. * Various fixes to translation handling, such as the translation of early startup messages, thanks to Abdo. * Fixed some issues with adding/renaming decks (thanks to Cecini). * Fix duplicate search when sort field is not first field (thanks to Abdo). * Fix sync colour not updating after sync. * Thanks (as always) to people who contributed translations. * Other minor fixes. ### Changes in 2.1.36beta3 Build c1d15a8e / 2020-11-18. * MathJax has been updated to V3, thanks to Henrik. It should render faster than before. Please report any issues you notice. * Anki's translation system has been updated. This should not have caused any user-visible changes, but if you notice any regressions please let us know. * Fix issues with "find duplicates" (thanks to Abdo) For developers: * Gettext is no longer required to build Anki, as all strings have been migrated to Fluent. * Python wheels have been provided on the beta download site - you should be able to install them with "pip install /path/to/.whl". Please report any issues you have with them. ### Changes in 2.1.36beta2 Build e0550b60 / 2020-11-12. The way Anki is built and packaged has been reworked for this release, which should make developing Anki easier moving forward. These changes should be mostly invisible to end users, but if you notice any problems introduced in this beta, please let us know on the forums. As part of these changes, the alternate Windows and Mac builds have been discontinued. If you're still using a 32-bit OS or a macOS version below 10.13, 2.1.35 is the last version that will work on your setup. For developers, please see [https://forums.ankiweb.net/t/changing-ankis-build-system-to-bazel/4737](https://forums.ankiweb.net/t/changing-ankis-build-system-to-bazel/4737). Python 3.8 is now the minimum supported version, so feel free to go wild with the walrus operator. Other changes: * Thanks to all the people who have contributed bugfixes and code/doc updates: Abdo, Lukkea, Akshara, Kelciour, David, Henrik, Colin, Johan, Piotr, Andreas, Arthur, Alan, RumovZ, Cecini, Soren, Krish, and ianki, in no particular order. For the full list of changes, please see [https://github.com/ankitects/anki/](https://github.com/ankitects/anki/). If I've missed someone, please let me know! * The main card area is now focused instead of the bottom area during review, which allows using the keyboard to scroll (thanks to Henrik). * A separate mpv process is now used to play videos on Windows, which should solve issues with playing getting stuck (thanks to Kelciour). * Fix error when switching to note type with fewer fields * Fix corrupt indexes when checking database. * Fix invalid utf8 in notes when checking database. * Fix invisible scrollbar in night mode + browser. ### Changes in 2.1.36beta1 Build 53a984ba / 2020-10-02. * Normal and night mode theming now uses CSS variables, making it easier to use and override in add-ons. * Congrats screen, burying/suspending, filtered deck building/emptying, and card reposition/reset have been reworked, but should (mostly) function as before. Please report any issues you encounter. * When cards are rescheduled in the browse screen, a review entry log is now created. * Various improvements, thanks hgiesel, cyphar, kaczmarj and Arthur. ### Changes in 2.1.35beta1 Build 84dcaa86 / 2020-09-30. * Fix a bug in Anki 2.1.29+ that caused excessive memory and CPU usage on long-running operations that show a progress bar, such as importing. * Roll back Mac and Windows builds to Qt 5.14 again, as there are still issues with 5.15. * Fix display issue in graphs on alternate Mac build. * Fix preview not updating on multiple selection (thanks to abdo). * Fix old content appearing when flagging immediately after typing. * Fix some handling of `*` in searches. * Sidebar now correctly escapes some characters (thanks to abdo). ### Changes in 2.1.34beta2 Build 8af8f565 / 2020-09-22. * Fix a bug in Anki 2.1.28+ where a newly created deck config would default to an ease of 130%. When updating, Anki will automatically change any deck configs with an ease of 130% back to 250%, and change any cards using those deck configs with a low ease back to an ease of 250%. If you have deliberately set an initial ease of 130%, please change it to 131% or greater prior to upgrading, so that Anki leaves your settings alone. Users who updated from an older Anki version and did not add new deck configurations should not be affected. Thanks to Aleksa for discovering the issue. * Roll back most of the non-bugfix scheduling changes from the previous beta, so that this can be released as stable after a couple of days of testing. ### Changes in 2.1.34beta1 Build 133fe851 / 2020-09-21. * Update the standard builds to the latest GUI toolkit version. Please report any improvements or regressions you notice. * Dropped audio plays automatically again (thanks to abdo). * Revert to older sound playing behaviour to work around issues (thanks to kelciour) * Various improvements, thanks hgiesel, cyphar, kaczmarj and Arthur. * Normal and night mode theming now uses CSS variables, making it easier to use and override in add-ons. * Congrats screen, burying/suspending, filtered deck building/emptying, and card reposition/reset have been reworked, but should (mostly) function as before. Please report any issues you encounter. * When cards are rescheduled in the browse screen, a review entry log is now created. * is:due now stops at now+learn ahead limit, instead of end of day. * Various bugfixes. ### Changes in 2.1.33beta2 Build 4662a9fe / 2020-08-28. * Fix cards not being unburied if leaving Anki open and the first action of a new day is a sync. * Access More button in review screen with 'm' (thanks to ANH). * Audio no longer plays when dropped/pasted (thanks to ANH). * Fix next learn message in congrats screen. ### Changes in 2.1.33beta1 Build 7bcec00e / 2020-08-26. * Fix drag\&drop into existing content (thanks to ANH). * Fix text in export file selector (thanks to ANH). * Fix timeouts in full syncs and media syncs again. ### Changes in 2.1.31beta3 Build 85d99f73 / 2020-08-21. * Full syncs and media syncs now terminate more quickly when the connection breaks. * Improve support for getting proxies from Windows registry. ### Changes in 2.1.31beta2 Build 2b1bcda9 / 2020-08-21. * Fix mpv failing to play audio after it's restarted, thanks to Kelciour. * Fix Find\&Replace window sizing. * Fix 'stale notetype' error after sync+add. * Code improvements from ANH, Evandro and Thomas. * Minor graph tweaks. ### Changes in 2.1.31beta1 Build 680b5e4b / 2020-08-19. * Show card counts in pie graph, and other minor graph tweaks. * Fix crash when dragging & dropping, thanks to ANH25. * Fix sync error+lost review when undoing in v2 filtered deck with scheduling off. * Close "edit current" when current card deleted. * Code improvements, thanks to Arthur, Evandro and Henrik. * Find\&replace completion is now case sensitive. * Fix crash when recovering notes with missing notetype. * Fix handling of nested legacy template directives. * Fix issues with bulk tag removal. * Remove embedded direction markers in RTL cloze deletions. * Strip nul characters from tags. ### Changes in 2.1.30beta3 Build 83637199 / 2020-08-08. * Standard Windows build tweaked to hopefully fix issues introduced by Windows update. * Standard Mac build rolled back to Qt 5.14, to fix "show windows in tabs" not working. * More fixes for syncing bad data from older clients. * Catch negative review times in DB check. ### Changes in 2.1.30beta2 Build 818012e0 / 2eee4cb0 / 2020-08-05. Update 2020-08-06: Windows build repackaged to fix failure to start. * Add right axis to graphs. * Fix some young cards being shown as mature in reviews graph. * Fix negated conditionals being non-negated when renamed. * Fix automatic logout not working when auth failure occurs. * Fix 'add mobile class' not working properly. * Fix some syncing errors that could happen until Check Database was run. * Other graph tweaks/fixes. * Big thanks to Matt and phwoo who submitted a bunch of code improvements recently. ### Changes in 2.1.30beta1 Build 1353590a / 2020-07-31. * Fix early reviews not appearing in review graph. * Fix hour graph problem in timezones west of UTC. * Card counts graph now always shows table. * Fix move into/out of filtered decks not syncing. * Handle multiple same-numbered clozes in cloze-only filter. * Fix deck list and graphs not including v2 scheduler cards with rescheduling disabled. * Added night mode and mobile class toggles in card layout screen (thanks to ANH25). * Code improvements (thanks to Matt, phwoo, Evandro and aplaice). * Refresh tag list after clearing empty tags. * Other minor fixes. ### Changes in 2.1.29beta4 Build 88fee1b7 / 2020-07-27. * Fix an issue introduced by the previous change to the future due graph. * Don't show an error when card contains an empty URL. ### Changes in 2.1.29beta3 Build 15c9cd91 / 2020-07-26. * Fix due reviews in filtered deck showing incorrectly in future due graph. * Another attempt at addressing the AltGr issue on Windows. ### Changes in 2.1.29beta2 Build ca8265a6 / 61e8611b / 2020-07-24. * Roll standard Windows build back to Qt 5.14.1 for now (fixes performance problems) * Graphs now instruct user to use Check Database if data can't be read. * Future due graph now includes today's learning cards. * Fix preview not updating when editing text in the Browse screen. * Fix mpv taking time to start (thanks to Kelciour) * Code/build improvements (thanks to Evandro & Matt). * Other minor tweaks. ### Changes in 2.1.29beta1 Build 1b441f50 / 2020-07-21. * Add cloze-only: template filter, which can be combined with TTS to speak only the elided part. * Fix 1+ day learning cards not being included in future due graph. * Start media sync after full sync finishes. * Use right-to-left direction in webviews when using RTL interface language. * Support the terminal command that enables dark mode again. * Code tidy-ups (thanks to Arthur). * Close gracefully on SIGTERM. ### Changes in 2.1.28beta6 Build 7d8818f8 / 2020-07-17. This is a candidate for the next stable release. * Add range selectors to button + hour graphs. * Make it easier for add-ons to modify the graphs (thanks to Aristotelis). * Code testing tidy-ups (thanks to Arthur). ### Changes in 2.1.28beta5 Build 61017a2e / 2020-07-16. * Minor tweaks to graph tooltips and axis labels. * Ctrl/cmd+number selects decks/note types in list (thanks to Alexander). * Translation updates (thanks as always to the volunteer translators). ### Changes in 2.1.28beta4 Build 116aeead / 2020-07-13. * More graph tweaks. * Fixed is:review not including relearning cards. * Scroll media log to bottom at start (thanks to kelciour) * Update some dependencies, and other minor changes. ### Changes in 2.1.28beta3 Build 93425be8 / 2020-07-07. * Fix add-on regression (thanks to Evandro). * Various graph tweaks. ### Changes in 2.1.28beta2 Build cfc33815 / 2020-07-06. * Various tweaks to the graphs. * Update local media server (thanks to Evandro). * Use Qt colour picker on Linux (thanks to Andreas). * Fix some add-ons being broken. * Other minor fixes. ### Changes in 2.1.28beta1 Build 4d23a69e / 2020-07-01. * The stats screen has been rewritten - feedback on the beta thread would be appreciated. * The old stats are accessible by shift+clicking on Stats. * Add edited:x search for matching notes edited in last x days. * Improvements to mpv handling (thanks to Kelciour). * Windows build fix (thanks to Evandro). * Various other fixes, including contributions from BlueGreenMagick, Arthur, neitrinoweb and kenden. ### Changes in 2.1.28alpha3 Build f44597bb / 2020-06-09. * The standard Mac build now uses Qt 5.15 - please report any regressions. The file size is a bit larger than it needs to be, and may be improved in the future. * The Linux build now uses Qt 5.15 - please report any regressions. * DB check now shows progress. * Fixed duplicate/empty field check. * Fixed audio being included in FrontSide. * Clearer error message on failed regex search. * Find & Replace remembers input (thanks to Evandro). * Code improvements (thanks to BlueGreenMagick, Thomas and Andrew). * Support input.conf for mpv * Fixed '&' being changed in image filenames in HTML editor. * Fixed exports getting broken by Windows carriage returns in note fields. * Miscellaneous other fixes. ### Changes in 2.1.28alpha2 Build ebce044b / 2020-06-02. Reworked collection syncing. Some warnings: * While it has had some testing, please take frequent backups, and keep an eye out for (and report) any problems. * The checking stage at the end of the sync may be slower than normal, as some checks that are normally disabled have been re-enabled for safety. Sync changes: * Normal syncs and media syncs can operate in parallel, speeding up startup and shutdown. * Normal syncs no longer need to close open windows like the Browse screen, or close & re-open the collection. * Full syncs now show a progress bar. * Full syncs can now be cancelled, and both normal and full syncs cancel more quickly. Other changes: * Windows standard version has been updated to Qt 5.15. * Audio player on Windows has been switched back to mpv. Please report any issues you have playing audio files/videos. * Fixed deck deletion, and allow "deleting" the default deck (it comes back empty). * Fixed custom study not saving. * Card layout screen divider can now be adjusted (thanks to Evandro). * Fixed duplicate rendering in card layout screen (thanks to Evandro). * Fix for a previewing issue (thanks to Evandro). * Fixed off-by-one in field drag\&drop (thanks to BlueGreenMagick) * Other minor fixes. ### Changes in 2.1.28alpha1 Build 97eadb78. * Performance improvements to: * Startup and shutdown (the first startup will be slow as your collection is ```text theme={null} updated). ``` * The Browse screen. * The deck list. * The note types screen. * The card templates screen. * The database check. * Card generation changes: * Card generation now supports negated conditionals, and a mix of required and ```text theme={null} optional fields. ``` * When adding/importing, if a normal note doesn't generate any cards, Anki ```text theme={null} will now add a blank card 1 instead of refusing to add the note. ``` * Please bear in mind that if you take advantage of these features, older Anki ```text theme={null} clients may report the cards are blank, or try to clean them up when you use the Empty Cards feature. ``` * Cloze numbers over 499 are no longer supported. * Card template screen: * Changes are now accumulated, and can be saved or discarded when you close ```text theme={null} the screen. ``` * The front, back, and styling are no longer shown at the same time. You can ```text theme={null} switch between them with ctrl+1/2/3 or cmd+1/2/3. ``` * Added a search bar to search for text in the template or styling. * Added a dropdown to change the previewed cloze number. * Added a checkbox to toggle the filling of empty fields for preview. * You can now delete a card template even if some notes are only using that ```text theme={null} template - they will be given a blank card 1 instead. ``` * Scheduling: * The deck list no longer caps counts to 1000. * The overview and study screen no longer caps counts to 1000. * The deck list will no longer show a parent count higher than the limit set ```text theme={null} on the parent. ``` * Empty cards screen: * Notes will not be deleted by default. * Empty cards are grouped by note type. * Empty cards can be clicked on to reveal them in the browse screen. * Database check: * Notes with the wrong field count are now recovered instead of being deleted. * Notes with missing note types are now recovered instead of being deleted. * Notes with missing cards are now recovered instead of being deleted. * Unicode normalization: If you are studying rare CJK characters and wish to prevent them from being converted into modern equivalents, the following in the debug console will stop Anki from normalizing note text. ``` mw.col.conf["normalize_note_text"] = False ``` Other changes: * Fields screen now accumulates changes, which can be saved or discarded when you close the screen. * Updated a few screens to show progress bars instead of hanging the UI. ### Changes in 2.1.24beta9 Build 359b9f5c. * You can use `w:something` to search on word boundaries, eg: * `w:dog` ```text theme={null} \ search for "dog" on a word boundary - will match "dog", but not "doggy" or "underdog". ``` * `w:dog*` ```text theme={null} \ will match "dog" and "doggy", but not "underdog". ``` * `w:*dog` ```text theme={null} \ will match "dog" and "underdog", but not "doggy". ``` * Fixed clicking on links in add-on configuration documentation. ### Changes in 2.1.24beta8 Build 683f664d. * Fixed adding and removing deck option groups. ### Changes in 2.1.24beta7 Build ec6c0f86. * Move the scheduling options in the preferences to a separate tab, so options fit on the screen even on devices with small screens. * Fix pauses caused by a regression in the previous beta. ### Changes in 2.1.24beta6 Build 394f7c63. This beta changes the macOS dark mode handling of the standard build: * Anki now solely relies on the night mode setting in the preferences to decide whether to show in light or dark mode. Some users wanted to run Anki in light mode while keeping the rest of their system dark, and there were various display problems when dark mode was changed after Anki started that couldn't be easily worked around. * Users who only use dark mode, and preferred the native look of widgets in dark mode, can achieve the previous appearance by running the following command in the terminal: ``` defaults write net.ankiweb.dtop NSRequiresAquaSystemAppearance -bool no ``` And the following in the debug console: ``` mw.pm.meta["dark_mode_widgets"] = True ``` This is hidden behind a debug console command because it requires the user ensure their system is always set to the same light/dark mode as Anki. Other changes: * The macOS standard build is built with a newer SDK. If you notice any regressions, please let me know. * Fixed Anki closing after a full sync on collection load. * Fixed an error being shown when replaying audio. * Fixed filtered decks displaying an error in older Anki versions after downgrading. * Fixed add-ons with multiple branches not updating properly. * Change the way cloze deletions in RTL fields are handled, which should address some corner cases. * Fix editor buttons not being highlighted (thanks to Simone). * Improve invalid HTML/JS error messages (thanks to Evandro). * Fixed a useless log file being created when exporting. * Allow selecting add-on config help text (thanks to ijgnd). ### Changes in 2.1.24beta5 Build 0c5f22f4. * New load/save handling for note types and decks. This should be transparent; if you notice any issues, please let me know. * Avoid scrolling if the selected browser row is still visible after an operation. * Handle renamed cloze fields when previewing (thanks to BlueGreenMagick). * Fix a case where decks could be sorted incorrectly (thanks to Arthur). * Fix some bugs introduced by the recent previewing changes. * Allow dragging fields to change their position (thanks to BlueGreenMagick). * Add socks support to media sync. * Improvements to debug console (thanks to BlueGreenMagick). * Build improvements (thanks to Evandro). * Fix deck option changes not marking collection as changed. * Fix deck\_browser\_did\_render hook. * Fix interface getting stuck when a corrupt collection was encountered. ### Changes in 2.1.24beta4 Build 16ab351b. * Updated tag handling: * non-wildcard searches now do full unicode case folding (eg 'tag:masse' ```text theme={null} matches 'Maße'). ``` * wildcard searches do simple unicode case folding. * tag list in browse screen now uses unicode case folding. * Fix 'is:due' search not combining with other searches properly. * Fix searches for things like deck:current not reflecting current state. * Fix duplicate searches. * Be more tolerant of deck IDs stored in the wrong format by older Anki versions. * Fix an error that could occur when performing an operation in the browse screen then immediately closing it. * Clean up the previewing code (thanks to Arthur). Add-ons that modify the preview screen will need updating. * Prepare for uploading releases to PyPI (thanks to Evandro). * Improve the handling of deck deletions (thanks to Arthur). * Avoid decimal place in steps lists where possible. * Add a compatibility shim for named args to avoid breaking some add-ons. * Updated config handling. While there should be no immediate breakages, if you're an add-on author and store lists or dicts in Anki's config, please see 676f4e74a. ### Changes in 2.1.24beta3 Build d3964603. Updated the way cards and deck options are loaded and saved. Most add-ons should not be affected, but a few will need minor tweaks. If you run into any issues and can reproduce them when add-ons are disabled, please let me know. Other changes: * Media syncs no longer take time to abort. * Fixed media sync waiting forever when connection dropped. * Fixed an issue where regular syncs could fail to end. * Fixed current card sometimes not being centered when searching. * Don't force a full sync when DB check finds cards with a high due number. * A tweak which should fix some broken add-ons from preventing the collection from being loaded. * GitHub now checks Windows and Mac builds as well (thanks to Evandro). * More hooks (thanks to Arthur). * Fix tag searches in custom study (thanks to zjosua). * Don't throw an error when user has an embedded null in a note field. * Left-align tags in the browser. * Ignore .DS\_Store files in the media trash folder. * Remove the check for ':' in DB queries. ### Changes in 2.1.24beta2 Build b1a8107a. Please see beta 1 for most of the changes. * The media check will now fix file references in fields that broke because a filename was shortened as part of a sync. * Fixed error when reviewing (thanks to zjosua). * Fixed reverse sort order for some browser columns. * Fixed the UI displaying badly when macOS dark mode changes while Anki is running. * Don't show a popup when a network error occurs while syncing media. * Fixed the collection\_did\_load add-on hook. * Fixed searches for "(something )" with a trailing space not working. * Fixed the wrong language shown in the preferences screen for some languages. ### Changes in 2.1.24beta1 Build 9dda5cf6. 2.1.24 focuses on changes to the database layer and searching code. Searching: * You can now use `re:something` to search via regular expression, eg: * `re:\bdog\b` will search for the word 'dog'. It has a word boundary ```text theme={null} character (`\b`) at the start and end, so it will match 'a dog', but not 'a doggy'. ``` * `front:re:t+1` would match "t1", "tt1" and so on in the Front field * When searching by regex, unicode case folding is used, so searching for ```text theme={null} `re:über` will show a card that has "Über" on it. ``` * `nc:something` (short for "no combining") can be used to search while ignoring accents, eg `nc:uber` will match both "über" and "Über". This behaves the same way as the "Ignore Accents" add-on, but is about 16x faster. * You can now sort on the deck, card template, note type and tags columns. * You can now use wildcards when limiting the search to a field, eg `field*:something`. * You can now use wildcards when searching for a card template or note type by name. * `rated:x` searches are now capped to a year instead of a month. * You can now escaped double-quotes in a search - eg `"foo\"bar"` * Single-quote searches are no longer supported. * A version of Advanced Browser that works with this beta has been made available [here](https://github.com/ankitects/advanced-browser/releases/tag/2.1.24-fixes). Not everything has been tested, and sorting on some fields will not currently work properly. * Because the searching code has been rewritten, add-ons that modify the search code will need to be updated to support 2.1.24. Unfortunately it is no longer possible to override the Finder class - add-ons will need to use the new hooks in the browser screen to either rewrite the search text, or perform their own lookups instead. Database changes (mainly of interest to add-on developers): * Anki now uses Rust's sqlite libraries instead of Python's. * The 'db' object on the collection retains most of the same API as before, minimizing the amount of immediate code changes that are required. * Some less-used features like named sqlite bindings ("where column = :foo") and custom sql functions are no longer supported. * The old database code remains in db.py, and add-ons can continue to use it for accessing their own databases. * The database is now behind a mutex, and can be safely accessed from a background thread. * Various screens like the database check have been updated to run on a background thread, so they no longer lock up the UI while they're running. * The database progress handler has been removed. Anki previous had sqlite call back into Python periodically during long-running DB operations so it could drain the UI queue, but this would vary in choppyness depending on the type of DB operation being performed, and it was the cause of some crashes in the past. Add-ons that perform long-running operations should instead use mw\.taskman.run\_in\_background() or their own threading solution moving forward. Other changes: * Anki will now wait for a media sync to complete or be aborted before closing the collection. * Fixed progress dialogs failing to appear in a timely manner. * Allow the type answer arrow to be styled (thanks to Evandro). * More hooks (thanks to Arthur). A lot has changed in this beta, so some issues may have slipped through the cracks. If you run into any problems, please let me know. ### Changes in 2.1.22beta2 Build 0ecc189a. * Fixed problems playing audio on Windows. Users using the gtts add-on will need to update it. * Clear the audio queue when moving between cards with autoplay off. * Fixed play icons not appearing in browser preview when autoplay off. * Restored grey styling of zeros in the deck list that got lost in the night mode changes. * Fixed an error shown when running in Spanish. * Fixed fields containing a filename with non-Latin text from being corrupted when editing HTML (thanks to Evandro). * Support for validating add-on config schemas (thanks to Arthur). * Fixed a change that broke some add-ons. * Fixed the wrong language being selected in the preferences screen. * Removed the 'too many decks' message in the deck list screen. * Possible fix for issue playing audio from flash drive. * Fixed Anki getting stuck when importing an invalid file. ### Changes in 2.1.22beta1 Build 131d37dc. Please use File>Export to back up your collection with media before trying this beta. While big problems are unlikely, a backup is always a good thing to have. * All the changes from 2.1.21beta1 to 3 * The new timezone handling is now exposed as an option in the preferences screen. Please avoid using this if you use AnkiDroid: [https://anki.tenderapp.com/kb/anki-ecosystem/timezone-handling-changes](https://anki.tenderapp.com/kb/anki-ecosystem/timezone-handling-changes) * Instead of automatically clearing the media trash after 7 days, the media check screen now displays how many files are in the trash folder, and allows you to either empty the trash, or restore it back into the media folder. * Fixed repetitive sync errors when long filenames in media folder and media check not run. * More code improvements (thanks to Alan) * More add-on hooks (thanks to Arthur and Glutanimate) * More Windows build improvements (thanks to Evandro) * Rotate log files. * Ignore http(s) links when checking media. * Fix a resource leak introduced in an earlier beta. * Fix inversion of iOS drawings in night mode. ### Changes in 2.1.21beta4 Build f1734a47. This has been released as 2.1.21 stable without the below changes - please see the 2.1.21 change notes. ### Changes in 2.1.21beta3 Build 8960d12a. * Media syncing now logs to collection2.log in your profile folder. If you experience any problems with syncing, please attach your log in a support ticket and describe the problem (giving an example filename) so I can investigate. * Fix time spans over 12 months not being displayed in years. * Files deleted via the media check no longer trigger a rescan on next sync. * Fix the standard Mac build not displaying properly when dark mode active, and updated the docs to explain how you can force light mode in Anki while system dark mode is active. * Fix an oversight that was breaking some add-ons unnecessarily. * More translation work. * More type hints in the code (thanks to Alan). * Improvements for building on Windows (thanks to Evandro). * Support '/' separator in add-on web paths on Windows (thanks to BlueGreenMagick) * Fix tags that are in the wrong encoding as part of the DB check. * Display a more helpful warning when mpv/mplayer not installed. ### Changes in 2.1.21beta2 Build 65ec9d19. * More work on the handling of translations, including tweaks to the way the answer buttons and the review history screen show intervals. * You can now export .apkg files with the V2 scheduler enabled. * Show next learning card due time, and count for today * Add-on hook improvements, thanks to Glutanimate and Arthur. * Hide the default deck in more cases (thanks to Arthur). * Some improvements to the build process (thanks to Evandro). * Fixed negative number in "add-on incompatible" message. * Fixed field contents added by old add-ons like Japanese Support not appearing. * Fixed card info screen not appearing. * Fixed an error message when using very small learning steps. * Add "New #" prefix to the due column for new cards. * Add back missing fcntl for add-ons. * Fix a race condition in the audio playing code. * Fixed \{\{Deck}} showing the filtered deck name instead of the original deck. * Fixed LaTeX in cloze deletions not being rendered by the media check. * Cards in night mode now default to dark grey instead of black. * Fix issue with macOS's dark mode in the alternate Mac build. * Don't allow scaling of the UI below 100%, as it doesn't work properly. * Fixed Anki not starting on Windows installs that were lacking TTS support. * Interrupt current audio even if autoplay is disabled. ### Changes in 2.1.21beta1 Build 683b7983. Media syncing improvements: * Media syncing now happens in the background, so you can continue using Anki while the media sync completes. * Aside from syncing at open and close, Anki will sync any media changes every 15-20 minutes. * You can click on the sync button while the spinner is active to monitor progress. * Long filenames and problematic characters should be handled smoothly now, instead of causing syncing errors. * Anki should no longer sometimes forget to download files when a media sync fails due to network errors. * When media files are added within Anki, Anki now marks them in the database immediately, which can make things faster for people with slower disks if they are not modifying the media folder externally. Media check improvements: * The Check Media function now shows progress, and can be interrupted. * There is now a separate button to generate missing LaTeX. * If LaTeX fails to build, the problem card will be revealed in the browse screen. * When Anki finds files that are too long or would cause errors on some operating systems, it will automatically rename them and update your notes to point to the new filename. Both media sync and the media check now place deleted files in a media.trash folder inside your profile, instead of placing the files in the system trash. Any files that have been sitting in that folder for a week or more will be deleted permanently when you next run a media check. Other changes: * Updates to the translation infrastructure: ``` The upcoming 2.1.21 beta is introducing a new way to translate strings, and in order to support it, the translations website will be moving again. The new system uses Fluent (https://projectfluent.org/) instead of gettext. This has a number of advantages: Separate identifiers are used for each string instead the English text, which means the English text can be improved without breaking existing translations in other languages. It is easier to add comments to the translation files to make things clearer for translators. Plural support is more flexible, and translators can add different plural forms even if the original English text doesn't use separate single/plural forms. Translations can be more easily split up into multiple files. Only a small number of strings are currently using Fluent, and most of the text in Anki is still using gettext. The plan is to gradually move more strings over to Fluent over time. Because Crowdin does not support Fluent, I've set up a separate translations site using Mozilla Pontoon. Both the new Fluent strings and the old gettext strings are available. You can view it in read-only mode by visiting https://i18n.ankiweb.net ``` * Improvements to the readability of the scheduling code (thanks to Arthur) * More hooks for add-on authors (thanks to Arthur & Aristotelis) ### Changes in 2.1.20beta10 Build d0284f75. For a full list of changes since 2.1.19, please see [https://apps.ankiweb.net/docs/changes.html](https://apps.ankiweb.net/docs/changes.html) * Added the ability to export selected notes from the Browse screen, thanks to Arthur. * Don't filter em/strong tags when pasting. * Fix rendering of question/answer column in browse screen. * Clearer error when conditional replacement closing tags are switched. * Show whether template errors occurred on the front or back template. * Drawings done in AnkiMobile now appear correctly in night mode. * Work around HTML editor sometimes failing to appear on macOS. * Fix error when double-clicking the open profile button. * Constrain image width in editor to the field width. * Tweaks to replay audio button alignment/outline. ### Changes in 2.1.20beta9 Build 1fbd925f. * Standard Windows and Linux builds updated to latest Qt. * More legible colours in the stats screens in night mode. ### Changes in 2.1.20beta8 Build 5d91580c. * Emptying a filtered deck in the V2 scheduler no longer unsuspends suspended cards inside it. * Added an option in the preferences to not interrupt the currently playing audio when answering. * In night mode, the scrollbar style is now consistent in and out of webviews. * Lighter buttons and scrollbars in night mode. * Fix the white lines showing on macOS dark mode in the browse screen. * Fix some misaligned dialogs in night mode. * Fix building from a .tar.gz file. ### Changes in 2.1.20beta7 Build 77912aa2/c70badcd/a4764e2a. * Foreground and background colours in text are now ignored when pasting in night mode. * On macOS, the system theme will be used when dark mode is active. * Qt has been downgraded to 5.13 on macOS to facilitate the above. * The audio replay buttons are smaller by default, and can be styled using fill and stroke on `.replay-button svg [circle|path]`. * Night mode now also used .night\_mode - if you notice any problems with this please let me know. * Disabled elastic scrolling in webviews to work around a Qt bug. * Progress dialogs no longer pop up immediately. * Minor night mode tweaks. ### Changes in 2.1.20beta6 Build 23f13a31. * TTS tags now accept a 'speed=1.0' option to control voice speed. * Adding \{\{tts-voices: to your template will show all available voices. * Replay audio buttons now clickable in card layout and preview screens. * Fix autoplay of audio in the preview screen. * Fix Anki filtering spaces out of pasted sound files. * Fix add-ons being marked as incompatible when they weren't. * Handle AnkiWeb's new support for multiple add-on versions. ### Changes in 2.1.20beta5 Build d428b3b4. * Fix issues loading mpv on Mac/Linux. * Replay buttons now appear in \{\{FrontSide}}. * Replay buttons are shown in card layout and preview screens, but are not yet clickable. * More changes to the card display code, which will break more add-ons I'm afraid. * The template hooks have been updated - please see [https://github.com/ankitects/anki-addons/commits/master](https://github.com/ankitects/anki-addons/commits/master) for required changes. * A few colour fixes for night mode. * A change from Arthur that fixes one issue that was breaking add-ons. * Invert LaTeX in night mode (thanks to zjosua). * Support specifying min/max versions in .ankiaddon files. ### Changes in 2.1.20beta4 Build 98041059. * The night mode option now turns the interface dark as well. Please report any areas that don't display properly. * Fix mplayer window popping up on Windows. * Alter the way negated conditionals are handled in card generation. ### Changes in 2.1.20beta3 Build 95b497cc. * You can now use `{{tts en_US:Field}}` on your card templates to use the text to speech support built into Windows and macOS, changing the language code as necessary. * You can specify the voices you'd prefer - the first available one will be used. Eg. `{{tts ja_JP voices=Apple_Otoya,Microsoft_Haruka:Field}}`. The voices you specify must match the language. * In addition to the built in TTS, there is an example add-on that uses gTTS available here: [https://ankiweb.net/shared/info/391644525](https://ankiweb.net/shared/info/391644525) * To see all available voices, use the following in the debug console: ```python theme={null} for p in aqt.sound.av_player.players: if v := getattr(p, 'get_available_voices', None): pp(v()) ``` * Audio buttons are now shown on the card, and can be turned off in the preferences. They will show for both regular audio and text to speech. * Added shortcut keys in the review screen to pause and jump forward/backward 5 seconds. * Anki now starts a new copy of mplayer for each audio file on Windows, which avoids the need to create temporary files. If you notice any problems related to this, please let me know. * Add-ons that modified the audio code may break with this update. * For add-on authors, some more examples using the new hook system are available on the following page, including ported versions of the clickable tags and additional card fields add-ons: [https://github.com/ankitects/anki-addons/tree/master/demos](https://github.com/ankitects/anki-addons/tree/master/demos) ### Changes in 2.1.20beta2 Build c9a46268. * Anki will now check for add-on updates once a day. * Disabled add-ons are now included in the check as well. * If a user attempts to install an add-on that doesn't support the version they're on, Anki will now prevent them from doing so. * The 'max supported version' that add-on authors can specify in AnkiWeb is now used to prevent users from downloading add-ons that won't work on their Anki version, and to disable add-ons when they update to a new version. * Fix incorrect delay being logged when Hard is used on the first learning step in the V2 scheduler. * The editor no longer modifies percent-escaped text outside of image tags. * Fix an extra linebreak being left in a field when an image is attached to an empty field. ### Changes in 2.1.20beta1 Build fa564772. * Changes to the way cards are rendered that will break some add-ons: ``` The card template rendering process in Anki 2.1.20 has changed significantly under the hood, and most of the code that was in the anki/templates folder has gone away. Add-ons that were relying on hooks to modify the card rendering should continue to function, but add-ons that were using or monkey patching methods in the templates module will break, as those methods no longer exist. I have looked through the add-ons on AnkiWeb that modify the card template, and believe most of them should be able to accomplish what they were doing before by using the new card_did_render and/or field_filter hooks. Examples of how each of them can be used are available here: https://github.com/ankitects/anki-addons/blob/master/demos/ For add-ons that were using the furigana/hint field modifiers, they are available for copying in the template_legacy.py file. If the hooks are insufficient for what your add-on is doing, please let me know within the next few weeks. If you're an end user and an add-on you use has broken, please let the add-on author know of this post. In terms of user-visible changes: The limit of 100 replacements on a template has been dropped. The new approach allow add-ons to add fields without 'unknown field' messages appearing on mobile devices (once they've been updated) Fields with a ':' character are no longer allowed. If you have a ':' in your fields, you can open and close the Cards screen to automatically remove the colon. Templates that reference a field that doesn't exist will now only show an error, instead of partially rendering. {{field}} references are ignored inside fields, so there is no risk of LaTeX/MathJax being interpreted as a field reference. The <% %> alternate syntax is deprecated, as it is no longer necessary due to the above change. Clearer errors when the user forgets to close a {{field}} reference, or mismatches open and close conditionals. ``` * A new hook system for add-ons: ``` Anki 2.1.20 introduces a new hook system that allows for better code completion and type checking than the old system. For a short explanation and link to some sample add-ons, please see https://apps.ankiweb.net/docs/addons.html#new-hooks Add-ons using the old hooks should continue to work, as the new hooks will automatically call the old hooks in most cases, and a few runHook/runFilter calls have been left in the codebase in the places where the new hooks differ significantly from the old ones. There are a bunch of hooks that previously were called with no arguments, such as when a new deck is created. The new hooks will tend to pass the newly created item into the callback, but will not do so for the legacy hooks, to avoid breaking old code. If anyone has feedback on the naming or the arguments of the new hooks, please let me know during the beta testing period, so they can be changed prior to add-on authors relying on them. To go along with these changes, the policy on adding new hooks has also changed. In the past, Anki's add-on documentation suggested hooks were best left for code paths that multiple add-ons wanted to extend, but this resulted in an over-reliance on monkey patching, and has made things fragile. The add-on documentation has been updated to encourage add-on authors to submit pull requests for any hooks they need, and the hope is that the bulk of add-ons can move away from monkey patching in the future. ``` * Tweaks to the 'tag updated notes' feature (thanks to Erez) * Fix cards being sorted in wrong order when added after the note was created (thanks to Arthur) ### Changes in 2.1.17beta8 Build f4fb7319. * Minimum Python version is now 3.7. * Updated the way templates are rendered. If you notice any problems or messages printed to the console, please post on the support site. * Double-clicking on .ankiaddon files should now work on Mac and Windows as well. * Bug fix for tag updated notes feature (thanks to Erez). ### Changes in 2.1.17beta7 Build a4d38d65. * Added an option to tag updated notes when importing (thanks to Erez). * Install add-ons by double clicking on their files (thanks to Glutanimate). Currently only on Linux; support for Windows/Mac will be added soon. * The alternate Windows build now uses Python 3.8/Qt 5.12. * The alternate Mac build now uses Python 3.8. * The alternate Linux build has been dropped. A bunch of behind-the-scenes changes to the code in this release. If you notice any regressions, please post on the beta testing thread. ### Changes in 2.1.17beta6 Build 4cead7ef. * Added a beta label to the experimental scheduler, as a timezone corner case needs to be addressed before general release. * Fixed sidebar background on Windows 10. * Fixed building from source on 32 bit Linux. * Fixed alternate template syntax not being recognized. * Automatically remove ':' from field names when opening the card templates screen, as it conflicts with the template syntax. ### Changes in 2.1.17beta5 Build 518cc442. * Changing large note types is significantly faster. * Fix a bug that was preventing new profiles from being created. * Fix a bug in the handling of MathJax+Cloze (thanks to Michal). * Fix missing border when the user has modified the interface scale. ### Changes in 2.1.17beta4 Build bfcc8379. The standard Mac and Linux builds have now been updated to the new toolkit as well - please report any regressions. ### Changes in 2.1.17beta3 Build da942617. Another Windows-only build. * Improved the performance of the browse screen's sidebar. * If you use any add-ons that alter the sidebar, you will need to disable them prior to upgrading, as add-on authors will need to modify their code to work with the new implementation. * Added an option in the preferences screen to adjust the UI size. * Fixed a regression in the way duplicate deck names were handled. ### Changes in 2.1.17beta2 Build ff6b58c2. A Windows-only build, built with the latest toolkit version. Please report any improvements or regressions. If you've previously customized the DPI/Scaling as described on [https://apps.ankiweb.net/docs/knownissues21.html#text-size](https://apps.ankiweb.net/docs/knownissues21.html#text-size), please try running the beta without the customizations and report how you go. In beta 2: * Alter the way DPI scaling is handled. * Remove help button from some Window titles. * Alter a change made in .16 that could break some editor add-ons. ### Changes in 2.1.17beta1 Build 81bdd860. A Windows-only build, built with the latest toolkit version. Please report any improvements or regressions. ### Changes in 2.1.16beta4 Build 4bc33e2f. * Syncing should work properly now when you change timezones without visiting AnkiWeb. * Ensure learning cards in filtered decks with 'order due' show in template order. ### Changes in 2.1.16beta3 Build bb62a3c1. * Remove the 'experimental' label from the new scheduler. * New installs default to the new scheduler. * You can now import and export decks with scheduling enabled in the new scheduler. * Fix bold/italics/underline pasting that broke in the last beta. * Hide empty Default deck in deck picker (thanks to Arthur). * Add an extra day to the interval when using Easy on a relearning card. * Preserve surrounding styling when making cloze deletions. ### Changes in 2.1.16beta2 Build bceb4feb. * Pasting now includes formatting by default. * Preserve foreground/background color when pasting. * Preserve bold/italic/underline when pasting from Google Docs. * When pasting with the shift key, bold/italics/underline is also stripped. * Draw preview screen more quickly. * Fix race condition in preview screen (thanks to Håkon). * Use --exact with dvsvgm to prevent truncated subscript/superscript in LaTeX. * Various small fixes. Thanks to Arthur for contributing a number of fixes: * Newly created cards could be given the wrong due number. * Sticky fields were ignored when closing the add card window. * Adding a note type forced a full sync. * Remove shortcut keys from translations. * Documentation changes for translators. * Case not being preserved when changing a deck's parent. * Hide default deck in other screens when empty. ### Changes in 2.1.16beta1 Build 2e7b7560. This build updates the translation handling as part of the move to Crowdin. Some languages were missing some plural forms in the past - in order to prevent errors, the missing forms have been copied from the highest previous plural. If you'd like to contribute to the translation effort, please see [https://apps.ankiweb.net/docs/manual.html#translating-anki](https://apps.ankiweb.net/docs/manual.html#translating-anki) Also: * Fix qtwebengineprocesses not being cleaned up when stats window closed. * Allow smaller window when editing current card. * Support pasting multiple URLs at once. * Add ability to force software rendering on old Macs (thanks to Mike) * A fix for case insensitive field name handling in find\&replace (thanks to lovac42) * Fix non-integer intervals being imported from Mnemosyne (thanks to Blauelf) * Clear undo queue when changing scheduler (thanks to lovac42) * Default to not closing add window (thanks to Aidan) * Sort new cards separately when sorting by ease (thanks to Arthur) * Fix a bug in the V2 scheduler. * Properly handle backslashes in the replacement section of Find\&Replace. ### Changes in 2.1.15beta1 Build 442df9d6. This is a candidate for the next stable release, so if you encounter any issues, please let me know as soon as you can. * The V2 scheduler now fully randomizes review cards due on a given day. * Fix add-ons errors on Windows when profile path was short. * Fix flag changes in Browse screen not syncing. * Cleanup recording wav file when recording canceled. * Fix the window icon on Wayland (thanks to Wilco). * Add a progress bar to media deletion. * Other minor changes. # Changes in Anki 2.1 Source: https://docs.ankiweb.net/releases/changes/changes/2.1 ## Translations * [日本語](http://rs.luminousspice.com/changeinanki2/) ## At a glance * Anki 2.1 uses the same scheduling, syncing and file format as Anki 2.0.x, so you can upgrade and downgrade at will. * It’s built with recent support libraries (Python 3.6, Qt 5.9/5.12), bringing fixes for crashes, better handling of high resolution displays, non-Latin text, and the latest web standards. * It requires a modern system - Windows 7+, OSX 10.10+, or a Linux distro from around 2014+. * Add-ons will need to be updated to work with 2.1. ## Add-ons Add-ons need to be updated to work with Anki 2.1. [Some add-ons](https://ankiweb.net/shared/addons) have already been updated; others have not been ported yet. When you install 2.1, it will create a separate folder for add-ons, and not import any existing ones you have installed. If you’re an add-on author, you can read more about the required changes on [https://apps.ankiweb.net/docs/addons.html](https://apps.ankiweb.net/docs/addons.html) ## Other changes Anki 2.1 brings numerous bugfixes, and some quality of life improvements, such as: * Built in MathJax support * A "restore backup" option in the profiles screen * SVG rendering support for LaTeX * Improved add-on configuration, management and updating * Night mode for reviewing * Improved pasting, with less unnecessary formatting included, and better handling of media links. You can hold the shift key when pasting to allow more formatting to be included. The Browse screen has been simplified: * Various shortcuts that were previously in the sidebar are now available via the Filter button. If you find yourself frequently accessing certain items, you can save the search to have them appear in the side bar. * The top bar with common shortcuts has been removed. You can access all actions quickly by right clicking or ctrl+clicking in the card list instead, and there is an add-on available for adding back the top bar if you still prefer it. A full list of changes made during the alpha and beta period are documented [here](https://apps.ankiweb.net/docs/beta.html). ## Experimental scheduler Anki 2.1 contains an optional, [experimental scheduler](https://anki.tenderapp.com/kb/anki-ecosystem/experiment-scheduling-changes-in-anki-21). The experimental scheduler is not compatible with older Anki versions. # Changes in 2.1.0 to 2.1.9 Source: https://docs.ankiweb.net/releases/changes/changes/2.1.0-9 ## Changes in 2.1.9 Released 2019-02-20, build ae67c976. * Update standard build to latest toolkit version. * Hardware acceleration defaults to off again on Windows/Linux, due to the issues it was causing some users. If you were not experiencing any issues, turning hardware acceleration back on in the preferences screen is recommended. * Various statistics fixes for the V2 scheduler, including an automatic remapping of button 2/3 in the review history when moving back and forth between scheduler versions so the "answer buttons" graph displays correctly. * Fix BR tags being included in empty fields (thanks to David and zjosua) * Optimize card template repositioning (thanks to Arthur) * Fix a crash when copying/cutting with an empty selection (thanks to David) * Avoid screen flash when undoing reviews. * Make sure info/warning dialogs appear on top. * Fixed an issue with just-typed text not being saved when using the mouse to save/add a card. * Added support for \{\{CardFlag}}, which is either empty, or in the format "flagN" where N is 1-4. * Fix bulk flag changes in Browse screen not syncing. * Fix advanced menu in editor not showing shortcut keys. * When UI fails to load after resuming computer from sync, show a tooltip and automatically refresh. * Clean up old mplayer instances after a crash so that profile renaming works. * Fix add-on list not refreshing when toggling enabled in latest toolkit. * Fix cursor jumping on first click in "Edit Current" area on Windows. * Preserve whitespace when pasting plain text. * Prevent errors caused by a timer firing after collection is unloaded. * Ensure a full sync is forced when restoring from a backup. * Ensure full window is on screen when displaying windows on a changed screen layout. * Improvements to the add-ons, debug console, and error screens (thanks to Glutanimate) * Ensure \{\{Deck}} shows the correct deck when adding (thanks to Arthur) * Ensure windows don’t get shown off-screen. * Remember add-on window size and position. ## Changes in 2.1.8 Released 2019-01-02, build 71e0c880. * Fix startup on Windows 8. * Fix field content appearing under editor buttons. * Better handle an error when recording. * Fix improper handling of collections with deck errors. * Fix duplicate deck names being created due to text encoding. * Fix gtk2 theme and fcitx module not being included. * Detect nouveau graphics drivers and automatically switch to software rendering. ## Changes in 2.1.7 Released 2018-12-17. * Fix "QPushButton has been deleted" error messages after a problem occurs changing note types. * Fix errors during "Check Database" that are just a byproduct of a previous operation that failed. * Fix problems searching for some non-Latin text in decks/note type names. * Ensure cgi and uuid modules are available to add-ons. * Improvements to the Windows installer. * Automatically restart mpv if it stops responding. * Don’t convert non-Latin characters in add-on configuration to difficult-to-read escape codes. * Add a bottom border to the menubar on Windows 10. ## Changes in 2.1.6 Released 2018-12-10. Downloads are now split into a standard and alternate version. **The standard version**: * Is built with the latest toolkit, which fixes various issues. * Changes the undo shortcut back to Ctrl+Z or Command+Z like Anki 2.0. * Includes a separate anki-console.exe executable in the Windows build that may be useful for add-on authors. * Includes support for the fcitx input method and a gtk2 theme in the Linux build. You can switch between the standard and alternate 2.1.6 without problems. If you move back to a previous Anki 2.1 release, your sync login details and window positions will be lost, and will need to be set again. **The standard version has updated requirements**: * The Windows build only supports 64 bit Windows 7 or later, and will not run on a 32 bit install. * The Mac build requires macOS 10.12 or later. * The Linux build requires a Linux distribution from approximately 2016 or later. The alternate version is similar to previous Anki 2.1 releases, and is built with an older toolkit. It will run on some older systems that the standard version will not, but as it is not as up to date, it may be missing bugfixes and security improvements that the standard version includes. **The alternate version will run on**: * Windows 7 32 bit or 64 bit installs * Mac 10.10 or later. * A Linux distro from around 2014 or later. **In addition to the toolkit upgrade, there have been some changes in Anki itself**: * Improvements to the Browse screen and flagging: * Search text is normalized, which fixes problems searching for ```text theme={null} unicode characters with multiple possible encodings. ``` * The selection is now partially transparent, allowing you to see ```text theme={null} the underlying colours of the rows. ``` * The screen doesn’t scroll when performing actions that don’t ```text theme={null} change the selection count. ``` * Flags now toggle on and off, and the separate clear flag action ```text theme={null} has been removed. ``` * The second flag is now orange instead of purple. * Find\&replace now only shows fields relevant to the notes you’ve ```text theme={null} selected, and is case insensitive. ``` * Fix card list not updating when editing HTML. * Importing apkgs is now more verbose about how notes have been handled. * Prevent errors caused by the user adding a field reference to itself on a field. * Better handle issues with the deck list, such as decks that are missing a parent deck. * Anki should now be able to function even if a system proxy is configured for localhost connections. * Fix font size being copied when pasting between Anki fields with bold text. * Pasting a link with shift held down now creates a clickable link. * Fixed an issue with the bulk remove tags option where tags with similar names could be removed as well. * Fixed an error that occurred with very long filenames on Windows. * Fixed an issue running latex commands on some Linux installs. * The Browse screen’s sidebar now defaults to on. * Fixed a race condition that could cause two copies of Anki to open. * When adding media to cards, Anki now will automatically rename the filenames if they’re too long. * The experimental scheduler now regularly checks if new learning cards have become due. * Handle invalid add-on config (thanks to Arthur). * Enforce template ordering when card templates are reordered after card creation (thanks to Arthur). * Don’t change deck when Esc pressed in deck chooser (thanks to David). * Fix a problem on initial startup when English not the default language. * Fix busy cursor showing in import results screen. * Fix content overlap when add-ons have added many editor buttons. * Don’t change current note when reopening editor from review screen (thanks to Arthur). * A fix for running on Python 3.7 (thanks to Alexey). * Restore the tooltip for the Fields and Cards buttons in editor. * A possible fix for 'database is locked' errors on Windows. ## Changes in 2.1.5 Released 2018-10-01. * Use selected answer button instead of default when enter/space pressed. * Change undo shortcut in browse screen to avoid conflict with editing functionality. * Ignore standard mpv config file location in favour of Anki data folder. * Fix importing of .apkg files when interface in Dutch. * Fix translations not working on Linux after 'make install'. * Support newlines in type:cloze, and treat them as spaces. * Add browser.rowChanged hook for add-on authors. * Possible fix for some 'database is locked' errors. * Fix errors on startup when deck given an invalid name. * Fix sorting not working when field contains only a media reference. * Fix 'access denied' error not being caught properly. * Fix exporting of v2 colpkg when interface in non-English language. * Fix conditional replacement not ignoring HTML formatting. * Fix question fade time being forced when hardware acceleration on. * Add a small margin between buttons during review. * V2 scheduler now respects maximum interval even if it will lead to all buttons giving the same interval. * Tweak margins in overview and answer button areas. * Ignore UI events that are received after collection has been closed. * Don’t try to import .anki(2) files as text. * Added support for Lojban (thanks to giqtaqisi) ## Changes in 2.1.4 Released 2018-09-05. * Fix deck list getting stuck when creating filtered deck. * Prevent local cards being overwritten when accidentally downloading empty AnkiWeb collection. * Favour mark/flag colour over suspended colour in browse screen. * Fix new day calculation in experimental scheduler. * Linux theme tweaks (thanks to Glutanimate). * Disable view page button for locally added add-ons (thanks to upday7). ## Changes in 2.1.3 Released 2018-08-30. * Hardware acceleration can now be toggled in the preferences screen on Windows/Linux. * Disable question fade-in during review when hardware acceleration is off. * Fix some add-ons leaving a blank space in the main window when Anki restarted. * Fix file associations on macOS. * Fix some unwanted text being included when pasting. * Fix shortcut keys like space from repeatedly triggering when held down. ## Changes in 2.1.2 Released 2018-08-20. * Add missing .apkg and .colpkg file associations. * Improve handling of images inlined in fields. ## Changes in 2.1.1 Released 2018-08-09. * Fixed exporting of .apkg files with regular scheduler. * Work around Anki failing to start on some Windows machines. * Fix dialogs failing to show in tabs when using macOS’s full screen mode. * Extract embedded images when pasting HTML. * Fix images copied from Finder not pasting properly. * When the sort field is set to RTL, display in RTL order in the browser. * Update toolkit version on Windows. ## Changes in 2.1.0 Released 2018-08-06. The first stable release of Anki 2.1. Changes from the previous release candidate: * Don’t unmaximize when reshowing browse screen. * Add \*.webm to attach media file selector. * Add shortcut key for MathJax mhchem support. # Changes in 2.1.10 to 19 Source: https://docs.ankiweb.net/releases/changes/changes/2.1.10-19 ## Changes in 2.1.19 Released 2020-01-16, build 3c8690ae. * Fix formatting and images getting lost when creating cloze deletions. * Added an option to the preferences screen to strip formatting by default. * Fix the preview button shortcut key not working. ## Changes in 2.1.18 Released 2020-01-14, build fb9d59fe. * Fixed Anki failing to start for some users updating from Anki 2.0. * Fixed the alternate Windows build failing to start on Windows 8. ## Changes in 2.1.17 Released 2020-01-11, build c69ccb50. Linux version repackaged on 2020-01-12 to fix a 'make install' issue. * Improved the performance of the browse screen’s sidebar for users with many decks/tags. * Add-ons that modify the sidebar will break when you update, and will need to be updated by the add-on author. * Add-ons that alter the audio handling may need to be updated, as code has moved from anki.sound to aqt.sound. * Changing large note types is significantly faster. * Added an option in the preferences screen to adjust the user interface size. * You can now double-click on an .ankiaddon file to install it (thanks to Glutanimate). * Updated GUI libraries for the standard installs and the alternate Windows install. * The minimum Python version is now 3.7, and the packaged versions ship with Python 3.8. * The alternate Linux build has been dropped - you will need to be on a Linux distro from 2016+ with systemd support to use the packaged version. * Source tarballs are available from the releases tab of the GitHub repo. * Added an option to tag updated notes when importing (thanks to Erez). * Automatically remove ':' from field names when opening the card templates screen, as it conflicts with the template syntax. * Fix a bug in the handling of MathJax+Cloze (thanks to Michal). * Fixed a regression in the way duplicate deck names were handled. * Remove help button from some Window titles. ## Changes in 2.1.16 Released 2019-12-12, build 4bc33e2f. Due to some minor issues that were found, the website was not updated to point to this release. * Pasting now includes formatting by default. * Preserve foreground/background color when pasting. * Preserve bold/italic/underline when pasting from Google Docs. * When pasting with the shift key, bold/italics/underline is also stripped. * Ensure learning cards in filtered decks with 'order due' show in template order. * Remove the 'experimental' label from the new scheduler. * You can now import and export decks with scheduling enabled in the new scheduler. * Hide empty Default deck in deck picker (thanks to Arthur). * Add an extra day to the interval when using Easy on a relearning card. * Preserve surrounding styling when making cloze deletions. * Draw preview screen more quickly. * Fix race condition in preview screen (thanks to Håkon). * Use --exact with dvsvgm to prevent truncated subscript/superscript in LaTeX. * Newly created cards could be given the wrong due number (thanks to Arthur). * Sticky fields were ignored when closing the add card window (thanks to Arthur). * Adding a note type forced a full sync (thanks to Arthur). * Remove shortcut keys from translations (thanks to Arthur). * Documentation changes for translators (thanks to Arthur). * Case not being preserved when changing a deck’s parent (thanks to Arthur). * Hide default deck in other screens when empty (thanks to Arthur). * Fix qtwebengineprocesses not being cleaned up when stats window closed. * Allow smaller window when editing current card. * Support pasting multiple URLs at once. * Add ability to force software rendering on old Macs (thanks to Mike) * A fix for case insensitive field name handling in find\&replace (thanks to lovac42) * Fix non-integer intervals being imported from Mnemosyne (thanks to Blauelf) * Clear undo queue when changing scheduler (thanks to lovac42) * Default to not closing add window (thanks to Aidan) * Sort new cards separately when sorting by ease (thanks to Arthur) * Fix a bug in the V2 scheduler. * Properly handle backslashes in the replacement section of Find\&Replace. * Various small fixes. ## Changes in 2.1.15 Released 2019-08-22, build 442df9d6. * The V2 scheduler now fully randomizes review cards due on a given day. * Fix add-ons errors on Windows when profile path was short. * Fix flag changes in Browse screen not syncing. * Cleanup recording wav file when recording canceled. * Fix the window icon on Wayland (thanks to Wilco). * Add a progress bar to media deletion. * Other minor changes. ## Changes in 2.1.14 Released 2019-06-27, build 7b93e985. * Fix a bug in the V2 scheduler that would cause partially learnt cards removed from filtered decks to revert to an earlier state. * Fix a bug in the handling of relearning cards when switching back to the V1 scheduler. * Fix lost space when pasting indented text. * Limit image height relative to window height, not document height. * Fix deck list being re-rendered unnecessarily. * Remove the 'unable to connect to local port' message. ## Changes in 2.1.13 Released 2019-05-20, build 3ba55990. * Fix formatting getting lost when copying\&pasting between fields on macOS. * Fix some issues that cause the main window to get stuck. * Fix an empty deck list sometimes appearing when restoring from a backup. * Fix Anki hanging after an error occurs during startup. * Fix error caused by profile with trailing space on Windows. * Fix error message when syncing with an unconfirmed email address. * Use jsonschema for add-on manifests (thanks to Erez). * Warn in DB check when high due numbers are encountered. * Improve error messages on full disk and failed add-on deletion. * Fix relearning cards being given learning step count in V2 scheduler. * Fix preview window failing to appear when 'show both sides' enabled. * Removing trailing BR tag when pasting into an empty field. * Don’t throw an error when non-Latin text in the Javascript console can’t be shown. * Double click on add-ons to edit their configuration (thanks to lovac42). * Fix the window icon in a few screens (thanks to John). * Don’t highlight the deck selection button in the add screen on Windows. * Improve the default 'type in the answer' note type. ## Changes in 2.1.12 Released 2019-04-23, build eef86bf3. * Fix an issue that could prevent profile renaming/deletion on Windows. * Fix fields appearing under editor buttons. * Fix memory leak in card layout screen. * Fix some issues with previewing in the Browse screen. * Fix card counts not updating when a review is undone. * Fix an error that could occur on startup on some Windows installs. * The Mac build now uses the new hardened runtime on Mojave. * Change focus outline colour on Windows. * Fix an error caused by missing note types. * A possible workaround for the audio player getting stuck on Macs. * Display the installed version in the Windows uninstall screen. * Fix an issue checking for add-on updates (thanks to Glutanimate). * Disable add-on config button when not appropriate (thanks to Glutanimate). * Tweaks to the 'deck age' graph binning (thanks to Jian). * Add-ons hosted on AnkiWeb can now define conflicts in the manifest file. * Switch to mplayer on the alternate OS X build, as mpv was not working on some older machines. * Make sure mpv doesn’t attempt to load scripts from default location. * Other minor fixes. ## Changes in 2.1.11 Released 2019-03-11, build 3cf770c7. * Change Undo shortcut back to Ctrl+Alt+Z/Cmd+Opt+Z in Browse screen, to prevent accidentally undoing non-text changes when editing fields. * Revert a previous card template optimization that could cause an error. * Suppress a spurious error message that could occur when editing. ## Changes in 2.1.10 Released 2019-03-07, build 22d6feed. * Add option to strip html in export. * Avoid nbsp for single spaces when pasting text. * Fix preview screen flashing when moving between cards. * Improvements to the add-ons screen (thanks to Glutanimate). * Support .ankiaddon bundles (thanks to Glutanimate). * Improve subpixel antialiasing on some machines (thanks to Glutanimate). * Improve Japanese interface font on Windows 10, and make it possible for translators to change the font for other languages that need it as well. * Fix inability to start if problem occurs on first run. * Allow decreasing daily limits in custom study. * Add a button to copy debug info to about screen (thanks to Glutanimate). * Fix problem running from source on Windows (thanks to dlon). * Allow add-ons to serve files from mediasrv (thanks to Glutanimate). * More user-friendly error messages for some network errors. # Changes in 2.1.20 to 29 Source: https://docs.ankiweb.net/releases/changes/changes/2.1.20-29 ## Changes in 2.1.29 Released 2020-07-28, build bbff62bf. * Add cloze-only: template filter, which can be combined with TTS to speak only the elided part. * Fixed AltGr key handling in standard Windows build. * Fix some Windows performance problems by rolling back to an older Qt version. * Support the terminal command that enables dark mode on macOS again. * Start media sync after full sync finishes. * Fixed mpv taking time to start (thanks to Kelciour) * Code/build improvements (thanks to Evandro, Matt & Arthur). * Use right-to-left direction in some webviews when using RTL interface language. * Fixed card ID and note ID being flipped in card stats. * Don't show an error when card contains an empty URL. * Various fixes for deck statistics. * Fixed preview not updating when editing text in the Browse screen. * Close gracefully on SIGTERM. * Other minor tweaks. ## Changes in 2.1.28 Released 2020-07-20, build 7d8818f8. 2.1.28 is a big update with changes in a number of areas. * A reworked graphs screen: * Rewritten with new graphing tools for more interactivity. * Graphs can now be displayed for arbitrary searches. * Added a calendar/heatmap view. * If you need them for add-ons, the old graphs are currently still ```text theme={null} accessible with a shift+click on the Stats button. ``` * Reworked syncing: * Normal syncs and media syncs can operate in parallel, speeding up startup and shutdown. * Normal syncs no longer need to close open windows like the Browse screen, or close & re-open ```text theme={null} the collection. ``` * Full syncs now show a progress bar. * Full syncs can now be cancelled, and both normal and full syncs cancel more quickly. * Card generation changes: * Card generation now supports negated conditionals, and a mix of required ```text theme={null} and optional fields. ``` * When adding/importing, if a normal note doesn't generate any cards, Anki ```text theme={null} will now add a blank card 1 instead of refusing to add the note. ``` * Please bear in mind that if you take advantage of these features, older Anki ```text theme={null} clients may report the cards are blank, or try to clean them up when you use the Empty Cards feature. ``` * Cloze numbers over 499 are no longer supported. * Card template screen: * Changes are now accumulated, and can be saved or discarded when you close the screen. * The front, back, and styling are no longer shown at the same time. You can switch between them with ctrl+1/2/3 or cmd+1/2/3. * Added a search bar to search for text in the template or styling. * Added a dropdown to change the previewed cloze number. * Added a checkbox to toggle the filling of empty fields for preview. * You can now delete a card template even if some notes are only using that ```text theme={null} template - they will be given a blank card 1 instead. ``` * Scheduling: * The deck list no longer caps counts to 1000. * The overview and study screen no longer cap counts to 1000. * The deck list will no longer show a parent count higher than the limit ```text theme={null} set on the parent. ``` * Empty cards screen: * Notes will not be deleted by default. * Empty cards are grouped by note type. * Empty cards can be clicked on to reveal them in the browse screen. * Database check: * Notes with the wrong field count are now recovered instead of being deleted. * Notes with missing note types are now recovered instead of being deleted. * Notes with missing cards are now recovered instead of being deleted. * Unicode normalization: If you are studying rare CJK characters and wish to prevent them from being converted into modern equivalents, the following in the debug console will stop Anki from normalizing note text. ```py theme={null} mw.col.conf["normalize_note_text"] = False ``` * The standard Windows build has troubles with the AltGr key. This is fixed in the 2.1.29 beta, or [a workaround is available](https://forums.ankiweb.net/t/altgr-shortcuts/67). * The standard Mac build currently does not support native dark mode. If you previously enabled it from the terminal, please either try the 2.1.29 beta, or undo the change with the following terminal command: ```py theme={null} defaults write net.ankiweb.dtop NSRequiresAquaSystemAppearance -bool yes ``` Other changes: * Performance improvements to a number of screens. * Fields screen now accumulates changes, which can be saved or discarded when you close the screen. * Updated a few screens to show progress bars instead of hanging the UI. * The standard builds now use Qt 5.15. * Audio player on Windows has been switched back to mpv. Please report any issues you have playing audio files/videos. * Fixed is:review not including relearning cards. * Scroll media log to bottom at start (thanks to Kelciour) * Update local media server (thanks to Evandro). * Use Qt colour picker on Linux (thanks to Andreas). * Add edited:x search for matching notes edited in last x days. * Improvements to mpv handling (thanks to Kelciour). * Windows build fix (thanks to Evandro). * Clearer error message on failed regex search. * Find & Replace remembers input (thanks to Evandro). * Code improvements (thanks to BlueGreenMagick, Thomas and Andrew). * Fixed '&' being changed in image filenames in HTML editor. * Fixed exports getting broken by Windows carriage returns in note fields. * Fixed deck deletion, and allow "deleting" the default deck (it comes back empty). * Card layout screen divider can now be adjusted (thanks to Evandro). * Fixed duplicate rendering in card layout screen (thanks to Evandro). * Fixed off-by-one in field drag\&drop (thanks to BlueGreenMagick) * Various other fixes, including contributions from BlueGreenMagick, Arthur, neitrinoweb and kenden. ## Changes in 2.1.27 This number was reserved for a bugfix release. ## Changes in 2.1.26 Released 2020-05-09, build 70784154. * Fixed saving of searches in the browse screen. * Fixed card layout screen failing to open in the alternate Anki build. * Fixed .log files appearing when exporting. * Fixed an error appearing when undoing V2 filtered decks with scheduling disabled. * Fixed duplicate search when text contains formatting. * Improvements to the PyPI packages (thanks to Evandro). * Tweak the handling of changed note types in the add screen (thanks to Arthur). * Tolerate decks with missing modification time from third party software. * Support SOCKS proxies in the non-media sync. ## Changes in 2.1.25 Released 2020-05-01, build 898801eb (PyPi 6046bbc7) * Fix a change to deck configurations that was breaking AnkiDroid. * Fix deck configurations not deleting. * Fix angle brackets inside cloze+MathJax not working properly. * The DB check fixes an AnkiMobile bug where tags were not searchable. * Revert to an earlier macOS toolchain to work around recordings not working. * The media check no longer fails when files with very long filenames are in the folder. * More gracefully handle case where deck conf is missing. * Don't throw an error when cards have an invalid due number. * \{\{type::Field}} now marks the card as non-empty if Field is non-empty. * Tweak tab width in card layout screen (thanks to BlueGreenMagick). * Build fixes (thanks to Evandro). ## Changes in 2.1.24 Released 2020-04-28, build 359b9f5c. Searching: * You can use `w:something` to search on word boundaries, eg: * `w:dog` ```text theme={null} search for "dog" on a word boundary - will match "dog", but not "doggy" or "underdog". ``` * `w:dog*` ```text theme={null} will match "dog" and "doggy", but not "underdog". ``` * `w:*dog` ```text theme={null} will match "dog" and "underdog", but not "doggy". ``` * You can now use `re:something` to search via regular expression, eg: * `"re:(some|another).*thing"` ```text theme={null} find notes that have "some" or "another" on them, followed by 0 or more characters, and then "thing" ``` * `re:\d{3}` ```text theme={null} find notes that have 3 digits in a row ``` * When searching by regex, unicode case folding is used, so searching for `re:über` will ```text theme={null} show a card that has "Über" on it. ``` * `nc:something` (short for "no combining (characters)") can be used to search while ignoring accents, eg `nc:uber` will match both "über" and "Über". This behaves the same way as the "Ignore Accents" add-on, but is about 16x faster. * You can now sort on the deck, card template, note type and tags columns. * You can now use wildcards when limiting the search to a field, eg `field*:something`. * You can now use wildcards when searching for a card template or note type by name. * `rated:x` searches are now capped to a year instead of a month. * You can now escaped double-quotes in a search - eg `"foo\"bar"` * Single-quote searches are no longer supported. * Because the searching code has been rewritten, add-ons that modify the search code will need to be updated to support 2.1.24. It is no longer possible to override the Finder class - add-ons will need to use the new hooks in the browser screen to either rewrite the search text, or perform their own lookups instead. The Advanced Browser add-on has already been updated, and can be used as an example of how to accomplish things in 2.1.24. * Non-wildcard searches now do full unicode case folding (eg 'tag:masse' matches 'Maße'). * Wildcard searches do simple unicode case folding. * The tag list in the Browse screen now uses unicode case folding. macOS dark mode handling: * Anki now solely relies on the night mode setting in the preferences to decide whether to show in light or dark mode. Some users wanted to run Anki in light mode while keeping the rest of their system dark, and there were various display problems when dark mode was changed after Anki started that couldn't be easily worked around. * Users who only use dark mode, and preferred the native look of widgets in dark mode, can achieve the previous appearance by running the following command in the terminal: :warning: This will only work if your system is permanently in dark mode! If you switch between dark and light mode, the interface will render incorrectly. ```shell theme={null} defaults write net.ankiweb.dtop NSRequiresAquaSystemAppearance -bool no ``` And the following in the debug console: ```py theme={null} mw.pm.meta["dark_mode_widgets"] = True ``` Database changes (mainly of interest to add-on developers): * Anki now uses Rust's sqlite libraries instead of Python's. * The 'db' object on the collection retains most of the same API as before, minimizing the amount of immediate code changes that are required. * Custom sql functions are no longer supported, and named DB arguments (eg "where id = :id") are deprecated. * The old database code remains in db.py, and add-ons can continue to use it for accessing their own databases. * The database is now behind a mutex, and can be safely accessed from a background thread. * Various screens like the database check have been updated to run on a background thread, so they no longer lock up the UI while they're running. * The database progress handler has been removed. Anki previous had sqlite call back into Python periodically during long-running DB operations so it could drain the UI queue, but this would vary in choppyness depending on the type of DB operation being performed, and it was the cause of some crashes in the past. Add-ons that perform long-running operations should instead use mw\.taskman.run\_in\_background() or their own threading solution moving forward. Other changes: * A tweak which should fix some broken add-ons from preventing the collection from being loaded. * Add socks support to media sync. * Allow dragging fields to change their position (thanks to BlueGreenMagick). * Allow selecting add-on config help text (thanks to ijgnd). * Allow the type answer arrow to be styled (thanks to Evandro). * Anki will now wait for a media sync to complete or be aborted before closing the collection. * Build improvements (thanks to Evandro). * Changed the way cloze deletions in RTL fields are handled, which should address some corner cases. * Clean up the previewing code (thanks to Arthur). Add-ons that modify the preview screen will need updating. * Don't force a full sync when DB check finds cards with a high due number. * Don't show a popup when a network error occurs while syncing media. * Fixed a case where decks could be sorted incorrectly (thanks to Arthur). * Fixed a useless log file being created when exporting. * Fixed add-ons with multiple branches not updating properly. * Fixed an error that could occur when performing an operation in the browse screen then immediately closing it. * Fixed Anki closing after a full sync on collection load. * Fixed current card sometimes not being centered when searching. * Fixed deck\_browser\_did\_render hook. * Fixed editor buttons not being highlighted (thanks to Simone). * Fixed interface getting stuck when a corrupt collection was encountered. * Fixed media sync waiting forever when connection dropped. * Fixed progress dialogs failing to appear in a timely manner. * Fixed tag searches in custom study (thanks to zjosua). * Fixed the collection\_did\_load add-on hook. * Fixed the wrong language shown in the preferences screen for some languages. * GitHub now checks Windows and Mac builds as well (thanks to Evandro). * Handle renamed cloze fields when previewing (thanks to BlueGreenMagick). * Ignore .DS\_Store files in the media trash folder. * Improved invalid HTML/JS error messages (thanks to Evandro). * Improved the handling of deck deletions (thanks to Arthur). * Improvements to debug console (thanks to BlueGreenMagick). * Left-align tags in the browser. * Media syncs no longer take time to abort. * More hooks (thanks to Arthur). * Moved the scheduling options in the preferences to a separate tab, so options fit on the screen even on devices with small screens. * Prepare for uploading releases to PyPI (thanks to Evandro). * The media check will now fix file references in fields that broke because a filename was shortened as part of a sync. * Updated config handling. While there should be no immediate breakages, if you're an add-on author and store lists or dicts in Anki's config, please see 676f4e74a. ## Changes in 2.1.23 Released 2020-03-19, build de9543ff. A macOS-only build that fixes a problem syncing media files with non-Latin filenames added by previous Anki versions on macOS. Please see 2.1.22 below for the bulk of the changes. ## Changes in 2.1.22 Released 2020-03-18, build 0ecc189a. Media syncing improvements: * Media syncing now happens in the background, so you can continue using Anki while the media sync completes. * Aside from syncing at open and close, Anki will sync any media changes every 15-20 minutes. * You can click on the sync button while the spinner is active to monitor progress. * Long filenames and problematic characters should be handled smoothly now, instead of causing syncing errors. * Anki should no longer sometimes forget to download files when a media sync fails due to network errors. * When media files are added within Anki, Anki now marks them in the database immediately, which can make things faster for people with slower disks if they are not modifying the media folder externally. Media check improvements: * The Check Media function now shows progress, and can be interrupted. * There is now a separate button to generate missing LaTeX. * If LaTeX fails to build, the problem card will be revealed in the browse screen. * When Anki finds files that are too long or would cause errors on some operating systems, it will automatically rename them and update your notes to point to the new filename. Both media sync and the media check now place deleted files in a media.trash folder inside your profile, instead of placing the files in the system trash. You can use the Check Media function to either empty the trash, or restore the deleted files back to your media folder. Other changes: * You can now export .apkg files with the V2 scheduler enabled. * Add "New #" prefix to the due column for new cards. * Fixed audio getting stuck on Windows. * Clear the audio queue when moving between cards with autoplay off. * Fixed play icons not appearing in browser preview when autoplay off. * Show next learning card due time, and count for today. * Restored grey styling of zeros in the deck list that got lost in the night mode changes. * Improvements to the readability of the scheduling code (thanks to Arthur) * Add-on hook improvements, thanks to Glutanimate and Arthur. * Fixed fields containing a filename with non-Latin text from being corrupted when editing HTML (thanks to Evandro). * Support for validating add-on config schemas (thanks to Arthur). * Removed the 'too many decks' message in the deck list screen. * Fix for issue playing audio from flash drive. * Fixed Anki getting stuck when importing an invalid file. * More type hints in the code (thanks to Alan). * Improvements to the build process and building on Windows (thanks to Evandro). * Support '/' separator in add-on web paths on Windows (thanks to BlueGreenMagick) * Fix tags that are in the wrong encoding as part of the DB check. * Hide the default deck in more cases (thanks to Arthur). * Updates to the translation infrastructure, including tweaks to the way the answer buttons and the review history screen show intervals. ## Changes in 2.1.21 Released 2020-03-09, build f1734a47. * Fixed error messages when playing audio. * Fixed legacy add-on filters not working (reading generation in Japanese Support, etc). * The alternate Mac build works properly when macOS is in dark mode now, and can be used if you prefer light Anki in macOS dark mode. * Prevent UI scale from being decreased below 100%, which caused display problems. * Fixed Anki failing to start on some Windows 7 machines that were missing TTS support. * Display a more useful message when mpv/mplayer not installed. * Don't allow exporting into Anki folder. * Fixed display of AnkiMobile drawings in night mode. * Fixed interrupting of current audio when autoplay is turned off. * Night mode defaults to dark grey instead of black card background. * Fixed \{\{Deck}} showing filtered deck instead of original deck. * Fixed an error that could occur with very small learning steps. * Fixed a negative version number being shown when add-ons incompatible. * Fixed some invalid HTML in the review screen (thanks to BlueGreenMagic) * Added back missing fcntl module. ## Changes in 2.1.20 Released 2020-02-14, build 47a1bf8b. Template changes: The way Anki combines your card templates and fields has been updated. Many users will not notice a difference, but if you encounter error messages inside the review screen and opening and closing the Cards screen from the editing area does not resolve the issue, please see [this support page](https://anki.tenderapp.com/kb/problems/card-template-has-a-problem). Add-ons that alter the way cards are shown may need to be updated: ``` The card template rendering process in Anki 2.1.20 has changed significantly under the hood, and most of the code that was in the anki/templates folder has gone away. Add-ons that were relying on hooks to modify the card rendering should continue to function, but add-ons that were using or monkey patching methods in the templates module will break, as those methods no longer exist. I have looked through the add-ons on AnkiWeb that modify the card template, and believe most of them should be able to accomplish what they were doing before by using the new card_did_render and/or field_filter hooks. Examples of how each of them can be used are available here: https://github.com/ankitects/anki-addons/blob/master/demos/ For add-ons that were using the furigana/hint field modifiers, they are available for copying in the template_legacy.py file. If the hooks are insufficient for what your add-on is doing, please let me know within the next few weeks. If you're an end user and an add-on you use has broken, please let the add-on author know of this post. In terms of user-visible changes: The limit of 100 replacements on a template has been dropped. The new approach allow add-ons to add fields without 'unknown field' messages appearing on mobile devices (once they've been updated) Fields with a ':' character are no longer allowed. If you have a ':' in your fields, you can open and close the Cards screen to automatically remove the colon. Templates that reference a field that doesn't exist will now only show an error, instead of partially rendering. {{field}} references are ignored inside fields, so there is no risk of LaTeX/MathJax being interpreted as a field reference. The <% %> alternate syntax is deprecated, as it is no longer necessary due to the above change. Clearer errors when the user forgets to close a {{field}} reference, or mismatches open and close conditionals. ``` Audio changes: * Text to speech is now [supported in card templates](/manual/templates/fields#text-to-speech-for-individual-fields). * Audio buttons are now shown on the card, and can be turned off in the preferences. They will show for both regular audio and text to speech. * You can [customize the size and colour](/manual/templates/styling#audio-replay-buttons). * Added shortcut keys in the review screen to pause and jump forward/backward 5 seconds. * Anki now starts a new copy of mplayer for each audio file on Windows, which avoids the need to create temporary files. * Added an option in the preferences to not interrupt the currently playing audio when answering. * Fix multiple spaces in filenames from getting truncated when pasting sound files. Night mode: * The night mode option in the preferences screen now turns the interface dark as well. * On macOS, when the system is in dark mode, Anki will switch to night mode automatically. * Invert LaTeX in night mode (thanks to zjosua). * Some of the colours in areas like the graphs could be improved - pull requests with included screenshots of the changes would be appreciated. Add-on changes: * Anki will now check for add-on updates automatically once a day. * Disabled add-ons are now included in the check as well. * Add-on authors can specify the minimum and maximum Anki version they support, and add-ons will be automatically disabled when running on an unsupported Anki version. * Add-on authors can now upload different add-on versions for different Anki versions, and Anki will download the correct one. * A new hook system for add-ons: ``` Anki 2.1.20 introduces a new hook system that allows for better code completion and type checking than the old system. For a short explanation and link to some sample add-ons, please see https://apps.ankiweb.net/docs/addons.html#new-hooks Add-ons using the old hooks should continue to work, as the new hooks will automatically call the old hooks in most cases, and a few runHook/runFilter calls have been left in the codebase in the places where the new hooks differ significantly from the old ones. There are a bunch of hooks that previously were called with no arguments, such as when a new deck is created. The new hooks will tend to pass the newly created item into the callback, but will not do so for the legacy hooks, to avoid breaking old code. If anyone has feedback on the naming or the arguments of the new hooks, please let me know during the beta testing period, so they can be changed prior to add-on authors relying on them. To go along with these changes, the policy on adding new hooks has also changed. In the past, Anki's add-on documentation suggested hooks were best left for code paths that multiple add-ons wanted to extend, but this resulted in an over-reliance on monkey patching, and has made things fragile. The add-on documentation has been updated to encourage add-on authors to submit pull requests for any hooks they need, and the hope is that the bulk of add-ons can move away from monkey patching in the future. ``` * For add-on authors, some more examples using the new hook system are available on the following page, including ported versions of the clickable tags and additional card fields add-ons: [https://github.com/ankitects/anki-addons/tree/master/demos](https://github.com/ankitects/anki-addons/tree/master/demos) Other changes: * Added the ability to export selected notes from the Browse screen (thanks to Arthur). * Updated to a newer toolkit. * Emptying a filtered deck in the V2 scheduler no longer unsuspends suspended cards inside it. * Fix incorrect delay being logged when Hard is used on the first learning step in the V2 scheduler. * The editor no longer modifies percent-escaped text outside of image tags. * Fix an extra linebreak being left in a field when an image is attached to an empty field. * Tweaks to the 'tag updated notes' feature (thanks to Erez) * Fix cards being sorted in wrong order when added after the note was created (thanks to Arthur) * Disabled elastic scrolling in webviews to work around a Qt bug. * Don’t filter em/strong tags when pasting. * Fix error when double-clicking the open profile button. * Constrain image width in editor to the field width. # Changes in 2.1.30 to 39 Source: https://docs.ankiweb.net/releases/changes/changes/2.1.30-39 ## Changes in 2.1.39 Released 2021-02-02, build 576f0043. * Fix the Reposition command not preserving the browser sort order. * Fix some issues causing the sync indicator to show unnecessarily (thanks to Rumo). * Fix a spurious warning about a full sync when renaming card templates. * Fix Anki not working after installing on Linux over a previous install. * Don't log card resets when exporting. * Fix congrats screen not showing when learning cards were due soon. * Updated bundled lame and mpv on Windows and Mac builds. * Other fixes and improvements, with thanks to Henrik, Rumo, Abdo, Arthur, Guillem, Meredith, Gustavo, and Daniel. ## Changes in 2.1.38 Released 2020-12-26, build 355e4cd5. * Use a new approach for recording audio. If you encounter any issues, the old PyAudio driver can be selected in the Preferences screen. The old driver will likely be retired in the future, so please let us know if the default system does not work for you. * All built-in Windows TTS voices should now be supported on recent Windows 10 releases (thanks to Ryan). * Fix the Reposition tool in the Browse screen not following the sort order. * Reduce the default fade time in the review screen. * The ANGLE video driver can now be selected in the Preferences on Windows. * Fix some instances of the sync indicator remaining on after sync (thanks to Rumo). * Work around --text-fg appearing in fields. * Fix link in about screen (thanks to Abdo). * Fix '1' being shown instead of the correct number in some Russian translations. * Fixed invisible characters when adding new card templates (thanks to Henrik). * Fixed duplicate check getting confused by non-breaking spaces (thanks to abdo). * Don't throw error when computer hostname is invalid. * Other minor changes (thanks to Henrik & k12sh) For developers: * Protobuf binaries are now used to speed up the initial build. * Fixed Python code completion, and added some info to docs/development.md * ./run now runs Anki with Python warnings enabled - PRs that fix any that come up would be welcome (thanks cecini for the first!) ## Changes in 2.1.37 Released 2020-12-12, build 6d596c8f. * Fixed filtered decks not honoring sort order. * Fixed review screen not automatically scrolling to answer (thanks to Henrik). * The deck options screen now limits minimum ease to 131%. For developers: * Added a scripts/build command to build the redistributable wheels. * The Rust worker is disabled by default, as some users had trouble building with it. ## Changes in 2.1.36 Released 2020-12-09, build c505894b. Notable changes: * Alternate builds have been discontinued. If you are using a 32 bit system, or a macOS version older than 10.13, Anki 2.1.35 is the last release you will be able to update to. * MathJax has been updated to version 3, thanks to Henrik. It should render faster than before. If you were customizing the MathJax configuration using Javascript, you will need to [use a new method](https://github.com/ankitects/anki/pull/809#issuecomment-721438738). * A separate mpv process is now used to play videos on Windows, which should solve issues with playing getting stuck, thanks to Kelciour. * The handling of wildcards and escape characters in search [has been reworked](/manual/searching#matching-special-characters) to be more consistent, thanks to Rumo. * Early startup messages are now translable, thanks to Abdo. * When cards are rescheduled in the browse screen, a review entry log is now created. * The main card area is now focused instead of the bottom area during review, which allows using the keyboard to scroll, thanks to Henrik. Bugfixes: * Fixed corrupt indexes when checking database. * Fixed duplicate search when sort field is not first field (thanks to Abdo). * Fixed error when switching to note type with fewer fields. * Fixed invalid utf8 in notes when checking database. * Fixed invisible scrollbar in night mode + browser. * Fixed issues with "find duplicates" (thanks to Abdo) * Fixed some issues with adding/renaming decks (thanks to Cecini). * Other minor fixes. For developers: * Anki is now built using Bazel. This leads to more reliable builds, and reduces the number of dependencies you need to manually install. Please see docs/ for updated build instructions, and report any issues you encounter on the user forums. * The minimum Python version has been updated to 3.8. * The wheels available on PyPI support both Python 3.8 and 3.9. * All translations have been migrated to [Fluent](/translators/anki/developers). * Normal and night mode theming now uses CSS variables, making it easier to override in add-ons. * The congrats screen, burying/suspending, filtered deck building/emptying, browser sidebar, and card reposition/reset have been reworked. If you were modifying them in an add-on, your add-on may need updating. For the congratulations screen, see the new webview\_did\_inject\_style\_into\_page hook Thanks to all the people who have contributed bugfixes and code/doc updates: Abdo, Lukkea, Akshara, Kelciour, David, Henrik, Colin, Johan, Piotr, Andreas, Arthur, Alan, RumovZ, Cecini, Soren, Krish, ianki, Cyphar and kaczmarj, in no particular order. Thanks also to all of the people who have contributed translations for this and previous releases: [https://i18n.ankiweb.net/contributors/](https://i18n.ankiweb.net/contributors/) ## Changes in 2.1.35 Released 2020-10-02, build 84dcaa86. * Fix a bug in Anki 2.1.29+ that caused excessive memory and CPU usage on long-running operations that show a progress bar, such as importing. * Roll back Mac and Windows builds to Qt 5.14 again, as there are still issues with 5.15. * Fix display issue in graphs on alternate Mac build. * Fix preview not updating on multiple selection (thanks to abdo). * Fix old content appearing when flagging immediately after typing. * Fix some handling of `*` in searches. * Sidebar now correctly escapes some characters (thanks to abdo). ## Changes in 2.1.34 Released 2020-09-24, build 8af8f565. * Fix a bug in Anki 2.1.28+ where a newly created deck config would default to an ease of 130%. When updating, Anki will automatically change any deck configs with an ease of 130% back to 250%, and change any cards using those deck configs with a low ease back to an ease of 250%. Users who updated from an older Anki version and did not add new deck configurations should not be affected. If you have deliberately set an initial ease of 130%, please change it to 131% or greater prior to upgrading, so that Anki leaves your settings alone. Thanks to Aleksa for discovering the issue. * Update the standard builds to the latest GUI toolkit version. Please report any improvements or regressions you notice. * Dropped audio plays automatically again (thanks to abdo). * Revert to older sound playing behaviour to work around issues (thanks to kelciour). * is:due now stops at now+learn ahead limit, instead of end of day. * Various improvements/fixes, some thanks Aleksa & Henrik. ## Changes in 2.1.33 Released 2020-08-30, build 3f403040. * Access More button in review screen with 'm' (thanks to ANH). * Audio no longer plays when dropped/pasted (thanks to ANH). * Fix bulk tag adding not adding tags if tag is a substring of an existing tag (thanks to Soren) * Fix cards not being unburied if leaving Anki open and the first action of a new day is a sync. * Fix drag\&drop into existing content (thanks to ANH). * Fix error when add-ons tried to access note/template in card template screen. * Fix next learn message in congrats screen. * Fix nonbreaking spaces in filenames not being handled properly. * Fix text in export file selector (thanks to ANH). * Fix timeouts in full syncs and media syncs again. ## Changes in 2.1.32 Released 2020-08-25, build dee7d45d. * Roll back a change in the previous update that could cause syncs to time out. * Fix sign up link in login screen. ## Changes in 2.1.31 Released 2020-08-23, build 13476503. * Show card counts in pie graph, and other minor graph tweaks. * Fix sync error+lost review when undoing in v2 filtered deck with scheduling off. * Fix crash when dragging & dropping, thanks to ANH25. * Fix 'stale notetype' error after sync+add. * Close "edit current" when current card deleted. * Code improvements thanks to ANH, Arthur, Evandro, Henrik and Thomas. * Find\&Replace completion is now case sensitive. * Fix crash when recovering notes with missing notetype. * Fix duplicate detection when input text is not normalized. * Fix Empty Cards not ignoring BR tags. * Fix Find\&Replace window sizing. * Fix handling of nested legacy template directives. * Fix issues with bulk tag removal. * Fix mpv failing to play audio after it's restarted, thanks to Kelciour. * Fix some (rare) crashes. * Full syncs and media syncs now terminate more quickly when the connection breaks. * Improve support for getting proxies from Windows registry. * Remove embedded direction markers in RTL cloze deletions. * Strip nul characters from tags. ## Changes in 2.1.30 Released 2020-08-09, build 06a69c25. * Work around a failure to start on some Windows 10 May 2020 installations. * Fix "show windows in tabs" not working on standard macOS build. * Fix move into/out of filtered decks not syncing. * Add right axis to graphs. * Add night mode and mobile class toggles in card layout screen (thanks to ANH25). * Card counts graph now always shows table. * Catch negative review times in DB check. * Code improvements (thanks to Matt, phwoo, Evandro and aplaice). * Fix a crash in the DB check when a note type was missing. * Fix automatic logout not working when auth failure occurs. * Fix deck list and graphs not including v2 scheduler cards with rescheduling disabled. * Fix early reviews not appearing in review graph. * Fix hour graph problem in timezones west of UTC. * Fix negated conditionals being non-negated when renamed. * Fix some syncing errors that could happen until Check Database was run. * Fix some young cards being shown as mature in reviews graph. * Handle multiple same-numbered clozes in cloze-only filter. * Refresh tag list after clearing empty tags. * Other minor fixes. # Changes in 2.1.40 to 49 Source: https://docs.ankiweb.net/releases/changes/changes/2.1.40-49 ## Changes in 2.1.49 Released 2021-10-26. * Fixed cards not being automatically unburied when v3 scheduler enabled. * Fixed incorrect learning count in v3 scheduler when interday learning cards were queued (thanks to Rumo). * Work around an AnkiDroid inconsistency causing deck config to be reset if options edited on AnkiDroid. * Fixed a memory leak in the Preview screen (thanks to Hikaru). * Fixed an issue copying filenames from the Check Media screen (thanks to Abdo). * Fixed deck changing when toggling sticky fields (thanks to Abdo). * Fixed invalid default column in notes mode in the Browse screen (thanks to Abdo). * The bury command ignores suspended cards now (thanks to Rumo). * Anki no longer migrates any files from the old \~/Documents/Anki and \~/Anki folders. * Increased number of card templates shown in card templates screen dropdown (thanks to Evando). * Added a new example Dockerfile (thanks to Jakub). * Handle spaces in Linux install location (thanks to lolilo). * Work around a PyQt error on Python 3.10. * Other minor changes. ## Changes in 2.1.48 Released 2021-09-21. * Add "Previous Card Info" action to review screen (thanks to Evandro). * Fix flag names not updating on profile switch (thanks to Rumo). * Hide "Rename with Parents" for top-level items (thanks to Rumo). * "Add Field" action now correctly handles multi-word font names. * Fix newline being added when coloring text (thanks to Henrik). * Fix incorrect system font when running Anki in some non-English languages. * Fix learning count sometimes jumping to a large number in the v3 scheduler. * Another fix for Reposition command not working on buried/suspended cards. * Preserve focus when changing notetype in the Add screen. * Wayland can now be optionally enabled with an env var in the packaged builds, but remains off by default due to a number of bugs. * Fix an error message that could appear when deleting notes (thanks to Rumo). * The card templates screen no longer defaults to filling empty fields when opened from the Add screen (thanks to BlueGreenMagick). * Miscellaneous other fixes. ## Changes in 2.1.47 Released 2021-08-29. Changes to the [v3 scheduler](/faqs/the-2021-scheduler): * Interday learning cards are included in the learning count again, instead of the review count. * Interday learning cards are still affected by the review limit. Interday learning cards are fetched first, then reviews, and finally new cards. * Filtered decks with rescheduling disabled now log reviews, so the reviews will appear in your graphs. * Added an option to sort reviews by ascending/descending ease. * Fixed an issue where an error message could appear after undoing/redoing a mix of reviews and other changes. * Fixed custom scheduling not working. Other changes: * The "timebox finished" message is now shown on card answer, instead of after revealing the next card. This should also address an issue where the message popped up outside of review. * Added shortcut for Forget in the Browse screen. * Fixed an error being shown when there was no current deck. * Fixed incorrect quoting in duplicate search (thanks to Abdo). * Fixed deck options inverting the "replay question when showing answer" option. * Fixed an issue with ampersands in the Add Cards history button (thanks to Arthur). * Fixed handling of audio/video tags (thanks to Hikaru). * Fixed errors playing audio when computer was slow to respond (thanks to Kelciour). * Fixed preferences screen not updating undo menu, and causing an error when subsequently reviewing a card in the v3 scheduler. * Fixed case changes being ignored in tag rename. * Fixed error shown when DB check run on corrupt collection. * Fixed deck options prompt showing the default deck, instead of the correct one. * Fixed reposition command ignoring suspended cards. * Fixed answer button highlight on Windows (thanks to Henrik). * Fixed calendar graph day labels showing incorrectly in some timezones. * Improved validation of add-on package names (thanks to BlueGreenMagick for the report and initial fix). For add-on developers: * The Svelte components Anki exports should now work correctly in add-ons, provided they exclude Svelte when bundling. * WithShortcut is now also available. ## Changes in 2.1.46 Released 2021-08-04. * Fix duplicate text when pasting with Ctrl+Shift+V (thanks to Henrik). * Remember last colors in editing window (thanks to Henrik). * Show flag and mark icons in preview window (thanks to Hikaru). * Center first match when searching in sidebar (thanks to Abdo). * Added F9/Shift+F9 shortcuts for sticky fields, and increase opacity (thanks to Henrik). * Fixed starting ease specified in deck options not being used by v3 scheduler. * Fixed learning cutoff not updating during review, and some learning cards remaining at the end of review in the v3 scheduler. * Fixed Change Notetype not mapping fields correctly when count differed. * The congrats screen now updates periodically again. * Fixed Redo menu item showing Undo action name. * Fixed notetype selection in the import screen. * Fixed error in overview/congrats screen when there is no current deck. ## Changes in 2.1.45 Released 2021-07-30. Undo handling: * Most actions now support multiple undo steps. You can change a card template, delete some notes, bury a card, then undo each of those steps if you wish. * Actions that support multiple undo steps will now save the changes immediately, meaning that if Anki crashes, the changes you made in the last few minutes will no longer be lost. * Most undoable actions can now be redone, so you can undo an accidental undo. * Actions that don't support the new undo handling (eg, Check Database), will clear the undo history. * Add-ons will clear the undo history if they modify the database directly, or use routines that don't support undoing. There are some new routines available to add-ons to make operations undoable, but add-ons may need to be updated to use them. Scheduling changes: * A new scheduler is available, with a number of improvements. Please see the [2021 scheduler page](/faqs/the-2021-scheduler) for more information. * The deck list now shows the learning count separately. * On new collections, the v2 scheduler is now the default. * Set due date uses the deck's configured starting ease (thanks to cyphar). Browser changes, mostly thanks to Rumo: * The sidebar now has two modes. The default allows clicking on items to search for them. The other mode allows you to select multiple items at once, so you can drag & drop or delete multiple items. * The browse screen can now be toggled between showing cards, and showing notes. * When showing notes, some columns will show an aggregate over all the cards of a note. * Added an introduced:x search to locate cards first studied in the last x days. * Column rendering has been moved into the backend, and will be faster than before (but is still limited by the speed of the graphics toolkit). * A fair bit of the browser code has been changed, and some add-ons like the "Advanced Browser" add-on will need to be updated to support the new approach. * New tag icons and associated backend work (thanks to Henrik). * Added an option in the Preferences screen to customize the starting search text (eg, to start with "deck:current"). * More reliably scroll to the current card. * When opening the Browse screen with an active study card, the whole deck is now shown. * Added 3 new flag colours. * Flags can now be renamed in the sidebar. * Horizontal scrolling in the browse screen is less jumpy. * Sidebar items can be dragged onto the Saved Searches area to add them as a favourite. Editor changes, mostly thanks to Henrik: * A new editor toolbar implementation, with improved icons and handling. * The editor now provides bullet and numbered list buttons. * The editor now provides buttons to control text alignment and indent. * Sticky fields can now be toggled on/off from the editing screen. * A new API is available for add-ons, and the existing API should continue to work. * The HTML editor is now shown inline, and supports syntax highlighting, and showing opening/closing tags. * Warn user when they attempt to use cloze markers inappropriately (thanks to Rumo). State handling: * When you make changes, the user interface should update more consistently now. Adding a new tag to a note will update the sidebar in the Browse screen for example, and when you review a card that is shown there, the columns will update. * The Browse screen no longer refreshes a search automatically. When you make a change, the column text may update, but the number of rows will not change. Deleted cards show "(deleted)" until you search again. * The main window no longer shows a "waiting for editing to finish" screen. When you make changes such as editing a note, the main window will dim, and will automatically refresh when you return to it. The deck options screen has been reimplemented: * (Re)learning steps are now shown with units, eg 10m or 4d. * Deck options are now shown on one scrollable page. * Extra help is available for most options. * It is easy to see at a glance which options have been changed from the default, and individual options can be reverted to the default setting. * Warnings will be shown for some common issues (eg, review limit too low compared to new cards). * Some of the more advanced options have been moved to a separate "Advanced" section. * The old options can be accessed with a Shift+click, since it will take a while for add-ons to be updated to support the new screen. A new API is available, thanks to Henrik. * The deck description is now accessible via a button in the overview screen, instead of via the deck options. Other features: * An updated Change Notetype implementation, that can match fields by name, and allows you to map a source field to multiple destination fields in order to clone a field. * Pre-load images on answer side (thanks to Hikaru). * The `[...]` in cloze deletions is now read as "blank" by TTS (thanks to Rumo). * The Find\&Replace option in the Browse screen can now be used on tags as well. * Added a Card Info option to the review screen. * When opening deck option from the study screen, you'll now be asked which deck you want if the card is in a subdeck. * You can now choose which add-ons you want to update (thanks to BlueGreenMagick). * Support system SSL certs on Linux. * Extra checks are now done when updating a card template, such as detecting when a cloze notetype is missing a cloze directive, or two templates have identical question sides (thanks to Rumo). * Support Ctrl+Numpad Enter to add cards. * Added night mode styling to 'type in the answer' box, and improve legibility of comparison. * Sidebar search now scrolls to first match (thanks to Abdo & Rumo). * F3/F4 in card layout screen go to next/previous template (thanks to Evandro). Fixes: * Custom study now limits the tag selection to 100 tags or fewer, to prevent errors caused by exceeding database limits. * Fixed an issue compiling on recent Python 3.9 installs. * Fixed audio getting stuck when pausing near end (thanks to kelciour). * Fixed building on linux-arm64 (thanks to qubist-pixel-ux). * Fixed Card Info screen not ignoring manual rescheduling when calculating the average time. * Fixed crash when pressing the copy shortcut with no active selection. * Fixed current review card sometimes changing when making edits. * Fixed deck options tooltip appearance (thanks to Matthias). * Fixed escaping of hyphens in searches (thanks to Rumo). * Fixed field pin status being forgotten when opening Cards screen (thanks to Henrik). * Fixed incorrect card count when removing multiple templates. * Fixed incorrect font on Windows (thanks to Kelciour). * Fixed resource leak in sound code (thanks to Kelciour). * Fixed some instances of a flash when revealing answer on cards with images. * Fixed text with single quote not being escaped in export (thanks to Ryan). * Fixed various links to the manual (thanks to cherryblossom000). * Fixed red duplicate background being included in copy+paste (thanks to Hikaru). * Fixed flags not being excluded on export (thanks to Alex). * Force x11 mode when the packaged build is run on a system that tells Qt to use Wayland, as Wayland is not currently supported by the packaged build. * Numerous behind-the-scenes improvements from Henrik and Rumo. * Other fixes and improvements, thanks to Abdo, Glutanimate, Arthur, Shaun, hkr and others. * Strip invalid unicode from filenames in media check. * Performance improvements and other miscellaneous fixes. A big thank you to everyone who contributed, including people who contributed translations, and those who helped test out the beta releases and provided feedback. Add-on authors, there are [some notes](https://forums.ankiweb.net/t/add-on-porting-notes-for-anki-2-1-45/11212) on porting add-ons to 2.1.45 available. ## Changes in 2.1.44 Released 2021-05-04. * Search text is no longer automatically quoted/interspersed with ANDs. * Fix two backslashes being treated as one in MathJax. ## Changes in 2.1.43 Released 2021-04-03. * The reviewing screen will now wait for up to 100ms for images to load before showing, and waits until images have been loaded before scrolling to the answer. * The default fade-in on the review screen has been removed. * Fix DB check incorrectly identifying an issue after lapsing a card with a non-zero interval % in the V1 scheduler. * Fix editing toolbar being initially active (thanks to Henrik). * Fix some error messages (thanks to Rumo). * Fix expand/collapse triggering click in sidebar (thanks to BlueGreenMagick). * Update translations, thanks to the translators. * Fix "Forgot Card" message. * Fix deck list not updating after deleting. ## Changes in 2.1.42 Released 2021-03-10. * Fix sync downloads failing when temp folder on separate partition. * Fix RTL fields (thanks to Abdo). * Fix issues with field focusing and caret positioning (thanks to Henrik). * Strip comments when pasting HTML (thanks to Abdo). * Don't forget CSV delimiter when canceling dialog (thanks to Benjamin). * Fix stale caches after rolling back to a checkpoint (thanks to Rumo). For build hashes, please see the [GitHub releases page](https://github.com/ankitects/anki/releases). ## Changes in 2.1.41 Released 2021-03-07, build 312fa278. Browser improvements: * Tags now show in a tree (thanks to Abdo). * Added a search bar to the sidebar (thanks to Abdo). * New context menu actions to rename or remove tags and their children, rename decks, manage notetypes, and rename/remove saved searches (thanks to Abdo and BlueGreenMagick). * The preview button in the browse screen has moved into the editing area (thanks to Henrik). * With the improved sidebar, a number of options have been removed from the Filter button. * The remaining items in the Filter button have been moved into the sidebar, and the Filter button removed. * Tags and decks can now be dragged and dropped in the sidebar. * Each section can now be expanded/collapsed. * "Due" now shows only cards due that day. * Added "Overdue" item. * Click on Decks to show whole collection. * Click on Flags to show any flag. * Click on Tags to show all non-empty tags. * Added "Untagged" under Tags. Editing improvements: * `
` tags will now be used by default instead of the previous `
` tags, which solves some issues with multiple lines in cloze deletions and MathJax (thanks to Henrik). * The tags field in the editor now autocompletes from anywhere in a tag name, not only the start. * Invalid field content can no longer spill out into the editing area (thanks to Henrik). Search improvements: * Searches are now rewritten into a canonical format (eg `one two` becomes `"one" AND "two"`) (thanks to Rumo). * Search error messages are now much more specific (thanks to Rumo). * is:learn, is:due and prop:due now handle more cases, such as suspended cards (thanks to Henrik). * Added prop:pos search to search for new card position (thanks to Abdo). * Added a shortcut to replace part of a search with a different search (eg changing the selected deck) (thanks to Rumo). * Support resched:x for searching for cards that were manually rescheduled in x days (thanks to Henrik). * Support prop:rated/resched to search for rated/rescheduled cards over specific time periods (thanks to Henrik). * Filtered decks can now be created from a browser search, and vice versa (thanks to Rumo). * Filtered deck screen now has a link to show cards not matched by search (thanks to Rumo, Abdo). * Better ergonomics for developers (thanks to Rumo). Graph improvements: * A number of the graphs can now be clicked on to search for the cards displayed by the graph (thanks to Henrik). * The starting day of week can now be altered in the Calendar graph (thanks to Henrik). * The Card Counts graph now supports toggling separate suspended/buried counts (thanks to Henrik). * The intervals and ease graphs now covers more cases, such as suspended cards (thanks to Henrik). * Place less emphasis on outliers in the Calendar graph (thanks to Henrik). * Ignore manually scheduled cards in hour graph. Scheduler improvements: * The V2 scheduler no longer applies parent review limits to child decks. Previously the limits were inconsistently applied, which could lead to the deck list not reflecting the actual number of cards you'd receive when you clicked on a deck. AnkiMobile and AnkiWeb have been updated to match this behaviour, and AnkiDroid will also be updated soon. Using 2.1.41 in conjunction with older clients will not cause any problems when syncing, but you may find the deck list/review counts do not match. * The V1->V2 upgrade process no longer resets cards that are in learning, or removes cards from filtered decks. * Users on the old scheduler will now see a message at the top of the deck list prompting them to update to the Anki 2.1 scheduler. * There is no option to downgrade to the V1 scheduler anymore, though you can still do so by downgrading to an older Anki version first. Reworked the Reschedule tool: * Split into separate "Forget" and "Set Due Date" actions * "Set Due Date" defaults to not adjusting the card interval. * Changed the "Delete Tags" shortcut; Ctrl+Shift+D now changes the due date. * Added the action to the review screen as well. * Input now remembered. Other changes: * A basic sync server is now built into Anki. It does not yet support media. Docs are in the docs/ folder of the source tree. * The title bar on Macs will now turn dark when night mode is activated. * Deck descriptions of the congratulations screen can be enabled by turning markdown on in the deck options, but only 2.1.41+ will be able to render the markdown. * Add opus to media list in editor. * Edit/More buttons auto-hide when window is small (thanks to Henrik). * Support Alt+number to switch between clozes in the card layout screen (thanks to Abdo). * Use monospace font in HTML editor. * Improve error message when trying to nest under a filtered deck (thanks to Rumo). * Reposition dialog's "shift cards" option now defaults to off. * Other fixes and improvements thanks to Henrik, Rumo, Abdo, Arthur, Maksim, Guillem, stayingpeachy, Daniel, khonkhortisan and Kerrick. Fixes: * Fix the Reposition command not preserving the browser sort order. * Fix some issues causing the sync indicator to show unnecessarily (thanks to Rumo). * Fix slowdown after large "check media" report. * Fix a spurious warning about a full sync when renaming card templates. * Fix a freeze when answering a card with a missing parent deck. * Fix Anki not working after installing on Linux over a previous install. * Don't log card resets when exporting. * Fix congrats screen not showing when learning cards were due soon. * Updated bundled lame and mpv on Windows and Mac builds. For developers: * Add-on authors, please see [https://forums.ankiweb.net/t/add-on-porting-notes-for-anki-2-1-41/7390](https://forums.ankiweb.net/t/add-on-porting-notes-for-anki-2-1-41/7390) * Almost all of the Python codebase now has type hints. 🎉 * JS libraries like jQuery have been updated (thanks to Henrik). * Add (untested) support for ARM64 Linux. * orjson is turned back into an optional requirement (though is still recommended, as it's faster). * The sidebar code has been moved from from browser.py into sidebar.py, which may break some add-ons. ## Changes in 2.1.40 Released 2021-02-07, build cf446733. * Fixed backup not being made when choosing "Download" when syncing. * Fixed a slowdown after importing. # Changes in 2.1.50 to 59 Source: https://docs.ankiweb.net/releases/changes/changes/2.1.50-59 ## Changes in 2.1.59 Due to a packaging problem, this release was yanked. ## Changes in 2.1.58 This release fixes an issue in 2.1.57 that caused cards and deck presets to be reset to the default ease, if you exported a .colpkg with compatibility with older clients enabled, or used the downgrade and quit option, then opened the collection again. For the former issue, this occurred to the collection you were exporting from, and not just the .colpkg file. If you were affected by this, running the following in the debug console after updating should restore your cards to the ease they were at when you last reviewed them, if they were not reviewed after the problem occurred. Please make a backup before proceeding. ``` updated = 0 for cid, old, new in mw.col.db.all("select id, factor, (select factor from revlog where cid=cards.id order by id desc limit 1) as factor2 from cards where type=2"): if new and old != new: card = mw.col.get_card(cid) card.factor = new mw.col.update_card(card) updated += 1 print("updated", updated) ``` It will print the number of updated cards. [/manual/misc#debug-console](/manual/misc#debug-console) Other changes in this update: ### Custom sync server * You can now customize the network timeout in the sync settings, which may be required if you have a large collection and/or a slower device. * Maximum sizes are no longer enforced when downloading from custom sync servers. ### Type in the answer * Fix type answer comparison being collapsed when extra characters in input. * Revert to blanking out missed chars in provided text, like older releases. * Wrap expected text in code block when no answer provided. ### Importing * When importing csv files, you can now limit duplicate matching to the deck cards are in (thanks to Rumo). * Support UTF-8-BOM when importing CSV (thanks to Rumo). * Duplicate handling policy can be specified in the csv file header (thanks to Rumo). ### Scheduling * It is no longer possible to enable burying of reviews without also burying new cards, as Anki excludes buried cards up front, and needs to do so in a particular order to avoid errors during review. * Fix v3 deck-specific limits affecting the deck list/study screen in v2 mode. * Show custom data from third-party schedulers in stats screen. * Allow burying cards in the browser (thanks to Kaben). ### Fixes * Switch to a new Windows TTS implementation, which unblocks future upgrades, and should perform better (thanks to Rumo). * Work around a startup error some users were receiving on Windows. * Fix currently-selected preset not being indicated in deck options (thanks to Fabricio). * Fix error shown after toggling full screen. ## Changes in 2.1.57 More UI improvements/fixes thanks to Matthias, including: * The top toolbar area can now take on the color/background of the main window. * The top toolbar appears more subtle during review. * A new option in the preferences to automatically hide the top and bottom bar during review. * A new option in the preferences to enable a "minimalist" mode that makes the UI more compact/less fancy. * A new option in the preferences to switch between native styling and the Anki theme (on Mac/Linux). * The preferences screen has been redesigned to be easier to navigate. Syncing has also been updated: * Tweaks to the sync protocol that should be transparent when syncing with AnkiWeb, but that will break syncing with third-party servers that haven't been updated yet. * The sync server bundled with Anki has been updated, and now supports syncing media as well. More information is available on [/manual/sync-server](/manual/sync-server). Other changes: * Switch to a different library for handling type-in-the-answer comparisons, which should give more reliable results, and not crash with certain inputs (thanks to Rumo). * Fix `introduced:x` not working correctly when negated (thanks to Rumo). * Fix ctrl+enter not working when importing screen first opened. * Fix image dimensions not being correctly constrained (thanks to Hikaru). * Fix incorrect total/average in added graph. * Fix newlines not appearing when importing a csv file with HTML disabled. * Fix quotes preventing field descriptions from showing. * Fix spaces not handled properly when entering text around MathJax (thanks to Hikaru). * Fix toolbar add-on breakages and introduce toolbar tray layout & API (thanks to Aristotelis). * Fix type-in-the-answer not supported nested cloze deletions. * Increase delay when adjusting clipboard, which may improve compatibility on some systems. * Update Windows/Linux builds to Qt 6.4.2. * Fix non-Latin text wrapping in deck options dropdown (thanks to Fabricio). * Fix outer whitespace not being trimmed in type answer. * Fix the future due graph counting learning cards on the wrong day. * Fix deck options screen allowing invalid/blank input. * HTML is now escaped in the deck list. Dev related: * Make it easier to override node/protoc binaries during a build (thanks to Mani) ## Changes in 2.1.56 Released 2023-01-09. If updating from Anki 2.1.49 or below, please see the [2.1.50 change notes](https://github.com/ankitects/anki/releases/tag/2.1.50) first. New features/improvements: * Cloze deletions can now be nested inside other cloze deletions (thanks to TRIAEIOU). * Inactive cloze deletions can now be styled with .cloze-inactive (thanks to TRIAEIOU). * Graphs in large collections now load approximately twice as quickly. * Add-on config help is now shown in a webview (thanks to Abdo). Fixes: * Fix error popping up 12 hours after starting Anki on macOS and some Linux machines. * Fix unreadable text when searching in sidebar. * Fix fcitx not working on Linux Qt6 package. * Fix old graphs failing to appear. * Fix dark mode display issues on macOS/Qt5. * Don't display a 'timestamps in the future' message after a bulk import. * Fix cloze buttons being disabled in MathJax editor. * Fix images not being constrained to window width when image shrinking disabled. * Fix incorrect macOS minimum version in Qt5 build. * Fix lack of highlight for marked cards in day mode. * Fix pop-up menu in editor sometimes flashing (thanks to Hikaru). * Fix some issues entering text via IME around MathJax area (thanks to Hikaru). * Fix some regressions with the graphs when saving to a PDF. * Fix truncated text on some buttons. * Fix two mpv issues on Windows (thanks to Kelciour). * Tweak focus highlight of some widgets (thanks to Abdo). For devs: * Improve web building/reloading experience (thanks to Aristotelis). * Fix an issue building the code with the latest git version. * Fix aqt type completion not working with PyPI wheel. ## Changes in 2.1.55 Released 2022-12-16. Known issues: * The old shift+click graphs screen is broken in this release. The regular graphs screen works correctly. Lots of UI improvements, thanks to Matthias: * The theme has been reworked, especially on Windows/Linux. * A number of screens like the deck list, editor, deck options and graphs have been re-styled. * Added an option for fields to show the HTML editor by default. * Fields can now be collapsed/expanded. The animation can be disabled in the preferences. * HTML tag auto-close can now be toggled via settings button in editor. * Improve layout for RTL languages. * The editor in the browse screen can now be shown on the right. * The tags area can now be collapsed/expanded (thanks also to Henrik). * On macOS, dark mode now uses the default macOS styling; you can optionally force behavior like the other platforms with the following in the debug console: `mw.pm.set_force_custom_styles(True)`. * Many other small tweaks. V3 scheduler improvements, thanks to Rumo: * Custom scheduling now supports per-card data, enabling things like [FSRS](https://forums.ankiweb.net/t/how-did-i-publish-a-paper-in-acmkdd-as-an-undergraduate-a-fantastic-research-experience-on-spaced-repetition-algorithm-open-source-the-code-and-dataset/23387). * Decks can now specify daily limits independently of the deck preset. You can either specify a permanent override, or one that will reset when the next day comes around. * The Hard button on the first step is now capped to a maximum of 1 day greater than Again. * You should no longer see strange behavior when changing learning steps while cards are in learning. Import/export improvements, thanks to Rumo: * The new import/export code is now the default. * When scheduling is included, filtered decks are no longer converted to normal decks. * When a deck is specified in a CSV import, it's now created if missing. * Keep content of unmapped fields when importing CSV. * Various other fixes. Other improvements: * `introduced:x` now ignores manual reschedulings (thanks to Rumo). * Anki now opens to the previously-active profile (thanks to Sam). * Card info now refreshes as a card is reviewed (thanks to Rumo). * Close MathJax editor when Esc is pressed (thanks to Abdo). * Double-click on an editor pane to equally split the two sides (thanks to Aristotelis). * Improve Anki's error handling, including some more informative error messages (thanks to Rumo). * Improvements to the MathJax editor (thanks to Henrik). * Make dvipng use transparent background by default (thanks to gnnoh). * Preload images on the front side of a card to reduce pop-in (thanks to Kelciour). * Remember previous choices in reposition dialog (thanks to Sam). * The build system now uses ninja instead of bazel. * The MathJax preview can now be turned off. * The maximum answer time can now be set below 30 seconds. * The way your typed text is compared with the correct answer has been tweaked. * The zoom level is no longer reset when moving between screens. * Updated to Qt 6.4 on Windows/Linux. * You can now control whether images are automatically shrunk or not in the editor. Fixes: * Add screen can be closed with Cmd+W on macOS (thanks to Sam). * Add tooltip to More button (thanks to Hikaru). * Cmd+Shift+C cloze shortcut should be more responsive on macOS now. * Fix \{\{CardFlags}} not working with flags 5-7 * Fix an error showing when making network connections on macOS after leaving Anki open for a few days. * Fix browser sidebars appearing in wrong order in RTL mode (thanks to Abdo). * Fix certain installed TTS voices on Windows causing errors. * Fix daily counts being included in apkg import. * Fix fields sticking in add screen when they shouldn't (thanks to Henrik). * Fix flicker when remapping imported notetype field (thanks to Rumo). * Fix font size not being removed when pasting between fields. * Fix incorrect header text alignment in Qt 6.3.1 (thanks to Rumo). * Fix non-admin users having trouble with Anki on macOS. * Fix reviewer shortcuts being inaccessible due to IME * Fix scheduler change not reflected after normal sync. * Fix scrolling with keys/keyboard event listeners not working on answer side (thanks to Hikaru). * Fix sidebar appearing as small window in some cases (thanks to Hikaru). * Fix slow field pin/unpin with large notetype (thanks to Rumo). * Fix styling of pop-over arrows (thanks to BlueGreekMagick). * Fix the UI getting stuck at startup when multiple pop-ups appear (thanks to Sam). * Fixed an issue with the night theme class (thanks to BlueGreenMagick). * Fixed indent/outdent shortcuts not working properly. * Fixed inverted ctrl+right/left handling in RTL fields again (thanks to Abdo). * Fixed shortcuts to select all/delete tags not working (thanks to Hikaru). * Fixed some issues with dragging tags/decks onto other tags/decks (thanks to Abdo). * Improve handling of invalid UTF-8 in DB check. * Improve the appearance of the note/card switch toggle (thanks to Aristotelis). * Make it easier to read add-on errors (thanks to Abdo). * Possible fix for error when copying text in editor * Preserve background color when copy+pasting between fields. * Preserve background-color when pasting external content in light mode. * Suppress the "Unknown error" message that the web toolkit can output on Windows. * Various other fixes. ## Changes in 2.1.54 Released 2022-06-24. A new CSV importer & exporter, thanks to Rumo: * Shows a preview based on the selected field separator. * Column mapping includes field text for reference. * Multiple decks and notetypes can now be imported/exported at once, as columns can be mapped to deck or notetype name. * Supports exporting and importing a unique identifier for a note, to use instead of a matching first field. This removes the need for the 'add note id' add-on. * Extends the header syntax so that files can specify metadata such as the desired field separator, and the mapping of fields. * The new functionality is not enabled by default, and can be enabled with a checkbox in the preferences screen. This also enables the new apkg import/export code introduced in 2.1.52. If you use the Special Fields add-on, you will need to disable this option in order to use the add-on. Update to Qt 6.3.1: * Fixes complex-language input (eg Japanese, Hindi, etc) on macOS being flaky. * Fixes unwanted text when copying from the review screen on Windows. * Fixes a startup failure with certain Linux keyboard configurations. * Due to a change in Qt, you will need to reconfigure your columns in the browse screen after updating. Fixes & improvements: * Accept .zip extension when importing add-ons (thanks to Abdo). * Add support for getting light/dark mode status with latest freedesktop standard (thanks to Bart). * Editor API improvements (thanks to Henrik). * Field descriptions in the editor are now shown inline, instead of in a tooltip (thanks to Matthias, Henrik and Hikaru). * Fixed a rounding issue when describing time intervals of a year or more. * Fixed an error that occurred after a one-way download fetched a collection with a different scheduler version enabled. * Fixed desktop hanging when attempting to add a new notetype in KDE (kwin). * Fixed flag names not updating after sync until Anki restarted. * Fixed inability to enter underscore in tags area on some keyboard layouts (thanks to Henrik). * Fixed undo history being cleared and error showing when double-tapping delete in Browse screen. * Provide a way for the review screen to support drop events (thanks to Abdo). * Other minor fixes and improvements. ## Changes in 2.1.53 Released 2022-05-28. ### Editor Improvements * Rework image resizing (thanks to Henrik). Images expand to the editor width by default now, and images that are resized for the editor will remain that way if you switch fields, or navigate to a different note and back. * Existing height constraints on images are stripped when resizing (thanks to BlueGreenMagick). * The MathJax editor now provides buttons/shortcuts to cloze-delete selected text (thanks to Henrik). * MathJax preview now hides cloze markers. * Style tags are no longer stripped when editing (thanks to Henrik). * `
` tags in MathJax are now handled correctly (thanks to Henrik). * MathJax in the review screen now supports mathtools, and available packages in editor and review screen match (thanks to Henrik). * Move focus into HTML editor when hiding normal editor (thanks to Henrik). * Image tags now have the alt property preserved when pasting. ### Other Improvements * Fixed the Qt6 version crashing on some machines. * Custom study no longer includes child decks in available card count in v3 scheduler. * Fixed an error sometimes appearing in the browser when deleting notes (thanks to Rumo). * Fixed automatic backups popping up progress window when Anki minimized. * Fixed cards not being generated after template edits. * Fixed deck options top bar disappearing as you scroll down. * Fixed duplicate Anki icons appearing in dock on macOS. * Fixed duplicate first character in certain ibus configurations (thanks to wisherhxl). * Fixed future due graph incorrectly including new cards. * Fixed initially-incorrect tooltip position in graphs (thanks to BlueGreenMagick). * Fixed some MathJax directives failing to render in editor. ## Changes in 2.1.52 Released 2022-05-13. ### Editor Improvements * Ctrl/Cmd+A in tag editing area now selects all tags (thanks to BlueGreenMagick). * Fixed backspace sometimes removing multiple images at once (thanks to Henrik). * Fixed copying and pasting MathJax on Windows (Qt6). * Fixed handling of `<` and `>` symbols in MathJax (thanks to Henrik). * Fixed intermittent editor loading failures when add-ons have injected a large amount of code. * Fixed pasting of local files of unsupported types that contain spaces (thanks to Abdo). * Fixed some formatting being lost when copying between fields on Windows (Qt6). * Fixed various issues with tag editing (thanks to BlueGreenMagick and Henrik). * Pressing tab on the last field now moves focus to tag area (thanks to Henrik). * Reduce size of editor buttons on Windows/Linux (thanks to Henrik). * Tags copied from the tag editor are no longer joined together when pasted into the add tags/remove tags dialogs (thanks to Henrik). * The Qt5 Mac build now caps tag autocomplete matches to 10, as showing more is extremely slow in the old toolkit version. ### Other Improvements * Update Qt to 6.3.0, which fixes slow loading of large images, and inertial scrolling on macOS. * Fixed an error when previewing cards and selecting multiple cards (thanks to Rumo). * Fixed Anki needing to close when invalid modification times encountered by the browser on Windows. * Fixed colpkg imports not being cancellable (thanks to Rumo). * Fixed current working directory changing on apkg export. * Fixed custom browser font not being honored (Qt6). * Fixed custom study applying the previously-input limit, instead of the current one. * Fixed due graph showing wrong date for review cards in a filtered deck with rescheduling disabled. * Fixed grey background in type answer text + dark mode (thanks to Matthias). * Fixed v3 scheduler allowing one extra card when review limit reached (thanks to Rumo). * Lists on cards are now aligned to the left by default (thanks to Matthias). * Removed the highlight on the Show Answer and Good buttons. * Reset page zoom when moving between different screens. * The Qt6 Linux build now defaults to X11/XWayland instead of Wayland due to some [remaining issues](https://github.com/ankitects/anki/issues/1767); you can force-enable Wayland with ANKI\_WAYLAND=1. ### For Developers * The `field_filter` hook can now check if it's running for the question or answer side (thanks to Abdo). * Added a `av_player_will_play_tags` hook (thanks to Abdo). * Make it easier to search in fields programmatically (thanks to Abdo). ### New Apkg Import/Export This build also includes a new implementation of apkg importing and exporting, thanks to Rumo. Some advantages: * Undo/redo is now supported. * Faster imports (especially for decks with a lot of note content). * Support for older clients can be optionally disabled, which results in smaller apkg files, and faster imports. * Flags are removed when scheduling is excluded. The new functionality is hidden behind a feature flag, and **not active by default**. You can try it out by using `mw.pm.set_new_import_export(True)` in the [debug console](/manual/misc#debug-console). To revert to the old behaviour, replace True with False. Things to note: * This is new code that has received limited testing so far, so please use `File>Create Backup` before trying it out. Any testing/feedback you can provide would be appreciated. * While active, it is not currently possible to import/export files other than apkg/colpkg. * The Special Fields add-on will not work while this functionality is enabled. ## Changes in 2.1.51 Released 2022-04-25. Changes: * Reviews in the V3 scheduler can now optionally be sorted by relative overdueness (thanks to Abdo). * Remember original card position when using 'set due date' on a card (thanks to Rumo). * Improve editor startup time, especially with many fields (thanks to Henrik). Fixes: * Fixed compatibility with older macOS versions. * Fixed an issue that was breaking some add-ons when running on Windows without using anki-console.bat * Anki now closes the Browse screen before full sync or colpkg import/export, so it doesn't show errors. * Automatically re-enable disabled add-ons when user explicitly reinstalls them, and improve conflict handling (thanks to Aristotelis). * Fixed an issue with the search history when clicking on items in the sidebar (thanks to Rumo). * Fixed card layout screen opening too wide if card template name was long (thanks to Sam). * Fixed compatibility with 'card info during review' and similar add-ons. * Fixed formatting being turned off when pressing shift (thanks to Henrik). * Fixed full sync not being triggered when changing sort field. * Fixed illegible calendar buttons in dark mode on Mac/Linux. * Fixed stats PDF being illegible when saving in dark mode after scrolling down (thanks to Luka). * Use `` and `` formatting tags, instead of `` and ``. ## Changes in 2.1.50 Released 2022-04-09. ### Platform-Specific Changes Windows: * Windows 10 or 11 is required. If you are still using Windows 7 or 8, 2.1.49 is the last build that will install on your system. macOS: * Anki now supports Apple Silicon natively. If you're on a newer Mac with an M1 processor, pick the qt6-apple download for better performance and battery life. * The Qt6 x86 build requires macOS 10.14.4 * The Qt5 x86 build requires macOS 10.13.4. Linux: * The Linux builds need zstd to decompress, eg: ```sh theme={null} sudo apt install zstd tar xaf anki-2.1.50-linux-qt6.tar.zstd ``` * The packaged version requires glibc 2.28 or later. * A wheel is now provided for ARM64 Linux, and requires glibc 2.31 or greater. See [this page](https://betas.ankiweb.net/#via-pypipip) for instructions on using it. * Both Fcitx4 and Fcitx5 support is now bundled. ### Qt6 Please see the notes for your platform: * [Windows](/manual/platform/windows/installing#qt5-vs-qt6) * [Mac](/manual/platform/mac/installing#qt5-vs-qt6) * [Linux](/manual/platform/linux/installing#qt5-vs-qt6) ### Scheduler Changes The V1 scheduler is no longer supported. If you have not yet updated to V2 or V3, you will be prompted to update when you attempt to review cards in 2.1.50. This release includes a number of improvements to the V3 scheduler, mostly thanks to Rumo: * Intermediate deck limits now affect their children. Please see the [scheduler page](/faqs/the-2021-scheduler#daily-limits) for more info. * When new cards are answered, Anki now records their original position. When you later export a shared deck without scheduling, the original positions will be restored. * The Forget action now gives you options to restore the original card position, and to reset the card's lapse and repetition counters. * The gathering and sorting of new cards has been reworked, trading a little performance for more intuitive behaviour: * It is now possible to sort notes or cards randomly at gather time, ensuring a random ```text theme={null} selection is taken from all available new cards. ``` * The gather order and sort order options have been simplified, but should offer the same ```text theme={null} functionality as before. Please check your deck options after upgrading, as some users may need to adjust their display order settings to match what they were using before. ``` * The overview screen now shows how many cards will be buried. * Added a separate option to control burying of interday learning siblings. * Fixed interday learning siblings not being buried during review, causing them to reappear later after actions like an edit. * If you have more than 2 learning steps, after the first step, Hard repeats the previous delay, instead of being the average of the previous and next step. * When a Hard learning step exceeds a day, it is now rounded to a full day, so the delay does not vary depending on the time of day you answer. * Fuzz is applied more evenly now, especially with smaller intervals. * Fixed new cards not decrementing the review limit, which could lead to more new cards appearing after the review limit was reached. * Review cards and new cards are now interspersed more evenly. * When using Custom Study to extend deck limits in the V3 scheduler, parent/child limits of the selected deck are no longer adjusted. ### Editor Changes Most of these changes are thanks to Henrik. * A redesigned editing area, and a redesigned tag editor. * MathJax has a live preview. * HTML source and rendered text can be viewed at the same time. * The HTML editor now matches the current Anki theme. * Images can be resized within the editor. * Fields can now have an optional description/tooltip assigned to them (thanks to Matthias, Henrik & Rumo). * The "remove formatting" button now offers a choice of what to remove. * Adjust color picker shortcut, and apply color when different color selected. * Reduced editor button size on Windows/Linux (thanks to Matthias). * Fixed IME input after pressing tab. * Fixed media files not being inserted at cursor position on Windows. * Cloze shortcut correctly positions cursor. * Added a separate cloze button to repeat the current cloze. * Lots of behind-the-scenes changes and fixes. Because of the extensive changes, some add-ons that modify the editing screen will have broken (see the developers section below) ### New Features * Anki will now switch to day or night mode automatically depending on your system settings. You can force day or night mode in the Preferences screen. (thanks in large part to Rumo). * Reworked backup handling (mostly thanks to Rumo): * Backups are created much faster than they were previously. * Anki can now create backups periodically. The default is every 30 minutes; you can adjust this in the preferences screen. * There are new options in the preferences to control the number of daily, weekly and ```text theme={null} monthly backups you'd like to retain. ``` * The File menu now has an option to create a backup immediately. * Because the backup storage format has changed, backups created with 2.1.50 will not be ```text theme={null} importable into older Anki versions. ``` * Reworked .colpkg import/export (thanks to Rumo): * When exporting, you can optionally target Anki 2.1.50+. When doing so, ```text theme={null} imports and exports are faster, and media files will be compressed, but the resulting .colpkg will not be readable by older Anki clients. ``` * Collections are now checked for corruption when importing. * An option to ignore accents in searches by default has been added to preferences screen (thanks to Abdo). * The Card Info screen now updates automatically as you change to a different card (thanks to Rumo). * Added a View menu to the main window and browse window (thanks to Rumo). The view menu provides options to zoom in and out, and to toggle a full screen mode. Due to technical issues, the full screen mode is not currently available on Windows when graphics acceleration is enabled. * A new TTS tag format that allows you to combine extra text and multiple fields, such as `[anki:tts lang=en_US]Here is {{Field1}} and {{Field2}}[/anki:tts]` (thanks to Rumo). There are no plans to deprecate the old TTS syntax - either can be used. * Added an option to add/remove sidebar tag to selected notes (thanks to Rumo). * Be smarter about mapping existing text to new fields when switching notetypes in the Add screen (thanks to Abdo). * Apkg files can now be dragged on the main window to import them (thanks to Abdo). * Added a "Create Copy" option in the browse screen and review screen, to copy selected note's contents into the Add window (thanks to Rumo). * You can now search for tags by regular expression (thanks to Rumo). One use for this is locating notes that are tagged with a `parent` tag, while not matching ones tagged with `parent::child`: `tag:re:^parent$`. * When switching Anki versions, an add-on update check is run on startup (thanks to Rumo). * Make links with `target=_blank` work (thanks to Danish). * Added "Forget Card" action to review screen (thanks to Araceli). * Added Belarusian and Odia to available languages in the preferences. * Added a silent option (/s) for the Windows uninstaller (thanks to Patric). * Added tooltips to some browser columns (thanks to Rumo). ### Other Improvements * Added a "Learn" label to the learning counts in the deck list. * Added shortcut keys for creating lists and indentation (thanks to Rumo). * Allow longer maximum answer times in the deck settings (thanks to Bruce). * Behind-the-scenes improvements to the deck and notetype selectors (thanks to Sam). * Change cards/notes toggle to Ctrl/Cmd+Alt+T to avoid conflict on macOS. * Changed the "Previous Card Info" shortcut to avoid a conflict with language input. * Colpkg imports now always require a full sync. * Deck creation in the custom study screen has been reworked, and now supports undo properly (thanks to Rumo). * Don't show error when gsettings exists but does not have a GNOME theme set (thanks to Spooghetti420). * Don't show error when Windows color scheme setting is missing (thanks to qxo). * Fall back on regular file deletion when no recycling bin/trash folder is available on Linux. * Filtered decks in 'order added' now sort by card template. * Fix deck name not updating after deck/notetype renamed (thanks to Hikaru). * Fixed "tag duplicates" possibly operating on stale data (thanks to Ren). * Fixed a number of issues with the preview window (thanks to Hikaru). * Fixed AltGr triggering Ctrl+Alt shortcuts on Windows (thanks to Rumo) * Fixed an error loading the old deck options screen when using Python 3.10. * Fixed an error that could appear when clicking on the sidebar (thanks to qxo). * Fixed an error that could occur in the browser when switching profiles (thanks to Hikaru). * Fixed an error when an installed TTS voice on Windows supported multiple languages (thanks to Rumo). * Fixed an error when exporting a collection with media files in it with very old modification dates (thanks to gnnoh). * Fixed an intermittent error when building on Windows. * Fixed error shown when double-tapping answer buttons on the v3 scheduler. * Fixed errors and display issues when flagging and undoing in the review screen. * Fixed external scripts being executed out of order (thanks to Hikaru). * Fixed field content sometimes spilling outside container (thanks to Hikaru). * Fixed flicker in review screen when referencing external js, and preload css files (thanks to Hikaru). * Fixed incorrect card count in timebox after undo (thanks to Abdo). * Fixed new card position appearing as a date when cards were in preview (thanks to Abdo). * Fixed newly-added deck not being selected in the Add screen (thanks to Hikaru). * Fixed quotation of "and" and "or" in search (thanks to Rumo). * Fixed some parts of the media handling code matching more HTML tags than it should have (thanks to Brayan). * Fixed sound failing to play after exporting a collection (thanks to Rumo and Kelciour). * Fixed the deck list showing up blank in collections with many expanded decks. * Fixed the main window sometimes failing to load properly when Anki starts (which could lead to blank windows, a giant sync icon, etc). * Fixed unwanted `
` being left behind when deleting field contents (thanks to Hikaru). * Fixed various memory leaks (thanks to Rumo and Hikaru). * Flip sidebar location in RTL mode (thanks to Abdo). * Hide "open new window" action in GNOME (thanks to Fusion future & Felipe) * Improve search highlight color in templates screen (thanks to Abdo). * Improved display of the card info screen (thanks to Rumo). * Improved localization of large numbers in the graphs, and various layout tweaks (thanks to Vova). * Improved performance with large selections in the Browse screen (thanks to Rumo). * Improvements to the Change Notetype screen (thanks to Matthias). * Performance improvements for searching through many fields with a wildcard search (thanks to Rumo). * Randomized card positions now start at 1, which avoids a corner case in filtered deck scheduling. * Reduced flicker when opening browser in night mode (thanks to Rumo). * Report correct count in timebox screen with v2 scheduler (thanks to Abdo). * Rows with database inconsistencies in the browse screen now prompt you to use "check database" instead of saying they were deleted (thanks to Rumo). * Some behind-the-scenes code improvements (thanks to Sam). * Support autoplay in audio tags again (thanks to Andreas). * Support Markdown inside HTML tags in config.md (thanks to Abdo). * The 'future due' graph no longer shows learning cards in a filtered deck as being due a long time ago. * The `note:` and `card:` searches no longer do a substring match (thanks to Rumo). * The Add Cards screen will no longer allow accidental triggering of main window shortcuts when it is open on a Mac (thanks to Rumo). * The calendar graph uses consistent coloring as years are changed (thanks to Ryan). * The custom study screen no longer (sometimes incorrectly) limits the amount you can extend the daily limits by. * The top and bottom bars will no longer zoom in/out, but the main area and editors can be zoomed in and out (thanks to Rumo). * Truncate deck names in the deck list if they are too long (thanks to Sachin). * Tweaks to the sidebar icons (thanks to Henrik). * Updated translations - thanks as always to all the translators. * Use white menubar on Windows (thanks to Rumo). * Various behind-the-scenes fixes (thanks to Arthur). * Various improvements to right-to-left display (thanks to Abdo). * When Anki encounters an issue with a card template, it now provides a link to a help page with more information (thanks to Rumo). * Numerous other fixes and contributions, thanks to Rumo, Henrik, Abdo, Matthias, Evandro, Arthur, Soren, BlueGreenMagick, Yoshi, Jakub, Gesa, blue-putty, stopendy, TheFeelTrain and zjosua. ### For Developers * Anki now requires Python 3.9. * Anki contains some compatibility shims that should allow many add-ons written for PyQt5 to work with PyQt6 as well (thanks to Aristotelis). These shims will not remain forever, so it is recommended that you update your add-ons to be compatible with Qt6 without shims. The two main breakages are the renaming of PyQt5 to PyQt6 (you can support both by importing from aqt.qt instead), and the requirement that [enums are qualified](https://github.com/ankitects/anki/pull/1406/commits/a7812dedc096627692ab3d7e64b90be632f52134). * If you’re using Qt Designer to generate UI files, the Qt5 and Qt6 versions need to be generated and bundled separately if you want to support both at once. * PyQt6 does not support the Qt resource system (pyrcc was removed), so Anki now uses a different approach, and urls like `:/icons/foo.jpg` should become `icons:foo.jpg`. * Henrik has spent a lot of time working out how to smoothly provide an API for the editor, and investigating how we can provide types to make targeting the API easier. This has required a number of refactorings, and some add-ons that were accessing the editor will have broken in this update. While the code is not set in stone yet, hopefully we're getting there. An example of using the latest API is available here: [https://github.com/hgiesel/anki\_new\_format\_pack/commits/master](https://github.com/hgiesel/anki_new_format_pack/commits/master) * The way Anki is packaged has changed. Most of the standard library should be available now. If you notice any problems importing standard libraries that previously worked, please let us know. * The aqt package no longer depends on PyQt, as either version 5 or 6 is supported. You can specify the major version you want when installing - eg `pip install 'aqt[qt6]'` * manifest.json now supports a 'homepage' argument (thanks to Abdo) * `mw.progress.timer()` should now be passed a `parent` argument, as the previous default of using `mw` prevents the timers from being freed after they are no longer active. If you want a permanent timer, pass `mw` in as the parent. * Improved Python code completion/type handling in VS Code (thanks to Rumo). # Changes in 2.1.60 to 69 Source: https://docs.ankiweb.net/releases/changes/changes/2.1.60-66 ## Changes in 2.1.66 * Windows and Mac builds have been updated to the latest toolkit version, which will hopefully fix some crashes/bugs. * The v3 scheduler is now the default for new users. * When imports complete, a summary window is now shown (thanks to Abdo). * Use a different approach for detecting copy+paste from Anki fields, which may fix some crashes. * The minimalist/reduce motion toggles should no longer affect card content. * Media check now automatically extracts images that have been embedded in fields. * Handle importing of legacy AnkiDroid backups. * The built-in sync server can now be built without Python if you prefer. * Add keyboard shortcut for legacy stats (thanks to Luc). * Accessibility improvements (thanks to Derek and Kenny). * Fix addon update dialog showing twice (thanks to Rumo). * Fix bold toggle not working in certain circumstances (thanks to mmjang). * Align code blocks to left (thanks to shunlog). * Make weekday font smaller for Chinese locale (thanks to mmjang). * Improve performance of invalid ID fix in DB check. * Fix main window geometry/state not being restored in some cases (thanks to Abdo). * Handle invalid float mtimes in DB check. * Fix total note count not being logged in apkg import. * Report actual error when DbError occurs. * Fix two issues with MathJax editor (thanks to Hikaru). * Don't fail silently when an empty csv is imported. * Fix two issues that can cause editor fields to behave incorrectly (thanks to Hikaru). * When cards are in intraday learning queue, don't use original due. * Fix "Add-ons possibly involved" message never appearing on Windows (thanks to Abdo). * Add partial support for Hangul keyboard shortcuts during review (thanks to Christopher). * Disable add-on buttons when no field is focused by default (thanks to Abdo). * Fix toggleable editor button styles (thanks to Abdo). * Fixed a sporadic error in the review screen (thanks to mjuhanne). * Fixed an error that could occur when syncing between newer and older clients. * Fixed tab order in find\&replace screen (thanks to Gabriel). * Various other minor fixes and behind-the-scenes changes. Dev related: * Fix incorrect handling of locals in debug console (thanks to Rumo). * Add did-add-field-hook analogous to did-delete-field (thanks to 3ter). * Fix run-qt5.15.bat (thanks to Hikaru). * Support more mime types for add\_extension\_based\_on\_mime (thanks to BenYip). * Make set\_config\_help\_action work with submodules (thanks to Abdo). * Exclude Fabric's large canvas dependency (thanks to Kavel). ## Changes in 2.1.65 * Default to current deck in csv import if settings allow it. * Disable Toggle Bury when nothing is selected (thanks to Abdo). * Fix broken window styling when installation path includes certain Latin1 chars on Windows. * Fix illegible tooltips when system in dark mode on some Linux installs. * Fix incorrect font sizes on X11 when fractional scaling in use. * If the old Anki uninstaller fails, allow installation to proceed. * Improve phrasing in dialog that asks which deck's options should be shown (thanks to chrissy0). * Fix some add-on installation errors not being reported (thanks to Abdo) * Add add-on installation hooks (thanks to Abdo). ## Changes in 2.1.64 Functional changes: * The Windows installer no longer requires admin access (thanks to Martin). The first time you update, you'll need to run the installer again after uninstall completes. * Allow the user to configure answer keys in the preferences, fixing conflicts (thanks to Ren). * Preload embedded fonts to prevent flicker, and tweak wait time for image preloading (thanks to Hikaru). * Add the ability to search for FSRS scheduling properties, eg. `prop:cdn:d>0.5` to search for the difficulty > 0.5. * Window positions, state and browser headers are now reset each time the Qt version changes, which should fix a number of crashes that users were reporting. * Add-on shortcuts will now override Anki defaults (thanks to Ren). Fixes: * Fix media files being imported incorrectly when importing an .apkg file exported without support for older Anki versions. * Increase the number of supported fields in the editor (thanks to Hikaru). * Attempt to work around intermittent color setting failures in Qt6.5 on macOS. * Fix ugly text rendering on Wayland when using fractional scaling. * Fix inability to import csv when path contains single quote. * Show an error pop-up when csv import screen fails to load. * Don't disable animations on card templates when reduce motion is on. * Fix an error in the console when resizing windows (thanks to Austin) * Fix a panic when user sets a huge learning step. * Fix page scrolling when input box loses focus (thanks to Hikaru). * Fix failure to start on Windows when path contains non-Latin text. * Fix due/ivl prop queries not working in filtered decks. * Make some collection methods public in the Rust API (thanks to Joel). ## Changes in 2.1.63 * Add alternative review shortcuts (h,j,k,l,u) (thanks to Ren). * Add an option in the preferences to stop spacebar from rating card (thanks to Ren). * Prevent change in image aspect ratio in editor when images have an explicit size set (thanks to Matthias). * Fix custom sync URL not working with subpaths (thanks to XeR). * Fix fcitx5 failing to work in Linux Qt6 build. * Fix some buttons in the deck options screen being illegible when hovering. ## Changes in 2.1.62 * Update macOS/Linux builds to Qt 6.5, and update Windows build to Qt 6.4.3. * The minimum macOS version for the Qt6 build is now macOS 11. * If you are on Linux and don't have ANKI\_WAYLAND set, you may need to install ```text theme={null} libxcb-cursor or Anki will fail to start. Eg on Debian/Ubuntu: sudo apt install libxcb-cursor0 ``` * Add an option to fully randomize reviews in the V3 scheduler. * Add a new option to the card templates screen to restore a notetype to the default fields/templates/styling. * Add clearer tooltip to hourly breakdown graph (thanks to Rumo). * Fix focus loss when closing HTML editor (thanks to Hikaru). * Prevent MathJax editor from closing when you selected text with the mouse and released the mouse button outside the window (thanks to Hikaru). * Pass original deck name to custom scheduling code, instead of filtered deck name. * When importing an .apkg where notetypes have changed, display a clearer message, and only if the notes in the incoming collection are newer. * Fix MathJax editor not being sized correctly (thanks to Hikaru). * Fix a flicker when dropdowns shown with reduce motion on (thanks to Hikaru). ## Changes in 2.1.61 Improvements to the V3 scheduler: * Added a global option to stop the review limit from limiting new cards (thanks to Rumo). * You can now enable review burying without new burying again (thanks to Rumo). There are some caveats - please see the bury tooltips in the deck options. * Ensure good is at least previous+1 even if low hard factor set. Other features/improvements: * You can now exclude certain fields from unqualified searches via the Fields screen (thanks to Abdo). * The tag area in the editor is now shown with a dropdown instead of a splitter (thanks to Matthias). * You can now adjust the current deck in the stats screen (thanks to yellowjello). * Add a button in the preferences to reset window sizes (thanks to Abdo). * Passing an invalid profile name on the commandline will now show profile picker instead of an error. * You can shift-click on a deck to select it as the current deck (thanks to Tobias). * You can now import decks with broken timestamps - they'll automatically be fixed on import (thanks to Rumo). * A DB check will now fix broken timestamps (thanks to Rumo). * Add time of date to browser date. * Allow Shift+Tab to move focus from tag area to last field (thanks to Hikaru). * Custom schedulers now have the deck name and random seed passed in to them, so they don't need to extract the info from the DOM (thanks to Rumo). * Improve debug console (thanks to Rumo). Fixes: * Fix stats calendar incorrect due to daylight savings time (thanks to Kieran). * Prevent the top bar from hiding in the stats page as you scroll down (thanks to Fabricio). * Reduce motion is now on by default, as it fixes an issue with the bottom bar failing to appear for some users. * Fix new limit in v3 decreasing more than it should (thanks to Rumo). * Fix current tag text not being saved when changing note via shortcut key (thanks to Hikaru). * Fix tags popover becoming separated from the tags field (thanks to Fabricio). * Ensure the bottom buttons aren't displayed until the custom scheduling code has finished running (thanks to Rumo). * Refresh study screen if the user toggles the v3 scheduler (thanks to Rumo). * Fix notetypes screen not being closable after adding a notetype on Mac. * Check for division by zero when calculating browser aspect ratio, which fixes an issue with i3 (thanks to Ben). * Fallback to Wayland if X11 is not available (thanks to Ingemar). * Tweaks to the build scripts to make packaging in distros easier (thanks to Euan). * Fix silent file save failures and bad default save path in Flatpak (thanks to Jack). * Fix HTML editor sometimes not properly sized when opening editor (thanks to Hikaru). * Fix error showing if user clicks in sidebar before it's rendered. * Fix backup creation for collections > 1 GiB (thanks to Rumo). * Fix black on grey minimalist buttons in Qt5 (thanks to Daniel). * Fix black on grey deck options on Qt5 (thanks to Daniel). * Export static references from sound tags (thanks to Rumo). * Fix packaged audio tools path on Windows (thanks to Abdo). * Fix a case where 'reduce motion' and 'minimalist mode' were switched (thanks to Daniel). * Fix panic with invalid sync server URL with port (thanks to Daniel). * Fix double scrollbars in deck options (thanks to Fabricio). * Fix images with non-Latin text and commas failing to display. * Fix editor text possibly being transfer to different notetypes (thanks to Fabricio). * Improve hover appearance of buttons (thanks to Matthias). * Fix inability to activate search in graphs screen on Android (thanks to yellowjello). * Fix an issue building on Windows (thanks to Kieran). ## Changes in 2.1.60 If updating from 2.1.57 or earlier, please see the important note in the 2.1.58 change notes. * Add button to tag notes with missing media (thanks to Rumo). * Fix slow editor startup for users with lots of fields (thanks to Hikaru). * Fix a regression in 2.1.58 that broke TTS add-ons (thanks to Rumo). * Fix HTML editor hiding when shown by default (thanks to Fabricio). * Fix some widgets not indicating they're disabled (thanks to Matthias). * Fix deck options selector not updating the current entry sometimes (thanks to Fabricio). * Fix type box losing focus when switching IMEs (thanks to Hikaru). * Fix 'toggle bury' not updating for automatically-buried cards. * Improvements to lifecycle handling for add-ons accessing Svelte components (thanks to Matthias). # Changes in 23.10 Source: https://docs.ankiweb.net/releases/changes/changes/23.10 Release: 2023-11-01 ## Notable changes * Anki's version numbering scheme has changed to year.month(.patch). * Quite a few add-ons will need updates to support this release. Some [porting notes](https://forums.ankiweb.net/t/porting-tips-for-anki-23-10/35916) are available. * Support for FSRS (which improves upon the scheduling provided by SM-2) is now integrated into Anki. You can compute the model weights directly inside Anki, and no longer need to use custom scheduling. If you have previously used FSRS, please delete the text in the custom scheduling section before enabling FSRS, and ensure the helper add-on has been updated to the 23.10 version if you are using it. By @L-M-Sherlock with help from @dae and @asukaminato0721 in [https://github.com/ankitects/anki/pull/2633](https://github.com/ankitects/anki/pull/2633), #2654 and [https://github.com/open-spaced-repetition/fsrs-rs](https://github.com/open-spaced-repetition/fsrs-rs). * Anki now has built-in support for creating image occlusions. Select the automatically-added "Image Occlusion" notetype in the add screen to use it. Glutanimate intends to update his add-on soon to work with the new system. By @krmanik, with help from @glutanimate, @hikaru-y, @abdnh and @dae in [#2367](https://github.com/ankitects/anki/pull/2367), #2485, #2600, #2602, #2649, #2689, #2705 and more. * .apkg imports are able to merge changed notetypes, and can exclude scheduling data. By @RumovZ in [https://github.com/ankitects/anki/pull/2612](https://github.com/ankitects/anki/pull/2612) * Performance improvements to things like browser loading in the official builds. * You can now customize the video driver in Qt6 in the preferences, which can help to work around graphical issues. @abdnh in [https://github.com/ankitects/anki/pull/2643](https://github.com/ankitects/anki/pull/2643) * Add an option to stop the timer on answer by @abdnh in [https://github.com/ankitects/anki/pull/2673](https://github.com/ankitects/anki/pull/2673) * Allow searching for missing custom data properties by @abdnh in [https://github.com/ankitects/anki/pull/2626](https://github.com/ankitects/anki/pull/2626) * Support searching for custom data strings by @abdnh in [https://github.com/ankitects/anki/pull/2634](https://github.com/ankitects/anki/pull/2634) * Support for the v2 scheduler has been dropped. * .apkg exports now default to the new format. * New cards can now be gathered by deck then random note. ## Smaller tweaks/fixes * Check DB now fixes invalid UTF-8 in tags. - Create Python entry points for creating and editing IO notes by @glutanimate in [https://github.com/ankitects/anki/pull/2598](https://github.com/ankitects/anki/pull/2598) - Add a backend method to add notes in bulk by @abdnh in [https://github.com/ankitects/anki/pull/2659](https://github.com/ankitects/anki/pull/2659) - Add ability to tab to DuplicateLink by @SteelColossus in [https://github.com/ankitects/anki/pull/2646](https://github.com/ankitects/anki/pull/2646) - Add profile name in profile deletion confirmation message by @chandraiyengar in [https://github.com/ankitects/anki/pull/2722](https://github.com/ankitects/anki/pull/2722) - Add Sphinx documentation generation functionality by @gsingh93 in [https://github.com/ankitects/anki/pull/2720](https://github.com/ankitects/anki/pull/2720) - added Translator by @platynowy in [https://github.com/ankitects/anki/pull/2653](https://github.com/ankitects/anki/pull/2653) - Allow full screen mode on new Qt6 drivers by @abdnh in [https://github.com/ankitects/anki/pull/2660](https://github.com/ankitects/anki/pull/2660) - Allow saving window position when window fullscreen on Qt 6 - Better error messages when csv file is in the wrong format - Change “Delete Note” shortcut to cmd+backspace by @montyevans in [https://github.com/ankitects/anki/pull/2614](https://github.com/ankitects/anki/pull/2614) - Close import log page on error by @abdnh in [https://github.com/ankitects/anki/pull/2639](https://github.com/ankitects/anki/pull/2639) - Display a more friendly message when one or more add-ons fail at startup - Do not show `[object Object]` in import log by @abdnh in [https://github.com/ankitects/anki/pull/2636](https://github.com/ankitects/anki/pull/2636) - Don't rely on the presence of revlogs to decide whether deck configs should be imported. - Fix a11y issues with Badge component by @adeleke5140 in [https://github.com/ankitects/anki/pull/2721](https://github.com/ankitects/anki/pull/2721) - Fix an error when repositioning tags (thanks to @abdnh) - Fix an issue caused by adding a colon to the start or end of a deck name by @swektr in [https://github.com/ankitects/anki/pull/2748](https://github.com/ankitects/anki/pull/2748) - Fix answer button tooltips not reflecting configured shortcuts by @abdnh in [https://github.com/ankitects/anki/pull/2657](https://github.com/ankitects/anki/pull/2657) - Fix error when closing Find Duplicates screen early by @abdnh in [https://github.com/ankitects/anki/pull/2669](https://github.com/ankitects/anki/pull/2669) - Fix intermittent browser error triggered by an early resize event by @abdnh in [https://github.com/ankitects/anki/pull/2671](https://github.com/ankitects/anki/pull/2671) - Fix misleading warning when changing notetype from/to cloze by @abdnh in [https://github.com/ankitects/anki/pull/2744](https://github.com/ankitects/anki/pull/2744) - Fix ModuleNotFoundError: No module named 'distutils' by @virinci in [https://github.com/ankitects/anki/pull/2723](https://github.com/ankitects/anki/pull/2723) - Fix pasting from external programs not working after copying text inside the editor. - Fix reversed float left/right icons - Fix some issues with undo/redo in mask editor by @hikaru-y in [https://github.com/ankitects/anki/pull/2649](https://github.com/ankitects/anki/pull/2649) - Fix typo: notetypeId → noteId by @glutanimate in [https://github.com/ankitects/anki/pull/2615](https://github.com/ankitects/anki/pull/2615) - Fix unable to save field dialog if certain fields are deleted by @swektr in [https://github.com/ankitects/anki/pull/2663](https://github.com/ankitects/anki/pull/2663) - Fix unescaped HTML in type-in-the-answer by @abdnh in [https://github.com/ankitects/anki/pull/2658](https://github.com/ankitects/anki/pull/2658) - Implemented support to audio\_did\_seek\_relative by @evandrocoan in [https://github.com/ankitects/anki/pull/2632](https://github.com/ankitects/anki/pull/2632) - Reduce shaking of bottom bar by @abdnh in [https://github.com/ankitects/anki/pull/2734](https://github.com/ankitects/anki/pull/2734) - Rework media syncing to make it a little faster, and avoid duplicate errors when your password has changed. [https://github.com/ankitects/anki/pull/2647](https://github.com/ankitects/anki/pull/2647) - Skip template checks in Fields screen by @abdnh in [https://github.com/ankitects/anki/pull/2670](https://github.com/ankitects/anki/pull/2670) - Support AVIF by @nihil-admirari in [https://github.com/ankitects/anki/pull/2630](https://github.com/ankitects/anki/pull/2630) - Support Qt.TextFormat.MarkdownText in aqt.utils by @abdnh in [https://github.com/ankitects/anki/pull/2675](https://github.com/ankitects/anki/pull/2675) - The "edit current card" window is now a main window, which fixes some shortcut keys on macOS. By @abdnh in [https://github.com/ankitects/anki/pull/2732](https://github.com/ankitects/anki/pull/2732) - Tooltips for CSV import and import page refactoring by @RumovZ in [https://github.com/ankitects/anki/pull/2655](https://github.com/ankitects/anki/pull/2655) - Tweak browser column labels to card type, note type by @Gustaf-C in [https://github.com/ankitects/anki/pull/2751](https://github.com/ankitects/anki/pull/2751) - Update to Qt 6.5.3 on Windows/Mac ## Notes for devs * If you wish to build Anki and have installed n2 in the past, please run tools/install-n2 before building. ## New Contributors * @montyevans made their first contribution in [https://github.com/ankitects/anki/pull/2614](https://github.com/ankitects/anki/pull/2614) * @nihil-admirari made their first contribution in [https://github.com/ankitects/anki/pull/2630](https://github.com/ankitects/anki/pull/2630) * @SteelColossus made their first contribution in [https://github.com/ankitects/anki/pull/2646](https://github.com/ankitects/anki/pull/2646) * @platynowy made their first contribution in [https://github.com/ankitects/anki/pull/2653](https://github.com/ankitects/anki/pull/2653) * @swektr made their first contribution in [https://github.com/ankitects/anki/pull/2663](https://github.com/ankitects/anki/pull/2663) * @meliache made their first contribution in [https://github.com/ankitects/anki/pull/2684](https://github.com/ankitects/anki/pull/2684) * @martinetd made their first contribution in [https://github.com/ankitects/anki/pull/2703](https://github.com/ankitects/anki/pull/2703) * @CarloQuick made their first contribution in [https://github.com/ankitects/anki/pull/2718](https://github.com/ankitects/anki/pull/2718) * @virinci made their first contribution in [https://github.com/ankitects/anki/pull/2723](https://github.com/ankitects/anki/pull/2723) * @chandraiyengar made their first contribution in [https://github.com/ankitects/anki/pull/2722](https://github.com/ankitects/anki/pull/2722) * @gsingh93 made their first contribution in [https://github.com/ankitects/anki/pull/2720](https://github.com/ankitects/anki/pull/2720) * @user1823 made their first contribution in [https://github.com/ankitects/anki/pull/2741](https://github.com/ankitects/anki/pull/2741) * @Gustaf-C made their first contribution in [https://github.com/ankitects/anki/pull/2751](https://github.com/ankitects/anki/pull/2751) # Changes in 23.10.1 Release: 2023-11-10 General: * Update all platforms to Qt 6.6. This change fixes Japanese input on macOS. * Fix Anki failing to run on older macOS versions. * The Linux Qt6 build requires a newer glibc, so older distros like Debian 11 won't work with it. * Fix syncserver failing to run in macOS packaged build. * Fix some potential security issues. * Fix 'creating backup' showing for longer than necessary. * Add tooltip to mask editor button. * Allow creation of empty filtered decks by @Gustaf-C in [https://github.com/ankitects/anki/pull/2788](https://github.com/ankitects/anki/pull/2788) * Add confirmation for upload when AnkiWeb collection determined empty. * Fix add-ons screen showing 'requires Anki >= 2.1.231000'. * Fix overflowing filenames displacing import button by @RumovZ in [https://github.com/ankitects/anki/pull/2806](https://github.com/ankitects/anki/pull/2806) * Fix Anki closing before 'your clock is wrong' message appears. * Hide "toggle masks" in "Hide One, Guess One" mode by @abdnh in [https://github.com/ankitects/anki/pull/2817](https://github.com/ankitects/anki/pull/2817) * Change tooltip strings for image occlusion center alignments by @snowtimeglass in [https://github.com/ankitects/anki/pull/2815](https://github.com/ankitects/anki/pull/2815) * Check video tags in media check. FSRS: * Prompt user to save preset changes before they compute FSRS weights. * Fix panic when enabling FSRS with add-on-rescheduled cards. * Add an info box so the non-linear nature of desired retention can be seen * Improve presentation of log loss and RMSE by @user1823 in [https://github.com/ankitects/anki/pull/2805](https://github.com/ankitects/anki/pull/2805) * Rename FSRS weights to parameters * Handle stability \< 0.5 in stability graph