Math & ScienceHow to escape square bracket "["?

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
azertyazerty
Posts: 7
Joined: Fri Nov 26, 2010 8:30 pm

How to escape square bracket "["?

Post by azertyazerty »

Hi,

I'm having some trouble with the next code;

Code: Select all

\begin{eqnarray}
\mathcal{L}^I &=& \{[x_1,x_2] \mid (x_1,x_2) \in [0,1]^2\,\textrm{en}\,x_1 \leq x_2\}\\
x_1,x_2] \sqcap [y_1,y_2] &=& [min(x_1,y_1),min(x_2,y_2)]\\
x_1,x_2] \sqcup [y_1,y_2] &=& [max(x_1,y_1),max(x_2,y_2)]
\end{eqnarray}
Right before the two "x_1"s there need to be a "[", and I just don't manage to escape them... ("[", \[ is not working). Can somebody help me?

Thanks guys!
Last edited by azertyazerty on Sun Nov 28, 2010 1:47 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: How to escape square bracket "["?

Post by frabjous »

Try {[} in braces.

I guess otherwise it interprets the [ there as if it were part of the \\[length] construction you could use to insert extra space after the line, but {[} seems to work to disable this.
azertyazerty
Posts: 7
Joined: Fri Nov 26, 2010 8:30 pm

Re: How to escape square bracket "["?

Post by azertyazerty »

{[} is working, thanks mate!
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How to escape square bracket "["?

Post by localghost »

Now that the problem is solved, please be so kind and mark the topic accordingly as written in the Board Rules (to be read before posting) and as you have already been directed. Please keep that in mind for the future so that further reminders will not be necessary.

Just for notification. The eqnarray environment should not be used any more [1]. The problem can be avoided by grouping the concerned expressions completely with curly braces as shown below.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}
  \begin{align}
    \mathcal{L}^I &= \{[x_1,x_2] \mid (x_1,x_2) \in [0,1]^2\ \text{en}\ x_1 \leq x_2\}\\
    {[x_1,x_2]} \sqcap [y_1,y_2] &= [\min(x_1,y_1),\min(x_2,y_2)]\\
    {[x_1,x_2]} \sqcup [y_1,y_2] &= [\max(x_1,y_1),\max(x_2,y_2)]
  \end{align}
\end{document}
[1] The PracTeX Journal — TeX Users Group, Lars Madsen: Avoid eqnarray!


Best regards and welcome to the board
Thorsten
Post Reply