ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* extra white after equation
@ 2011-11-13 13:57 Hans van der Meer
  2011-11-13 22:11 ` Meer, H. van der
  0 siblings, 1 reply; 2+ messages in thread
From: Hans van der Meer @ 2011-11-13 13:57 UTC (permalink / raw)
  To: ConTeXt NTG

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

I find that the placement of an equation number makes a difference on the amount of white after the equation. Should they both give the same amount of whitespace? Or is the difference intentional? But then why?
I add a minimal example.

Hans van der Meer

% Test white after formula with and without equation number.
\starttext
\input tufte
\placeformula\startformula a^2 + b^2 = c^2 \stopformula     % no extra white
\input tufte
\placeformula[-]\startformula a^2 + b^2 = c^2 \stopformula  % extra white
\input tufte
\stoptext


[-- Attachment #2: equationwhite.pdf --]
[-- Type: application/pdf, Size: 32170 bytes --]

[-- Attachment #3: Type: text/plain, Size: 3 bytes --]





[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: extra white after equation
  2011-11-13 13:57 extra white after equation Hans van der Meer
@ 2011-11-13 22:11 ` Meer, H. van der
  0 siblings, 0 replies; 2+ messages in thread
From: Meer, H. van der @ 2011-11-13 22:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen


[-- Attachment #1.1: Type: text/plain, Size: 2555 bytes --]

I guess I have found the culprit in the bad placement of formulas without an equationnumber.

The minimal example I used is that found in strc-mat.mkiv, added a [-] in the middle one.
\setuppapersize[A6][A6]
\setupformulae[spacebefore=0pt,spaceafter=0pt]
% <HERE REDEFINED \dododoformulanumber>
\starttext
\placenamedformula[one]{first}  \startformula a = 1 \stopformula \endgraf
\placeformula[-]                   \startformula a = 2 \stopformula \endgraf
\placenamedformula     {second} \startformula a = 3 \stopformula \endgraf
\stoptext

It appears that in the case of an absent equationnumber extra stretching takes place at the position of the (now absent) equationnumber. Placing phantom ()'s remedies this. The effect is best seen by enabling the \rlap{\tracedformulamode}%-line.

May I ask Hans to take a look and change it in the next beta if this indeed a correct solution? For my suggestion for the change see below.
Thanks in advance.

Hans van der Meer




On 13 nov. 2011, at 14:57, Hans van der Meer wrote:

> I find that the placement of an equation number makes a difference on the amount of white after the equation. Should they both give the same amount of whitespace? Or is the difference intentional? But then why?
> I add a minimal example.
>
>

Output (1) as in Context ver: 2011.11.04 14:15 MKIV
Output (2) with redefined \ dododoformulanumber

% lines 240+ in strc-mat.mkiv
\def\dododoformulanumber
  {\ifconditional\handleformulanumber
     \hbox\bgroup
       % main counter
       \ifconditional\insidesubformulas
         % nothing
       \else
         \ifcase\formulasnumbermode
           \ifcase\placeformulanumbermode
             \dohandleformulanumbering
           \or
             \dohandleformulanumbering
           \or
             % nothing THIS SEEMS BAD
 \phantom{()}% THIS GIVES CORRECT SPACING
          \or
             \dohandleformulanumbering
           \fi
         \or
           \dohandleformulanumbering
         \or
           % nothing
         \or
           \dohandleformulanumbering
         \fi
       \fi
       % subcounter
       \ifconditional\insidesubformulas
         \ifcase\subformulasnumbermode
           % nothing
         \or
           \dohandlesubformulanumbering
         \or
           % nothing NOT CHECKED BUT PROBABLY SAME AS ABOVE
 \phantom{()}% PROBABLY HERE TOO
         \or
           \dohandlesubformulanumbering
         \fi
       \fi
      %\rlap{\tracedformulamode}%
     \egroup
   \fi}


[-- Attachment #1.2: Type: text/html, Size: 5118 bytes --]

[-- Attachment #2: equationwhite-bad.pdf --]
[-- Type: application/pdf, Size: 17113 bytes --]

[-- Attachment #3: equationwhite-good.pdf --]
[-- Type: application/pdf, Size: 14011 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-13 22:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-13 13:57 extra white after equation Hans van der Meer
2011-11-13 22:11 ` Meer, H. van der

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).