9

I want to get three dots in timeline, not next to it like in the following picture. Code

\documentclass[xcolor=x11names]{beamer}
% http://tex.stackexchange.com/a/196808/13173
% http://tex.stackexchange.com/a/303021/13173

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{graphicx}
\usepackage[x11names]{xcolor}
\usepackage{colortbl}
\usepackage{caption}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

\begin{document}

\begin{frame}
\begin{table}
\renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
\captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
\caption{Timeline}\vskip -1.5ex    
\begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
\toprule
\addlinespace[1.5ex]
1969 & Lassa virus. \\
... \\
1989 & Guanarito virus, Venezuela.\\
\end{tabular}
\end{table}
\end{frame}

\end{document} 

Output

enter image description here

where I do not like that three dots are next to the line. I actually do not want any separate dots but those dots should be along the vertical timeline

Expected out: some dots in the timeline vertically such that no separate entry needed. I do not want those dots next to the timeline but integral parts of the timeline like you can cut axis in some Excel versions. cuts here for axes without dots

enter image description here

Such a cut is also ok. It just must show that there is a gap in timeline.

Minimize Tobi's Vertical Space

% http://tex.stackexchange.com/a/303060/13173
\newlength{\CVbreakdotsep}% length to change spacing between dots
\setlength{\CVbreakdotsep}{0.1mm}

\newcommand{\CVbreakdot}{% command for smaller dots
   \scalebox{0.4}{\textbullet}% % 0.6 too big!
}

\newcommand{\CVbreak}{% command for the break itself
   \multicolumn{2}{l}{%
      \hspace*{8.715mm}% <--- align dots with vertical line
      \rotatebox[origin=c]{-90}{%
         \color{LightSteelBlue3}%
         \hspace{0mm}% <--- extra vertical space; No
         \CVbreakdot\kern\CVbreakdotsep\CVbreakdot\kern\CVbreakdotsep\CVbreakdot
         \hspace{0mm}% <--- extra vertical space; No
      }%
   } \\%
}

\newcommand{\foo}{\color{LightSteelBlue3}
\makebox[0pt]{\textbullet}\hskip-0.5673pt\vrule width 1pt\hspace{\labelsep}}

% - - 
\begin{document}
% - - 
\begin{table} 
% - -
   \begin{tabular}{@{\,}r <{\hskip 1.3pt} !{\foo} >{\raggedright\arraybackslash}p{9cm}}
% - - 

Output where uneven distance to top and tail, and too much vertical distance around the cut

enter image description here

2nd Iteration on Tobi's Minimal Vertical Space

I found out that two dots is the optimum amount to indicate the cut. Three is just too much and one is too little. I find little different horizontal alignment and also a little change in the vertical alignment

\newcommand{\CVbreakdot}{% command for smaller dots
   \scalebox{0.4}{\textbullet}%
}

\newcommand{\CVbreak}{% command for the break itself
   \multicolumn{2}{l}{%
      \hspace*{8.7mm}% <--- align dots with vertical line
      \rotatebox[origin=c]{-90}{%
         \color{LightSteelBlue3}%
         \hspace{-5.3mm}% <--- extra vertical space
         \CVbreakdot\kern\CVbreakdotsep\CVbreakdot
      }%
   } \\[-3.6mm]%
}

Output which shows that the timeline's head and tail are taking much space in the region so I think they can be shortened

enter image description here


How can you get a Cut in Timeline?

  • 2
    Loading graphicx and xcolor is unnecessary and the latter has significant potential for confusion: if you change the options there or earlier, you'll get an error. Also, the font packages you are loading are probably not having any effect, although I'd have to check to be sure of this. – cfr Apr 7 '16 at 19:29
6

Here's a way of drawing the non-dotted cut using TikZ:

