-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use "align" environment to wrap math equations instead of "gather" #2254
Conversation
if not ret: | ||
return '' | ||
return '\\begin{gather}\n' + '\\\\'.join(ret) + '\n\\end{gather}' | ||
if label is not None or numbering: | ||
env_begin = r'\begin{align}\label{%s}' % label |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
\label{None}
will be generated here if label is None and numbering(math_number_all
) is True.
Now, master branch has broken. Input:
This PR fixes the problem same time. it looks good. But I don't know about the difference between |
Using align brings the benefit when multiple math equations are in one math directive, alignment is provided. We also use "aligned" to wrap the equations since in this way all the equations will be given only one label/tag, while previously only the first equation is labeled.
@tk0miya I've updated the PR so None label would not be generated.
|
For example, the following LaTeX source: \documentclass{article}
\usepackage{amsmath}
\begin{document}
Align:
\begin{align}
\begin{aligned}
\begin{split}a &= b + c\\ &= d + e\end{split}
\\\begin{split}x + y &= z \\ &= u \end{split}
\end{aligned}
\end{align}
Gather:
\begin{gather}
\begin{aligned}
\begin{split}a &= b + c\\ &= d + e\end{split}
\\\begin{split}x + y &= z \\ &= u \end{split}
\end{aligned}
\end{gather}
\end{document} You can view the difference here. It also makes sense semantically when multi equations grouped together in a math directive in Sphinx are aligned. |
Thank you for the thorough explanation. I understand clearly. |
BTW, I found this article:: This says using |
Also (without having taken a closer look) keep backwards compatibility in mind please. |
@tk0miya Yes, Actually I think that |
Thank you for comment. Finally, I vote +1 to this again. |
shall we merge this? :) |
no objections? I will merge this in Sunday. |
Also I believe the tag |
Oops. You're right. |
Use "align" environment to wrap math equations instead of "gather"
Thank you always! |
This is a follow-up commit of sphinx-doc#2254, which supported alignment of multiple equations for imgmath and LaTeX output.
This is a follow-up commit of sphinx-doc#2254, which supported alignment of multiple equations for imgmath and LaTeX output.
Using align brings the benefit when multiple math equations are in one math directive, alignment is provided. We also use "aligned" to wrap the equations since in this way all the equations will be given only one label/tag, while previously only the first equation is labeled.