Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: Cloze within LaTeX blocks and snippets. #1100

Open
JackHunt opened this issue Sep 27, 2024 · 4 comments
Open

[FEAT]: Cloze within LaTeX blocks and snippets. #1100

JackHunt opened this issue Sep 27, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@JackHunt
Copy link

Is your feature request related to a problem? Please describe.

No response

Describe the solution you'd like

It would be really great if cloze cards could be generated from LaTeX blocks, like so:

Pythagoras Theorem is: 
$$
{{ c^{2} }} = {{ a^{2} + b^{2} }}
$$

In the above example, I have used {{ and }} to indicate the cloze ({ and } aren't rendered in LaTeX unless escaped).

Similarly, this could work for inline LaTeX, like so:

Pythagoras Theorem is ${{ c^{2} }} = {{ a^{2} + b^{2} }}$

I have looked through the documentation, and as far as I can see, there is no way currently to achieve this, unless one were to split the LaTeX snippet like so:

Pythagoras Theorem is ==$c^{2}$== $=$ ==$a^{2} + b^{2}$==

where I have used == to indicate the cloze. Also, this would not work for more complex, multiline maths like so:

$$
\begin{align}
\left| \mathbf{u} \right| - \left| \mathbf{v} \right| &
\leq \left| \mathbf{u} + \mathbf{v} \right| \\
&{}\leq \left| \mathbf{u} \right| + \left| \mathbf{v} \right|
\end{align}
$$

Additional context

No response

@JackHunt JackHunt added the enhancement New feature or request label Sep 27, 2024
@ronzulu
Copy link
Collaborator

ronzulu commented Sep 27, 2024

Hi @JackHunt there is code in the pipeline that I believe will help.

See the section "Custom Cloze Patterns" in #943

@JackHunt
Copy link
Author

Brilliant; looks like a nice PR in the works!

@LeonelRFF
Copy link

Yes, it's true with the latest update it is now possible 👏

cloze.latex.mp4

@JackHunt
Copy link
Author

Amazing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants