With this plugin, you can get your equations automatically numbered and reference them by their equation numbers,[1] just as in
By default, this plugin only numbers equations with backlinks (i.e. the ones that are referenced elsewhere). Alternatively, you can number all equations by turning off the option Equations - numbering > Number only referenced equations
.
An equation is not numbered when it has backlinks but all of them are embeds. This is intentional, but you can send a feature request if you want embeds to be counted as backlinks too.
Suppose you have these three equations:
Source:
$$
f(x)
$$
$$
g(x) \tag{$\ast$}
$$
$$
h(x)
$$
Rendered:
Now, insert a link to the last equation (1)
is xautomatically added to the equation and the inserted link is displayed with the corresponding equation number.
Source:
$$
f(x)
$$
$$
g(x) \tag{$\ast$}
$$
$$
h(x)
$$
Link to $h(x)$: [[#^934f5c]]
Rendered:
But we can do this without any plugins, right? All we have to do is just adding a display text manually, like so: [[#^934f5c|(1)]]
.
The problem of this naive approach is that the display text (1)
will be never updated. What if we add a link to the first equation
...Well, this plugin does it right!
Source:
$$
f(x)
$$
^05ce41
$$
g(x) \tag{$\ast$}
$$
$$
h(x)
$$
^934f5c
Link to $h(x)$: [[#^934f5c]]
Link to $f(x)$: [[#^05ce41]]
Rendered:
Note that linking to the second equation \tag{...}
and this plugin respects it.
Source:
$$
f(x)
$$
^05ce41
$$
g(x) \tag{$\ast$}
$$
^f16880
$$
h(x)
$$
^934f5c
Link to $h(x)$: [[#^934f5c]]
Link to $f(x)$: [[#^05ce41]]
Link to $g(x)$: [[#^f16880]]
Rendered:
Also observe that deleting these links remove the equation numbers.
Just like for theorem calloutstheorem callouts, you can attach some metadata to each equation via % ...
) with a yaml-like key-value pair syntax (key: value
).
The currently available keys are label
and display
. They are also available for theorems, and their functionalities are also the same as the theorem counterparts.
label
Has no effect for now. It might be used when exporting to Pandoc markdown or
display
When set, all links to this equation are displayed with this text instead of its equation number (see also: Clever referencingClever referencing).
If you are turning off Use [[Wikilinks]]
in the app settings, you will have to the live suggestion feature provided by this plugin instead of Obsidian's built-in [[
suggestion. This is because the built-in suggestion generates markdown links (i.e. []()
) in this case, but they are not suitable for dynamically updating the displayed text.
You must include at least one line break between $$ ... $$
if you want the equation to be numbered.
Otherwise, Obsidian will not recognize it as a math block.
In other words:
Good
$$
f(x)
$$
Good
$$f(x)
$$
Good
$$
f(x)$$
Bad
$$f(x)$$
Also, make sure there is an empty line under the block ID of the equation. Again, this is needed due to how Obsidian works. You can enforce this using the Linter plugin's rule "Empty Line Around Math Blocks."
You cannot insert a link to equations in callouts or blockquotes.
This is an inherent limitation of Obsidian rather than this plugin.
In version 2, equation numbers are expected to be successfully printed in PDF exports. Being a new feature, however, there might be some corner cases where it doesn't work perfectly.
If equation number printing is not successful, this plugin will show you a notification. In that case, you can run the command Convert equation numbers in the current note to static \tag{}
to explicitly insert the equation numbers as static LaTeX tags (\tag{...}
) as a quick fix.
Make sure you make a backup before running this command and undo the tag insertion after exporting finishes so that your equations can be dynamically numbered again.
align
EnvironmentYou can choose whether multi-line equations in an align
environment are numbered collectively as a group:
or individually.
Go to the Number line by line in align
section in the plugin preferences to change the current setting.
When Number line by line in align
is turned on, you can exclude a line from numbering by inserting \nonumber
, just like in