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

The following does not compile because of the "[" after the \item. I presume it is because LaTeX expects a "]" as per the \item[option] syntax. However, I just want to insert the "[" character into the text as the first character of the enumerated item.




\item before

\item [ random text

\item after



I would like LaTeX to generate a document:


[ random text


One way I've come up with is to put a \ in front of the "[", however I'd appreciate thoughts on the least invasive way to do this.

share|improve this question

migrated from stackoverflow.com Feb 5 '12 at 1:21

This question came from our site for professional and enthusiast programmers.

What you've done is initializing the displaymath environment. – Crowley May 24 '10 at 10:33
up vote 23 down vote accepted

Just like whenever you want to put a special character (such as a space, or something else) after a command, you can use the {} to suppress the next character.

\item{}[your random text
share|improve this answer
Another option is to insert some other command, such as \relax (which does nothing at all) between \item and the bracket. – Jouni K. Seppänen Feb 5 '09 at 7:55
@JouniK.Seppänen I don't like the {} tweak, because it looks like that it is an argument of \item, which is not true. So I agree with Jouni that \relax is a good option. – yo' Feb 5 '12 at 21:50

\item looks ahead for the [ character in its definition using \@ifnextchar [:

  \@ifnextchar [\@item{\@noitemargtrue \@item[\@itemlabel]}}

This is done to enable an optional argument for \item. In that sense, using anything other than [ before using [ would suffice.

If you never use the optional argument for \item, you could remove it from its definition and use something different like \Item. That way you can use [ without worrying about it:

enter image description here

% Remove optional argument from \item
  \Item before
  \Item [ random text
  \Item after

The \item renewal removes the conditional "peeking" for a [ in the input stream, setting the default optional argument to be the regular label. As mentioned, if you never use it in any of your lists, this should be no problem.

share|improve this answer
Beware, for this to be safe it's not enough that you never use \item[]. You must also not use any commands or environments that use this internally. latex.ltx uses this for theorems and bibliography items for example, and probably several packages do likewise. – David Carlisle Feb 5 '12 at 11:18
An alternative would be to create an \Item command that does not have optional arguments, and use that. – Brian M. Hunt Feb 5 '12 at 13:18
Sorry, but this is bad advice when a simple {} is enough. – Martin Schröder Feb 5 '12 at 14:53
@DavidCarlisle: Thanks, I forgot about "other" things... in that sense, @ BrianMHunt's suggestion is better. I've updated my answer. – Werner Feb 5 '12 at 15:29

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.