ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Formulas and pagebreaks
@ 2017-08-30 10:44 Henri Menke
  2017-08-30 17:18 ` Hans Hagen
  0 siblings, 1 reply; 2+ messages in thread
From: Henri Menke @ 2017-08-30 10:44 UTC (permalink / raw)
  To: ntg-context

Dear list,

Motivated by this question on TeX.SX (https://tex.stackexchange.com/questions/388963) I found that formulas do not honour the samepage option in spacebefore.  I could track the issue down to the \strc_math_obey_depth macro where a vertical kern is inserted which apparently introduces a good breakpoint.  MWE is below, the line is marked with an ASCII arrow.  Please fix.

Cheers, Henri

---

\setupformulas[spacebefore={big,samepage},spaceafter=big]

\unprotect

\def\strc_math_obey_depth
  {\ifvmode\ifdim\prevdepth<\zeropoint\else\ifdim\prevdepth<\strutdp
     % maybe add a tracing option here
     \ifgridsnapping
       \directvspacing\v!depth
     \else
       \kern\dimexpr\strutdp-\prevdepth\relax % <-----------
       \prevdepth\strutdp
     \fi
   \fi\fi\fi}

\protect

\starttext

\dorecurse{4}{\input knuth\par}
\startformula
  \exp(x)=\sum_{k=0}^{+\infty}\frac{x^k}{k!}.
\stopformula

\stoptext
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2017-08-30 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30 10:44 Formulas and pagebreaks Henri Menke
2017-08-30 17:18 ` Hans Hagen

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).