-
-
Notifications
You must be signed in to change notification settings - Fork 303
Description
Brief outline of the enhancement
\predisplaydirection is a primitive register which is internally set at the start
of every display math construction.
Usually it is set to 0, but if the direction before a display
differs from the equation direction it is set to -1.
It is probably the only primitive related to directions that both
e-TeX and LuaTeX has (it does not require \TeXXeTstate to be initialized).
It appears the consensus is that \leqno should be typeset on the left, and \eqno
on the right side, but because by default equation number side is influenced by the direction
before the display (\pardir in LuaTeX, and \beginR in e-TeX) \eqno side can vary, and so
packages like babel and bidi patches things to accommodate that.
LaTeX already redefines \eqno and \leqno, so they alraedy don't have their primitive
meaning. I propose to change their definition to test for \predisplaydirection, something like
\protected\def\eqno{\ifnum\predisplaydirection=\m@ne\@kernel@leqno\else\@kernel@eqno\fi\aftergroup\ignorespaces}
\protected\def\leqno{\ifnum\predisplaydirection=\m@ne\@kernel@eqno\else\@kernel@leqno\fi\aftergroup\ignorespaces}or have a socket in a proper place, to reduce the need for patching.
Minimal example showing the current behaviour
\RequirePackage{latexbug} % <--should be always the first line (see CONTRIBUTING)!
\documentclass{article}
\begin{document}
\pardirection=1\textdirection=1
\begin{equation}
1+1=2
\end{equation}
\end{document}Minimal example showing the desired new behaviour
\RequirePackage{latexbug} % <--should be always the first line (see CONTRIBUTING)!
\makeatletter
\protected\def\eqno{\ifnum\predisplaydirection=\m@ne\@kernel@leqno\else\@kernel@eqno\fi\aftergroup\ignorespaces}
\protected\def\leqno{\ifnum\predisplaydirection=\m@ne\@kernel@eqno\else\@kernel@leqno\fi\aftergroup\ignorespaces}
\documentclass{article}
\begin{document}
\pardirection=1\textdirection=1
\begin{equation}
1+1=2
\end{equation}
\end{document}