Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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)?

share|improve this question
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 '13 at 17:28
add comment

1 Answer

up vote 2 down vote accepted

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}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.