How can I align at relation symbols within a cases environment?
You can use the align
environment, which is provided by the amsmath
package. I see you load it anyway:
\documentclass{article}
\usepackage{amssymb,amsmath}
\begin{document}
\begin{table}[H]
\centering
\begin{tabular}{c|c}
\hline
{ $X=y+z$} & {
\parbox[c]{0.75\columnwidth}{
\begin{align}
C_L&= \begin{cases}
min\left[\left(Re\right),\: f(B)\right]\:;\: A<4\\
f(E)\:;\:4\le E<10\\
-0.29\:;\: E\ge10
\end{cases}\\
f(E)&= E^{3}-0.0159E^{2}-0.0204E+0.474
\end{align}
}
}\tabularnewline \hline
\end{tabular}
\end{table}
\end{document}
The ampersands before the equal signs set the characters that need to be aligned, meaning that if you used it in another place, the character that follows will be aligned.
And here's the output of the code:
You can push the cases
content to the right the same amount as f(E)
using
$\phantom{f(E)}\llap{$C_L$} = \begin{cases}
%...
The l
eft overlap
makes a right-aligned, zero-width box to not let C_L
influence the spacing.
Ps. You may want to use \min
instead of just typing min
in math mode.
use of the aligned
environment seems the simplest fix to me:
\documentclass{article}
\usepackage{amssymb,amsmath}
\begin{document}
\begin{table}[H]
\centering
\begin{tabular}{c|c}
\hline
{ $X=y+z$} & {
\parbox[c]{0.75\columnwidth}{
\( \begin{aligned}
C_L&= \begin{cases}
min\left[\left(Re\right),\: f(B)\right]\:;\: A<4\\
f(E)\:;\:4\le E<10\\
-0.29\:;\: E\ge10
\end{cases}\\
f(E)&= E^{3}-0.0159E^{2}-0.0204E+0.474
\end{aligned} \)
}
}\tabularnewline \hline
\end{tabular}
\end{table}
\end{document}
two things to notice:
- within a
\parbox
, thealigned
environment needs to be put explicitly into math mode; - the original example had more space at the bottom than at the top; this was caused by an extra
\\
after the last line, which has been removed here.