Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I had the following situation

\begin{itemize}
\item[(A_s)] Item (A_s) such that 
\begin{equation}\label{sob}
\sum_{n}n
\end{equation}
\item[(B_s)] Item (B_s)
\end{itemize}

and the result was blank screen. After that I put $ at the beginning and end of the items

\begin{itemize}
\item[$(A_s)$] Item (A_s) such that 
\begin{equation}\label{sob}
\sum_{n}n
\end{equation}
\item[$(B_s)$] Item (B_s)
\end{itemize}

and everything worked fine. I lost a lot of time until I found this. What was the problem?

share|improve this question
    
Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  Adam Liter Mar 13 at 3:44

1 Answer 1

_ is a special character that denotes the beginning of a subscript, and that is only allowed in math-mode. As such, inserting $ around the math-related content, the problem is avoided.

The equation environment automatically initiates math-mode, so there's no additional need to enter math-mode.

If you actually want an underscore, then you can use any of the methods below. Also see Underscores in words (text).

enter image description here

\documentclass{article}
\usepackage[T1]{fontenc}
\begin{document}

\begin{itemize}
  \item[$(A_s)$] Item ($A_s$) such that 
    \begin{equation}\label{sob}
      \sum_{n}n
    \end{equation}
  \item[$(B_s)$] Item ($B_s$)
  \item[(C\string_s)] Item (\detokenize{C_s}) and (C\textunderscore s)
\end{itemize}

\end{document}
share|improve this answer
2  
Inputting C\_s, i.e., "escaping" the _ character, works too. –  Mico Mar 13 at 5:04
    
@Mico: Of course, thanks. –  Werner Mar 13 at 5:12

Your Answer

 
discard

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.