Available for beta testing: Math support in notes

2»
  • Amazing feature!
    Just one thing: Is there a way to customize the triggers? I might want to have inline math with double-dollar sign $$...$$, and something else for the block.
    Thank you!
  • edited November 15, 2022
    @atahanafsar: No, the delimiters aren't customizable, sorry.

    Note that we've tried to avoid accidentally triggering — e.g., you can type "$400 to $500" without it creating an inline math node.

    If you're seeing it triggered for something that you wouldn't expect, let us know.
  • edited November 16, 2022
    Speaking of delimiters, is there a reason why \[ and \] are not supported as math block delimiters? My understanding is that $$ is plain TeX, while \[ \] is preferred in LaTeX. It's not a big issue at all, I've just been using \[ and \] for about 20 years so it's what I'm personally used to (others may have different preferences). But I do think that \[ and \] is quite common out there.

    It appears that KaTeX supports it by default as well.
  • @dstillman I observe the following scenario which might not be desirable:
    Text in the notes:
    "$something $somethingelse $$"
    Rendering:
    $something \inline{somethingelse}$

    where "\inline{}" refers to the latex rendering.

    I think if there are two "$" appear anywhere in the text, and if the second one is not followed by certain characters (alphanumeric perhaps?), then inline math mode is rendered. So if I type "I will give you $400, and I am expecting you to return $ 500", then the inline math mode will be triggered for "400, and I am expecting you to return ".
  • awesome, it was very useful for me. A big thank you to the Zotero team!
  • I love this feature, great work!

    Is there any way to include a personal macro file? Either locally (to a note) or globally?
  • @jukatz9: You're talking about something like this? No, we have no plans for that.
  • @dstillman Yeah, that's what I'm talking about. Thanks for the quick response.
  • Love this! Are there any plans to include latex support also in annotations? As in the ones you put directly on a PDF.
  • Zotero devs have said in several other threads that additional features in annotations directly are quite tricky for a bunch of technical reasons, so at least not super soon.
  • > Zotero uses prosemirror-math, which is based on KaTeX. There's a chemistry extension for KaTeX, so perhaps it's possible to add support for chemical formulas.

    Apparently, KaTeX supports mhchem syntax by the mhchem extension (https://katex.org/docs/libs). But this extension isn't part of core KaTeX, so it needs to be activated separately (https://github.com/KaTeX/KaTeX/tree/main/contrib/mhchem). I hope, they will add mhchem support soon.
  • Thanks for the brilliant feature!
    I find that if I copy text to notes and the math blocks in the pasted text are not rendered directly. Is this desired or can be improved later so that the math rendering does not need to be triggered by typing sth directly after the math block?
  • There seems a bug in rendering sth like `${*}$ *`. After typing the second *, the right curly bracket would disappear.
  • @unifields
    There seems a bug in rendering sth like `${*}$ *`. After typing the second *, the right curly bracket would disappear.
    We'll fix it.
    I find that if I copy text to notes and the math blocks in the pasted text are not rendered directly. Is this desired or can be improved later so that the math rendering does not need to be triggered by typing sth directly after the math block?
    How exactly are you copying text blocks? Normally they should look exactly the same after pasting.
  • edited November 13, 2023
    @martynas_b
    How exactly are you copying text blocks? Normally they should look exactly the same after pasting.
    Indeed after pasting the text looks exactly the same, as plain text. I was expecting that the math blocks would look like math formulae, such as `$\alpha$` would appear as `α`, which however is only so after typing any character after the closing `$`.
  • Sth wrong also happens when two `_` appears in math blocks
  • AxiomOfChoice May 27, 2023
    Love this! Are there any plans to include latex support also in annotations? As in the ones you put directly on a PDF.

    adamsmith May 27, 2023
    Zotero devs have said in several other threads that additional features in annotations directly are quite tricky for a bunch of technical reasons, so at least not super soon.
    Would it be possible to write an inline math node inside an annotation, as text, and having this node automatically rendered when a note is created from annotations?
  • > Would it be possible to write an inline math node inside an annotation, as text, and having this node automatically rendered when a note is created from annotations?

    @poettli
    Yes, via the Better Notes' annotation2note, the markdown will be converted to note format, including math. But that's not available with Zotero's built-in create note from annotation.
  • @unifields The issue with * and _ interfering with math nodes is fixed in the latest Zotero 7 beta.
  • Is it possible to add the autofill function when writing equations? Just like writing latex in Overleaf or Vscode.
Sign In or Register to comment.