While putting together a "traditional" timeline, I kludged together a means of coloring my boxes in chronosys, but I would like the event boxes to be partially transparent.
This would allow better eye-tracking, particularly when events are close together, with different mark depths. Please see the below mock up, made with Gimp, for how this might look.
It would also be nice if the text was better aligned to the colorbox, notice the "s" in Darwin and the "m-" in Empire. My kludge code seems to work but produces errors. **(Thanks to Kola B., and see Gray vs. grey)
The code is below:
\documentclass[letterpaper,12pt,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage{chronosys}
\begin{document}
\subsection*{Biographical cornerstones}
\startchronology[startyear=1850,stopyear=1950,height=0.5ex]
\chronoevent[textwidth=4.5cm,colorbox={grey!10},markdepth=100pt]%
{1882}{born in the Austrian part of the Austria-Hungarian Empire}
\chronoevent[textwidth=4cm,colorbox={grey!10},markdepth=40pt]%
{1885}{Publication of Darwin's Evolutionary Theory}
\stopchronology
\end{document}
A sample of the above when compiled:
A crude mock up of what this might look like:
The chronosys documentation does not mention transparency as an option, but as it uses Tikz (for drawing lines), and colorbox (for events) and I believe transparency is possible.
I tried the following, attempting to use how to specify transparent colors per cfr's reference:
\documentclass[letterpaper,12pt,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage{chronosys}
\usepackage{transparent}
\begin{document}
\subsection*{Biographical cornerstones}
\startchronology[startyear=1850,stopyear=1950,height=0.5ex]
\chronoevent[textwidth=4.5cm,colorbox={gray!10},markdepth=100pt]%
{1881}{born in the Austrian part of the Austria-Hungarian Empire}
\chronoevent[textwidth=4cm,markdepth=40pt]%
{1885}{\transparent{0.3}\colorbox{blue}{Publication of Darwin's Evolutionary Theory}}
\stopchronology
\end{document}
But the result was this:
Changing the transparency affects the color of the box, making it lighter or darker, but not allowing the box to become more, or less, transparent. Notice that the text in the light blue box is very faint. The text within the box also becomes lighter or darker when the "transparency" is modified, an unwanted side effect.
Please advise if a solution exists using another timeline package other than chronosys
It also occurred to me that another way of accomplishing the goal would be to somehow make the lines connecting the boxes semi transparent. The solution should be able to reflect month/day/year for events, with automatic horizontal placement of events on the timeline. If anyone knows how to turn percusse's answer into a MWE that would be appreciated. It does not matter if the answer is "plain-TeX" or "Tikz", or requires multiple compilation, or otherwise, just so long as it works.
Bravo to @cfr for the below solution which works perfectly. His solution makes for a different type of timeline than can be made with currently available LaTeX/TeX packages (at least with the packages that I know of).
Notwithstanding the wonderful solution presented, it still be helpful to have a "package" based solution, either with chronosys or another package.
gray
inthe place ofgrey
?\documentclass[tikz,border=10pt,multi]{standalone} \begin{document} \begin{tikzpicture} \fill [blue, opacity=.5] (0,0) rectangle (1,1); \fill [blue] (1,0) rectangle (2,1); \fill [blue!50] (2,0) rectangle (3,1); \end{tikzpicture} \end{document}
produces this. What is the difference between the left and right squares?chronosys
and abandon transparency (probably) or abandonchronosys
. There are some other existing solutions for drawing timelineschronology
is one but there's also a TikZ-based solution on GitHub somewhere. If you are interested, I'll see if I can find the question which talks about it.