7

I am trying to reproduce the answer here about How can you create a vertical timeline? in Beamer (not OS X specific only). I installed TeX By MacTeX. I have these packages in OSX xcolor, colortbl and caption because Test code 1 works and verified also by Tex Live Utility.

Test code 1

Works:

\documentclass{report}

\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{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]
1933 & LCMV, aseptic meningitis. Epidemic St. Loius encephalitis. \\
1956 & Tacaribe virus.  \\
\end{tabular}
\end{table}
\end{document} 

Test code 2

Does not work:

\documentclass{beamer}

- - same as above - - 

Output

Latex Error: ./test_timeline.tex:11 LaTeX Error: Option clash for package xcolor.

Latex Error: ./test_timeline.tex:45 Package xcolor Error: Undefined color `LightSteelBlue3'.

Latex Error: ./test_timeline.tex:46 Package xcolor Error: Undefined color `LightSteelBlue3'.

...

How can you get a vertical timeline in Beamer?

  • 1
    none of the packages you mention is operating system dependent, why do you think OS X is involved? – David Carlisle Apr 06 '16 at 19:08
  • 1
    sudo tlmgr install xcolor colortbl caption? – DG' Apr 06 '16 at 19:09
  • maybe you need to update file name data base and formats? – naphaneal Apr 06 '16 at 22:44
  • How did you install TeX exactly? Did you use MacTeX? – cfr Apr 06 '16 at 23:50
  • 1
    In that case, you should already have all of those packages installed. They are all installed by MacTeX. Why do you think HomeBrew is involved? If you can create a Minimal Non-Working Example and post the code for that example, that would be helpful. You can then post the .log file you get from trying to compile that example somewhere. (It may not fit here.) – cfr Apr 07 '16 at 12:24
  • @cfr I managed to get problem forward. The thing is that the code does not work in Beamer but works elsewhere. – Léo Léopold Hertz 준영 Apr 07 '16 at 14:57

2 Answers2

9

The "problem" is, that beamer already loads xcolor and your [x11names] causes an option clash. Fortunately beamer has an own build-in option.

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

\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]
1933 & LCMV, aseptic meningitis. Epidemic St. Loius encephalitis. \\
1956 & Tacaribe virus.  \\
\end{tabular}
\end{table}
\end{frame}
\end{document} 

enter image description here

3

This answer uses \PassOptionsToPackage{x11names}{xcolor} following @Herbert's answer (LaTeX Error: Option clash for package xcolor). The caption is in a minipage environment to align it with the vertical timeline.

\PassOptionsToPackage{x11names}{xcolor}
\documentclass{beamer}

\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}

\begin{minipage}{7cm}
    \caption{Timeline}
\end{minipage}
\vskip -1.5ex

\begin{tabular}{@{\,}r <{\hskip 2pt} !{\foo} >{\raggedright\arraybackslash}p{5cm}}
\toprule
\addlinespace[1.5ex]
1933 & LCMV, aseptic meningitis. Epidemic St. Loius encephalitis. \\
1956 & Tacaribe virus.  \\
\end{tabular}
\end{table}
\end{frame}
\end{document} 

enter image description here

Ross
  • 5,656
  • 2
  • 14
  • 38