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

I want to use some text as the optional parameter to some command. The text includes square braces ([ and ]), but since the optional parameter goes within square brackets, unexpected things happen.

More info: I want an itemized list whose bullets are citations like [GMR85]. I used this command:

  \item[[GMR85]] ...

but it takes the first ] as the end of optional parameter.

Any way to escape ] ?

Edit: I specially want this to work in beamer. My current result is like:

Note how ] is not included the label.


This bug has been solved in the latest versions of beamer.

share|improve this question

closed as off-topic by LaRiFaRi, Mico, barbara beeton, Torbjørn T., Jesse Jul 19 '15 at 9:14

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

Use {description} rather than {itemize} with lexicon-like lists. – Charles Stewart Dec 7 '10 at 13:23
Also, why don't you use the bibliography environment? – Caramdir Dec 7 '10 at 17:51
@Caramdir: I always use the bibliography environment, but let's just say that there are technical reasons I don't want to do that now. (It's a long story!). As a short answer, you can just assume that I want an enumerate listing whose labels include brackets. (while they aren't citations.) – M.S. Dousti Dec 7 '10 at 18:26
@Charles: Sorry, but even {description} environment does not work in the beamer. (Screenshot: s1.bild.me/bilder/311010/1151044untitled.PNG) – M.S. Dousti Dec 7 '10 at 18:37
I'm voting to close this question as off-topic because this problem has been fixed in a newer version of beamer. – LaRiFaRi Jul 19 '15 at 7:57
up vote 26 down vote accepted

group the citation...


  \item[{[GMR85]}] ...

The Beamer package makes things a little bit more difficult.



\begin{frame}{frame title}
  \item[\braces{GMR95}] ...


This works fine for me.

share|improve this answer
Thanks Matten, but it does not work either (I tried) – M.S. Dousti Dec 7 '10 at 13:01
It does not work? I'll put a complete example in my answer, I have compiled it and it works fine for me... – Matten Dec 7 '10 at 13:04
itemize will cause the bullet cross beyond the left margin. See my answer (not really answer actually, just a comparison) :-) – xport Dec 7 '10 at 17:43
@Matten: Sorry, I should have described more. I'm using it in a beamer slide, and it does not work in that case (but works fine when you use the article documentclass). Can you test it in the beamer too? (screenshot of my result: s1.bild.me/bilder/311010/1151044untitled.PNG). – M.S. Dousti Dec 7 '10 at 18:35
hey Sadeq.. I supplied another approach for your beamer problem. Please see my second code example! – Matten Dec 7 '10 at 18:55

Based on Charles Stewart's comment and Matten's answers, I make the following comparion. I suggest to follow the Stewart's suggestion. If we insist on using itemize environment instead of description, the bullet item will expands to the left crossing the left margin.

alt text

  {\typeout{***Successfully patched \protect\SX@codeInput***}}
  {\typeout{***ERROR! Failed to patch \protect\SX@codeInput***}}

  \item{[GMR85]} I am happy.
  \item{[GMR86]} Are you happy?

  \item[{[GMR85]}] I am happy.
  \item[{[GMR86]}] Are you happy?

share|improve this answer
paralist also fixes the margin behavior. – Caramdir Dec 7 '10 at 17:53

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