我有一个带 beamerposter 的两列布局,其中各列由垂直线分隔(感谢 egreg)。现在我需要用水平线将各部分分开,水平线的范围从纸张边缘到海报中间的垂直线。我已经尝试通过在\rule
实际规则命令前使用带有负长度的命令来更正水平规则的长度和位置,但线条可以移动的步骤似乎太粗(线条要么结束得太早,要么开始和结束得太晚)。
这是我所说的一个例子,但是我如何实现正确长度和位置的水平线?
\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}
编辑:我尝试通过 tikz 绘制线条,用以下代码替换水平规则
\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}
由于某种原因,这种方法在两个维度上都存在偏移。它从何而来,我需要将 tikzpicture 移动多少来补偿它(如果这种方法可以做到的话)?
答案1
感谢 JLDiaz 的提示,我设法使用 tikz 完成了此操作。以下是解决方案的来源:
\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}