4

I've got this example from https://stackoverflow.com/questions/217834/how-to-create-a-timeline-with-latex?newreg=d5d53aaf6a014bda9555c93bf7597c74

The only thing that bothers me is the little arrow at the end of the timeline.

Could someone tell me how to get the end of the line looking like the beginning?

Code:

\documentclass{article}
\usepackage{chronology}
   \begin{document}
      \begin{chronology}[5]{1983}{2010}{\textwidth}
         \event{1984}{one}
         \event[1985]{1986}{two}
         \event{\decimaldate{25}{12}{2001}}{three}
      \end{chronology}
   \end{document}

Problem: enter image description here

6

The timeline arrow is hard coded in the sty-file as [|->]. You can change it globally by setting >=| but that means all your tikzpictures will have | as the default arrow tip.

\documentclass{article}
\usepackage{chronology}
\tikzset{>=|}
\begin{document}
\begin{chronology}[5]{1983}{2010}{\textwidth}
  \event{1984}{one}
  \event[1985]{1986}{two}
  \event{\decimaldate{25}{12}{2001}}{three}
\end{chronology}
\end{document}

enter image description here

As noted by Schweinebacke the \tikzset can be put inside {...} which makes the changes local.

{
  \tikzset{>=|}
  \begin{chronology}[5]{1983}{2010}{\textwidth}
    \event{1984}{one}
    \event[1985]{1986}{two}
    \event{\decimaldate{25}{12}{2001}}{three}
  \end{chronology}
}
  • Almost simultaneous the same idea. You can limit the effect of \tikzset either by using it in the document body inside an extra group (e.g. {…\tikzset{>=|}\begin{chronology}…\end{chronology}}) or by patching it into the (begin of the) environment (as shown in my answer). – Schweinebacke Aug 8 '17 at 18:03
  • @Schweinebacke, I have added the grouping alternative. But your patching alternative is nicer:-) – StefanH Aug 8 '17 at 18:24
5

Unfortunately there is not a configuration option for this. But you can patch \chronology@iii to replace the line ending:

\documentclass{article}
\usepackage{chronology}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\chronology@iii}{->}{-|}{}{\failure}
\makeatother
\begin{document}
\begin{chronology}[5]{1983}{2010}{\textwidth}
  \event{1984}{one}
  \event[1985]{1986}{two}
  \event{\decimaldate{25}{12}{2001}}{three}
\end{chronology}
\end{document}

or the chronology environment:

\documentclass{article}
\usepackage{chronology}
\usepackage{xpatch}
\xpretocmd{\chronology}{\tikzset{>=|}}{}{\failure}

\begin{document}
\begin{chronology}[5]{1983}{2010}{\textwidth}
  \event{1984}{one}
  \event[1985]{1986}{two}
  \event{\decimaldate{25}{12}{2001}}{three}
\end{chronology}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.