有人知道如何左对齐内联标签(任务 3 和任务 4)吗?
下面的代码来自较旧的手册版本,不起作用:
代码:
\begin{ganttchart}[vgrid, hgrid, inline,]{1}{12}
\gantttitle{2014}{12} \\
\ganttbar{Task 1}{1}{3}
\ganttbar[bar inline label node/.style={above=3pt}]{Task 2}{5}{10} \\
\ganttbar[bar inline label node/.style={left}]{Task 3}{2}{7} \\
\ganttbar[bar inline label node/.style={left}]{Task 4}{2}{15}
\ganttbar[inline=false]{Final task}{11}{12}
\end{ganttchart}
答案1
\documentclass[10pt]{article}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[vgrid, hgrid, inline,]{1}{12}
\gantttitle{2014}{12} \\
\ganttbar{Task 1}{1}{3}
\ganttbar[bar inline label node/.style={above=3pt}]{Task 2}{5}{10} \\
\ganttbar[bar inline label node/.style={anchor=west},bar inline label anchor=west]{Task 3}{2}{7} \\
\ganttbar[bar inline label node/.style={anchor=west},bar inline label anchor=west]{Task 4}{2}{15}
\ganttbar[inline=false]{Final task}{11}{12}
\end{ganttchart}
\end{document}