Formulas and pagebreaks
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
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
On 8/30/2017 12:44 PM, Henri Menke wrote: please test extensively with: \setvalue{\??mathdisplayspacemodel\v!before:3}% {\let\m_spacebefore\empty \ifvmode \ifdim\lastskip>\zeropoint\else \ifdim\prevdepth<\zeropoint\else \ifdim\prevdepth<\strutdp % maybe add a tracing option here \ifgridsnapping \let\m_spacebefore\v!depth \else \edef\m_spacebefore{\the\dimexpr\strutdp-\prevdepth\relax}% \fi \fi \fi \fi \nointerlineskip \fi \ifx\m_spacebefore\empty \ifx\p_spacebefore\v!none % nothing \else\ifx\p_spacebefore\empty \directvspacing\currentvspacing \else \directvspacing{\p_spacebefore,\the\scratchdimen}% \fi\fi \else \ifx\p_spacebefore\v!none \directvspacing{\m_spacebefore}% \else\ifx\p_spacebefore\empty \directvspacing{\m_spacebefore,\currentvspacing}% \else \directvspacing{\m_spacebefore,\p_spacebefore}% \fi\fi \fi} ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Henri Menke