![케이스 환경 내에서 관계 기호를 정렬하려면 어떻게 해야 합니까?](https://rvso.com/image/254687/%EC%BC%80%EC%9D%B4%EC%8A%A4%20%ED%99%98%EA%B2%BD%20%EB%82%B4%EC%97%90%EC%84%9C%20%EA%B4%80%EA%B3%84%20%EA%B8%B0%ED%98%B8%EB%A5%BC%20%EC%A0%95%EB%A0%AC%ED%95%98%EB%A0%A4%EB%A9%B4%20%EC%96%B4%EB%96%BB%EA%B2%8C%20%ED%95%B4%EC%95%BC%20%ED%95%A9%EB%8B%88%EA%B9%8C%3F.png)
LaTeX에서 다음 코드를 사용했습니다.
\documentclass{article}
\usepackage{amssymb,amsmath}
\begin{document}
\begin{table}[H]
\centering
\begin{tabular}{c|c}
\hline
{ $X=y+z$} & {
\parbox[c]{0.75\columnwidth}{
$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$\\
}
}\tabularnewline \hline
\end{tabular}
\end{table}
\end{document}
출력에서 등호 C_L
와 가 f(E)
서로 정렬되기를 바랍니다. 환경을 사용하려고 시도했지만 align
작동하지 않습니다. 누구든지 도와주실 수 있나요?
답변1
를 사용하는 cases
것과 같은 양만큼 콘텐츠를 오른쪽으로 밀어 넣을 수 있습니다.f(E)
$\phantom{f(E)}\llap{$C_L$} = \begin{cases}
%...
eft l
over는 간격에 영향을 lap
주지 않도록 오른쪽 정렬되고 너비가 0인 상자를 만듭니다 .C_L
추신. 수학 모드에서 \min
입력하는 대신 사용하고 싶을 수도 있습니다 .min
답변2
align
패키지 에서 제공하는 환경을 사용할 수 있습니다 amsmath
. 어쨌든 로드하는 걸 봤습니다.
\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}
등호 앞의 앰퍼샌드는 정렬해야 하는 문자를 설정합니다. 즉, 다른 위치에서 사용한 경우 뒤에 오는 문자가 정렬됩니다.
코드의 출력은 다음과 같습니다.
답변3
환경 을 사용하는 것이 aligned
나에게는 가장 간단한 해결책인 것 같습니다.
\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}
주목해야 할 두 가지 사항:
- 내에서
\parbox
환경aligned
은 명시적으로 수학 모드로 전환되어야 합니다. - 원래 예에서는 상단보다 하단에 더 많은 공간이 있었습니다. 이는
\\
여기에서 제거된 마지막 줄 이후의 추가 항목으로 인해 발생했습니다 .
답변4
이것은 Barbara의 제안에 대한 설명일 뿐입니다(대답은 더 나은 형식을 허용합니다). 내부 케이스 대신에 alignedat
내부 조건을 정렬하기 위해 사용하겠습니다.cases
\left\{
\begin{alignedat}{2}
&\min[(Re),\: f(B)]\:;&\quad A&<4\\
&f(E)\:; &4&\le E<10\\
&-0.29\:; &E&\ge10
\end{alignedat}
\right.
또한 나는 아무것도 기여하지 않은 \left...\right
구성을 내부에서 제거했습니다 .\min
편집: 시각적 요소를 추가했습니다.