Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Markdown equations alignment

Tags:

markdown

latex

I am writing equations in wikidocs using markdown and latex. I tried to align the equations along the equal sign but I can't find the solution. The following is the latex that I wrote currently.

$$\begin{align}
Then,\ (x+z)+t & = x+(z+t)\ (\because Rule2) \\
& = x+0_V \\
& = x\ (\because Rule3) \\
\end{align}$$

The following is the resulted equation on the wikidocs. enter image description here I found this link R Markdown Math Equation Alignment, but I still don't know what the problem is. Could you help me please?

like image 980
tesio Avatar asked Jun 07 '26 11:06

tesio


2 Answers

As $$...$$ establishes an equation math mode environment, as does \begin{align}, it is not possible to use the align environment inside $$...$$; it can only be used (in real LaTeX source, that is) outside math mode, because it wants to switch to math mode all by itself.

You should use \begin{aligned}...\end{aligned} — note ist's aligned, not align —, as that is an environment meant to be used inside math mode. As such it is suited for use inside the $$...$$ fencing.

like image 79
x a Avatar answered Jun 09 '26 12:06

x a


I ran your code on my system and it aligns just fine. Make sure you have the latest version of tools and packages installed. A minimal working example would be useful too.

like image 27
Tom Avatar answered Jun 09 '26 11:06

Tom



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!