有没有办法打破 a 的标签\gantgroup
?它适用于\gantbar
,但似乎不适用于\ganttgroup
。有什么建议吗?
有用:
\begin{ganttchart}[
hgrid,
vgrid,
newline shortcut=true,
bar label node/.append style=%
{align=left}
]{1}{6}
\gantttitle{Title}{6} \\
\ganttgroup{Group 1 test}{1}{4}\\
\ganttbar{%
This is a\ganttalignnewline
multi-line text.%
}{1}{3}
\end{ganttchart}
它没有:
\begin{ganttchart}[
hgrid,
vgrid,
newline shortcut=true,
bar label node/.append style=%
{align=left}
]{1}{6}
\gantttitle{Title}{6} \\
\ganttgroup{Group 1\ganttalignnewline test}{1}{4}\\
\ganttbar{%
This is a\ganttalignnewline
multi-line text.%
}{1}{3}
\end{ganttchart}
答案1
我可以确认\ganttgroup
不能拆分字符串,尽管我和原始帖子的作者一样尝试过:
\ganttalignnewline
像这样插入:\ganttgroup{第 1 组\ganttalignnewline 测试}{1}{4}\
- 插入
\newline
或\\
更新:
暂时的解决方案是这样的:
\ganttgroup{ \parbox[c][1ex][c]{0.03\textwidth}{Some \\ text} }{2017-04}{2019-03} \\
您可以0.03\textwidth
根据自己的喜好进行调整。虽然有点丑陋,但确实有效。
更新2:来自ganttchart作者(Wolfgang)的电子邮件:
诀窍是在组标签中启用换行,例如通过将组标签指定node/.append style={align=right}
为 \ganttgroup 的可选参数。考虑以下示例:
\begin{ganttchart}{1}{12}
\ganttgroup{This is \ganttalignnewline Group 1}{1}{2} %% will not work
\ganttgroup[group label node/.append style={align=right}]{This is \ganttalignnewline Group 2}{1}{7} %works!
\end{ganttchart}