# Memrise card template \[support thread\]

**URL:** <https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233>\
**Category:** Card Design\
**Created:** [September 13, 2023, 6:25am UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233 "2023-09-13T06:25:44Z")\
**Posts on this page:** 1\
**Showing post:** 156

<div class="post-metadata">

**Author:** ![Eltaurus](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/eltaurus/32/10287_2.png) [@Eltaurus](https://forums.ankiweb.net/u/Eltaurus)\
**Post date:** [November 13, 2024, 5:49am UTC](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/156 "2024-11-13T05:49:37Z")

</div>

The template was updated to **Version 4.2** on both [GitHub](https://github.com/Eltaurus-Lt/Anki-Card-Templates) and [Ankiweb](https://ankiweb.net/shared/info/510199145) a [while back](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/154), so here is the post detailing all the improvements from the previous versions of the template. This one is rather **a big update** (probably bigger than all the other updates posted here before combined), so, hopefully, it meets the expectations for all the requests it is intended to fulfill and is worth the long wait.

 ![main 2](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/c/4/c450349d7f08e6aa8c3c495b7b07848f5cd03ca2.jpeg)

* * *

**1)** The single most significant change is the transition to a completely new system for typing and handling answers. This should keep **all the existing things working exactly as before** while removing several crucial limitations of the previous versions adding:

- **Full Anki Mobile (iOS) support**  
All the features, such as multiple-choice questions, Memrise on-screen keyboard, spelling diffs, the hing button, etc. will now be functioning on iPhones and iPads (huge thanks to rean and amaccuish for all the [assistance with testing and suggestions](https://forums.ankiweb.net/t/element-which-stores-the-solution-typed-by-the-user/45052)):  

- **Images in multiple-choice questions**  
The multiple-choice cards now work with practically any type of answers (save for audio) supporting **formatted HTML** (bold, italic, and colored text, lists, etc.), LaTeX (more on this below), and all image formats recognized by Anki (including **animated gifs** ):

- **Spelling diffs on Android** now work independently of the input device  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/0/9/095c2a355332f9f4b3dedbf4d8649941a3f13a22.png)  
This means another limitation (mentioned in the fine print of the on-screen keyboard section in [this post](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/54) and also reported by @mthierst [here](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/102)) is no longer relevant.  
🚩 Please note 🚩 , that with the new system, the **“Type answer into the card”** setting is **now mandatory** on AnkiDroid (otherwise Android keyboard won’t appear for typing):

* * *

**2) Dark mode and alternative themes**

I’ve noticed from the screenshots (posted by @khong and @HQYang in this thread as well as several other people in [GitHub issues](https://github.com/Eltaurus-Lt/Anki-Card-Templates/issues?q=is%3Aissue+is%3Aclosed)) the template doesn’t look very good when Anki is switched to the dark mode. Since Memrise itself does not have a dark color scheme, I’ve decided to make one myself and incorporate it into the template:

 ![New Dark mode](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/1/5/158495c18cd7ad1742c3b1e79d531fcf1f08a073.png)

> **For comparison, the look of the template in dark mode before the dedicated theme**
>
> ![Old dark mode](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/d/2/d239679ff0945bec1a9c87d582344edf8f84b6ae.png)

Since this style is completely original, feedback on the change would be especially welcome. This update required a major refactor of the template’s CSS, but in the end allowed making more variations very simple. For example, here is an Anki theme for the template in the light mode:

 ![AnkiCard](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/0/9/0961f0f1e7c6a2fbf9442d34f8026afb900b54f1.png)

It can be activated by typing its name in the “theme” attribute on the front of a card:

![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/4/a/4aac8ea02bd31f1dfbfa9b4b6fd45d27f06b0a3d.png)

In addition to that, a default color scheme (for the case of this attribute being left empty) and two other ones (named “Forest” and “Sunset”) are included in the template styles. Each with proper light and dark modes:

 ![Forest](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/c/0/c0e93c1df20be2b85bd139891e82384425faa7a2.png)  
 ![Sunset](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/b/d/bd3af4c5cf70d4dd300ae4050f4e65a94d8f9a2e.png)

These themes can be useful for color-coding cards with different translation directions/question types or for different courses/languages/etc. It is now possible to adjust any of the existing ones or **make a completely new theme with minimal effort** (refer to [this post for the details](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/163)).

On that note, is there anyone interested in a theme replicating **the Classic Memrise look** (circa 2014)?

* * *

**3) Alternative answers**

Alts can now be put inside any of the template fields (as requested by the Chrome extension users and also mentioned by amaxwell311 [here](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/144)). These alts function the same way as on Memrise – hidden when a field is used as a question, shown on the back of a card with smaller and fainter font, and properly processed when a submitted answer is being rated:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/e/0/e0689669bc8f2649592db730fe4484898d509423.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/9/4/948bfd89d6b8dad3e4fb434d3cf458e355697799.png)

> **To add an alt to a field**
>
> In Anki editor open HTML code of the field by pressing the ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/8/0/803d952bde0d1acaad6715c522183e5a72467182.png) icon in the top right corner, then after the main content type
> 
> ```html
> <div part="alt">
> 
> ```
> 
> and
> 
> ```html
> </div>
> 
> ```
> 
> putting the alts inside:
> 
> ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/a/8/a8455c41ec80a3734c56b141cb6235d57b6b16c2.png)
> 
> If several alts are needed, they can be separated by `|` symbol (as in the image above) or put into separate `<div part="alt">` tags. The proper styles for the alts in the editor as well as a button for automating this action will be added in the upcoming version of [the support addon](https://ankiweb.net/shared/info/884199977). The `<div part="alt">` can also be put on a card template itself (in particular, inside `<data id="correctAnswer">` for the answer checked by the template) and used to combine several different fields for each to be accepted as a valid alternative.
> 
> In the current version, only plain text (and LaTeX) works properly with the `<div part="alt">` (is there a need for other types of answers?), but it can be used with multiple-choice mode to make cards with several possible answers:

* * *

**4) LaTeX (MathJax) support**  
Per request from @Zelkii the support for LaTeX expressions (entered as MathJax) has been added, and should work on all platforms:

 ![latex copy](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/c/1/c1b83bc9891f17f8fae24aea92d8131f1d9600f7.png)

