# File ended while scanning use of \substack

Everything was fine when I changed external pdf from default to adobe reader. after that it never meant to run again indicating the above error. Frustrating

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{relsize}
\usepackage{xcolor}
\begin{document}
\section{Capacity} \par
Let $\rho_{P}$ and $\rho_{S}$ be the capacity of PU and SU service respectively. Correspondingly we obtain
$$\rho_{P} =\sum_{x\epsilon S}(i_{n} + i_{r})\mu_{P}\pi(x)$$\par
$$\rho_{S} =\sum_{x\epsilon S}(j_{n1} + j_{n2} + j_{r1} + j_{r2})\mu_{S}\pi(x)$$
\section{Channel Availability}
$A_P$ denotes availability of PU service. We obtain
$$A_{P}=1-\sum_{\substack{x\epsilon S \\B(x)=M \;or\; B_n(x)=M-R(x);\; j_{n1}=j_{n2}=0}}\pi(x)$$
Similarly, $A_{S1}$ denotes availability of $SU_{1}$ service. We obtain $$A_{S1}=1-\sum_{x\epsilon S \\B(x)=M \;or\; B_n(x)=M-R(x);\; j_{n2}=0}\pi(x)$$
Similarly, $A_{S2}$ denotes availability of $SU_{2}$ service. We obtain\\
$$A_{S2}=1-\sum_{\substack{x\epsilon S \\B(x)=M}}\pi(x)$$\par
Accordingly the blocking probabilities of PU and SU services, denoted as $P^{B}_{P}$ and $P^{B}_{S}$ respectively, are obtained as
$$P^{B}_{P}=1-A_P$$
$$P^{B}_{S1}=1-A_{S1}$$
$$P^{B}_{S2}=1-A_{S2}$$\par
The retainability of a service, $\theta$ , is expressed as
$$\theta= 1 - P_F$$\\
where $P_F$ is the forced termination probability of that service. \par
Now, denote the rate of forced terminations SUs due to PU arrivals as $R_S$. Then we have
$$R_{S1}=\lambda_P \sum_{\substack{x\epsilon S \\B(x)=M;\;\; j_{n2}=j_{r2}=0;\;\; j_{n1}>0}}\pi(x)$$\\
Similarly, the rate of forced termination of $SU_{2}$ due to $PU$ and $SU_1$ arrivals are respectively given as:
$$R_{S2}=\lambda_P \sum_{\substack{x\epsilon S \\B(x)=M;\;j_{n2}>0$$ and
$$R_{S2}=\lambda_S \sum_{\substack{x\epsilon S \\B(x)=M;\;j_{n2}>0$$ \par
\section{Forced Termination on Channel Failure}
In addition, ongoing $SU_1$ services can also be terminated upon a channel failure when all other channels in the CRN are busy. Denote the rate of forced termination of SUs due to channel failure as $R^{'}_{S1}$. It is obtained by
$$R^{'}_{S1}=\lambda_F\sum_{x\epsilon S \\B(x)=M\\ ((j_{n1}>0;\;j_{n2}=j_{r2}=0)\; or\; (B_n(x)=0;\;jr_1=0\; jr_1>0))}(M-f)\pi(x).$$
For $SU_2$, we have
$$R^{'}_{S2}=\lambda_F \sum_{\substack{x\epsilon S\\ (j_{n2}>0\;or\;\; j_{r1}>0))}}(M-f)\pi(x).$$
\par
\section{Retainability}
\subsection{Retainability of the SN:}
Since the effective rate in which a new SU service is assigned a channel is $\Lambda_S=A_S\lambda_S$, we have $P^F_S=(R_S+R^{'}_{S})/\Lambda_S$\\
Correspondingly, the retainability of SU services, $\theta_S$, can be expressed as
$$\theta_S=1-\frac{(R_S + R^{'}_{S})}{\Lambda_S}$$
\par
\subsection{Retainability of the PN:} Similarly, the forced termination probability of PU services due to channel failures, $P^F_P$, can be expressed as
$$P^F_P=\frac{(R_P+R^{'}_P)}{\Lambda_P}$$\\
where $R^{'}_P$ and $\Lambda_P$ are given by
$$R^{'}_P=\lambda_F \quad \sum_{\substack{x\epsilon S \\B(x)=M\\ ((j_{n1}=j_{n2}=j_{r2}=0;\; i_n>0)\; or\; (B_n(x)=j_{r2}=0;\; i_r>0))}} (M - f) \pi(x)$$\\
and $\Lambda_P=A_p\lambda_P$ respectively. Note that $R_P$, which denotes the forced termination rate of PUs due to new user arrivals, always equals zero since none of the ongoing PUs can be terminated due to the arrivals of new users. Therefore, the retainability of PU services, $\theta_P$, is given by
$$\theta_P=1-\frac{R^{'}_P}{\Lambda_P}$$
\par
\section{NUP}
Accordingly, the NUP for SU services, $Q_S$, can be defined as the probability that an SU service cannot be completed successfully. It is obtained by calculating the ratio between the rate of service completions and the rate of arrivals as follows:\par
\begin{eqnarray*}
Q_S&=& \text{1 - (prob. of successfully finishing an SU service)}\\
&=&1 - \frac{\lambda_S(1 - P^B_S)(1-P^F_S)}{\lambda_S}\\
&=&P^B_S + P^F_S - P^B_S P^F_S\\
Q_S&=&P^B_S + P^F_S - P^B_S P^F_S
\end{eqnarray*}
Similarly, the NUP for PUs, $Q_P$ can be derived as follows.
$$Q_P=P^B_P + P^F_P - P^B_PP^F_P$$
\end{document}

• Welcome to TeX.SE. Sep 15, 2018 at 11:16

The main problem are some missing braces: it should be

\sum_{\substack{<row>\\<row>\\...\\<row>}}


with two braces at the end!

It's also a good occasion for polishing up your code.

1. The option 12 should be 12pt

2. You rarely (if ever) need \par in the body of a document; use a blank line instead

3. Never use  in LaTeX; for a single equation use $...$ instead 4. Consecutive centered equation should be typed in as a single gather* environment 5. The symbol for “belongs to” is \in, not \epsilon 6. Don't add \\ after a math display 7. Never use eqnarray, prefer align 8. R^{'} should simply be R' 9. Rather than \;or\; you should use \text{ or } You should try and make the \substacks more compact, because when too long they make the formula hard to read. \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{relsize} \usepackage{xcolor} \usepackage[colorlinks]{hyperref} \begin{document} \section{Capacity} Let \rho_{P} and \rho_{S} be the capacity of PU and SU service respectively. Correspondingly we obtain \begin{gather*} \rho_{P} =\sum_{x\in S}(i_{n} + i_{r})\mu_{P}\pi(x) \\ \rho_{S} =\sum_{x\in S}(j_{n1} + j_{n2} + j_{r1} + j_{r2})\mu_{S}\pi(x) \end{gather*} \section{Channel Availability} A_P denotes availability of PU service. We obtain $A_{P}= 1-\sum_{\substack{x\in S \\ B(x)=M\text{ or }B_n(x)=M-R(x);\\ j_{n1}=j_{n2}=0}}\pi(x)$ Similarly, A_{S1} denotes availability of SU_{1} service. We obtain $A_{S1}=1-\sum_{\substack{x\in S \\ B(x)=M\text{ or }B_n(x)=M-R(x);\\ j_{n2}=0}}\pi(x)$ Similarly, A_{S2} denotes availability of SU_{2} service. We obtain $A_{S2}=1-\sum_{\substack{x\in S \\ B(x)=M}}\pi(x)$ Accordingly the blocking probabilities of PU and SU services, denoted as P^{B}_{P} and P^{B}_{S} respectively, are obtained as \begin{gather*} P^{B}_{P}=1-A_P \\ P^{B}_{S1}=1-A_{S1} \\ P^{B}_{S2}=1-A_{S2} \end{gather*} The retainability of a service, \theta , is expressed as $\theta= 1 - P_F$ where P_F is the forced termination probability of that service. Now, denote the rate of forced terminations SUs due to PU arrivals as R_S. Then we have $R_{S1}= \lambda_P \sum_{\substack{x\in S \\ B(x)=M;\\ j_{n2}=j_{r2}=0;\\ j_{n1}>0}}\pi(x)$ Similarly, the rate of forced termination of SU_{2} due to PU and SU_1 arrivals are respectively given as: $R_{S2}=\lambda_P \sum_{\substack{x\in S \\B(x)=M;\\ j_{n2}>0}}\pi(x)$ and $R_{S2}=\lambda_S \sum_{\substack{x\in S \\B(x)=M;\\ j_{n2}>0}}\pi(x)$ \section{Forced Termination on Channel Failure} In addition, ongoing SU_1 services can also be terminated upon a channel failure when all other channels in the CRN are busy. Denote the rate of forced termination of SUs due to channel failure as R'_{S1}. It is obtained by $R'_{S1}=\lambda_F\sum_{\substack{x\in S \\B(x)=M\\ ((j_{n1}>0;\; j_{n2}=j_{r2}=0)\; \text{ or }\; (B_n(x)=0;\;jr_1=0\; jr_1>0))}}(M-f)\pi(x).$ For SU_2, we have $R'_{S2}=\lambda_F \sum_{\substack{x\in S\\ (j_{n2}>0\text{ or }j_{r1}>0))}} (M-f)\pi(x).$ \section{Retainability} \subsection{Retainability of the SN:} Since the effective rate in which a new SU service is assigned a channel is \Lambda_S=A_S\lambda_S, we have  P^F_S=(R_S+R'_{S})/\Lambda_S. Correspondingly, the retainability of SU services, \theta_S, can be expressed as $theta_S=1-\frac{(R_S + R'_{S})}{\Lambda_S}$ \subsection{Retainability of the PN:} Similarly, the forced termination probability of PU services due to channel failures, P^F_P, can be expressed as $P^F_P=\frac{(R_P+R'_P)}{\Lambda_P}$ where R'_P and \Lambda_P are given by $R'_P=\lambda_F \sum_{\substack{x\in S \\B(x)=M\\ ((j_{n1}=j_{n2}=j_{r2}=0;\; i_n>0)\text{ or }(B_n(x)=j_{r2}=0;\; i_r>0))}} (M - f) \pi(x)$ and \Lambda_P=A_p\lambda_P respectively. Note that R_P, which denotes the forced termination rate of PUs due to new user arrivals, always equals zero since none of the ongoing PUs can be terminated due to the arrivals of new users. Therefore, the retainability of PU services, \theta_P, is given by $\theta_P=1-\frac{R'_P}{\Lambda_P}$ \section{NUP} Accordingly, the NUP for SU services, Q_S, can be defined as the probability that an SU service cannot be completed successfully. It is obtained by calculating the ratio between the rate of service completions and the rate of arrivals as follows: \begin{align*} Q_S &= 1- \text{(prob. of successfully finishing an SU service)}\\ &= 1 - \frac{\lambda_S(1 - P^B_S)(1-P^F_S)}{\lambda_S}\\ &= P^B_S + P^F_S - P^B_S P^F_S\\ Q_S &= P^B_S + P^F_S - P^B_S P^F_S \end{align*} Similarly, the NUP for PUs, Q_P can be derived as follows: $Q_P=P^B_P + P^F_P - P^B_PP^F_P$ \end{document}  • Superb suggestions and advice! It made me love Latex. :-) Sep 16, 2018 at 14:42 • @Abdullah1 You're welcome! Sep 16, 2018 at 15:05 There were four brackets missing. Please try to compile the following code. \documentclass{article} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{relsize} \usepackage{xcolor} \usepackage[colorlinks]{hyperref} \begin{document} \section{Capacity} \par Let \rho_{P} and \rho_{S} be the capacity of PU and SU service respectively. Correspondingly we obtain \rho_{P} =\sum_{x\epsilon S}(i_{n} + i_{r})\mu_{P}\pi(x)$$\par$$ \rho_{S} =\sum_{x\epsilon S}(j_{n1} + j_{n2} + j_{r1} + j_{r2})\mu_{S}\pi(x)$$\section{Channel Availability} A_P denotes availability of PU service. We obtain$$ A_{P}=1-\sum_{\substack{x\epsilon S \\B(x)=M \;or\; B_n(x)=M-R(x);\; j_{n1}=j_{n2}=0}}\pi(x)$$Similarly, A_{S1} denotes availability of SU_{1} service. We obtain$$ A_{S1}=1-\sum_{x\epsilon S \\B(x)=M \;or\; B_n(x)=M-R(x);\; j_{n2}=0}\pi(x)$$Similarly, A_{S2} denotes availability of SU_{2} service. We obtain\\$$A_{S2}=1-\sum_{\substack{x\epsilon S \\B(x)=M}}\pi(x)$$\par Accordingly the blocking probabilities of PU and SU services, denoted as P^{B}_{P} and P^{B}_{S} respectively, are obtained as$$ P^{B}_{P}=1-A_PP^{B}_{S1}=1-A_{S1}P^{B}_{S2}=1-A_{S2}$$\par The retainability of a service, \theta , is expressed as$$\theta= 1 - P_F$$\\ where P_F is the forced termination probability of that service. \par Now, denote the rate of forced terminations SUs due to PU arrivals as R_S. Then we have$$ R_{S1}=\lambda_P \sum_{\substack{x\epsilon S \\B(x)=M;\;\; j_{n2}=j_{r2}=0;\;\;  j_{n1}>0}}\pi(x)$$\\ Similarly, the rate of forced termination of SU_{2} due to PU and SU_1 arrivals are respectively given as: \textcolor{red}{\bfseries{}There are two "\}" missing in the index of the sum}$$ R_{S2}=\lambda_P \sum_{\substack{x\epsilon S \\B(x)=M}};\;j_{n2}>0$$and$$ R_{S2}=\lambda_S \sum_{\substack{x\epsilon S \\B(x)=M}};\;j_{n2}>0$$\par \section{Forced Termination on Channel Failure} In addition, ongoing SU_1 services can also be terminated upon a channel failure when all other channels in the CRN are busy. Denote the rate of forced termination of SUs due to channel failure as R^{'}_{S1}. It is obtained by$$ R^{'}_{S1}=\lambda_F\sum_{x\epsilon S \\B(x)=M\\ ((j_{n1}>0;\;j_{n2}=j_{r2}=0)\; or\; (B_n(x)=0;\;jr_1=0\; jr_1>0))}(M-f)\pi(x).$$For SU_2, we have$$ R^{'}_{S2}=\lambda_F \sum_{\substack{x\epsilon S\\ (j_{n2}>0\;or\;\; j_{r1}>0))}}(M-f)\pi(x).$$\par \section{Retainability} \subsection{Retainability of the SN:} Since the effective rate in which a new SU service is assigned a channel is \Lambda_S=A_S\lambda_S, we have  P^F_S=(R_S+R^{'}_{S})/\Lambda_S\\ Correspondingly, the retainability of SU services, \theta_S, can be expressed as$$ \theta_S=1-\frac{(R_S + R^{'}_{S})}{\Lambda_S}$$\par \subsection{Retainability of the PN:} Similarly, the forced termination probability of PU services due to channel failures, P^F_P, can be expressed as$$ P^F_P=\frac{(R_P+R^{'}_P)}{\Lambda_P}$$\\ where R^{'}_P and \Lambda_P are given by$$R^{'}_P=\lambda_F \quad \sum_{\substack{x\epsilon S \\B(x)=M\\ ((j_{n1}=j_{n2}=j_{r2}=0;\; i_n>0)\; or\; (B_n(x)=j_{r2}=0;\; i_r>0))}} (M - f) \pi(x)$$\\ and \Lambda_P=A_p\lambda_P respectively. Note that R_P, which denotes the forced termination rate of PUs due to new user arrivals, always equals zero since none of the ongoing PUs can be terminated due to the arrivals of new users. Therefore, the retainability of PU services, \theta_P, is given by$$\theta_P=1-\frac{R^{'}_P}{\Lambda_P}$$\par \section{NUP} Accordingly, the NUP for SU services, Q_S, can be defined as the probability that an SU service cannot be completed successfully. It is obtained by calculating the ratio between the rate of service completions and the rate of arrivals as follows:\par \begin{eqnarray*} Q_S&=& \text{1 - (prob. of successfully finishing an SU service)}\\ &=&1 - \frac{\lambda_S(1 - P^B_S)(1-P^F_S)}{\lambda_S}\\ &=&P^B_S + P^F_S - P^B_S P^F_S\\ Q_S&=&P^B_S + P^F_S - P^B_S P^F_S \end{eqnarray*} Similarly, the NUP for PUs, Q_P can be derived as follows.$$Q_P=P^B_P + P^F_P - P^B_PP^F_P$$\end{document}  You will see a remark printed in red that shows the relevant spots. You can remove those marks. Various editors feature syntax highlighting (https://en.wikipedia.org/wiki/Syntax_highlighting) and some of those make finding those missing braces easier, see LaTeX Editors/IDEs or https://en.wikipedia.org/wiki/Comparison_of_TeX_editors. Please see Why is $...$ preferable to$$ ... $$? and What are the differences between$$, \[, align, equation and displaymath?. The video https://youtu.be/LFrdqQZ8FFc might also be helpful.

I do not know what this has to do with the change to the Adobe Reader.