# MathJax and the French notation for open intervals

\begin{align} \forall x\in(0,+\infty), \quad f(x) > 0 \tag 1 \10pt] \forall x\in ]0,+\infty[, \quad f(x) > 0 \tag 2 \10pt] \forall x\in {]}0,+\infty{[}, \quad f(x) > 0 \tag 3 \end{align} I was instructed from an early age to use the notation in line (1) above. In France apparently the one in line (3) prevails, or at least has some currency. I coded line (3) like this: \forall x\in {]}0,+\infty{[}, \quad f(x) > 0 Line (2), on the other hand, is coded like this: \forall x\in ]0,+\infty[, \quad f(x) > 0 In the conspicuous difference between the appearances of lines (2) and (3) we see that MathJax doesn't apply the spacing conventions that it applies well in line (1). (Apparently to some users this is not conspicuous until the actual juxtaposition of lines (2) and (3) is seen.) If one must use the French notation, how should that be done? Just the way I did in line (3)? Or is there a less crude way? • I don't know, but it might be worth trying \left] and \right[ to see if that improves the spacing. Dec 1, 2016 at 20:03 • This might be a good question for the TeX SE Dec 1, 2016 at 22:51 • I don't spend much time on Meta, and no offense to the OP, but why is this not considered off topic? Typically people on this site are like hawks about that kind of thing... Dec 2, 2016 at 2:46 • FWIW we (i.e. in Finland) use that notation in schools. When meeting a fresh batch of college kids among the first things I teach them is the proper'' notation for intervals. 'cause this is ugly as (insert unflattering comparison of choice). I sorta see the point of using this in schools, because (a,b) is one of the more overloaded pieces of notation. But, imagine typesetting a union of a mixture of open/half-open intervals (I am sparing your eyes). Dec 2, 2016 at 5:35 • @TheCount How could this possibly be off-topic? It is a question about how to typeset something correctly/conveniently on this site. What would be off-topic are (La)teX questions (see TeX - LaTeX for this) and also general queries on MathJax (like, 'How to I configure MJ for my blog?'; yet this can go to Stack Overflow AFAIK, the main site of course not its meta) – quid Mod Dec 2, 2016 at 9:19 • @JyrkiLahtonen I quite disagree on this, but that's off-topic. It's also not clear why it is "proper." And as we are talking about doing things properly and things being ugly, proper'' is extremely ugly here as LaTeX syntax does not work on this site. ;-) – quid Mod Dec 2, 2016 at 9:34 • @quid, yes, the output in LaTeX is the same as MathJax for all three lines above. So asking about this on TeX - LaTeX (without mentioning MathJax) should be on-topic there. Dec 2, 2016 at 13:43 • @quid chill dude, i was ASKING. Dec 2, 2016 at 14:50 • This is an exercise in the TeXbook. It’s a shame nobody reads it anymore. Dec 5, 2016 at 16:57 • It’s exercise 18.14, and I have it on page 171 (this may depend on the edition). But to be fair, now I see that it is marked with a double dangerous bend. Dec 5, 2016 at 17:07 • Should we perhaps start calling these Freedom Intervals? :-P – Asaf Karagila Mod Dec 6, 2016 at 16:42 • There is already a question about this on TeX.SE: tex.stackexchange.com/questions/326237/… Dec 6, 2016 at 19:44 • It should be noted that Don Knuth doesn't spare us his opinion either in that exercise: Some perverse mathematicians use brackets backwards, to denote “open intervals.” :-) Dec 6, 2016 at 20:23 • Point taken, @quid. Admittedly I exaggerate this (in lecture halls, and apparently consequently also here) to drive home the point that the students should not expect their high school math books to be an ultimate authority. Particularly on conventions such as notation (or whether 0 is a natural number or not). The "ugly" comes when yours truly handwrites things like ]1,2[\cup]3,4] when horizontal line segments of the brackets gain extra length. Dec 8, 2016 at 7:20 • @JyrkiLahtonen I certainly agree it is important to high-light that there are various competing and contradictory conventions. Given my shaky hand-writing, I personally am more concerned that ] and ) could morph into one another. – quid Mod Dec 8, 2016 at 16:41 ## 4 Answers Since my comment under the other answer got about three times more votes than the answer, maybe it's worth converting it into a full answer: The correct way would be, as far as I can tell, to convert the brackets into opening and closing delimiters through the use of \mathopen and \mathclose: \forall x \in \mathopen{]} -1, 1 \mathclose{[}, f(x) > 0  \forall x \in \mathopen{]} -1, 1 \mathclose{[}, f(x) > 0 Compared to \left and \right, this does not scale the delimiters (which may become too big), and the spacing is slightly different (at least in LaTeX, I don't know about MathJax precisely). See What is the correct way to do delimiters? and Spacing around \left and \right at TeX.SE. Though to be honest I'm French and was taught the French notation since (the equivalent of) sixth grade, and I don't think I've ever used it on this website, just like I don't put spaces before exclamation/interrogation marks when I write in English (even though I do prefer the French notation: is (0,1) a pair or an interval?). • It's obviously the greatest common divisor of 0 and 1. Dec 6, 2016 at 10:14 • The meaning of (0,1) is always clear from the context. Dec 6, 2016 at 13:06 • @MathematicsStudent1122 that's obviously an exaggeration. Maybe 'usually' or 'most of the time' instead of 'always' would be more sensible. – quid Mod Dec 6, 2016 at 14:53 • @quid Prove me wrong by finding a counterexample. Dec 6, 2016 at 14:58 • @MathematicsStudent1122 'clear' not being an objective notion, you could always maintain it is clear. Thus giving particular examples here is an exercise in futility. I know for a fact that I get asked questions for clarification what is meant by (a,b) sometimes, some of which I would not get when it'd say (a,b) or ]a,b[ or \gcd(a,b) or \langle a, b \rangle depending on whether it's the couple, the open interval, the gcd or the ideal generated. // Separately, the notation with the inverted brackets is arguably also somewhat more intuitive re what is open and what is closed. – quid Mod Dec 6, 2016 at 16:28 • @MathematicsStudent1122 Perhaps, but I prefer a notation where you don't even need the context. I don't think it's necessary to continue this argument. Dec 6, 2016 at 16:43 Plain \mathrm{\TeX} defines \mathcode\[="405B \mathcode="505D \delcode$="05B302 \delcode$="05D303  and \mathrm{\LaTeX} does essentially the same. One could get extensible French brackets by something like \def\lfb{\delimiter"405D303 } \def\rfb{\delimiter"505B302 }  Compiling the following file \def\lfb{\delimiter"405D303 } \def\rfb{\delimiter"505B302 } $$\lfb 0,1\rfb\cup \lfb 2,3\rfb$$ $$\left\lfb {1\over2},3\right\rfb$$ \bye  with plain \mathrm{\TeX} produces with the correct spacing and extensible brackets. Also \bigl\lfb and similar commands would work. However, MathJax doesn't understand this syntax, for obvious reasons, so it should be a feature request for them. On the other hand, simply typing \bigl]0,1\bigr[ \cup \bigl]2,3\bigr[  produces \bigl]0,1\bigr[\cup\bigl]2,3\bigr[, which might be deemed sufficient. For normal sized delimiters, I see no other choice than \mathopen]0,1\mathclose[ \cup \mathopen]2,3\mathclose[  that produces \mathopen]0,1\mathclose[ \cup \mathopen]2,3\mathclose[. • I'm sorry, but what's the point of this answer? The whole discussion about latex is irrelevant, and your conclusion is the same as my answer no? Dec 11, 2016 at 7:42 • @NajibIdrissi Two points: first, showing what's behind the scenes in TeX; second, that one needs a fearure request to the MathJax people. Dec 11, 2016 at 9:25 The problem with (2) is that the \in sign is inside the interval. Hence we can wrap the brackets in a \newcommand: \newcommand{\ointerv}{\left] #1 \right[}  which generates $$\newcommand{\ointerv}{\left] #1 \right[} \forall x \in \ointerv{-1,1}$$ • \left and \right will scale the brackets, which may be undesirable. The correct way in LaTeX (and, I guess, MathJax) would be \mathopen and \mathclose: \forall x \in \mathopen{]} -1, 1 \mathclose{[}. Dec 2, 2016 at 9:56 • @NajibIdrissi: Why should scaling be undesirable? As I understand, \left and \right are the correct, semantic way to do things... Dec 5, 2016 at 22:01 • @darijgrinberg tex.stackexchange.com/q/1454/14965 Dec 6, 2016 at 7:04 Here's an idea: try \newcommand{}{{]}}
\newcommand{$}{{[}\,}  With that, coding $0,+\infty$ yields  \newcommand{$}{{]}} \newcommand{$}{{[}\,} \forall x \in$0,+\infty$, \quad f(x) > 0  • \[ and $ is a standard delimiter for displayed equations in MathJax (granted it's hardly used on this site as one would have to escape the characters due to interactions wit Markdown, but it does work even here), and the standard delimiter for this in LaTeX. I do not think it's a good idea to use this particular syntax, but it'd be easy to rename it.
– quid Mod
Dec 2, 2016 at 9:29
• Wow, that seems obvious in retrospect Dec 2, 2016 at 13:43
• Still a good answer I think, but the macros would maybe need to be renamed. Dec 2, 2016 at 22:30