# [luatex] How to get a \mid binary relation that grows in LuaTeX

Malte Dehling malte.dehling at uni-goettingen.de
Wed Nov 15 18:16:47 CET 2017

On Wed, Nov 15, 2017 at 03:16:45PM +0100, Hans Hagen wrote:
> On 11/14/2017 1:43 PM, Malte Dehling wrote:
> > I posted a question on tex.SE with the subject as title.  In short,
> > there is a difference in how pdflatex and lualatex handle the expression
> > $\left(a\mathrel{}\middle|\mathrel{}b\right)$.  Using pdflatex one gets
> > symmetric spacing around the vertical bar while lualatex produces more
> > space on the right.  See here for the question and an explanation in the
> >
> > https://tex.stackexchange.com/questions/401234/how-to-get-a-mid-binary-relation-that-grows-in-luatex
> >
> > Is this a bug or intentional behavior?
> A mixture.
>
> (1) middle behaves like a mixture of open and close and this was swapped so
> that's a bug
>
> (2) but ... luatex provides control over the spacing and as you inject a rel
> noad you get twice the spacing but you can tweak that with
>
>     \Umathopenrelspacing \textstyle0mu
>     \Umathcloserelspacing\textstyle0mu

Am I correct in assuming that this would have unintended side effect in
many other equations, not just spacing of \middle (and maybe \left and
\right?)

>
> (3) the good news is that you can do this:
>
>     \left( a \Umiddle class 5 | b \right)

Heel erg bedankt!  I'll use this since I only need to compile with
lualatex.  For the record, Enrico (egreg) posted an answer to my
question on tex.se, based on your reply, which works in both pdflatex
and lualatex.

Best,

--
Malte Dehling
<malte.dehling at uni-goettingen.de>