我正在尝试编译一个包含我从应用程序收到的性能分析数据的 tex 文件。但是编译器失败并出现 2 个错误。第一个似乎是因为“group peaks”中有一个已弃用的函数,但第二个我真的搞不清楚。
这是我的代码:
\documentclass{article}
\usepackage[empty]{fullpage}
\usepackage[pdftex,active,tightpage]{preview}
\setlength\PreviewBorder{1mm}
\usepackage{pgfgantt}
\begin{document}
\begin{preview}
\noindent \resizebox{\textwidth}{!}{
\noindent \begin{tikzpicture}
\begin{ganttchart}[vgrid,x unit=0.122699cm,group left shift=0, group right shift=0, group peaks={0}{}{.4}]{163} \\
\gantttitlelist{0, ..., 162}{1} \\
\ganttgroup[group/.style={fill=brown}]{Title1}{47.528000}{55.143002}
\ganttgroup[group/.style={fill=pink}]{}{31.235001}{38.120998}
\ganttgroup[group/.style={fill=blue}]{}{15.351000}{22.355000}
\ganttgroup[group/.style={fill=purple}]{}{39.223000}{46.444000}
\ganttgroup[group/.style={fill=green}]{}{23.455999}{30.150000}
\ganttgroup[group/.style={fill=red}]{}{140.309998}{146.031998}
\ganttgroup[group/.style={fill=yellow}]{}{1.048000}{6.955000}
\ganttgroup[group/.style={fill=yellow}]{}{132.285995}{139.251007}
\ganttgroup[group/.style={fill=green}]{}{154.936005}{161.061005}
\ganttgroup[group/.style={fill=blue}]{}{147.087006}{153.880005}
\ganttgroup[group/.style={fill=gray}]{}{56.182999}{64.136002}
\ganttgroup[group/.style={fill=pink}]{}{162.119003}{162.858994}
\ganttgroup[group/.style={fill=red}]{}{8.086000}{14.280000}
\\
\ganttgroup[group/.style={fill=red}]{Title2}{1.000000}{0.000000}
\ganttgroup[group/.style={fill=purple}]{}{31.209000}{30.209000}
\ganttgroup[group/.style={fill=green}]{}{147.063004}{146.063004}
\ganttgroup[group/.style={fill=pink}]{}{23.430000}{22.430000}
\ganttgroup[group/.style={fill=blue}]{}{140.283997}{139.283997}
\ganttgroup[group/.style={fill=blue}]{}{8.040000}{7.040000}
\ganttgroup[group/.style={fill=purple}]{}{162.095993}{161.095993}
\ganttgroup[group/.style={fill=pink}]{}{154.912003}{153.912003}
\ganttgroup[group/.style={fill=gray}]{}{47.504002}{46.504002}
\ganttgroup[group/.style={fill=brown}]{}{39.195999}{38.195999}
\ganttgroup[group/.style={fill=red}]{}{132.248001}{131.248001}
\ganttgroup[group/.style={fill=green}]{}{15.324000}{14.324000}
\\
\ganttbar[bar/.style={fill=pink}]{Title3}{163.306000}{162.858002}
\ganttbar[bar/.style={fill=green}]{}{24.966999}{30.149000}
\ganttbar[bar/.style={fill=purple}]{}{40.833000}{46.442001}
\ganttbar[bar/.style={fill=gray}]{}{57.873001}{64.134003}
\ganttbar[bar/.style={fill=pink}]{}{32.761002}{38.118999}
\ganttbar[bar/.style={fill=blue}]{}{148.289993}{153.878006}
\ganttbar[bar/.style={fill=yellow}]{}{2.729000}{6.953000}
\ganttbar[bar/.style={fill=green}]{}{156.117996}{161.059998}
\ganttbar[bar/.style={fill=red}]{}{141.552994}{146.031006}
\ganttbar[bar/.style={fill=red}]{}{9.573000}{14.279000}
\ganttbar[bar/.style={fill=brown}]{}{49.120998}{55.140999}
\ganttbar[bar/.style={fill=yellow}]{}{133.998001}{139.246994}
\ganttbar[bar/.style={fill=blue}]{}{16.949001}{22.354000}
\\
\ganttbar[bar/.style={fill=green}]{Title4}{24.971001}{23.975000}
\ganttbar[bar/.style={fill=red}]{}{141.557007}{140.612000}
\ganttbar[bar/.style={fill=red}]{}{9.577000}{8.646000}
\ganttbar[bar/.style={fill=purple}]{}{40.838001}{39.984001}
\ganttbar[bar/.style={fill=yellow}]{}{2.743000}{1.982000}
\ganttbar[bar/.style={fill=blue}]{}{148.294006}{147.427994}
\ganttbar[bar/.style={fill=brown}]{}{49.125000}{48.222000}
\ganttbar[bar/.style={fill=yellow}]{}{134.003006}{133.005997}
\ganttbar[bar/.style={fill=green}]{}{156.121994}{155.128006}
\ganttbar[bar/.style={fill=pink}]{}{32.765999}{31.770000}
\ganttbar[bar/.style={fill=gray}]{}{57.876999}{56.945000}
\ganttbar[bar/.style={fill=blue}]{}{16.954000}{16.211000}
\ganttbar[bar/.style={fill=pink}]{}{163.309006}{162.455994}
\\
\ganttbar[bar/.style={fill=brown}]{Title5}{47.528999}{48.119999}
\ganttbar[bar/.style={fill=blue}]{}{147.087006}{147.289001}
\ganttbar[bar/.style={fill=green}]{}{23.455999}{23.966000}
\ganttbar[bar/.style={fill=red}]{}{140.309998}{140.550995}
\ganttbar[bar/.style={fill=pink}]{}{31.235001}{31.760000}
\ganttbar[bar/.style={fill=gray}]{}{56.182999}{56.872002}
\ganttbar[bar/.style={fill=purple}]{}{39.223000}{39.832001}
\ganttbar[bar/.style={fill=blue}]{}{15.351000}{15.947000}
\ganttbar[bar/.style={fill=yellow}]{}{132.285995}{132.996994}
\ganttbar[bar/.style={fill=red}]{}{8.086000}{8.572000}
\ganttbar[bar/.style={fill=pink}]{}{162.119003}{162.304001}
\ganttbar[bar/.style={fill=yellow}]{}{1.057000}{1.728000}
\ganttbar[bar/.style={fill=green}]{}{154.936005}{155.117004}
\\
\ganttbar[bar/.style={fill=yellow}]{Title6}{133.998993}{133.003006}
\ganttbar[bar/.style={fill=blue}]{}{16.949001}{15.953000}
\ganttbar[bar/.style={fill=red}]{}{9.574000}{8.577000}
\ganttbar[bar/.style={fill=green}]{}{24.966999}{23.969999}
\ganttbar[bar/.style={fill=green}]{}{156.117996}{155.121002}
\ganttbar[bar/.style={fill=brown}]{}{49.122002}{48.125000}
\ganttbar[bar/.style={fill=purple}]{}{40.833000}{39.838001}
\ganttbar[bar/.style={fill=yellow}]{}{2.738000}{1.742000}
\ganttbar[bar/.style={fill=red}]{}{141.552994}{140.557007}
\ganttbar[bar/.style={fill=gray}]{}{57.873001}{56.875999}
\ganttbar[bar/.style={fill=pink}]{}{163.306000}{162.309006}
\ganttbar[bar/.style={fill=blue}]{}{148.291000}{147.294006}
\ganttbar[bar/.style={fill=pink}]{}{32.762001}{31.766001}
\\
\ganttgroup[group/.style={fill=gray}]{Title7}{57.873001}{56.873001}
\ganttgroup[group/.style={fill=yellow}]{}{132.285995}{131.285995}
\ganttgroup[group/.style={fill=yellow}]{}{133.998001}{132.998993}
\ganttgroup[group/.style={fill=red}]{}{140.309998}{139.309998}
\ganttgroup[group/.style={fill=red}]{}{141.552994}{140.552994}
\ganttgroup[group/.style={fill=blue}]{}{147.087006}{146.087006}
\ganttgroup[group/.style={fill=blue}]{}{148.289993}{147.291000}
\ganttgroup[group/.style={fill=yellow}]{}{1.057000}{0.057000}
\ganttgroup[group/.style={fill=yellow}]{}{2.738000}{1.738000}
\ganttgroup[group/.style={fill=red}]{}{8.086000}{7.086000}
\ganttgroup[group/.style={fill=red}]{}{9.573000}{8.574000}
\ganttgroup[group/.style={fill=blue}]{}{15.351000}{14.351000}
\ganttgroup[group/.style={fill=green}]{}{154.936005}{153.936005}
\ganttgroup[group/.style={fill=blue}]{}{16.949001}{15.949000}
\ganttgroup[group/.style={fill=green}]{}{156.117996}{155.117996}
\ganttgroup[group/.style={fill=green}]{}{23.455999}{22.455999}
\ganttgroup[group/.style={fill=green}]{}{24.966999}{23.966999}
\ganttgroup[group/.style={fill=pink}]{}{31.235001}{30.235001}
\ganttgroup[group/.style={fill=pink}]{}{32.761002}{31.761999}
\ganttgroup[group/.style={fill=purple}]{}{39.223000}{38.223000}
\ganttgroup[group/.style={fill=pink}]{}{162.119003}{161.119003}
\ganttgroup[group/.style={fill=purple}]{}{40.833000}{39.833000}
\ganttgroup[group/.style={fill=pink}]{}{163.306000}{162.306000}
\ganttgroup[group/.style={fill=brown}]{}{47.528000}{46.528999}
\ganttgroup[group/.style={fill=brown}]{}{49.122002}{48.122002}
\ganttgroup[group/.style={fill=gray}]{}{56.182999}{55.182999}
\\
\ganttbar[bar/.style={fill=yellow}]{Title8}{138.634003}{137.901001}
\ganttbar[bar/.style={fill=yellow}]{}{140.147003}{139.238007}
\ganttbar[bar/.style={fill=blue}]{}{23.274000}{22.344000}
\ganttbar[bar/.style={fill=blue}]{}{21.937000}{21.500000}
\ganttbar[bar/.style={fill=blue}]{}{20.476999}{20.094000}
\ganttbar[bar/.style={fill=brown}]{}{54.556999}{54.109001}
\ganttbar[bar/.style={fill=blue}]{}{18.927000}{18.236000}
\ganttbar[bar/.style={fill=brown}]{}{56.007999}{55.132000}
\ganttbar[bar/.style={fill=red}]{}{15.183000}{14.270000}
\ganttbar[bar/.style={fill=red}]{}{13.981000}{13.608000}
\ganttbar[bar/.style={fill=red}]{}{142.934006}{142.238007}
\ganttbar[bar/.style={fill=red}]{}{12.281000}{11.686000}
\ganttbar[bar/.style={fill=red}]{}{145.684998}{145.059998}
\ganttbar[bar/.style={fill=red}]{}{146.848999}{146.022003}
\ganttbar[bar/.style={fill=yellow}]{}{7.880000}{6.944000}
\ganttbar[bar/.style={fill=yellow}]{}{6.772000}{6.227000}
\ganttbar[bar/.style={fill=yellow}]{}{5.462000}{4.873000}
\ganttbar[bar/.style={fill=purple}]{}{44.400002}{43.702999}
\ganttbar[bar/.style={fill=yellow}]{}{4.276000}{3.618000}
\ganttbar[bar/.style={fill=purple}]{}{42.715000}{42.160000}
\ganttbar[bar/.style={fill=purple}]{}{47.348999}{46.432999}
\ganttbar[bar/.style={fill=pink}]{}{37.554001}{37.081001}
\ganttbar[bar/.style={fill=blue}]{}{150.126999}{149.408997}
\ganttbar[bar/.style={fill=blue}]{}{151.811996}{151.171997}
\ganttbar[bar/.style={fill=blue}]{}{153.309998}{152.776993}
\ganttbar[bar/.style={fill=blue}]{}{154.776001}{153.865005}
\ganttbar[bar/.style={fill=purple}]{}{45.930000}{45.337002}
\ganttbar[bar/.style={fill=pink}]{}{35.976002}{35.592999}
\ganttbar[bar/.style={fill=pink}]{}{34.471001}{33.828999}
\ganttbar[bar/.style={fill=gray}]{}{59.768002}{58.973999}
\ganttbar[bar/.style={fill=gray}]{}{61.529999}{60.803001}
\ganttbar[bar/.style={fill=gray}]{}{63.355999}{63.120998}
\ganttbar[bar/.style={fill=gray}]{}{64.994003}{64.125000}
\ganttbar[bar/.style={fill=pink}]{}{38.937000}{38.110001}
\ganttbar[bar/.style={fill=green}]{}{157.796005}{157.130997}
\ganttbar[bar/.style={fill=green}]{}{159.300995}{158.682999}
\ganttbar[bar/.style={fill=green}]{}{160.738998}{160.151001}
\ganttbar[bar/.style={fill=green}]{}{161.968994}{161.050003}
\ganttbar[bar/.style={fill=green}]{}{31.059000}{30.139999}
\ganttbar[bar/.style={fill=green}]{}{29.782000}{29.249001}
\ganttbar[bar/.style={fill=brown}]{}{51.089001}{50.363998}
\ganttbar[bar/.style={fill=green}]{}{28.235001}{27.903999}
\ganttbar[bar/.style={fill=brown}]{}{52.856998}{53.022999}
\ganttbar[bar/.style={fill=green}]{}{26.718000}{26.068001}
\ganttbar[bar/.style={fill=red}]{}{11.033000}{10.341000}
\ganttbar[bar/.style={fill=yellow}]{}{135.613007}{134.841003}
\ganttbar[bar/.style={fill=yellow}]{}{137.276001}{137.087997}
\ganttbar[bar/.style={fill=red}]{}{144.302002}{143.595001}
\end{ganttchart}
\end{tikzpicture}
}
\end{preview}
\end{document}
错误信息如下: - ! 软件包 pgfkeys 错误:我不知道您传递了“{0}{}{.4}”的密钥“/pgfgantt/group peaks”,我将忽略它。也许您拼错了。请参阅 pgfkeys 软件包文档以了解解释。输入 H 可立即获得帮助.... } - ! 缺少数字,视为零。\protect }
总结一下2个问题:
- 我应该用什么来代替组峰?
- 为什么会出现“缺失数字,视为零”的错误?
我曾尝试使用 Texmaker、MikTex 和 Texworks 进行编译。
任何帮助都将不胜感激!谢谢。
答案1
没有可选参数group peaks
,只有group peaks width
和 group peaks height
。并且环境需要两个强制参数:
\begin{ganttchart}[vgrid,x unit=0.122699cm,
group left shift=0,
group right shift=0,
group peaks width=.4]{1}{163}