\documentclass[xcolor={x11names,table}]{beamer}% edited in light of Tobi's comment on samcarter's answer at http://tex.stackexchange.com/questions/303039/how-to-get-a-cut-in-timeline/303060?noredirect=1#comment734775_303059
% http://tex.stackexchange.com/a/196808/13173
% http://tex.stackexchange.com/a/303021/13173
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[TS1,T1]{fontenc}
\usefonttheme{professionalfonts}% otherwise fourier's font configuration will be partially overridden
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{caption}
\usepackage{tikz}
\usetikzlibrary{tikzmark,calc}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}
\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}
\begin{document}
\begin{frame}
  \begin{table}
    \renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}%
    \captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}%
    \caption{Timeline}\vskip -1.5ex
    \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
      \toprule
      \addlinespace[1.5ex]
      1969\tikzmark{a} & \tikzmark{b}Lassa virus. \\
      1989\tikzmark{c} & \tikzmark{d}Guanarito virus, Venezuela. 1993 - Sabia virus (BrHF), Brazil. 2004 - \end{tabular}
    \begin{tikzpicture}[overlay,remember picture]
      \path [draw=LightSteelBlue3, double distance=2.5pt, thick] ([xshift=3pt,yshift=4.5pt]$({pic cs:a})!1/2!({pic cs:c})$) .. controls +(10pt,5pt) and +(-10pt,-5pt) .. ([xshift=-5pt, yshift=2pt]$({pic cs:b})!1/2!({pic cs:d})$);
    \end{tikzpicture}
  \end{table}
\end{frame}
\end{document}

non-dot cut

  • Assume you have more than two entries in the list. It would be great that you do not need to manually decide the precise location of the cut in the list; just by using \tikmark{a} ... \tikmark{c} in the lines. Some of the logic in \path [draw ... could probably done differently. – Léo Léopold Hertz 준영 Apr 8 '16 at 16:41
  • 1
    @Masi Answers here are typically a basis for what you might want to do. Obviously you would typically modify an answer for your particular needs. Surely you might prefer a different 'logic' and somebody else a third approach. Certainly you could do it with 2 tikzmarks, for example, because a and d provide as much information as a-d, although it would complicate the calculations a bit. Or you can define just one and hard-code the distances relative to that one, if that works better. Also, you might want to use Beamer's colours for double, depending on your Beamer theme. – cfr Apr 8 '16 at 20:59
  • Interesting! I am considering your sentence Beamer's colours for double. What do you mean by double? I really want to have better colours. My current Beamer theme is Copenhagen. – Léo Léopold Hertz 준영 Apr 8 '16 at 22:31
  • If you say double=blue, the space between the lines will be blue rather than white. Probably you want it to match the colour Beamer is using for the background, unless that is white which would be fine with the default. – cfr Apr 8 '16 at 22:44
7

Here is a solution with the nccrules package. I define a \vdashrule, slightly thinner than the rule of the time line, and a \addvdashrule commands. The parameters for the vertical dashline are specific to this context but can easily be adapted to another. You can stack vertical dashlines.

\documentclass[xcolor={x11names, table}]{beamer}
% http://tex.stackexchange.com/a/196808/13173
% http://tex.stackexchange.com/a/303021/13173

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, erewhon}
\usepackage{array, booktabs}
\usepackage{nccrules}
\usepackage{caption}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{{\textbullet}}\hskip-0.5pt\vrule width 1pt}
\newcommand\vdashrule{\color{LightSteelBlue3}\dashrule[-0.75ex]{0.8}{2.5 2 2.5 2 2.5 2 2.5}}%
\newcommand\addvdashrule{%
 \multicolumn{1}{@{}r@{}}{\begin{tabular}{@{\,}r <{\hskip 2pt} !{\hspace{\labelsep}\hskip-0.5pt \vdashrule\hskip0.1pt }}~\end{tabular}}}%

\begin{document}

\begin{frame}
    \begin{table}
    \renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
    \captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
    \caption{Timeline}\vskip -1.5ex
        \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
        \toprule
        \addlinespace[1.5ex]
        1969 & Lassa virus. \\%
        \addvdashrule \\[-0.4ex]
         \addvdashrule \\
         1989 & Guanarito virus, Venezuela. 1993 - Sabia virus (BrHF), Brazil. 2004 - \end{tabular}
    \end{table}
