# [NTG-context] Bug in placeformula with framed text

Otared Kavian otared at gmail.com
Mon Jul 4 11:11:55 CEST 2016

Hi Hans,

It seems that there is a bug in the latest beta (ConTeXt  vesion: 2016.07.01 16:28) when using \placeformula with a framed text environment. The numbers for the formulas are placed incorrectly, on the left as well as on the right.
Also, as one may see in the example below the numbering of the formulas begins at 2 instead of 1 at the first instance, and at it continues at 6 instead of 4 in the second instance.

Below is an example (sorry if it is not absolutely minimal: I ran into this bug when updating a lecture notes which uses a left frame around \proclaim stuff). I attach the PDF showing the problem. I wonder whether this is related to the new features introduced recently for math frames.

The code gives correct result with ConTeXt version 2015.05.18 12:26 from TeXLive 2015).

Best regards: OK
%%% begin bug-framed.tex
\defineframedtext[ProclaimFramed]
[width=\textwidth,
frame=off,
leftframe=on,
framecolor=darkred,
rulethickness=2pt,
offset=0pt,
loffset=4pt,
roffset=4pt,
]
\defineenumeration[proclaim]
[text=,
before={\startProclaimFramed},
after={\stopProclaimFramed},
style=slanted,
title=yes,
titleleft=,
titleright={.},
alternative=hanging,
number=no,
width=fit,
right={~},
]

\definemathalignment[Lgather][n=1,align=left]

\starttext

\setupformulas[location=left]
\startproclaim{Some elementary properties of Landau notations} Let $(a_{n})_{n}$ and $(b_{n})_{n}$, as well as $(u_{n})_{n}$ and $(v_{n})_{n}$, be sequences of complex numbers. Then:
\placeformula
\startformula
\startLgather
\NC a_{n} = O(1)\; \mbox{ and }\; u_{n} = O(1) \imply  a_{n} + \lambda u_{n} = O(1) \NR[eq:O-ev-1]
\NC a_{n} = O(1)\; \mbox{ and }\; u_{n} = O(1) \imply a_{n}u_{n} = O(1) \NR[eq:O-ev-2]
\NC a_{n} = o(u_{n})\; \mbox{ et }\; b_{n} = O(v_{n})  \imply a_{n}b_{n} = o(u_{n}v_{n}) \NR[+]
\stopLgather
\stopformula
\stopproclaim
\blank
\hairline
\blank

\setupformulas[location=right]
\startproclaim{Some elementary properties of Landau notations} Let $(a_{n})_{n}$ and $(b_{n})_{n}$, as well as $(u_{n})_{n}$ and $(v_{n})_{n}$, be sequences of complex numbers. Then:
\placeformula
\startformula
\startLgather
\NC a_{n} = O(1)\; \mbox{ and }\; u_{n} = O(1) \imply  a_{n} + \lambda u_{n} = O(1) \NR[eq:O-ev-1]
\NC a_{n} = O(1)\; \mbox{ and }\; u_{n} = O(1) \imply a_{n}u_{n} = O(1) \NR[eq:O-ev-2]
\NC a_{n} = o(u_{n})\; \mbox{ et }\; b_{n} = O(v_{n})  \imply a_{n}b_{n} = o(u_{n}v_{n}) \NR[+]
\stopLgather
\stopformula
\stopproclaim

\stoptext
%%% end bug-framed.tex

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug-framed.pdf
Type: application/pdf
Size: 17956 bytes
Desc: not available
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20160704/d54238ef/attachment-0001.pdf>