
센터링을 시도했지만 작동하지 않았습니다.
\begin{longtabu}{|r|r|} %\textwidth
\hline
\centering \boldmath $X$ & \centering \boldmath $Y$ \tabularnewline
\hline
$-9.644$ & $93.000$ \\
\hline
$1.997$ & $3.988$ \\
\hline
\end{longtabu}
답변1
답변2
평소에 \multicolumn{1}{<alignment>}{<content>}
도움이 될 수 있습니다. \mathbf{X}
또한 ,X
대신 수학 모드에서는 굵은 글씨로 표시됩니다 \boldmath X
. 또한 각 셀에서 수동으로 수학 모드로 전환하는 대신 >{$} r <{$}
헤더의 사양으로 충분합니다.
\documentclass{article}
\usepackage{longtable,tabu}
\begin{document}
\begin{longtabu}{| >{$}r<{$} | >{$}r<{$} |} %\textwidth
\hline
\multicolumn{1}{|c|}{$\mathbf{X}$} & \multicolumn{1}{c|}{$\mathbf{Y}$} \\
\hline
-9.644 & 93.000 \\
\hline
1.997 & 3.988 \\
\hline
\end{longtabu}
\end{document}
답변3
tabu
님의 명령을 사용하세요 \rowfont [alignment]{font spec}
.
\documentclass{article}
\usepackage{tabu}
\begin{document}
\begin{tabu} to 15em {| X[r] | X[r] |} \hline
\everyrow{\hline}
\rowfont[c]{\bfseries}
X & Y \\
-9.644 & 93.000 \\
1.997 & 3.988 \\
\end{tabu}
\end{document}
(첫 번째 줄을 굵게 표시하지 않으려면 \rowfont[c]{}
물론 을 사용할 수도 있습니다.)
불행히도 \rowfont[c]
수학 모드에서는 무시되는 것 같은데 이유를 모르겠습니다. 하지만 수학 모드가 필요하지 않다면 가장 간단하고 예쁜 솔루션입니다.