Obsidian math block's align aligns right instead of left

I want the text to be aligned to the left , for every line to start on the left and if any is too big grow to the right.
Here is the code i am using :

Things I have tried

I have tries as some posts suggested to anchor the code with & but it “deletes” the line I put it in and the format is unreadable. I have also changed align for aligned, flalign*

This is not a Obsidian/MathJax problem, it’s just how the LaTeX aligned environment works.

I’m not sure what you’re trying to do here, but generally, putting text among equations using \text{} within an aligned environment is not a good practice. Moreover, since every equation in your sequence is somewhat independent of the previous ones (i.e: they are not a system of equations), I don’t see the need for an aligned environment.

I would simply type the text intermissions as regular markdown (you can use $ in it to wrap variable names), and the equations in separate $$ displayed blocks. I.e:

$$f_i(\vec{v})=\sum_{s=1}^{J} A_{is} v_s$$

Therefore:

$$\frac{\partial f_{i}}{\partial A_{i}} = \left( 
   \frac{\partial f_{i}}{\partial A_{i 1}}, \frac{\partial f_{i}}{\partial A_{i 2}}, 
   \dots, \frac{\partial f_{i}}{\partial A_{i j}}
\right)$$

Since $f_i$ is the sum of the terms of the row $i$ of $A$ and the components of $v$

$$\frac{\partial f_{i}}{\partial A_{i}} = \left(v_1, v_2, v_3, \dots ,v_j\right) = v^T$$

However if we differentiate the $i$-th row of the output vector
with respect to a $j$ row of matrix a different to $i$

$$\frac{\partial f_{i}}{\partial A_{j}} = \left(
  \frac{\partial f_{i}}{\partial A_{j 1}},  \frac{\partial f_{i}}{\partial A_{j 2}},  
  \dots,  \frac{\partial f_{i}}{\partial A_{j J}}
\right)$$

Since for $f_{i}$  we only multiply by the elements of row $i$, 
differentiating with respect to the row $j$ does not affect the outcome

$$\frac{\partial f_{i}}{\partial A_{j}} = \vec0_{J}^T$$

Note: I also removed \pmatrix and used \left(, \right) instead, which ensures a more consistent size of the fractions inside.

This produces the following output. Note that every $$ block is by default horizontally centered:

The centered display of equations is standard practice in math and science books and papers, so it looks ok to me.

But, if you insist on having all left-aligned (which, in my opinion, looks worse), you can use this css snippet:

.math-block .MathJax {  
    text-align: left !important;
    display: inline !important;
}

And then, the result would be:

I think that at the very least a small left indentation for the displayed formulae would be necessary to make them easier on the eye. For example:

.math-block .MathJax { 
    text-align: left !important;
    display: inline !important;
    margin-left: 1em !important;
}

Result:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.