答案1
这只是一个概念验证。有些东西是硬编码的,但由于您没有提供太多细节信息,我不知道什么会变化,什么不会变化。
\documentclass[twoside]{article}
\usepackage{wrapfig}
\usepackage{eso-pic}
\usepackage{tikzpagenodes}
\usepackage{lipsum}
\newcounter{timeline}
\newcommand{\TimeLine}[2][10]{\stepcounter{timeline}
\begin{wrapfigure}[#1]{o}[10pt]{4cm}
\begin{tikzpicture}[remember picture]
\path (0,0) coordinate (TL-\thetimeline-bottom);
\path (0,{(#1-2)*12pt}) coordinate (TL-\thetimeline-top);
\end{tikzpicture}
\end{wrapfigure}
\AddToShipoutPictureFG*{%
\ifodd\thepage
\begin{tikzpicture}[remember picture,overlay,font=\sffamily]
\foreach [count=\Z] \X/\Y in {#2}
{
\xdef\Nmax{\Z}
}
\draw[very thick,-latex] (current page text area.east |- TL-\thetimeline-bottom) --
(current page text area.east |- TL-\thetimeline-top)
foreach [count=\Z] \X/\Y in {#2} {coordinate[{pos=\Z/(\Nmax+1)}]
(TL-\thetimeline-\Z) };
\foreach [count=\Z] \X/\Y in {#2}
{
\draw ([xshift=-1mm]TL-\thetimeline-\Z)
node[left]{\Y} -- ([xshift=+1mm]TL-\thetimeline-\Z) node[right]{\X};
}
\end{tikzpicture}
\else
\begin{tikzpicture}[remember picture,overlay,font=\sffamily]
\foreach [count=\Z] \X/\Y in {#2}
{
\xdef\Nmax{\Z}
}
\draw[very thick,-latex] (current page text area.west |- TL-\thetimeline-bottom) --
(current page text area.west |- TL-\thetimeline-top)
foreach [count=\Z] \X/\Y in {#2} {coordinate[{pos=\Z/(\Nmax+1)}]
(TL-\thetimeline-\Z) };
\foreach [count=\Z] \X/\Y in {#2}
{
\draw ([xshift=-1mm]TL-\thetimeline-\Z)
node[left]{\X} -- ([xshift=+1mm]TL-\thetimeline-\Z) node[right]{\Y};
}
\end{tikzpicture}
\fi
}}
\begin{document}
\lipsum[1-3]
\TimeLine{1998/France,2002/Brazil,2006/Italy}
\lipsum[4-6]
\TimeLine{2010/Spain,2014/Germany,2018/France}
\lipsum[7-9]
\end{document}
正如您所见,时间/日期总是在外面。