删除表格(或 tikz 图片?)的大部分底部空间

删除表格(或 tikz 图片?)的大部分底部空间

我正在尝试在甘特图左侧添加一个类似表格的结构。在我看来,用固定列宽的表格标记每个条形图是最简单的方法,而且我已经非常接近我想要的效果了:

在此处输入图片描述

但是我无法摆脱表格底部的垂直空间(红色圆圈) - 哪个间距命令定义了它?

任何提示都值得感激。


如果有帮助的话,这里是输出lua-visual-调试

在此处输入图片描述

另一个发现是,由于甘特图实际上是一个 tikz 图片,我可以通过以下方式将其向下移动:

\tikzset{baseline}

在序言中,但上面有空格。如何删除 tikzpciture 周围的所有空格?


(并非如此)MWE

\documentclass{scrreprt}

\usepackage[top=25mm, bottom=20mm, left=20mm, right=20mm, foot=20mm]{geometry}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{hyperref}


\usepackage{translator}  %// wird zur Übersetung von pgfgantt benötigt.
\usepackage{pgfgantt}

\ganttset{
%vgrid={*{1}{dotted}, draw = none },
vgrid = dotted,
hgrid = dotted,
%hgrid style/.style={thin},
newline shortcut=true,
%
y unit title = 15pt,
title height = 1,
y unit chart = 15pt,
x unit=0.014\textwidth,
%
canvas/.style={
    shape=rectangle, 
    draw=black,
    line width = 0.4pt,
    },
group peaks tip position=0,
group label node/.append style={align=right},
%
bar label node/.append style={align=right},
bar/.append style={fill=gray!20!white},
bar height=0.3,
bar top shift=0.3,
group top shift=0.5,
%
group peaks width=2,
}

\newcommand{\tabgantt}[1]{
\small
\begin{tabular}{p{0.1\textwidth}@{\hskip 0.015\textwidth}p{0.51\textwidth}}
#1
\end{tabular}
}

\newcommand{\tabganttgroup}[3]{
\ganttgroup{
\tabgantt{#1}}{#2}{#3}
}

\newcommand{\tabganttbar}[3]{
\ganttbar{
\tabgantt{#1}}{#2}{#3}
}

\begin{document}

\chapter{title}
\section{section}
\subsection{subsection}
\subsubsection*{subsubsection}\label{par:subsection}
\subparagraph{subparagraph}\label{par:subparagraph}

\begin{table}[h]
\setlength{\tabcolsep}{0pt}
\caption{my gantt chartt}
\label{tab:gantt}
\centering
\begin{tabular}{@{}|c@{}}

\specialrule{0.4pt}{0pt}{-0.4pt}
\specialrule{0.4pt}{30pt}{0pt}
\specialrule{0pt}{0pt}{-30.4pt}

\begin{ganttchart}{1}{24}

\gantttitle[]{2017}{12} \gantttitle[]{2018}{12}  \\
\gantttitle{I}{3}\gantttitle{II}{3}\gantttitle{III}{3}\gantttitle{IV}{3}
\gantttitle{I}{3}\gantttitle{II}{3}\gantttitle{III}{3}\gantttitle{IV}{3} \\

\tabganttgroup{ & \nameref{par:subsection} }{4}{15} \\
\tabganttbar{\ref{par:subsection} & \nameref{par:subparagraph} }{4}{15} \\
\tabganttbar{\ref{par:subsection} & \nameref{par:subparagraph} }{4}{15} \\
\tabganttbar{\ref{par:subsection} & \nameref{par:subparagraph} }{4}{15} \\
\tabganttgroup{ & \nameref{par:subsection} }{4}{15} \\
\tabganttbar{\ref{par:subsection} & \nameref{par:subparagraph} }{4}{15} \\
\tabganttbar{\ref{par:subsection} & \nameref{par:subparagraph} }{4}{15} \\
\tabganttbar{\ref{par:subsection} & \nameref{par:subparagraph} }{4}{15} 
\end{ganttchart}%
\\
\specialrule{0.4pt}{0pt}{-0.4pt}

\end{tabular}
\end{table}
\end{document}

相关内容