0

I'm creating a timeline using chronosys package but I have some issue adding a new line inside a chronoevent.

Example:

%!TEX TS-program = xelatex
\documentclass[]{article}
\usepackage{chronosys}

\begin{document}

\section{Timeline}
\startchronology[startyear=2005, stopyear=2023, height=1ex, color=blue, arrowcolor=blue, dates=false]
\chronoevent[markdepth=150pt, datesstyle=\footnotesize, textstyle=\it \footnotesize, barre=false, datesseparation=/, conversionmonth=false]{07/2005}{test1\\test2}
\chronoevent[markdepth=180pt, datesstyle=\footnotesize, textstyle=\it \footnotesize, barre=false, datesseparation=/, conversionmonth=false]{12/2009}{test3\\test4}
\stopchronology

\end{document}

enter image description here

The keyword \\ is not working and I'm not able to create a new line. I tried with \newline as well with no success. Any suggestion?

Thanks!

15
  • 2
    Welcome to TSE. Please post a Minimal Working Example, instead of a code snippet. Oct 26, 2023 at 12:42
  • I edited the question adding the output of the code snippet as reference. Thanks.
    – neoben
    Oct 26, 2023 at 13:33
  • 3
    You haven't been asked to post a picture of the output but to post a complete code, starting with \documentclass and ending with \end{document}.
    – campa
    Oct 26, 2023 at 13:36
  • 1
    Please give new users time to respond before down-voting their questions.
    – cfr
    Oct 26, 2023 at 14:05
  • 1
    @campa sorry about the confusion, now the question contains the complete code.
    – neoben
    Oct 26, 2023 at 14:10

1 Answer 1

0

You might, if you are feeling intrepid, try chronos. This is an experimental package and not currently on CTAN. It is based on my answers on TeX SE and some other code I used for timelines.

Caveat emptor ...

Looking just-like-chronosys-but-tweaked isn't chronos's default, but it is quite configurable.

The following example reproduces the MWE from the question and then illustrates a version using chronos rather than chronosys. The code uses showframe to mark the page layout. Note that the original timeline extends into the margin.

The example demonstrates one way to get multiline texts with chronos, using explicit \\ s. An alternative would be to specify text width and let the content be automatically split accordingly.

Note that two-letter font commands are seriously obsolete in LaTeX and ought not be used. Depending on your class, they may even give errors.

\documentclass{article}
% ateb: https://tex.stackexchange.com/a/701756/ i gwestiwn neoben: https://tex.stackexchange.com/q/699595/
% https://codeberg.org/cfr/chronos
\usepackage{chronos}
\usepackage{chronosys}
\usepackage[showframe]{geometry}

\begin{document}
\texttt{chronosys}

\startchronology[startyear=2005, stopyear=2023, height=1ex, color=blue, arrowcolor=blue, dates=false]
\chronoevent[markdepth=150pt, datesstyle=\footnotesize, textstyle=\it \footnotesize, barre=false, datesseparation=/, conversionmonth=false]{07/2005}{test1\\test2}
\chronoevent[markdepth=180pt, datesstyle=\footnotesize, textstyle=\it \footnotesize, barre=false, datesseparation=/, conversionmonth=false]{12/2009}{test3\\test4}
\stopchronology


\centering

\begin{chronos}
  [
    off line simple,
    timeline={%
      dates=2005:2023,
      timeline width=\linewidth,
      timeline height=1ex,
      timeline years=none,
      timeline foreground=blue,
    },
    every event below,
    event={%
      date format={!m/!Y},
      text tag+={%
        font=\normalsize\rmfamily\itshape,
      },
      date font=\footnotesize\upshape,  
    },
  ]
  \chronosevent{date=2005-07,name=t1,name content={test1\\test2},yshift=-150pt}
  \chronosevent{date=2009-12,name=t2,name content={test3\\test4},yshift=-180pt}
  \chronosmaintitle{name=\texttt{chronos}, at=chronos end, yshift=-10mm, anchor=north east}
\end{chronos}

\end{document}

chronosys and chronos with marked page layout

2
  • Thank you for the suggestion, I will try to integrate chronos on Overleaf (overleaf.com) and give it a try. I tried also the approach of changing "text width" but this will affect all the lines and i would like to have one line longer or shorter than the other. Thank you!
    – neoben
    Nov 24, 2023 at 14:32
  • @neoben In chronos, you could specify text width on a per event basis, if you really wanted to. I don't know if that's possible in chronosys.
    – cfr
    Nov 24, 2023 at 15:24

You must log in to answer this question.

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