Normally, a simple cases will get the result below.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
X=\begin{cases}
0, & \text{if $a=1$} \\
1, & \text{otherwise}
\end{cases}
\end{equation}
\end{document}
However, in my thesis template, it generates
\documentclass{article}
\usepackage{tabu}
\usepackage{longtable}
\usepackage{amsmath}
\usepackage{setspace}
\setstretch{1.435}
\begin{document}
\setlength{\extrarowheight}{8pt}
\begin{longtabu}{ll}
\caption{This is a caption} \\
Longtable & Longtable \\
Longtable & Longtable \\
Longtable & Longtable \\
\end{longtabu}
\begin{equation}
X=\begin{cases}
0, & \text{if $a=1$} \\
1, & \text{otherwise}
\end{cases}
\end{equation}
\end{document}
I changed the default line spacing by
\usepackage{setspace}
\setstretch{1.435}
and increased the row spacing by
\setlength{\extrarowheight}{8pt}
My question is how to center the two cases.



\setlength{\extrarowheight}{8pt}which was used to increase the vertical spacing for a table, but it also affects the equations as well. – WZhao Aug 22 '19 at 07:46\extrarowheightin a table, then don't change that value globally, place it in side the table float you have around your tabular, then the change it local to that float. – daleif Aug 22 '19 at 07:53\extrarowheightfor that one table, you can reset it to0ptafterwards, or else, place thetabuin its own scope-limited group to limit the reach of the\extrarowheight(assuming that labels are not an issue). – Steven B. Segletes Aug 22 '19 at 09:08