我目前有:
\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]{...