如何更改甘特图中的字体大小?我尝试在与表格环境相同的位置输入 scriptsize 命令,但它没有改变任何内容。
\begin{ganttchart}{1}{16}
\scriptsize
\gantttitle{Research Plan}{16} \\
\gantttitle{Year 1}{4}
\gantttitle{Year 2}{4}
\gantttitle{Year 3}{4}
\gantttitle{Year 4}{4} \\
\ganttbar{Task 1}{1}{2} \\
\ganttbar{Task 2}{1}{2} \\
\ganttbar{Task 3}{1}{2} \\
\ganttbar{Task 4}{1}{2} \\
\end{ganttchart}
答案1
有不同的键用于设置字体特征。适用于您的图表的键包括title label font
和bar label font
,但是,我还指定了其他可能与不同图表相关的键。
为了确定这些,我搜索了文档label font
。
\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
title label font=\tiny,
bar label font=\tiny,
group label font=\tiny,
milestone label font=\tiny,
today label font=\tiny,
vrule label font=\tiny]{1}{16}
\gantttitle{Research Plan}{16} \\
\gantttitle{Year 1}{4}
\gantttitle{Year 2}{4}
\gantttitle{Year 3}{4}
\gantttitle{Year 4}{4} \\
\ganttbar{Task 1}{1}{2} \\
\ganttbar{Task 2}{1}{2} \\
\ganttbar{Task 3}{1}{2} \\
\ganttbar{Task 4}{1}{2} \\
\end{ganttchart}
\end{document}