ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \abovedisplayskip and \belowdisplayskip
@ 2012-09-07  2:54 Troy Henderson
  2012-09-07  3:13 ` Aditya Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Troy Henderson @ 2012-09-07  2:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

It is my understanding that \abovedisplayskip and \belowdisplayskip should
adjust how much (rubber) spacing that is allowed between display math
formulas.  I have attached a ConTeXt file (bug.tex) that seems to indicate
that setting these skips does not affect this (rubber) spacing.  I have
also translated this ConTeXt file line-by-line to a LaTeX file (bug.ltx)
and attached it.

Both files produce a PDF (using `context bug.tex` and `pdflatex bug.ltx`)
in which the spacing between the formula changes from page 1 to page 2
simply by adding the final formula.  However, by changing \adjustdisplay{0}
to \adjustdisplay{1}, the LaTeX file produces a 3 page document where the
spacing between formula does not change (as expected) on the first two
pages and thus requires a third page to typeset the final formula.
However, making this same adjustment in the ConTeXt file does not seem to
affect the output.

I would appreciate any thoughts as to why this is happening, and I would
equally appreciate a solution to keeping the spacing the same in the
ConTeXt file and thus bumping that last formula to a third page.

Troy Henderson

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

[-- Attachment #2: bug.tex --]
[-- Type: application/x-tex, Size: 769 bytes --]

[-- Attachment #3: bug.ltx --]
[-- Type: text/x-tex, Size: 660 bytes --]

\documentclass{minimal}
\usepackage[paperwidth=600pt,paperheight=450pt]{geometry}

\def\adjustdisplay#1 {
	\ifnum#1>0
		\newdimen\mydimen
		\mydimen\abovedisplayskip \abovedisplayskip\mydimen
		\mydimen\belowdisplayskip \belowdisplayskip\mydimen
	\fi
}

\def\foo{
	\vskip0.5ex
	\[\frac{x}{1} = \frac{1}{x-1}\]
	\vskip0.5ex
	\[x(x-1)=1\]
	\vskip0.5ex
	\[x^2-x=1\]
	\vskip0.5ex
	\[x^2-x-1=0\]
	\vskip0.5ex
	\[x=\frac{1+\sqrt{5}}{2},\frac{1-\sqrt{5}}{2}\]
}

\begin{document}

	\pagestyle{empty}
	\fontsize{20}{24}\selectfont
	\adjustdisplay{0}

	\foo

	\clearpage

	\foo\vskip0.5ex
	\[\phi = \frac{x}{1} = x =\frac{1+\sqrt{5}}{2} \approx 1.618\]

\end{document}

[-- 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] 3+ messages in thread

* Re: \abovedisplayskip and \belowdisplayskip
  2012-09-07  2:54 \abovedisplayskip and \belowdisplayskip Troy Henderson
@ 2012-09-07  3:13 ` Aditya Mahajan
  2012-09-07  4:17   ` Troy Henderson
  0 siblings, 1 reply; 3+ messages in thread
From: Aditya Mahajan @ 2012-09-07  3:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 6 Sep 2012, Troy Henderson wrote:

> It is my understanding that \abovedisplayskip and \belowdisplayskip should
> adjust how much (rubber) spacing that is allowed between display math
> formulas.  I have attached a ConTeXt file (bug.tex) that seems to indicate
> that setting these skips does not affect this (rubber) spacing.  I have
> also translated this ConTeXt file line-by-line to a LaTeX file (bug.ltx)
> and attached it.
>
> Both files produce a PDF (using `context bug.tex` and `pdflatex bug.ltx`)
> in which the spacing between the formula changes from page 1 to page 2
> simply by adding the final formula.  However, by changing \adjustdisplay{0}
> to \adjustdisplay{1}, the LaTeX file produces a 3 page document where the
> spacing between formula does not change (as expected) on the first two
> pages and thus requires a third page to typeset the final formula.
> However, making this same adjustment in the ConTeXt file does not seem to
> affect the output.
>
> I would appreciate any thoughts as to why this is happening, and I would
> equally appreciate a solution to keeping the spacing the same in the
> ConTeXt file and thus bumping that last formula to a third page.

ConTeXt uses spacebefore and spaceafter keys to adjust the spacing around 
formulas. The values of these keys are fed to `\blank[...]` so they can be 
any value that `\blank[...]` accepts (none, small, medium, big, etc., or a 
valid TeX dimen)

So, you should use something like

\setupformulas[spacebefore=..., spaceafter=...]

or if you only want to change the space around specific formulas

\defineformula[big][spacebefore=big,spaceafter=big]

and then use

\startbigformula ... \stopbigformula.

Aditya

___________________________________________________________________________________
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] 3+ messages in thread

* Re: \abovedisplayskip and \belowdisplayskip
  2012-09-07  3:13 ` Aditya Mahajan
@ 2012-09-07  4:17   ` Troy Henderson
  0 siblings, 0 replies; 3+ messages in thread
From: Troy Henderson @ 2012-09-07  4:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

>
> \setupformulas[spacebefore=..., spaceafter=...]
>

This still does not quite fix my problem.  If spacebefore/after are set to
a reasonable value in the previously attached ConTeXt file, the spacing
changes very slightly (probably because of some rubber length) between the
formula from page 1 to page 2.

Troy

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

[-- Attachment #2: 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] 3+ messages in thread

end of thread, other threads:[~2012-09-07  4:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-07  2:54 \abovedisplayskip and \belowdisplayskip Troy Henderson
2012-09-07  3:13 ` Aditya Mahajan
2012-09-07  4:17   ` Troy Henderson

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