\end{frame}

\end{document} 

enter image description here

  • 1
    @Masi Your code contained the caption stuff. Since the question wasn't about that aspect of your code, there isn't any pressing reason for answers to address it. And lines should not be broken with \\ except in specialised environments such as tabular and array which doesn't apply here. (Unless we're effectively in a center where it will be equivalent to \par.) – cfr Apr 8 '16 at 21:29
  • @cfr You are right! I put it back because `\\` is wrong here. – Léo Léopold Hertz 준영 Apr 8 '16 at 22:10
7

You could use a \multicolumn to overwrite the general column specification. In the column I used \rotatexbox to get three dots below each other and \hspace to align them with the time line. You may adjust the values to your needs.

enter image description here

\documentclass[xcolor={x11names,table}]{beamer}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}

\newcommand{\foo}{%
   \color{LightSteelBlue3}%
   \makebox[0pt]{\textbullet}%
   \hskip-0.5pt\vrule width 1pt%
   \hspace{\labelsep}%
}

\newlength{\CVbreakdotsep}% length to change spacing between dots
\setlength{\CVbreakdotsep}{0.6mm}

\newcommand{\CVbreakdot}{% command for smaller dots
   \scalebox{0.6}{\textbullet}%
}

\newcommand{\CVbreak}{% command for the break itself
   \multicolumn{2}{l}{%
      \hspace*{8.715mm}% <--- align dots with vertical line
      \rotatebox[origin=c]{-90}{%
         \color{LightSteelBlue3}%
         \hspace{2mm}% <--- extra vertical (horizontal–90°) space
         \CVbreakdot\kern\CVbreakdotsep\CVbreakdot\kern\CVbreakdotsep\CVbreakdot
         \hspace{2mm}% <--- extra vertical (horizontal–90°) space
      }%
   } \\%
}

\begin{document}

\begin{frame}
\begin{table}
   \renewcommand\arraystretch{1.4}
   \arrayrulecolor{LightSteelBlue3}
   \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
      \toprule
      \addlinespace[1.5ex]
      1969 & Lassa virus. \\
      \CVbreak
      1989 & Guanarito virus, Venezuela. \\
   \end{tabular}
\end{table}
\end{frame}

\end{document} 

smaller spaces:

enter image description here

\documentclass[xcolor={x11names,table}]{beamer}

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}

\newcommand{\foo}{%
   \color{LightSteelBlue3}%
   \makebox[0pt]{\textbullet}%
   \hskip-0.5pt\vrule width 1pt%
   \hspace{\labelsep}%
}

\newlength{\CVbreakdotsep}% length to change spacing between dots
\setlength{\CVbreakdotsep}{0.1mm}

\newcommand{\CVbreakdot}{% command for smaller dots
   \scalebox{0.4}{\textbullet}% % 0.6 too big!
}

\newcommand{\CVbreak}{% command for the break itself
   \multicolumn{2}{l}{%
      \hspace*{8.97mm}% <--- align dots with vertical line
      \rotatebox[origin=c]{-90}{%
         \color{LightSteelBlue3}%
         \hspace{-5.5mm}% <--- extra vertical (horizontal–90°) space;
         \CVbreakdot\kern\CVbreakdotsep\CVbreakdot\kern\CVbreakdotsep\CVbreakdot
      }%
   } \\[-3.6mm]%
}

\begin{document}

\begin{frame}
\begin{table}
   \renewcommand\arraystretch{1.4}
   \arrayrulecolor{LightSteelBlue3}
   \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
      \toprule
      \addlinespace[1.5ex]
      1969 & Lassa virus. \\
      \CVbreak
      1989 & Guanarito virus, Venezuela. \\
   \end{tabular}
\end{table}
\end{frame}

