mathlive
mathlive copied to clipboard
Make ]a,b[ interval notation compatible with smartFence mode
The smartFence mode automatically resizes parentheses and brackets, which is very nice. But it is not compatible with the interval notation ]a,b[ / [a,b[ / ]a,b].
Is it possible to make it compatible ? I use MathLive with french students and that's the standard interval notation here.
That's an interesting problem. I'd need to give some thoughts about a possible solution, unless someone has some suggestion...
Maybe add some code that checks if there is no matching open to the left/close to the right, it pairs the close/open brackets? That works for a standalone expr, but if you had ]0,3[ ∪ ]1,5[ it fails. And the open/close combinations make heuristic even more of a mess.
Or maybe have an option that says "pair the first two open/close brackets (not parens, braces, etc)" when reading left-to-right in smartFence mode? Definitely don't make that the default though. That prevents having nested brackets (hence, don't make this a default), but does work for this notation.
One way of parsing such ambiguous notation would be to check if there is a comma , or semicolon ; in the middle, surrounded by two numbers. If yes, it's an interval. If not, it's not an interval.
However, I fully agree with NSoiffer regarding "don't make this a default". This sort of interval notation is sadly really ambiguous.