I want to write open and half-open intervals using the following notation:
]a, b[
]a, b]
]-∞, b]
When writing them just like that in the LaTeX source, the spacing doesn't come out right. For example, for this equation:
\(X = ]-\frac{π}{2}, +\frac{π}{2}[\)
the minus sign is typeset as a binary operator. I can solve this by surrounding the whole value in braces, but then the spacing around the equal sign is still not correct. For other combinations of intervals and operators, different spacing inconsistencies arise.
What is the correct and easy way to input intervals in order to avoid having to take care of this at all?
\(X = \left]-\frac{π}{2}, +\frac{π}{2}\right[\)
?{}
:\(X = ]{-\frac{π}{2}, +\frac{π}{2}}[\)
. However, this would work best when the contents is not in displaymath mode.\DeclarePairedDelimiter
frommathtools
. (i haven't time to write a more complete answer.)