1

Why is it that

\[
  f\langle s,t \rangle = \sum_\substack{v,w \in E \\ v \in S, w \in T}}f(v,w) \\    
\]

compiles for me, despite the extra }, but

\[
  f\langle s,t \rangle = \sum_\substack{v,w \in E \\ v \in S, w \in T}f(v,w) \\    
\]

does not?

Edit: amsmath 2000/07/18 v2.13, pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/W32TeX) (format=pdflatex 2013.3.3)

4

Please always post complete documents:

I get an error on both lines:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\[
  f\langle s,t \rangle = \sum_\substack{v,w \in E \\ v \in S, w \in T}}f(v,w)    \\
\]

compiles for me, despite the extra \}, but

\[
  f\langle s,t \rangle = \sum_\substack{v,w \in E \\ v \in S, w \in T}f(v,w) \\    
\]

does not?

\end{document}

Produces

! Missing { inserted.
<to be read again> 
                   \vcenter 
l.8 ...um_\substack{v,w \in E \\ v \in S, w \in T}
                                                  }f(v,w) \\
? 
(/usr/local/texlive/2012/texmf-dist/tex/latex/base/omscmr.fd)
! Missing { inserted.
<to be read again> 
                   \vcenter 
l.14 ...m_\substack{v,w \in E \\ v \in S, w \in T}
                                                  f(v,w) \\
? x
No pages of output.

with an error on lines 8 and 14.

The error is a missing { after the _

This produces no error:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\[
  f\langle s,t \rangle = \sum_{\substack{v,w \in E \\ v \in S, w \in T}}f(v,w)   
\]


\end{document}
| improve this answer | |
  • I'll keep the complete documents thing in mind. Also, I was under the impression that one entity counted as the same, for example a_\mathrm{min} is valid. Why is this different? – Hameer Abbasi Apr 9 '13 at 13:20
  • @HameerAbbasi \mathrm is designed so that works (athough it is bad style:-) the {} are required but the expansion of \mathrm includes the brace. Compare A_\foo with \newcommand\foo{abcd} or with \newcommand\foo{{abcd}} one gets subscript a the other abcd – David Carlisle Apr 9 '13 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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