\end{document} 
  • 1
    @Masi: See my new code. You can wrap the break in a new macro \CVbreak. And you can use \scalebox to shrink \textbullet. – Tobi Apr 8 '16 at 7:47
  • @Masi actually I don’t se any uneven spacing in the screenshot in my answer … if you like other distances change the value of CVbreaksep and the values of the \hspaces … – Tobi Apr 8 '16 at 18:56
  • @Masi: Sorry I don’t understand what you mean and what you consider “enormous” ;-) please make a screenshot, mark the wrong spacings and add the image to your question … – Tobi Apr 8 '16 at 19:12
  • @Masi: If I understand your correct and you mean the lines from the big bullet points to the gap, you can’t they are set by \foo. It might be a good idea to completly change the way you create the list if you dislike the output ;-) – Tobi Apr 9 '16 at 8:23
  • 1
    @Masi: The space can be reduced such that the little dos connect to the line (just try it yourself by changing the values). But you can’t reduce the length of the line which is made by \vrule in \foo and has the same height as the row it belongs to. – Tobi Apr 9 '16 at 13:31
6

well, rather a quick hack, than a solution, but perhaps it does, what you want.

\documentclass[xcolor=x11names,table]{beamer}
% http://tex.stackexchange.com/a/196808/13173
% http://tex.stackexchange.com/a/303021/13173

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{caption}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

\begin{document}

    \begin{frame}
        \begin{table}
            \renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
            \captionsetup{font=blue, labelfont=sc, labelsep=quad}
            \caption{Timeline}\vskip -1.5ex
            \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
                \toprule
                \addlinespace[1.5ex]
                1969 & Lassa virus.
            \end{tabular}

            \begin{tabular}{@{\,}r <{\hskip 2pt} !{\color{LightSteelBlue3}\makebox[0pt]{\textbullet\textbullet\textbullet}} >{\raggedright\arraybackslash}p{4.4cm}}
                {} & {}
            \end{tabular}

            \begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
                1989 & Guanarito virus, Venezuela. 1993 - Sabia virus (BrHF), Brazil. 2004 - \end{tabular}
        \end{table}
    \end{frame}

\end{document} 

enter image description here

2

Three dots on the timeline, without date or text appended to those dots, is achieved by adding {} & {} three times to the timeline data.

\documentclass[xcolor=x11names]{beamer}
% http://tex.stackexchange.com/a/196808/13173
% http://tex.stackexchange.com/a/303021/13173

\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage[TS1,T1]{fontenc}
\usepackage{fourier, heuristica}
\usepackage{array, booktabs}
\usepackage{colortbl}
\usepackage{caption}
\DeclareCaptionFont{blue}{\color{LightSteelBlue3}}

\newcommand{\foo}{\color{LightSteelBlue3}\makebox[0pt]{\textbullet}\hskip-0.5pt\vrule width 1pt\hspace{\labelsep}}

\begin{document}

\begin{frame}
\begin{table}
\renewcommand\arraystretch{1.4}\arrayrulecolor{LightSteelBlue3}
\captionsetup{singlelinecheck=false, font=blue, labelfont=sc, labelsep=quad}
\caption{Timeline}\vskip -1.5ex
\begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
\toprule
\addlinespace[1.5ex]
1969 & Lassa virus. \\
{} & {} \\
{} & {} \\
{} & {} \\
1989 & Guanarito virus, Venezuela. 1993 - Sabia virus (BrHF), Brazil. 2004 - \end{tabular}
\end{table}
\end{frame}

\end{document}

enter image description here

  • I mean to have dots in the line, not next to it. – Léo Léopold Hertz 준영 Apr 7 '16 at 16:50
  • Actually, I do not mean that neither. It takes absolute too much space. There must be a cut where a high density of some dots. – Léo Léopold Hertz 준영 Apr 7 '16 at 17:40
  • This method would really work if only one dot between the text and the between-dot could be made white. Do you have any idea for it? I like your method's simplicity a lot. – Léo Léopold Hertz 준영 Apr 7 '16 at 19:02
  • 1
    Can you remove the spurious loading of graphicx and, especially, xcolor? It will potentially confuse if somebody tries to add other options there as they'll get an error. – cfr Apr 7 '16 at 19:28

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.