I use French notation for intervals, like ]x,y[. But the brackets behave funny --- they try to surround wrong thing, like

] x,y [∪] a,b [

Writing \left]x,y\right[\cup\left]a,b\right[ solves the problem in most cases. But I want these brackets to have the same size, but they become larger on something like ]a,B^c[.

P.S. My question is closely related to "How to input open intervals", but not the same.


you can use \mathopen]x,y\mathclose[

  • 1
    @AntonPetrunin: Consider using mleftright and then \mleft] x, y \mright[.
    – Werner
    Dec 20 '17 at 21:24
  • 2
    @DavidCarlisle Wouldn't it be better to use \mathopen]x,y\mathclose[ instead of \mathopen{]}x,y\mathclose{[}? Suppose you want to write ]x,y[²: If you use \mathopen{]}x,y\mathclose{[}^2 the vertical positioning of the superscript "²" is bad. (Note that the braces aren't argument delimiters here because \mathclose is a TeX primitive. See also tex.stackexchange.com/a/110220/227621.)
    – user227621
    Nov 5 '20 at 22:17
  • @user227621 er, yes, done, thanks. Nov 5 '20 at 23:36

The interval package by Lars Madsen has been designed to take care of this kind of problem (and some others):

    \interval[open]{x}{y} \cup \interval[open]{a}{b}

enter image description here

See its documentation for more information.

  • Thanks for sharing this clean package!
    – Diaa
    Nov 6 '20 at 0:13

If you have many of these intervals, you may want to create a dedicated macro called, say, \frint (short for "French-notation interval"...), as follows:

\usepackage{mathtools} % for "\DeclarePairedDelimiter" macro

%% same output as '$\mathopen{]}x,y\mathclose{[} \cup \mathopen{]}a,b\mathclose{[}$'

enter image description here

Then, write \frint* to auto-size the "fences", and write \frint[\big], \frint[\Big], \frint[\bigg], or \frint[\Bigg] to enlarge the fences to a specific, fixed size.


Time ago, I created my own french notation intervals with several commands depending on type of interval (they added some unnecessary extra space). Now I implemented the \mathopen{]} and \mathclose{[} (as in David Carlisle answer). I use (in preamble)

\newcommand{\intsai}[2]{\cord #1,#2\cord}
\newcommand{\intsad}[2]{\cori #1,#2\cori}
\newcommand{\intc}[2]{\cori #1,#2\cord}
\newcommand{\inta}[2]{\cord #1,#2\cori}

Here is an example of application

enter image description here

\textbf{bounded}    &   \textbf{unbounded}  \\
\inta{x}{y}         &   \inta{-\infty}{y}   \\
\intc{x}{y}         &   \intsai{-\infty}{y} \\
\intsad{x}{y}       &   \inta{x}{+\infty}   \\   
\intsai{x}{y}       &   \intsad{x}{+\infty} \\
  • 1
    this is still using a mathclose node on the left and a mathopen on the right so the extra fixed spacing will not always be right depending on the context and the spacing that the mathopen and mathclose nodes add. Dec 20 '17 at 21:29
  • @DavidCarlisle Yes, that is true. Actually as you say, the fixed space make the intervals look weird (e.g. infinite negative intervals above). What would be a good practice to avoid that, preserving some "good looking" space in custom commands?
    – Cragfelt
    Dec 20 '17 at 23:41

Not the answer you're looking for? Browse other questions tagged or ask your own question.