French notation for intervals ]x,y[ [duplicate]

This question already has an answer here:

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.

marked as duplicate by Harald Hanche-Olsen, Sigur, Stefan Pinnow, Mensch, user2478 Dec 20 '17 at 21:22

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

• @AntonPetrunin: Consider using mleftright and then \mleft] x, y \mright[. – Werner Dec 20 '17 at 21:24

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

\documentclass{article}
\usepackage{interval}
\begin{document}
$\interval[open]{x}{y} \cup \interval[open]{a}{b}$
\end{document} 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:

\documentclass{article}
\usepackage{mathtools} % for "\DeclarePairedDelimiter" macro
\DeclarePairedDelimiter{\frint}{]}{[}

\begin{document}
$\frint{x,y}\cup\frint{a,b}$
%% same output as '$\mathopen{]}x,y\mathclose{[} \cup \mathopen{]}a,b\mathclose{[}$'
\end{document} 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{\cord}{\mathopen{]}}
\newcommand{\cori}{\mathclose{[}}
\newcommand{\intsai}{\cord #1,#2\cord} $\arraycolsep=10pt \renewcommand{\arraystretch}{1.5} \begin{array}{cc} \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} \\ \end{array}$
$\inta{x}{y}\cup\inta{a}{b}$