[Tex/LaTex] vertical dashed line between columns in beamer

beamercolumns

How to draw vertical dashed line between columns in beamer?

I have found how to make vertical line, but not dashed 🙁

Best Answer

A bit hacky, but with the dashrule package and \rotatebox macro from graphicx you can achieve something like the following (MWE taken from the other question you linked):

enter image description here

\documentclass[demo]{beamer}
\usepackage{dashrule}
\begin{document}
  \begin{columns}[c]
   \begin{column}{0.5\textwidth}
    \includegraphics<1>[width=0.35\textwidth]{picture.jpg}
   \end{column}
   \rotatebox{-90}{\hskip-1.8cm\hdashrule[0.2ex]{5cm}{1pt}{3mm}}
   \begin{column}{0.50\textwidth}
    \hskip10pt
    \includegraphics<1>[width=0.35\textwidth]{picture.jpg}
   \end{column}
  \end{columns}
\end{document}

You need to enclose the \hdashrule macro into a rotatebox and manually adjust the starting point of the rule after the rotation with a \hskip.

You can control the dashing factor, thickness, length, etc. of the rule via the \hdashrule command parameters explained in the package documentation.

TikZ solution

Just for fun, here is a TikZ based alternative solution:

\documentclass[demo]{beamer}
\usepackage{tikz}

\newcommand{\vdashrule}[1]{\tikz[remember picture]\draw[dashed,thick,overlay](current page.north)--+(0,-#1);}

\begin{document}
  \begin{columns}[c]
   \begin{column}{0.5\textwidth}
    \includegraphics<1>[width=0.35\textwidth]{picture.jpg}
   \end{column}
    \vdashrule{3.5}
   \begin{column}{0.50\textwidth}
    \hskip10pt
    \includegraphics<1>[width=0.35\textwidth]{picture.jpg}
   \end{column}
  \end{columns}
\end{document}

I just defined a \vdashrule command that takes advantage of the overlay and remember picture TikZ options, which let you anchor the rule to frame borders (or everywhere else in the frame, if you like).

The length of the rule is specified with an argument and the style can be controlled via the TikZ options.

The visual result is pretty much the same as the previous screenshot.