![xcolor 테이블 옵션을 사용할 때 테이블 형식 환경에서 정렬이 잘못됨](https://rvso.com/image/335467/xcolor%20%ED%85%8C%EC%9D%B4%EB%B8%94%20%EC%98%B5%EC%85%98%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%EB%95%8C%20%ED%85%8C%EC%9D%B4%EB%B8%94%20%ED%98%95%EC%8B%9D%20%ED%99%98%EA%B2%BD%EC%97%90%EC%84%9C%20%EC%A0%95%EB%A0%AC%EC%9D%B4%20%EC%9E%98%EB%AA%BB%EB%90%A8.png)
xcolor=table
옵션을 로드할 때 테이블 형식 환경의 올바른 정렬에 영향을 미치는 이상한 동작을 발견했습니다 .
이 MWE의 출력
\documentclass{beamer}
\usepackage{siunitx,booktabs,multirow}
\begin{document}
\begin{frame}
\centering
\begin{tabular}{@{}l|ccc@{}}
\toprule
\multirow{2}{*}{\huge Parameters} & \multicolumn{3}{c}{Levels}\\
\cmidrule{2-4}
& 1 & 2 & 3 \\
\midrule
Power \hfill \si{\W} & 100 & 200 & 300 \\
\bottomrule
\end{tabular}
\end{frame}
\end{document}
~이다
그런데 옵션을 사용하면 \documentclass[xcolor=table]{beamer}
마지막 행의 첫 번째 셀에 정렬이 잘못되어 이와 같은 출력이 나왔습니다.
이 옵션을 로드하여 올바르게 정렬하려면 어떻게 해야 합니까 xcolor=table
?
답변1
하나 대신 두 개의 열을 사용하십시오.
\documentclass[xcolor=table]{beamer}
\usepackage{siunitx,booktabs,multirow}
\begin{document}
\begin{frame}
\centering
\begin{tabular}{@{}lrccc@{}}
\toprule
\multicolumn{2}{@{}c}{\multirow{2}{*}{\huge Parameters}} & \multicolumn{3}{c}{Levels}\\
\cmidrule{3-5}
& & 1 & 2 & 3 \\
\midrule
Power & \si{\W} & 100 & 200 & 300 \\
\bottomrule
\end{tabular}
\bigskip
\begin{tabular}{@{}lrccc@{}}
\toprule
\multicolumn{2}{@{}c}{Parameters} & \multicolumn{3}{c}{Levels}\\
\cmidrule{3-5}
& & 1 & 2 & 3 \\
\midrule
Power & \si{\W} & 100 & 200 & 300 \\
\bottomrule
\end{tabular}
\end{frame}
\end{document}
나는 당신에게 거대한 \huge
라벨이 없는 두 번째 테이블을 고려해 볼 것을 제안합니다.
또는 코드에서 다음을 작성하십시오.
Power\hspace{0pt plus 1filll}\si{W}
TeXnical 이유는 colortbl
( table
옵션 으로 로드됨) 이 핵심 코드가 아닌 xcolor
왼쪽 정렬을 실현하기 때문입니다. 따라서 개체를 오른쪽 여백으로 밀어 넣으려면 더 높은 차원의 무한 접착제가 필요합니다.\hfill
\hfil