TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If you use a right square bracket at the end of an item label, then space is added before it. The problem occurs in all the standard list environments (itemize, enumerate and description). How can this be avoided?

Right square bracket at the end of an item label adds space before it



  \item[[Vpv]] For any\dots
  \item[[V\(\lnot\)]] For any\dots

share|improve this question
As I noticed this just after writing this question it may be trivial... Feel free to close or delete. – N.N. Oct 5 '11 at 8:55
not trivial, but a common error: in optional arguments, the opening (square) bracket matches the first closing bracket it sees -- if you put the close bracket in braces ("{]}") the matcher doesn't see the bracket; if you put the whole argument in braces, this is achieved -- and "{[foo]}" looks more comprehensible than "[foo{]}" (imho, at least!). – wasteofspace Oct 5 '11 at 9:17
+1, because I also think, like @Anon, that this is common and not really that obvious. I'd definitely keep it. – Count Zero Oct 5 '11 at 10:49
up vote 9 down vote accepted
  1. Your solution is absolutely correct: the inner stuff needs to be in braces if it contains a ].

  2. I'm pretty sure we've had a question which had the same underlying cause as this, but I don't know what to search for so can't find it right now. If it exists, it probably has a full explanation, but just in case it doesn't here's a quick version.

Optional arguments, such as that to the \item command, are not parsed in the same way as mandatory arguments. When LaTeX says "Looks like an optional argument here", TeX starts looking for the end of it. That end is signalled by a closing square bracket, ]. So TeX looks for one which is at the same grouping level as the opening bracket. So far, so good. And so far, just the same as with braces ({ and }). The crucial difference is that an opening square bracket does not open a new TeX group. So in \item[[hello]] the first ] is at the same level as the opening [. The second [ does not affect that. So it is the first ] which is taken as the delimiter.

So when you type \item[[hello]], the \item command get [hello as its argument. The first [ and first ] are eaten up, and then the start of the item is the second ]. So the space is the space between the item label (which is [hello) and the item text (which starts ]).

In these cases, the solution is to explicitly add a level of TeX grouping so that TeX sees the correct closing square bracket. This is what your solution does. Now, it is the second ] which matches the first because it is the first one which is at the same level. Then \item gets (in my example) [hello] as its argument and it is the second bracket which is swallowed.

share|improve this answer
Thanks for explaining the cause of this problem. It's great when you get answers that not only solves the problem but explains why it happens. – N.N. Oct 5 '11 at 9:25
@N.N.: This place does work well with that sort of thing. (I also feel I ought to say that Anon's comment - which says the same but more concisely - appeared after I'd started writing this, otherwise I probably wouldn't have written it.) – Loop Space Oct 5 '11 at 9:55

I noticed that nesting the argument for \item in curly brackets helped:



  \item[{[Vpv]}] For any\dots
  \item[{[V\(\lnot\)]}] For any\dots


Using curly brackets for the argument of \item corrects spacing

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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