带有工作日和日期的 pgfgantt 图表

带有工作日和日期的 pgfgantt 图表

我拥有的是这个:

\documentclass[a4paper]{article}
\usepackage{pgfgantt}
\usepackage{pgfcalendar}
\usepackage[a4paper,landscape,left=1cm,top=1cm,%
bottom=1.5cm,right=1cm]{geometry}
\begin{document}
\begin{ganttchart}[vgrid, hgrid]{42}
\gantttitle{Title}{42} \\
\gantttitlelist[title list options={var=\y, evaluate=\y as \x using "\pgfcalendarweekdayshortname{\y}"}]{5,6,0,1,2,3,4}{6}
\ganttgroup{x}{1}{42} \\
\ganttbar{l}{1}{3} \\
\ganttgroup{y}{1}{42} \\
\ganttbar{l}{1}{3} \\
\ganttgroup{z}{1}{42} \\
\ganttbar{l}{1}{3} 
\end{ganttchart}
\end{document}

但我希望这些简称的日期也能打印出来,每天用逗号分隔。例如:星期六,17.11.12 .. .. .. .. .. 星期五,23.11.12。我搜索了一下,但信息太多了,似乎让人应接不暇。谢谢你的帮助。

答案1

这似乎有效

在此处输入图片描述

\documentclass[a4paper]{article}
\usepackage{pgfgantt}
\usepackage{pgfcalendar}
\usepackage[a4paper,landscape,left=1cm,top=1cm,%
bottom=1.5cm,right=1cm]{geometry}
\begin{document}
\newcount\startdate
\pgfcalendardatetojulian{2012-011-03}{\startdate}

\protected\def\zzz{\ {\pgfcalendarjuliantodate{\numexpr\startdate\relax}{\year}{\month}{\day}\year--\month--\day\global\advance\startdate1}}
\begin{ganttchart}[vgrid, hgrid]{42}
\gantttitle{Title}{42} \\
\gantttitlelist[title list options={var=\y, evaluate=\y as \x using "\pgfcalendarweekdayshortname{\y}\zzz"}]{5,6,0,1,2,3,4}{6}
\ganttgroup{x}{1}{42} \\
\ganttbar{l}{1}{3} \\
\ganttgroup{y}{1}{42} \\
\ganttbar{l}{1}{3} \\
\ganttgroup{z}{1}{42} \\
\ganttbar{l}{1}{3} 
\end{ganttchart}
\end{document}

相关内容