Here's a MnWE:
\documentclass[12pt,letterpaper]{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{esdiff}
\begin{document}
$\diffp{V}{c_i}$
\end{document}
The error being returned:
line 14: Missing { inserted. $\diffp{V}{c_i}
From the log:
! Missing { inserted.
<to be read again>
}
l.14 $\diffp{V}{c_i}
$
A left brace was mandatory here, so I've put one in.
You might want to delete and/or insert some corrections
so that I will find a matching right brace soon.
The following causes the same error:
\documentclass[12pt,letterpaper]{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{esdiff}
\begin{document}
$\diffp{V}{c_{i}}$
\end{document}
How can I get esdiff
to properly work with subscripts?
Best Answer
Use an extra pair of braces for the argument with scripts:
A complete example:
The extra pair of braces forms a group thus
c_{i}
is seen as a "unit"; without it, TeX seesc
as a first token, internally\partial c
is built, and then ot takes_
as the next token to form\partial _
, which triggers the error.