-
Notifications
You must be signed in to change notification settings - Fork 407
Treat IEEEeqnarray as a math environment #1796
Description
Issue
IEEEtrantools.sty provides a multiline aligned equation environment, IEEEeqnarray. Both IEEEeqnarray and its starred variant, IEEEeqnarray* should be treated as math environments by vimtex.
Could you please make vimtex properly handle these environments?
IEEEeqnarraybox
This was brought up before in #1637, but dropped due to lack of response. In there, IEEEeqnarraybox was also brought up --- I haven't used it before, but may begin to.
It appears there are 6 forms of this environment:
IEEEeqnarraybox, IEEEeqnarrayboxm, and IEEEeqnarrayboxt, as well as their starred variants, IEEEeqnarraybox*, IEEEeqnarrayboxm*, and IEEEeqnarrayboxt*
From IEEEtrantools.sty, line 2129 (on my system):
% \IEEEeqnarraybox is like \IEEEeqnarray except the box form puts everything
% inside a vtop, vbox, or vcenter box depending on the letter in the second
% optional argument (t,b,c). Vbox is the default. Unlike \IEEEeqnarray,
% equation numbers are not displayed and \IEEEeqnarraybox can be nested.
% \IEEEeqnarrayboxm is for math mode (like \array) and does not put the vbox
% within an hbox.
% \IEEEeqnarrayboxt is for text mode (like \tabular) and puts the vbox within
% a \hbox{$ $} construct.
% \IEEEeqnarraybox will auto detect whether to use \IEEEeqnarrayboxm or
% \IEEEeqnarrayboxt depending on the math mode.
% The third optional argument specifies the width this box is to be set to -
% natural width is the default.
% The * forms do not add \jot line spacing
% usage: \IEEEeqnarraybox[decl][pos][width]{cols}
Suggested behavior
Now, in reading I've realized that all of the environments mentioned actually use text mode or math mode on a per-column basis, dependent on the column specifier. The modes for each column are described in Table IV of this document, on page 19. It would be wonderful if vimtex could handle this properly, but I imagine it would be difficult or impossible to implement.
If properly handling the mode of each column is infeasible, I suggest the following behavior:
IEEEeqnarray: math modeIEEEeqnarraybox: take mode of surrounding environmentIEEEeqnarrayboxt: text modeIEEEeqnarrayboxm: math mode
and the same for the starred variant of each of these, for a total of 8 environments.
minimal.tex
\documentclass{minimal}
\usepackage{IEEEtrantools}
\begin{document}
%%% standard usage
\begin{IEEEeqnarray}{rCl}
1\cdot1 &=& 1 \\
1 &=& 1\cdot1
\end{IEEEeqnarray}
\begin{IEEEeqnarray*}{rCl}
1\cdot1 &=& 1 \\
1 &=& 1\cdot1
\end{IEEEeqnarray*}
%%% column-specific modes
\begin{IEEEeqnarray}{sl}
text & math
\end{IEEEeqnarray}
\end{document}Thank you for all the work that goes into this plugin, I very much appreciate it. If there's anything else I can provide, please let me know, I'd like to help as much as I'm able.
P.S. I seem to remember reading an issue a while back asking about users being able to define custom environments as math mode. I don't remember seeing a resolution though; does vimtex have this feature in userland?
Edit: This is probably more of a feature request than a bug, but I can no longer change the label. Apologies.
Edit 2: To clarify, all 8 environments change mode depending on the column specifier, including the basic IEEEeqnarray.