Cloze support for Math (Latex)?

Math & Symbols (ankiweb.net)

SRS tools like anki allows to create flashcards inside latex equations:
[ {{c1::360}}^\circ={{c2::2\pi}} \ radians ]

Can we have a similar functionality please? As a math student, it would be really helpful. :anguished:

I miss something like this too. Additionaly I would also love to see cloze functionality inside code blocks.

3 Likes

Looks like I have not posted my Custom CSS workaround yet:

  • Use a colorbox of a specific color for things you’d like to cloze.
  • Add regular latex clozes after your formula containing each clozed part of the formula, here {{$$F$$}} (for single variables just text might be enough: {{F}}).

image

How it looks in Queue:

Custom CSS:

.Queue .mord:not(:hover) .colorbox[style*="background-color:skyblue"] {
  z-index: 5;
}

.colorbox[style*="background-color:skyblue"] {
  background-color: #eff5fd !important;
  border-bottom: 1.5px solid #3b7cc8;
  padding-bottom: .5px;
}

See also: Enable HTML in KaTeX formulas

4 Likes

Hi,

Inspired by Spaced Repetition for Mathematics: A Quick Summary - YouTube I decided to try and write out math solutions as forward rems, one per operation performed on the math problem, but couldn’t get the card to look the way I wanted. Sure, I can use align and latex to make a block of math look good… but apparently I have to turn the editable math latex back into an image in order to do a fill-in-the-blanks on top of the image such that I can have lines 1-3 show up, hide line 4, and then show the final line 5 operation. As mentioned in the above YouTube video, one way to study math and memorize proofs is to make each line of the proof something that can be hidden and tested with.

A similar approach might work for memorizing poetry or song lyrics - just hide one line but show the rest of the stanza, and quiz yourself on the hidden line in the song or poem. That works with regular text-based clozes (fill-in-the-blank). But it doesn’t seem to work when inline equations are involved. And it would be ideal if I could use a block equation because then things would like up nicely at the equals signs. I imagine the way this could work - ideally - is that I could mark a latex block or set of nested bullets as a cloze-list – it would identify each line in a latex block math equation, and create a cloze for each line or some approach where I could use inline equations (which sometimes don’t look as nice as block ones) and use regular cards or a list of cards, where each list item is acts like a cloze/fill-in-the-blank.

Right now the only approach I can think of besides making images and using image-fill-in-the-blanks manually would be to maybe indent each line such that subsequent cards show the previous line as a parent card. This wouldn’t provide the context of the line that comes next, though…

I might normally use images, but it’s convenient to make minor edits sometimes to the steps of an equation to make steps clearer, sometimes, and making LaTeX is pretty easy if you have MathPix installed, and I don’t really look forward to having to drag and drop so many boxes one after the other to use image-based fill in the blanks/clozes.

Thanks for the interesting product. I look forward to the day when everyone can study any subject using little effort in RemNote. :+1:

Louis.

Don’t trust that my math is correct - I’m just studying this subject now, but here was one idea I had on how I wish it would work:

Imagine in the above “card” that you could hide just the equation in line 1 for example, so you saw “Simplify 1-cos^2(theta) as sin^2(theta) <> ?” but would see the rest of the lines in full – only the equation is blanked out. Or imagine only the step is blanked out, but not the equation. I’m not sure how useful the text describing the operation is, I primarily added it so that the card would feel a bit more complete. It might work best to stick to the math only.

It would maybe be ideal, if trying to remember an equation, to be on an iPad for example, and to just have some scratch space to doodle out an answer. Same if you’re trying to remember how to draw a CJK character, for example. It would help you note down what you thought the answer was when comparing. Otherwise you’d have to use scratch paper, but really, who has time to find or buy scratch paper in 2022? Let alone ink for a real pen or sharpen a pencil. :wink:

It’s fascinating that when you use the align block, you get numbering for “free” along the right side of the latex block but not for every block equation, only the ones with lines inside align blocks - e.g. \begin{align} ... \end{align}. The numbering starts by default from where it left off last time. All rather interesting if you ask me – perhaps a sneak peek at what better support for math might look like inside RemNote? E.g. more control over equation line numbering, referencing equation lines by line number, or selecting part of an equation to reference or highlight it later?

