View Issue Details

IDProjectCategoryView StatusLast Update
0000553luatexfeature requestpublic2015-11-05 10:35
Reporterphi Assigned ToHans Hagen  
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
OSMac OS XOS Version10.6.6 
Product Version0.65.0 
Fixed in Version0.85.0 
Summary0000553: Suggestion: an inner noad with extended behavior regarding spacing
DescriptionThere are sometimes situations where we'd like to have a noad that normally behaves like an inner noad, but is treated by the spacing calculation as if preceded or succeeded by a void noad of a different class. A very common example is the construct $f \left(\frac12\right)$, where there is excessive spacing around the delimiters compared to the open/close noads $f(...)$. The current solution as implemented by various LaTeX packages is to write $\mathopen{} \mathclose{\left(\frac12\right)}$, which gives the desired behavior but were to break down should prescripts be implemented. Thus I propose the following:
- Add a new noad type that behaves like an inner noad but has two fields that control the spacing behavior on the left and the right side
- Add a field to the delim node type that controls the spacing behavior
- Add new syntax to allow the creation of such nodes from TeX: \left\mathopen( and \right\mathclose), which is currently illegal but would be allowed by the change
The following patch implements the suggested behavior:
https://github.com/phst/unimath-extras/blob/master/luatex-patches/delimiter-classes.patch
TagsNo tags attached.

Activities

Hans Hagen

2011-01-09 23:35

manager   ~0000717

Just a remark: extending the delimiter mechanism is on the agenda, for instance the mandate left/right matching. Internally there is already a bit more granularity (in the noad) than in traditional tex, so I suppose that more can be added. We probably don't need a new noad type (actually we tried to get rid of some) as the less types the better (less checking in lua code) so extra fields are more likely than new types.

Taco

2011-01-10 09:04

administrator   ~0000720

The proposed extension sounds fine on the user level, though, so I am tempted to apply it while waiting for an internal cleanup.

Hans Hagen

2011-01-10 09:36

manager   ~0000722

there are actually three proposas:

- adding a noad: i don't like that as temp solution as it will force me to adapt code that i later need to readapt

- adding a field: this is rather harmless

- a new syntax: it's not clear to me what the new syntax is; arbitrary to be checked token after left/right? \left\mathopen( ; in other cases we've chosen for the extra keyword route so \left open ( sounds better to me and is also easier to extend later on

phi

2011-01-10 21:25

reporter   ~0000723

About the noad: Of course that is only a suggestion, the internal implementation doesn't matter. I chose the noad because it is easiest to implement on the TeX side.
About the syntax: The patch changes \left to accept a math_comp command (\mathord etc.). This is again the easiest solution because no additional parsing has to be done: The math class is stored in cur_chr and only has to be added to the noad. But again (as with all my proposals), this shows only one possibility. The problem with the keyword approach is that it is not backwards-compatible: The "o" character could have a valid delimiter code, for example.

Hans Hagen

2011-01-10 22:55

manager   ~0000724

i think that patching \left and \right is not backward compatible either as \left\mathopen( feeds two tokens to \left; macro packages can overload \left and the replacement macro is unaware of this so this solution is no option (

better is probably to make a new command, say \Udelimiter open|close ... <number>; anyway, something will show up in version >= 0.80 but it needs a bit of thinking

Hans Hagen

2015-11-03 09:29

manager   ~0001501

0.85 will already provide more control over delimiter creation

Hans Hagen

2015-11-05 10:35

manager   ~0001518

\Uleft cum suis get a 'class' option (optional key)

Issue History

Date Modified Username Field Change
2011-01-09 12:20 phi New Issue
2011-01-09 23:35 Hans Hagen Note Added: 0000717
2011-01-10 09:04 Taco Note Added: 0000720
2011-01-10 09:36 Hans Hagen Note Added: 0000722
2011-01-10 21:25 phi Note Added: 0000723
2011-01-10 22:55 Hans Hagen Note Added: 0000724
2011-02-10 10:41 Taco Status new => assigned
2011-02-10 10:41 Taco Assigned To => Taco
2015-11-03 09:28 Hans Hagen Assigned To Taco => Hans Hagen
2015-11-03 09:29 Hans Hagen Note Added: 0001501
2015-11-05 10:35 Hans Hagen Note Added: 0001518
2015-11-05 10:35 Hans Hagen Status assigned => closed
2015-11-05 10:35 Hans Hagen Resolution open => fixed
2015-11-05 10:35 Hans Hagen Fixed in Version => 0.85.0