This code gives the error "missing } inserted". What is this error?

\begin{align}
\varphi_m(v_i)&= \left\lceil \frac{2i+3m}{4m}\right\rceil, &&\text{for $i=1,2,\dots, n$,}\\
$$\varphi_m(u_i)&= \begin {cases} \left\lceil \frac{i}{2m}\right\rceil, &&\text{for i &\equiv 0, \frac {m} {2} \mod 2m \ ,}\\ \left\lceil \frac{i}{m+1}\right\rceil, &&\text{for i &\not\equiv 0, \frac {m} {2} \mod 2m \ ,}\\ \end{cases}$$
$$\dim(G_{4,6}^{(k)})=\dim(K_4^{(k)}) = \begin{cases} 2 & \text{for 2\le k\equiv 0 \ ({\rm{mod}}\ 2),}\\ 3 & \text{for k=0 or 1\le k\equiv 1\ ({\rm{mod}}\ 2).} \end{cases}$$
\varphi_4(v_iv_{i+1})&= \left\lceil  \frac{i+1}{8}\right\rceil, &&\text{for $i=1,2,\dots, n-1$,}\\
\varphi_4(u_iu_{i+1})&= \left\lceil  \frac{i}{8}\right\rceil, &&\text{for $i=1,2,\dots, n-1$,}\\
\varphi_4(v_iu_i)&= \left\lceil  \frac{i+4}{8}\right\rceil, &&\text{for $i=1,2,\dots, n$,}
\end{align}

• You shouldn't use an alignment character inside \text, nor should you use $$...$$ inside align (or anywhere...).
– Werner
Feb 7 '17 at 7:01

This code gives the error “missing } inserted”. What is this error?

As a general rule, once sufficiently many syntax errors have piled up, and especially if the syntax errors interact with each other, TeX's error messages can become uninformative. Unfortunately, your code contains a disturbing number of syntax errors. For sure, don't ever use  when already inside a math environment. Your code also features several instances of either surplus or missing & (alignment character) and  (inline math initiator/terminator) characters. After fixing these issues, this is what I came up with -- is this what you're looking for? \documentclass{article} \usepackage[letterpaper,margin=1in]{geometry} % choose page settings \usepackage{mathtools} \DeclarePairedDelimiter{\ceil}{\lceil}{\rceil} \begin{document} \begin{align} \varphi_m(v_i) &= \ceil*{\frac{2i+3m}{4m}}, &&\text{fori=1,2,\dots, n$,}\\ \varphi_m(u_i) &= \begin {dcases} \ceil*{\frac{i}{2m}}, & \text{for$i\equiv 0,\frac{m}{2} \mod 2m$,}\\ \ceil*{\frac{i}{m+1}}, & \text{for$i\not\equiv 0,\frac{m}{2} \mod 2m$,} \end{dcases} \\ \dim(G_{4,6}^{(k)}) &=\dim(K_4^{(k)}) = \begin{cases} 2 & \text{for$2\le k\equiv 0 \ ({\rm{mod}}\ 2)$,}\\ 3 & \text{for$k=0$or$1\le k\equiv 1\ ({\rm{mod}}\ 2)$.} \end{cases} \\ \varphi_4(v_iv_{i+1})&= \ceil*{\frac{i+1}{8}}, &&\text{for$i=1,2,\dots, n-1$,}\\ \varphi_4(u_iu_{i+1})&= \ceil*{\frac{i}{8}}, &&\text{for$i=1,2,\dots, n-1$,}\\ \varphi_4(v_iu_i) &= \ceil*{\frac{i+4}{8}}, &&\text{for$i=1,2,\dots, n,} \end{align} \end{document}  Addendum: You may also want to replace all instances of the dreadful-looking \ ({\rm{mod}}\ 2) with \pmod{2}. For the sake of consistency, you should also write \pmod{2m} in one of the other equations. For a more compact and probably more readable look, consider replacing all instances of && spacers with \qquad. Reducing the vertical size of the "ceiling" brackets may also improve the look of the equations. \documentclass{article} \usepackage[letterpaper,margin=1in]{geometry} % text block settings \usepackage{mathtools} \DeclarePairedDelimiter{\ceil}{\lceil}{\rceil} \begin{document} \begin{align} \varphi_m(v_i)&= \ceil[\Big]{\frac{2i+3m}{4m}}, \qquad \text{fori=1,2,\dots, n$,}\\ \varphi_m(u_i)&= \begin {dcases} \ceil[\Big]{\frac{i}{2m}}, & \text{for$i\equiv 0,m/2\pmod{2m}$,}\\ \ceil[\Big]{\frac{i}{m+1}}, & \text{for$i\not\equiv 0,m/2\pmod{2m}$,} \end{dcases} \\ \dim(G_{4,6}^{(k)})=\dim(K_4^{(k)}) &= \begin{cases} 2, & \text{for$2\le k\equiv 0 \pmod{2}$,}\\ 3, & \text{for$k=0$or$1\le k\equiv 1 \pmod{2}$.} \end{cases} \\ \varphi_4(v_iv_{i+1})&= \ceil[\Big]{\frac{i+1}{8}}, \qquad\text{for$i=1,2,\dots,n-1$,}\\ \varphi_4(u_iu_{i+1})&= \ceil[\Big]{\frac{i}{8}}, \qquad\text{for$i=1,2,\dots,n-1$,}\\ \varphi_4(v_iu_i) &= \ceil[\Big]{\frac{i+4}{8}}, \qquad\text{for$i=1,2,\dots,n\$.}
\end{align}
\end{document}

• It should probably be \pmod{2m} and also \pmod{2} for consistency. If it is to be interpreted as a binary operation symbol, it should be \bmod. Feb 7 '17 at 9:11
• @egreg - Thanks for this. (I am more than happy to defer to you on issues of mathematical notation!) I already corrected the \pmod2 business in the addendum; I'll apply the same treatment to the 2m items.
– Mico
Feb 7 '17 at 9:22
• I insist: teaching \pmod 2 is wrong, because it doesn't underline that \pmod takes an argument. This can lead astray the beginner who's trying to typeset congruences modulo 11. Feb 7 '17 at 9:34
• @egreg -- Sorry, I completely missed that. I'll update the code right away.
– Mico
Feb 7 '17 at 9:35