i am new to Obsidian and I am trying to use Latex syntax in my notes. I have a strange issue since I was wondering why I am not able to have equations that are centered in the middle of the text…
Basically what I am used to do is typing the double $$ and then write the equations. For instance:
$$\cos{x}$$
But then the equation is written aligned on the left of the page …
In fact, Atom is the only theme with this behavior as far as I know. So almost any theme other than Atom is likely to be fine.
And importantly, you don’t even have to give up Atom. You can customize/adjust a single part of a theme using CSS snippets.
In this case, create the following .css file under <root of your vault>/.obsidian/snippets and enable this snippet in the Appearance settings (see the link above for details).
mjx-container[display="true"] {
text-align: center !important;
}
Thank you a lot @ush for your help : I followed your instructions and it worked for me. Sorry for such a newbie request : I am not familiar with obsidian yet !
I updated the snippet because the older version targeted every math element regardless of its type (inline/display). Now it only styles display math (i.e. $$ ... $$).