为了一份文件,我一直在准备一个辅音图表:
\documentclass{standalone}
\usepackage{booktabs}
\usepackage{array}
\begin{document}
\begin{tabular}{>{\bfseries}r*{10}{c}}
\toprule
&
\multicolumn{2}{c}{\bfseries Labial} &
\multicolumn{2}{c}{\bfseries Alveolar} &
\multicolumn{2}{c}{\bfseries Palatal} &
\multicolumn{2}{c}{\bfseries Velar} &
\multicolumn{2}{c}{\bfseries Glottal} \\ \midrule
Nasal & mh & m & nh & n & & & & & & \\
Stop & p & b & t & d & & & k & g & & \\
Sibilant & & & \multicolumn{2}{c}{s} & & & & & & \\
Fricative & f & v & th & dh & c & & & & xh & x \\
Approximant & & & & & & j & wh & w & & \\
Lateral & & & lh & l & & & & & & \\
Trill & & & rh & r & & & & & & \\
\bottomrule
\end{tabular}
\end{document}
编译此代码将pdflatex
产生以下输出(灰色区域只是我的 PDF 查看器的背景):
我的问题很简单:为什么偏离s
中心?
答案1
您现在的印象是,它是居中的吗?
我建议使用tabularx
,它提供等宽的列
\documentclass{standalone}
\usepackage{array}
\usepackage{booktabs}
\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcommand\mcbf[1]{\multicolumn{2}{c}{\textbf{#1}}}
\begin{document}
\begin{tabularx}{\linewidth}{>{\bfseries}r*{10}{C}}
\toprule
& \mcbf{Labial} & \mcbf{Alveolar} & \mcbf{Palatal}
& \mcbf{Velar} & \mcbf{Glottal} \\
Nasal & mh & m & nh & n & & & & & & \\
Stop & p & b & t & d & & & k & g & & \\
Sibilant & & & \multicolumn{2}{c}{s} & & & & & & \\
Fricative & f & v & th & dh & c & & & & xh & x \\
Approximant & & & & & & j & wh & w & & \\
Lateral & & & lh & l & & & & & & \\
Trill & & & rh & r & & & & & & \\
\bottomrule
\end{tabularx}
\end{document}
答案2
我补充道|c|
可视化单元格的边界。我增加了一个不可见的空间(\hspace{<some length>}
)以便将s。这是一个手动解决方案,不如来自的解决方案好扎尔科。
\documentclass{standalone}
\usepackage{booktabs}
\usepackage{array}
\usepackage{xcolor}
\begin{document}
\begin{tabular}{>{\bfseries}r*{10}{|c|}}
\toprule
&
\multicolumn{2}{c}{\bfseries Labial} &
\multicolumn{2}{c}{\bfseries Alveolar} &
\multicolumn{2}{c}{\bfseries Palatal} &
\multicolumn{2}{c}{\bfseries Velar} &
\multicolumn{2}{c}{\bfseries Glottal} \\ \midrule
Nasal & mh & m & nh & n & & & & & & \\
Stop & p & b & t & d & & & k & g & & \\
Sibilant & & & \multicolumn{2}{c|}{ \textcolor{red}{\bfseries\dotfill} } & & & & & & \\
Fricative & f & v & \multicolumn{2}{c|}{ \textcolor{red}{\bfseries s\hspace{0.4em}}} & c & & & & xh & x \\
Approximant & & & & & & j & wh & w & & \\
Lateral & & & lh & l & & & & & & \\
Trill & & & rh & r & & & & & & \\
\bottomrule
\end{tabular}
\end{document}
答案3
具有(2021-08-10{NiceTabular}
的nicematrix
≥ 6.0)。
\documentclass{article}
\usepackage{booktabs}
\usepackage{nicematrix}
\begin{document}
\begin{NiceTabular}{>{\bfseries}r*{10}{X[c]}}
\toprule
\RowStyle{\bfseries}
& \Block{1-2}{Labial} && \Block{1-2}{Alveolar} && \Block{1-2}{Palatal}
&& \Block{1-2}{Velar} && \Block{1-2}{Glottal} \\
Nasal & mh & m & nh & n \\
Stop & p & b & t & d & & & k & g & & \\
Sibilant & & & \Block{1-2}{s} & & & & & & \\
Fricative & f & v & th & dh & c & & & & xh & x \\
Approximant & & & & & & j & wh & w & & \\
Lateral & & & lh & l \\
Trill & & & rh & r \\
\bottomrule
\end{NiceTabular}
\end{document}