Might I also suggest a different appearance for block math equations that are part of a card - e.g. the back side of a card - that in those circumstances, you might use a grid or table to display the front side in one “block” and the back side in another “block”, side-by-side rather than one above and the other below? If you happened to have a math equation in the front side and another such block equation on the back side, your card would look pretty weird right now.

Another way of putting it, LaTeX being somewhat flexible for layout, I could almost imagine an advanced card builder with cloze support where all you do is write markdown and/or LaTeX such as in the Obsidian spaced repetition plugin, say. LaTeX’s layout support is inferior to HTML when it comes to mixing with other content, though.

For really advanced uses, let me tag the example with a video clip of the prof walking through the exercise, though that’s more useful if you had features like Descript, say. I’m waiting for someone to build Descript with LaTeX support at a price cheap enough that I can throw my lecture note-taking into it. It’d be great if I could just qucikly split a clip by which exercise or problem was worked on, and which questions might have been asked in class by students, and note when important exam info came up. Right now I’ve half a mind to import and review my lecture videos using a Video NLE app and set tags/timestamps that way.

Thought maybe I’d try Notion and Zorbi… but nope, can’t figure out how to do what I wanted to there either. Worse, Notion wouldn’t let me collapse the step-by-step solution under a math block for the problem statement - it converted a latex block to plain text when I tried to turn it into a toggle block just now, so I submitted a feature request to the Notion team. So while Notion can do a lot RemNote can’t (boards! calendars!) there are unique features to RemNote’s design too (anything can be collapsed/nested! cards are first-class!) Maybe I’ll try Obsidian & a spaced repetition plugin next. The plugin has the advantage of being open source, so I can hack it to add my line-by-line latex block cloze method to it. Or maybe I’ll try Quizlet or Anki first. The original video uses mnemosyne but it doesn’t seem to have first class Apple platform support.

Just discovered the workaround posted in Cloze support for Math (Latex)? … maybe I can get cloze to work with LaTeX in RemNote… let’s see…

Edit: Not sure if I’ve an incorrect setting somewhere. Whatever magic referenced in the above thread re. {{$$x=4$$}} as a cloze syntax for LaTeX inline or block, doesn’t seem to be working for me:

image

You can always manually break up your latex into multiple lines (i.e. shift+enter, then $$ on each new line), then add spaces on either side and cloze those. See also

1 Like

I managed to use the trick with spaces around the inline math equation to get clozes to work.

But it seems it is fragile - I was seeing a lot of the following:

I did manage to create cards that look like the following:

But it’s particularly difficult to know how much you’ve selected and once created with whitespace, how to change or properly move a cloze from one line to the next. For example - in the following card, the cloze for line two started on line one, and I can’t seem to move it easily.

image

And while trying to simply take these screenshots, I kept getting errors - highlighting that RemNote really, really isn’t designed for this task:

(I would embed another screenshot, but the forum software says I can only make 3 posts in a row.)

(As FYI, the reason I was/am making mulitple posts is because as a new user on the forum I am only allowed one attachment - e.g. screenshot - per post.)

As the title states. Currently there isn’t an option to highlight part of the latex or to cover it up in any way, thus requiring us to have to split the latex up manually. I think creating occlusion cards would be easier for the devs but honestly do whatever to get this feature in asap, I’d appreciate it very much.

The “get around” isn’t good enough, people need to be able to cloze parts of equations that are within the LaTeX that cannot be on the outside and separated.

I imagine the reason this has not been fixed by now is that it would require a lot of work to the editor or possibly the use of a different library.

Personally I have moved over to Obsidian + plugins and when I am satisfied with Remote I may come back and import all my data.

Would you mind sharing the combination of Obsidian plugins that allows to cloze parts of LaTeX? Perhaps some inspiration for the team.

Would you mind sharing the combination of Obsidian plugins that allows to cloze parts of LaTeX? Perhaps some inspiration for the team.

My setup is quite complex now, however, Anki supports latex with clozers natively. So the easiest way to be able to do that in the Obsidian editor is to use the following you can then export to Anki.
There is a SR plug-in the community plugins which adds SR and flash card features to obsidian itself. It works with a few quirks but it’s early days for that particular plug-in.

(Obsidian + Obisidian_to_Anki)+(Anki + Anki Connect)

1 Like