
ディセンダのスペースを自動的に考慮してラベルpgfgantt
を垂直に揃えているようです。inline
\documentclass{article}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
inline,
]{1}{4}
\ganttbar{XX}{2}{3}
\end{ganttchart}
\end{document}
のマニュアルの例でも同じことが見られますpgfgantt
。 ディセンダがない場合にラベルを垂直中央に配置するにはどうすればよいでしょうか。 を設定することでこれを実現しましたbar inline label node/.append style={text depth=.5ex}
が、毎回手動で魔法の数字を設定するのは避けたいです。
答え1
\strut
バーラベルに自動挿入されたテキストを削除するには、
\ganttset{bar label text=#1}
\strut
同様のエリアに自動挿入されたものをすべて削除するには、
\documentclass{article}
\usepackage{pgfgantt}
\usepackage{xpatch}
\ganttset{
title label text=#1,
bar label text=#1,
group label text=#1,
milestone label text=#1,
}
\makeatletter
\xpatchcmd\@newganttchartelement@definekeys
{\strut}
{}
{}{\fail}
\makeatother
\begin{document}
\begin{ganttchart}[inline]{1}{4}
\ganttbar{XX}{2}{3}
\end{ganttchart}
\end{document}