多行列名

多行列名

我目前有:

\documentclass{article}  
\usepackage{filecontents}
\usepackage{filecontents}    
\usepackage{pgfplots}  
\usepackage{pgfplotstable}    
\begin{filecontents*}{rawdata.txt}    
trial   water   massi   massf   tempi   tempf  
1   50.00   101.86  101.42  22.3    29.6    
2   50.00   101.41  100.79  22.5    26.4  
3   50.00   100.80  100.19  22.3    29.9  
4   50.00   100.18  99.58   22.7    28.0  
5   50.00   99.58   98.96   22.6    27.3  
\end{filecontents*}      
\begin{document}  
\pgfplotstabletypeset[    
 columns/trial/.style={column name={Trial}},  
  columns/water/.style={column name={Water volume \\ (mL \pm 0.02 mL)},   zerofill},   
 columns/massi/.style={column name=Initial burner mass, zerofill},    
  columns/massf/.style={column name=Final burner mass},  
  columns/tempi/.style={column name=Initial temp},  
  columns/tempf/.style={column name=Final temp,precision=1,zerofill},  
]{rawdata.txt}  
\end{document}  

这不起作用,并将其移至试用版,而我并不想这样。如何使用此配置制作多行标题?

答案1

您可以使用\makecell它。

\documentclass{article}  
\usepackage{filecontents}  
\usepackage{makecell}
\usepackage{siunitx}
\usepackage{pgfplots}  
\usepackage{pgfplotstable}    
\begin{filecontents*}{rawdata.txt}    
trial   water   massi   massf   tempi   tempf  
1   50.00   101.86  101.42  22.3    29.6    
2   50.00   101.41  100.79  22.5    26.4  
3   50.00   100.80  100.19  22.3    29.9  
4   50.00   100.18  99.58   22.7    28.0  
5   50.00   99.58   98.96   22.6    27.3  
\end{filecontents*}    
\begin{document}
\pgfplotstabletypeset[    
 columns/trial/.style={column name={Trial}},  
  columns/water/.style={column name={\makecell[b]{
  Water volume \\ ($\si{\milli\liter}\pm 0.02\si{\milli\liter}$)
}},   zerofill},   
 columns/massi/.style={column name=Initial burner mass, zerofill},    
  columns/massf/.style={column name=Final burner mass},  
  columns/tempi/.style={column name=Initial temp},  
  columns/tempf/.style={column name=Final temp,precision=1,zerofill},  
]{rawdata.txt}  
\end{document}  

在此处输入图片描述

\makecell[t]{...

在此处输入图片描述

相关内容