1

does someone recognise the package that is used to make the figure below? Or, does someone know how to exactly create this? Some assistance would be appreciated - I am still unexperienced with tikz/chronology/etc. Ideally, I would have a dictionary/list as input for this figure. Different colours do not necessarily matter.

Timeline (Fig 2. in https://arxiv.org/pdf/2307.06435.pdf)

Source: https://arxiv.org/pdf/2307.06435.pdf (Fig. 2)

3
  • 1
    Welcome to TeX.SX! If your question is really how this was created, you should ask the authors of the related paper. This question would then be off-topic here. If your question is how to redraw this, you should provide a minimal working example (MWE) and show what you tried so far. There are surely some diagrams on this site or in the internet that at least can serve as a starting point for an MWE. The TikZ manual contains some nice tutorials that can help you getting started. Dec 7, 2023 at 12:57
  • Given the meta data of the image, which lists cairo 1.17.4 as producer, I would guess some drawing program which uses cairo to export the image to pdf. I can't see any indication that this was produces with latex. Dec 7, 2023 at 12:58
  • 1
    You can go to arxiv.org/abs/2307.06435 to download the source (I had to add .zip) and see that it's simply \includegraphics[width=2\columnwidth]{Figure/LLM_chart.pdf} in the TeX. I agree with samcarter that this doesn't seem to have been produced with TeX. But like Jasper said, if you provide your attempt at doing this in TeX, we could help you complete the drawing.
    – Teepeemm
    Dec 7, 2023 at 13:31

2 Answers 2

3

Note that I don't think I ought to answer do-it-for-mes.

A chronos version:

chronos version

\documentclass[border=5pt]{standalone}
% ateb: https://tex.stackexchange.com/a/703431/
% https://codeberg.org/cfr/chronos
\usepackage{chronos}

\begin{document}
\begin{chronos}
  [
    timeline={%
      dates=2019:{2024-01-01},
      timeline years=below,
      height=1pt,
      width=150mm,
      timeline year={text=black},
      timeline foreground=black,
    },
    colour scheme=blues,
    only text,
    every text tags={text=black,fill=##1!25,draw=black,font=\scriptsize\sffamily},
    event/tag+={tag anchor=west,anchor=south west},
    every connections={draw=black},
    /tikz/my label/.style={label={[font=\scriptsize\sffamily,text=black]left:\MakeTitlecase{#1}}},
  ]
  \chronosevent{name=new year,date=2019-01-01,yshift=1pt,xshift=2pt,my label=jan}
    \foreach \i/\j [remember=\i as \ilast (initially new year)] in {martin luther king/,wintry storms/feb,dydd dewi sant/mar,april fools/apr,may day/may,longest day/jun,holidays/jul,sunshine/aug,back to school/sep,all hallows eve/oct,fireworks/nov,christmas/dec,hanukkah/}
  {
    \chronosevent{name/.expand once=\i,date=2019-01-01,at=text tag \ilast.north west,my label=\j}
  }
  \chronosevent{name=new year,date=2020-01-01,yshift=-15pt,xshift=2pt,my label=jan,anchor=north west,connection+={shorten <=12pt}}
  \foreach \i/\j [remember=\i as \ilast (initially new year)] in {martin luther king/,wintry storms/feb,dydd dewi sant/mar,april fools/apr,may day/may,longest day/jun,holidays/jul,sunshine/aug,back to school/sep,all hallows eve/oct,fireworks/nov,christmas/dec,hanukkah/}
  {
    \chronosevent{name/.expand once=\i,date=2020-01-01,at=text tag \ilast.south west,my label=\j,anchor=north west,connection+={shorten <=12pt}}
  }
\end{chronos}
\end{document}

EDIT

A corrected version of chronos.sty now allows - in names without issue. Thanks for reporting this bug.

To include citation commands in the text tags, we need to make use of name content as well as name. name content should be the kind of thing you can use as the name of a coordinate or node in TikZ, while name content can include any input valid in the content of a node.

For example,

  \chronosevent{name=another new year,date=2022-01-01,name content={Yet Another Year \cite{westfahl:space}},xshift=2pt,yshift=1pt,my label=jan}

If we want to use citation commands in a \foreach loop, we need to use an additional variable and alter the \chronosevent to use it. For instance,

  \foreach \i/\j/\k [remember=\i as \ilast (initially another new year)] in {martin-luther-king//{MLK, Jr.},wintry-storms/feb/Winter Blizzards,dydd dewi sant/mar/Dathlu!,april fools/apr/Hwyl!,may--day/may/{May Day \cite{padhye}},longest day/jun/{\Textcite{chiu}},holidays/jul/{\Autocite{jcg,nietzsche:historie}},sunshine/aug/Gwyliau,back to school/sep/Learning Ladder,all hallows eve/oct/Nos Galan Gaeaf,fireworks/nov/{Tân Gwyllt},christmas/dec/Nadolig,hanukkah//Festival of Light}
  {
    \chronosevent{name/.expand once=\i,name content={\k},date=2022-01-01,at=text tag \ilast.north west,my label=\j}
  }

This produces

modified timeline using citation commands

Complete code:

\documentclass[border=5pt]{standalone}
% ateb: https://tex.stackexchange.com/a/703431/
% https://codeberg.org/cfr/chronos
\usepackage{chronos}
\usepackage{biblatex}
\bibliography{biblatex-examples}
\begin{document}
\begin{chronos}
  [
    timeline={%
      dates=2019:{2024-01-01},
      timeline years=below,
      height=1pt,
      width=150mm,
      timeline year={text=black},
      timeline foreground=black,
    },
    colour scheme=blues,
    only text,
    every text tags={text=black,fill=##1!25,draw=black,font=\scriptsize\sffamily},
    event/tag+={tag anchor=west,anchor=south west},
    every connections={draw=black},
    /tikz/my label/.style={label={[font=\scriptsize\sffamily,text=black]left:\MakeTitlecase{#1}}},
  ]
  \chronosevent{name=another new year,date=2022-01-01,name content={Yet Another Year \cite{westfahl:space}},xshift=2pt,yshift=1pt,my label=jan}
  \foreach \i/\j/\k [remember=\i as \ilast (initially another new year)] in {martin-luther-king//{MLK, Jr.},wintry-storms/feb/Winter Blizzards,dydd dewi sant/mar/Dathlu!,april fools/apr/Hwyl!,may--day/may/{May Day \cite{padhye}},longest day/jun/{\Textcite{chiu}},holidays/jul/{\Autocite{jcg,nietzsche:historie}},sunshine/aug/Gwyliau,back to school/sep/Learning Ladder,all hallows eve/oct/Nos Galan Gaeaf,fireworks/nov/{Tân Gwyllt},christmas/dec/Nadolig,hanukkah//Festival of Light}
  {
    \chronosevent{name/.expand once=\i,name content={\k},date=2022-01-01,at=text tag \ilast.north west,my label=\j}
  }
  \chronosevent{name=new-year,date=2021-01-01,yshift=1pt,xshift=2pt,my label=jan}
  \foreach \i/\j [remember=\i as \ilast (initially new-year)] in {martin-luther-king/,wintry-storms/feb,dydd dewi sant/mar,april fools/apr,may--day/may,longest day/jun,holidays/jul,sunshine/aug,back to school/sep,all hallows eve/oct,fireworks/nov,christmas/dec,hanukkah/}
  {
    \chronosevent{name/.expand once=\i,date=2021-01-01,at=text tag \ilast.north west,my label=\j}
  }
  \chronosevent{name=new year,date=2019-01-01,yshift=1pt,xshift=2pt,my label=jan}
  \foreach \i/\j [remember=\i as \ilast (initially new year)] in {martin luther king/,wintry storms/feb,dydd dewi sant/mar,april fools/apr,may day/may,longest day/jun,holidays/jul,sunshine/aug,back to school/sep,all hallows eve/oct,fireworks/nov,christmas/dec,hanukkah/}
  {
    \chronosevent{name/.expand once=\i,date=2019-01-01,at=text tag \ilast.north west,my label=\j}
  }
  \chronosevent{name=new year,date=2020-01-01,yshift=-15pt,xshift=2pt,my label=jan,anchor=north west,connection+={shorten <=12pt}}
  \foreach \i/\j [remember=\i as \ilast (initially new year)] in {martin luther king/,wintry storms/feb,dydd dewi sant/mar,april fools/apr,may day/may,longest day/jun,holidays/jul,sunshine/aug,back to school/sep,all hallows eve/oct,fireworks/nov,christmas/dec,hanukkah/}
  {
    \chronosevent{name/.expand once=\i,date=2020-01-01,at=text tag \ilast.south west,my label=\j,anchor=north west,connection+={shorten <=12pt}}
  }
\end{chronos}
\end{document}

I've used Biblatex for the example, but this should work with standard BibTeX of LaTeX's builtin bibliography support, too. I used Biblatex because its more, rather than less, complex and supports a wider range of commands and characters.

11
  • Very nice package. Didn't find it at a glance: can you use a (true) logarithmic timescale to visualize very large periods of time (geology, universe etc.) ?
    – MS-SPO
    Dec 7, 2023 at 21:37
  • 1
    @MS-SPO No. It uses pgfcalendar for the calculations and I don't think that would cope with the dates involved. I'm assuming you wouldn't normally deal with those dates by turning them into Julian days, for example?
    – cfr
    Dec 7, 2023 at 21:50
  • right. It would probably be more like this: tex.stackexchange.com/a/606061/245790
    – MS-SPO
    Dec 7, 2023 at 22:48
  • 1
    @MS-SPO Indeed. I liked that answer when I saw it before ;). Even dealing with smaller timescales, there's no point it calculating days if you're looking at twenty thousand years, say. I guess what might be possible would be to generalise the framework so different calculation/scaling methods could be plugged into a common framework for styling/placement, but I've not really given that any thought.
    – cfr
    Dec 7, 2023 at 23:46
  • Excellent answer, thank you. I am still facing some issues for my use case: whenever the name contains a "-", the list does not stack up properly anymore and instead pushes those items to the first year. Similarly, would it be possible to \cite{...} within the bubbles, e.g. "dash-text-or-other-symbols+ [1]"? I tried surrounding it with brackets amongst other things, but I cannot get these two changes working unfortunately. Any help would be appreciated!
    – SWE
    Dec 9, 2023 at 12:07
1

Here's a starting point you could use.

Basic ideas:

  • draw a thicker line as timeline
  • place years
  • for every year: place nodes with a fill color for the items
  • for every year: put a month, and draw a vertical line

For simplicity styles are mentioned in the beginning. Any change here affects the whole graphics:

  • make the right side (east) anchor at the coordinate for the mnth, so it's left
  • define a style lbl for the boxes in the light color; anchor west (i.e. opposite)
  • reuse and redefine this style for the darker color as dbl
 \begin{tikzpicture}[ 
    mnth/.style={anchor=east,xshift=-1mm},
    lbl/.style={draw,
                fill=blue!25!white!30,
                anchor=west, xshift=1mm,
                font={\footnotesize},
                },
    dbl/.style={lbl,fill=teal!40},
 ]

The timeline is put more ore less automatically:

  • variable \yr runs through the set of years
  • the 1st, 2nd etc. of these is counted via \i
  • \i helps to calculate the coordinate of the node, which outputs \yr
    % ~~~ timeline ~~~~~~~~~~
    \draw[line width=1.5pt] (0,0) -- +(25,0); 
    \foreach \yr [count=\i] in {2019,2020,...,2024}
        \node at (5*\i - 5, -.3) {\yr};

For each year perform these actions manually:

  • draw a vertical line, here using a starting point and a delta upwards
  • put as many nodes as needed with the mnth style for the months
  • put as many nodes as needed with the lbl or dbl style for the items
  • using increments of 0.5cm seem to work fine here
    % ~~~ 2019 ~~~~~~~~
    \draw (0,0) -- +(0,.3);
    \node[mnth] at (0, .3) {Oct};
    \node[lbl]  at (0, .3) {T5};

Repeat, until you're done.

result

\documentclass[10pt,border=3mm,tikz]{standalone}

\begin{document}
 \begin{tikzpicture}[ 
    mnth/.style={anchor=east,xshift=-1mm},
    lbl/.style={draw,
                fill=blue!25!white!30,
                anchor=west, xshift=1mm,
                font={\footnotesize},
                },
    dbl/.style={lbl,fill=teal!40},
 ]
 
    % ~~~ timeline ~~~~~~~~~~
    \draw[line width=1.5pt] (0,0) -- +(25,0); 
    \foreach \yr [count=\i] in {2019,2020,...,2024}
        \node at (5*\i - 5, -.3) {\yr};
    
    % ~~~ 2019 ~~~~~~~~
    \draw (0,0) -- +(0,.3);
    \node[mnth] at (0, .3) {Oct};
    \node[lbl]  at (0, .3) {T5};
    
    % ~~~ 2020 ~~~~~~~~
    \draw (5,-.6) -- +(0,.9);
    \node[mnth] at (5, .3) {Oct};
    \node[lbl]  at (5, .3) {mT5};
    \node[mnth] at (5, -.8) {May};
    \node[lbl]  at (5, -.8) {GPT-3};
    

    % ~~~ 2022 ~~~~~~~~
    \draw (15,-4) -- +(0,8);
    \node[mnth] at (15, .3) {Mar};
    \node[mnth] at (15, .8) {Apr};
    \node[dbl]  at (15, 1.3) {Tk-Instr};
    \node[lbl]  at (15, .8) {GPT-NeoX-20B};
    \node[lbl]  at (15, .3) {CodeGen};
    
 \end{tikzpicture}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .