[OS X TeX] Controlling space around \center and \displaymath

Alain Schremmer schremmer.alain at gmail.com
Wed Sep 19 19:03:18 CEST 2012


On Sep 19, 2012, at 12:47 PM, William Adams wrote:

> On Sep 19, 2012, at 12:33 PM, Alain Schremmer wrote:
>
>> I would like to control the amount of space before and after  
>> \center and \displaymath.
>>
>> \vspace does it before to some extent as it seems "elastic" but I  
>> am totally unable to change the amount of space after.
>
> from:
>
> http://tex.stackexchange.com/questions/47773/how-can-i-change-the-whitespace-above-and-below-math-displays

I did make a google search but missed that one. :-((

>
>> There are four parameters that define this space and you can look  
>> at the values for them for example via
>>
>> \showthe\abovedisplayskip
>> \showthe\belowdisplayskip
>> \showthe\abovedisplayshortskip
>> \showthe\belowdisplayshortskip
>> The "..short.." are used if the previous text line has less  
>> material than the width of the formula. In case of displaymath(or \ 
>> [...\] for short) standard LaTeX behaves a bit strangely in that it  
>> adds an explicit empty box with a width of .6\linewidth in front of  
>> such a display if it starts out in vertical mode. As a result you  
>> see an empty line in front of the display and in addition 
>> \abovedisplayskip is used. This is not done for the equation  
>> environment (here low-level TeX is adding the empty line but it  
>> will only consists of an \indent box) so this is a strange  
>> historical "feature".
>>
>> The values for these parameters depend on the font size and in the  
>> default classes (e.g.,article) LaTeX sets them as part of executing  
>> \normalsize, \small, or \footnotesize. The other font size command  
>> do not chamge them, probably because Leslie thought that in  
>> something like \huge one doesn't typeset any displays.
>>
>> So changing them then to your taste can be done with \setlength, e.g.
>>
>> \setlength\abovedisplayskip{5pt plus 2pt minus 2pt}
>> or whatever you think fits your design (the plus and minus part  
>> define how much the space can stretch or shrink if necessary). But  
>> that definition then has to replace the one inside the font size  
>> command or at least have to be added to the end of it so that it  
>> overwrites whatever is being set up earlier. A simple way to do  
>> that would be
>>
>> \makeatletter
>> \g at addto@macro \normalsize {%
>> \setlength\abovedisplayskip{5pt plus 2pt minus 2pt}%
>> \setlength\belowdisplayskip{5pt plus 2pt minus 2pt}%
>> }
>> \makeatother
>> As long as you do not typeset displays in \small or \footnotesize  
>> there is no need to append values to those commands, but if so the  
>> same approach could be used.


I just tried

	Let $f$ be the function specified by the global input-output rule
	\setlength\abovedisplayskip{3pt plus 2pt minus 2pt}
	\setlength\belowdisplayskip{3pt plus 2pt minus 2pt}
		\begin{displaymath}
			x \xrightarrow{\hspace{5mm}f\hspace{5mm}} f(x)= -324.08^{-7}
		\end{displaymath}
	and given inputs that are $+large$, what is the \emph{sign-size} of  
the outputs?

and it works beautifully! :-)))

Grateful, if embarrassed, regards
--schremmer



More information about the macostex-archives mailing list