2

I have a two column layout with beamerposter, where the columns are seperated by a vertical (thanks to egreg). Now I need the sections to be divided by horizontal lines that range from the edge of the paper to the vertical line at the middle of the poster. I already tried to correct the length and position of the horizontal rules by using the \rule command with negative length in front of the actual rule command, but the steps in which the line could shifted seemed to be to coarse (the line ended either to early or started and ended to late).

Here is an example of what I mean, but how do I achieve horizontal lines of the right length and position?

\documentclass[final,hyperref={pdfpagelabels=false}]{beamer}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}               
\usepackage{lipsum}

\begin{document}
\begin{frame}
  \begin{beamercolorbox}[wd=\paperwidth]{headline}
    \centering\huge Headline and stuff\\
    \rule{.5\paperwidth}{2mm}\kern-1mm
    \smash{\vrule height 0pt depth \paperheight width 2mm}\kern-1mm
    \rule{.5\paperwidth}{2mm}%
  \end{beamercolorbox}

  \begin{columns}
   \begin{column}{0.01\textwidth}
   \end{column}
   \begin{column}{0.48\textwidth}
    \huge \lipsum[1]
    \rule{0.5\paperwidth}{2mm}
    End of part one
   \end{column}
   \begin{column}{0.02\textwidth}
   \end{column}
   \begin{column}{0.48\textwidth}
    \huge Start of part two\\
    \rule{0.5\paperwidth}{2mm}
    \lipsum[2]
   \end{column}
   \begin{column}{0.01\textwidth}
   \end{column}
  \end{columns}
\end{frame}
\end{document}

edit: I tried to draw the line via tikz, by substituting the horizontal rules with

\tikz[remember picture] \coordinate (A);
\begin{tikzpicture}[overlay]
      \path[->,red] let \p1 = (A), \p2 = (current page.center) in (\x2-0.5\paperwidth,\y1) edge (\x2,\y1);
\end{tikzpicture}

For some reason there is an offset in both dimension with this approach. Where does it come from and how much do I have to shift the tikzpicture to compensate it (if this approach can do it at all)?

1
  • 1
    Use remember picture and overlay both when you define coordinate (A) and when you draw the line. Also, remember to compile twice.
    – JLDiaz
    Feb 18, 2013 at 17:28

1 Answer 1

2

Thanks to the hint from JLDiaz I managed to do it using tikz. Here are the sources for the solution:

\documentclass[final,hyperref={pdfpagelabels=false}]{beamer}

\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[orientation=portrait,size=a0,scale=1.4,debug]{beamerposter}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand{\lefthalfline}{
    \begin{tikzpicture}[remember picture, overlay,line width=2mm]
    \coordinate (A);
    \path let \p1 = (A), \p2 = (current page.center) in (\x2-0.5\paperwidth,\y1) edge (\x2,\y1);
    \end{tikzpicture}\\}

\newcommand{\righthalfline}{
    \begin{tikzpicture}[remember picture, overlay,line width=2mm]
    \coordinate (A);
    \path let \p1 = (A), \p2 = (current page.center) in (\x2+0.5\paperwidth,\y1) edge (\x2,\y1);
    \end{tikzpicture}\\}

\begin{document}
\begin{frame}
  \begin{beamercolorbox}[wd=\paperwidth]{headline}
    \centering\huge Headline and stuff\\
    \rule{.5\paperwidth}{2mm}\kern-1mm
    \smash{\vrule height 0pt depth \paperheight width 2mm}\kern-1mm
    \rule{.5\paperwidth}{2mm}%
  \end{beamercolorbox}

  \begin{columns}
   \begin{column}{0.01\textwidth}
   \end{column}
   \begin{column}{0.48\textwidth}
    \huge \lipsum[1]
    \lefthalfline
    End of part one
   \end{column}
   \begin{column}{0.02\textwidth}
   \end{column}
   \begin{column}{0.48\textwidth}
    \huge Start of part two\\
    \righthalfline
    \lipsum[2]
   \end{column}
   \begin{column}{0.01\textwidth}
   \end{column}
  \end{columns}
\end{frame}
\end{document}

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.