Because LaTeX syntax does not play well with the default Memrise answer evaluation rules (it requires case-sensitivity, interprets commas and semi-colons differently, ignores spaces in certain places, etc.), this is implemented as a separate answer evaluation mode, which should be explicitly activated if a math card is manually created from a basic template. This is done by adding “eq” to the list of the card classes on the front of a card (the same way the multiple-choice cards are made):  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/e/f/ef9e295077b794b2ea60acda8d4ecb5b1b8b3aab.png)  
(there is no need to add this class if a LaTeX expression is used as anything other than the answer of a card)

The LaTeX mode is not only compatible with multiple-choice questions but works well with type-in cards as well. It accordingly highlights mistakes in the LaTeX syntax of a typed expression (providing a display of a rendered typed expression to visualize differences), automatically adds enclosing `\(` and `\)` when needed, and accounts for multiple ways of typing the same equation (e.g. “x^2\_3” and “x\_3^2” are treated as identical expressions):

 ![latex 2](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/3/1/31a439558a5c5e3f03d5fa03eed0bbdfa20827a0.png)&nbsp;&nbsp; ![latex 3](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/7/0/700e86e54b455c6613a75c9a72ae85613f9e9ca2.png)

* * *

**5) Number keys in multiple-choice cards**

If you are using [the support addon](https://ankiweb.net/shared/info/884199977), since [the last update](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/153) number keys (from 1 to 0) can be used to select an answer in multiple-choice cards (as intended). This will work even with older versions of the template, as long as the addon itself is updated.

🚩 Important 🚩 : in order to make these keys available for the template the **addon removes them from the list of default Anki shortcuts**. So number keys will no longer work for rating cards “Again”/“Good”/… on other templates without additional adjustments described below (already included in the Memrise template and are not needed if you do not use anything else)

> **Required adjustments**
>
> 1. Go to `Tools` → `Manage Note Types` → Select a Note Type you need to modify → Click `Cards` (or simply click `Cards` in Anki browser when any of the cards belonging to the Note Type is selected)
> 
> 2. Switch to `Back Template` and search for “document.onkeydown” to check if your template already uses any keyboard shortcuts (most of the templates do not, in particular, none of the Anki basic templates do). Also, if there is “{{FrontSide}}” on the `Back Template` tab, the front side should be checked as well.
> 
> 3. If the “document.onkeydown” is not present on the card, simply add
> 
> 4. Repeat the steps 2-3 for each Card Type in your Note (switched at the very top of the window) and click `Save`

If you do not wish to modify other templates **this feature can simply be turned off** , by going to the add-on configs (`Tools` → `Add-ons` → `Memrise Cards (Lτ)` → `Config`) and removing all relevant keys from the “reserved keys” list.

* * *

**6)** Several improvements that **facilitate scripts and styles customization**

- There are now dedicated sections for user scripts on the front and back cards, as well as in the styling tab. This should make transferring personal modifications when updating the template’s version easier (it is planned to add the functionality making such transfer fully automatic to the support addon in the future)

- In addition to the “.large” and “.off” classes mentioned in the thread before, several other classes for common customizations were added. The full list now consists of “.large”, “.blob”, “.off”, “.desk-off”, “.mobile-off”, and “.no-alts”. Details and usage examples for each one will be provided in the upcoming customization post.

- Similarly, the template now checks several special JS variables. They are intended to be put inside the “user script” sections mentioned above, and made to control certain aspects of the scripts without digging deep into the code:

* * *

**7) ALL known bugs have been fixed**  
This includes:

- the bug with [overflowing typed answer](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/86) (reported by @JayJay )
- the bug with [formatted text breaking down](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/100) in multiple lines when inserted in the question field (reported by @asiasiaa )
- the bug with [previous typed answer reappearing](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233/79) when empty one is submitted on Android
- the bug with special HTML character codes (e.g. `&nbsp;`) incorrectly displaying in their unconverted form in the “Your answer” section on a multiple-choice card
- [the bug of Chromium-based browsers](https://stackoverflow.com/questions/62834020/span-with-double-f-strange-performance-in-chrome), which incorrectly apply CSS styles to ligatures (e.g. “ff” in the spelling diff section on the back of a card for certain submitted answers) have been circumvented
- the bug with the [text cursor not updating position after using a hint on AnkiDroid](https://github.com/Eltaurus-Lt/Anki-Card-Templates/issues/13) from GitHub issue
- as well as the bugs with [the number keys in multiple-choice cards](https://github.com/Eltaurus-Lt/Anki-Card-Templates/issues/17) and [addon configs](https://github.com/Eltaurus-Lt/Anki-Card-Templates/issues/15) covered by the dedicated point above

---

_[View the full topic](https://forums.ankiweb.net/t/memrise-card-template-support-thread/34233)._
