0

This is similar question to here but beamer and multicoloured vertical line: I want a multi-coloured vertical line to the side of each page with 50% blue, 25% red and 25% green from bottom to the top.

A small working example is below but not vertical line and bar intercepting with other content, not hover.

enter image description here

How can you add a vertical line with many colours to the side of each page?

\documentclass{beamer}

\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usetheme{default}

%For sidebar with multicolored bar
\newcommand\crule[3][black]{\textcolor{#1}{\rule{#2}{#3}}}
\definecolor{purple}{rgb}{1,0.5,1}


\begin{document}

\begin{frame}
 Page1
 %How to make multicoloured bar on each page? 
 \crule[blue]{0.1cm}{4cm} 
 \crule[red]{0.1cm}{1.5cm} 
 \crule[green]{0.1cm}{1.5cm} 
\end{frame}


\begin{frame}
 Page2
 %How to make multicoloured bar on each page? 
 \crule[black]{0.1cm}{4cm} 
 \crule[red]{0.1cm}{1.5cm} 
 \crule[purple]{0.1cm}{1.5cm} 
\end{frame}

\end{document}

Wanted Output looks like this

enter image description here

4
  • Please add a small MWE that shows how you currently set up your beamer documents.
    – leandriis
    Commented Jan 13, 2020 at 11:53
  • @leandriis added a small working example
    – hhh
    Commented Jan 13, 2020 at 11:56
  • Please clarify the desired ouput. Do you want a single line with a color gradient or do you want three sinde by side vertical lines with different heights?
    – leandriis
    Commented Jan 13, 2020 at 12:11
  • @leandriis clarified in this picture here about intended output where a multicoloured vertical line demonstrated.
    – hhh
    Commented Jan 13, 2020 at 12:16

1 Answer 1

2

You should use a sidebar. Mine is but a quick sketch, but you should play with the exact lengths and colors.

\documentclass{beamer}
\usepackage{tikz}

\setbeamertemplate{sidebar canvas left}{}
\setbeamertemplate{sidebar left}{%
    \hspace*{0.1cm}
    \begin{tikzpicture}
    \draw[blue,line width=0.1cm] (0,0) -- (0,-5);   
    \draw[red,line width=0.1cm] (0,-5) -- (0,-7.25);    
    \draw[green,line width=0.1cm] (0,-7.25) -- (0,-9.4);    
    \end{tikzpicture}
}

\begin{document}

\begin{frame}
\end{frame}


\begin{frame}
\end{frame}
\end{document}

enter image description here

You must log in to answer this question.

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