
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