I recently updated my Anki from version 2.1.35 (which uses MathJax 2.7) to version 23.12.1 (which uses MathJax 3). In Anki 2.1.35 I had the following simple line in my Front Template:
<script>
MathJax.Hub.Config({
# some code unrelated to my question
displayAlign: "left"
});
MathJax.Hub.Configured();
</script>
This script aligned all MathJax diplaystyle equtions (they use delimiters \[ and \]) to the left (instead of the center alignment that was used by default).
My question is how to make such left alignment in Anki 23.12.1 (which uses MathJax 3)?
I tried the following code:
<script>
MathJax.config.chtml = {
displayAlign: "left"
};
if (typeof is_already_run == 'undefined') {
is_already_run = true
MathJax.startup.getComponents();
}
</script>
This script made left alignment but it broke the rendering:
This is how this formula \[\sin(x) + \cos(x)\] looks like without using my script (default center alignment, the rendering is correct):
So, I need to fix my script somehow…