![[테이블]{xcolor} 및 배열 v2.4k 충돌](https://rvso.com/image/391590/%5B%ED%85%8C%EC%9D%B4%EB%B8%94%5D%7Bxcolor%7D%20%EB%B0%8F%20%EB%B0%B0%EC%97%B4%20v2.4k%20%EC%B6%A9%EB%8F%8C%20.png)
다음을 사용하여 테이블을 만들려고 합니다.
- 셀마다 다른 서식 지정
- 각주
- 미니페이지
- 컬러 행
xcolor
컬러 행의 경우 옵션 과 함께 사용하려고 합니다 [table]
.
그러나 이로 인해 >{\bfseries}
열 사양에 오류가 발생합니다. 저는 Windows 10 x64 및 패키지 버전 2.4k에서 MiKTeX 2.9.6972를 사용하고 있습니다 array
.여기, XeLaTeX를 사용하여 컴파일합니다(PDFLaTeX가 동일한 오류를 생성하는 것 같지만). 패키지를 끄면 작동 xcolor
하지만 \rowcolor
명령을 더 이상 사용할 수 없습니다.
내 질문은 두 가지입니다.
[table]{xcolor}
와 함께 사용 가능한가요{array}
?- 그렇지 않은 경우 테이블 행에 색상을 지정하는 대안이 있습니까?
MWE:
\documentclass{article}
\usepackage[table]{xcolor} % works if we remove the 'table' option, but then we don't have access to cellcolor/rowcolor
%\usepackage{xcolor}
\usepackage{booktabs}
% force the new array package to be loaded.
\usepackage{tabularx}
% https://texfaq.org/FAQ-wholerow
\newcolumntype{@}{>{\global\let\currentrowstyle\relax}}
\newcolumntype{^}{>{\currentrowstyle}}
\newcommand{\rowstyle}[1]{\gdef\currentrowstyle{#1}%
#1\ignorespaces
}
\begin{document}
\begin{tabular}{>{\bfseries}@p{5.5cm}^r}
Col A & Col B \\
\midrule
\rowstyle{\bfseries\itshape\large}This row should be large, bold, italics with shading & So this cell too. \\
\rowcolor{blue}This bold but shaded & this just normal.\footnote{I.e., no extra mark-up} \\
Remark & \multicolumn{1}{c}{\begin{minipage}[t]{3.5cm}\raggedright {\footnotesize Some cells are included as a minipage to accommodate extra text.}\end{minipage}} \\
\midrule
\end{tabular}
\end{document}
내가 얻는 오류는 다음과 같습니다.
! Use of \@startpbox doesn't match its definition.
<inserted text> \@startpbox {
>{\bfseries }@p{5.5cm}^r}
l.19 \begin{tabular}{>{\bfseries}@p{5.5cm}^r}
If you say, e.g., `\def\a1{...}', then you must always put `1' after `\a',
since control sequence names are made up of letters only.
The macro here has not been followed by the required stuff, so I'm ignoring
it.
! LaTeX Error: Command \bfseries invalid in math mode.