Remnote Latex Editor doesn't let new commands be permanent

Hi, I’m using the latex editor in Remnote, but I found out that you can only create new commands in each single box. I’d like to create new commands that help me write faster, but it doesn’t seems to be possible, as I would always have to recreate the command in each math box, and it isn’t convenient at all. Is there any way to add new commands in the overall remnote system so that the newly created commands I need multiple times can be permanent? Thank you in advance.

1 Like

Possibly relevant KaTeX (which is what RemNote uses) discussion.

2 Likes

Thank you, but how can I enable macro persistance? Because it doesn’t seem to be enabled in remnote

You can’t reuse macros right now. If you create one it only is applied to that katex box you’ve just created.

A workaround is to create some very basic latex and then link it as a rem reference. It’s not the most scalable thing though.

Honestly, it’s better practice overall to use a text expander instead of macros. I know I’m in the minority about this, but it’s the truth.

If your macros are for symbols, it’s easier to use the Unicode literal, which KaTeX renders like a command, eg α for \alpha

Actually… you can set window.KATEX_SETTINGS in the console if you really want it right now.

And make that somewhat persistent via UserScript etc.

The problem to figure out here before we make macros available in a user friendly way is how that works across multiple KBs (copy&paste, sharing, etc.). What if you share (part of) that document and the other person does not have these macros configured?
Should the Katex just not be displayed correctly (and the user has to figure them out themselves, e.g. install the correct plugin) or should we somehow bundle the macros?

2 Likes

How can I use userscript to access the macros?

Also, as for what concerns the implementation of macros for all users, what would it mean for macros to be “bundled”? Would it avoid trouble in seeing them?

I actually want to use macros to apply new commands in all of the katex boxes, as for example I would do with the “\define” = “\xLeftrightarrow{def}” to make the writing process of my stem notes more fluent and easier, that’s why I’m asking for macros.

  • You can define UserScripts that run automatically by using extensions like Violentmonkey - Chrome Web Store. It’s rather technical and I would not recommend it if you don’t love hacking around. E.g. it’s a browser extension and you need to paste the snippet manually when using the Desktop App each time.

Bundling and sharing macros:

  • You cannot just define macros in a latex block somewhere in your document. It will not be executed when you toggle it away for example. Therefore it needs to be defined globally, either similar to Custom CSS or in dedicated KaTeX settings.
  • If you share some rem it is hard to figure out which macros they are using. You’d need to somehow parse the KaTeX code yourself and that’s difficult.
  • We could just share all macros you have defined whenever sharing a something with KaTeX, but that’s like a snowball getting bigger and bigger.
  • … or we let users take care to install the correct macros themselves for the content they import. But that’s very user unfriendly and shared documents can be broken when you look at them.

@Chiara_Anna_Montecuo are you aware of Using espanso (a text expander) to automate writing LaTeX which solves quick writing, but not editing/reading the KaTeX.

As hannesfrank says, if you’re only trying to make writing easier, this sounds like exactly the situation where text expansion would work well. It’s not any harder to set up text expansion than macros.