View Issue Details

IDProjectCategoryView StatusLast Update
0000265luatexfeature requestpublic2017-01-23 19:40
Reporteruser61Assigned ToHans Hagen  
Status closedResolutionfixed 
Fixed in Version0.82.0 
Summary0000265: Make mathsurround a glue
DescriptionIt is presently a kern. It would be very useful for short columns. OK, it requires reference counting, but just as any other glue.

I think it would also make mathsurround more usable if the possibility be added that it only get inserted if there is another glue following (or preceeding), via a primitive. This is to avoid inserting extra space when there is no space at all, such as before a punctuation mark. This would be easy to implement because the mathsurround does not actually enter the list while it is being formed, but just when it is packed.



2009-10-08 13:25

administrator   ~0000278

Can you post an actual example where having an explicit glue and/or an extra inhibiting primitive would be useful?

Currently, I have doubts on the practical usability of this request.

2009-10-14 13:37


mathsurround.tex (2,775 bytes)   
%First, making mathsurround a glue:
%So as not having to type something like this, which could be solved better by
%\mathsurround=1.11pt plus 1.66pt minus 0.5pt, say.
%This is some text at the top of a page with a figure at the top-left corner occupying more than half the with of the page,
%so the text has to be typeset in a narrow column. A similar case would happend for publications that display their text
%in serveral columns. (The \- was not needed in the original text, of course; just for right hyphenation)

%Definitions for some macros so that the example can be run.
%Some of them have been crudely defined, but for the example is enough
\def\sdot{\mskip 2mu minus0.6667mu\mathchar"0201\mskip 2mu minus0.6667mu}
\def\diez#1#2{#1\sdot 10^{#2}}
\def\?{\mskip -2mu}
\def\ApT{A^{\prime T}}
\def\sloppy{\tolerance=9999 \emergencystretch3em}
%End of macros

\font\ften=pplr8t at 10pt  \ften

%beginning of example
\quad\vbox{\hsize 114pt \sloppy \def\s{\spacefactor2000}
\hbox{[Omitted text]}
y para\s{} $\Sigma_A^{1,2,3}$\s{} y\spacefactor3000\penalty10000{} $\Sigma_E^{4,5,6}$\s{} es $\diez{16}{-6}/\?\sqrt{3}=\diez{7}{-6}$. Se otienen as� $A'$ y~$L'$. La matriz $N$ es~$\ApT A'$, y $N^{-1}$ se muestra en la p�gina si\-guiente.\par


%Appart form these situations, it is customary to consider that larger spaces shoud have larger total strechability, both in horizontal
%an vertical lists, so I don't see why TeX should ban that possibility for the mathsurround space. Consider the paragraph at the bottom
%of p. 72 of the TeXbook:
%    [...] furthermore, it automatically increases the strechability (and decreases
%    the shrinkability) after punctuation marks. The reason is that it's usually better
%    to put more space after punctuation than between two ordinary words,
%    when spreading a line out to reach the desired margins.
%Why should this argument be right for the extra space after punctuations but not for the extra space arround math?

%Now the second proposal: a primitive that inhibits the insertion of the mathsurround space when there is no space
%at all between the math and the following (or preceeding) character. Well, it seems obvious to me.
%I once tried to typsed a math problem with a nonzero mathsurround and the space that got inserted before the commas
%and periods looked so awfull that I desisted.
%What I proposed for the precise definition of "space following" is that at the time of packaging the list there be
%a glue node following the end-of-math node. If there is none, the space is not inserted. This is very easy to implement
%since the amount of space is carried by the math node, and not inserted itself as a node.
mathsurround.tex (2,775 bytes)   

2009-10-14 13:37


mathsurround.dvi (908 bytes)


2009-10-14 13:38


I have posted the example, together with more comments.


2009-10-14 14:12

administrator   ~0000291

I see your point now, thanks for the example

Hans Hagen

2015-10-22 21:38

manager   ~0001468

a new parameter: \mathsurroundskip (when set it replaces \mathsurround)


2015-10-23 09:06

administrator   ~0001472

Originally reported by user Jmugica, who was deleted because of undeliverable email

Issue History

Date Modified Username Field Change
2009-09-11 11:19 user61 New Issue
2009-10-08 13:25 Taco Note Added: 0000278
2009-10-08 13:25 Taco Status new => feedback
2009-10-14 13:37 user61 File Added: mathsurround.tex
2009-10-14 13:37 user61 File Added: mathsurround.dvi
2009-10-14 13:38 user61 Note Added: 0000286
2009-10-14 14:12 Taco Note Added: 0000291
2009-10-14 14:13 Taco Assigned To => Taco
2009-10-14 14:13 Taco Status feedback => acknowledged
2012-04-09 04:52 Khaled Hosny Tag Attached: math
2015-10-22 21:37 Hans Hagen Assigned To Taco => Hans Hagen
2015-10-22 21:37 Hans Hagen Status acknowledged => assigned
2015-10-22 21:38 Hans Hagen Note Added: 0001468
2015-10-22 21:38 Hans Hagen Status assigned => closed
2015-10-22 21:38 Hans Hagen Resolution open => fixed
2015-10-22 21:38 Hans Hagen Fixed in Version => 0.82.0
2015-10-23 09:06 Taco Note Added: 0001472