Custom LaTeX commands

It would be nice to store a list of user-defined commands to be loaded into each LaTeX block.

When I work on my regular .tex files, I like to define shortcuts such as \N for \mathbb{N}, \zo for {0,1}, etc.

there is plugins now for this

I think the OP is looking for something like this:

1 Like

Hi!

I wrote a plug in for speeding up latex math typing, and I have recently included a custom shorthand function, so that you may use any two-letter shorthand to denote any latex expression.

The plugin can be found in community plugin list with the name “quick latex for obsidian”
You may customize your own shorthand within the plugin settings page.

And here is the source code:

Hope this might meet your needs~

2 Likes

Hi everyone, I wrote a new plugin that adds even more powerful preamble support to Obsidian.

What’s most appealing about this plugin is that it allows you to switch preambles based on different note paths.

For example, you can use two different definitions of the expectation operator \E{} in two different folders, like so:

  • preamble 1: applied to “Textbook 1” folder
\newcommand{\E}[1]{\mathbb{E} \left[ #1 \right]}
  • preamble 2: applied to “Textbook 2” folder
\newcommand{\E}[1]{\mathbf{E} \left( #1 \right)}