TentativeConvert / LaTeX-Note-Importer-for-Anki

Add-on for the memory training program Anki, allowing to import and export notes written in LaTeX.
GNU Affero General Public License v3.0
32 stars 8 forks source link

Support for cloze deletions #9

Closed r0uv3n closed 3 years ago

r0uv3n commented 3 years ago

Thank you for this great Add-On!

Cloze deletions can be a great tool for learning mathematics (and other sciences), compare for example with this blog post. A way to include cloze deletions via a command in LaTeX (which would then be automatically converted to a cloze deletion when importing) would be great. A possible syntax could be \cloze{cloze number}{cloze text} (getting converted to {{c(cloze number)::(cloze text)}}, where parentheses just indicate variables. I believe supporting automatic numbering (so that the cloze number could be optional) would probably not be trivial, but could still be a nice comfort feature if one wanted to implement it. It seems Anki itself just uses (highest processed cloze number so far)+1 for new cloze deletions added in the editor.

TentativeConvert commented 3 years ago

Good idea! Can't make any promises, but if I do find some time to work on this addon, this will be top of the list.

TentativeConvert commented 3 years ago

With the current version, what happens if you just use Anki's syntax ({{c(close number)::(cloze text)}}) in the tex file? I understand that the cloze won't be nicely formated when compiling the tex file outside of Anki, but I guess it does nevertheless compile. Does anything go wrong in the conversion upon importing to Anki, or do you end up with a working cloze in Anki?

TentativeConvert commented 3 years ago

Having thought about this a bit, I slowly remember that there were several reasons why I decided against support for cloze deletion before.

I made extensive use of "simulated clozes" in the following deck: https://www.overleaf.com/read/jrdcnnkfvwrq

(As a final comment, in case you are still thinking about implementing support for a \cloze command yourself, it would not be universally useful to number clozes automatically upon import. Think about a scenario where you edit a tex-file that you've already imported into Anki. What if your edits include moving clozes around? How would you want the clozes to be numbered when you re-import the file into Anki and update existing cards? If you want matching clozes to get updated correctly, you'll need to number them explicitly.)

So this is a no-fix. Of course, it would be useful to describe how to "simulated clozes" in the documentation.

r0uv3n commented 3 years ago

Thank you, this is very understandable. I'll stick with the "simulated clozes".