View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000553 | luatex | feature request | public | 2011-01-09 12:20 | 2015-11-05 10:35 |
Reporter | phi | Assigned To | Hans Hagen | ||
Priority | normal | Severity | feature | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
OS | Mac OS X | OS Version | 10.6.6 | ||
Product Version | 0.65.0 | ||||
Fixed in Version | 0.85.0 | ||||
Summary | 0000553: Suggestion: an inner noad with extended behavior regarding spacing | ||||
Description | There 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 | ||||
Tags | No tags attached. | ||||
|
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. |
|
The proposed extension sounds fine on the user level, though, so I am tempted to apply it while waiting for an internal cleanup. |
|
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 |
|
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. |
|
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 |
|
0.85 will already provide more control over delimiter creation |
|
\Uleft cum suis get a 'class' option (optional key) |
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 |