我正在使用包 chronology。我尝试创建一个持续时间为 5 年的年表。事件节点太大,如何在不改变持续时间的情况下将其缩小。
\documentclass{article}
\usepackage{chronology}
\begin{document}
\begin{chronology}[1]{2014}{2018}{\textwidth}
\event{\decimaldate{1}{7}{2014}}{Hello}
\event{\decimaldate{20}{1}{2018}}{NOW}
\event{2017}{test}
\end{chronology}
\end{document}
答案1
您可以尝试使用第一个和第五个(可选)参数来获得所需的结果。请比较:
\documentclass{article}
\usepackage{chronology}
\begin{document}
\begin{chronology}[1]{2014}{2018}{\textwidth}
\event{\decimaldate{1}{7}{2014}}{Hello}
\event{\decimaldate{20}{1}{2018}}{NOW}
\event{2017}{test}
\end{chronology}
\begin{chronology}[5]{2014}{2018}{\textwidth}[0.3\textwidth]
\event{\decimaldate{1}{7}{2014}}{Hello}
\event{\decimaldate{20}{1}{2018}}{NOW}
\event{2017}{test}
\end{chronology}
\DeclareDocumentCommand \event {o m m}{%
\pgfmathsetlength\xstop{(#2-\theyearstart)*\unit}%
\IfNoValueTF {#1} {%
\ifflipped%
\draw[chronevent]%
(\xstop, 0) circle (.1\unit)% % was 0.2 -- PS
node[flippedeventlabel] {#3};%
\else%
\draw[chronevent]%
(\xstop, 0) circle (.1\unit)% % was 0.2 -- PS
node[eventlabel] {#3};%
\fi%
}{%
\pgfmathsetlength\xstart{(#1-\theyearstart)*\unit}%
\ifflipped%
\draw[chronevent,rounded corners=.2\unit]%
(\xstart,-.2\unit) rectangle%
node[flippedeventlabel] {#3} (\xstop,.2\unit);%
\else%
\draw[chronevent,rounded corners=.2\unit]%
(\xstart,-.2\unit) rectangle%
node[eventlabel] {#3} (\xstop,.2\unit);%
\fi%
}%
}
\begin{chronology}[1]{2014}{2018}{\textwidth}
\event{\decimaldate{1}{7}{2014}}{Hello}
\event{\decimaldate{20}{1}{2018}}{NOW}
\event{2017}{test}
\end{chronology}
\end{document}
标记为 PS 的线条的更改仅供参考。您可以以类似的方式设置刻度和带有圆头的线条。