Beamer:列中的行分隔符

Beamer:列中的行分隔符

我在用图案绘制线条分隔符。

它运行完美,但在这种情况下,我想将行分隔符放在一列内,但出现错误......

这是我做的 MWE:

\documentclass[xcolor={dvipsnames,table}, hyperref={unicode}]{beamer}
\usepackage{etex}
\reserveinserts{28}
\setbeameroption{hide notes}

\mode<presentation> {
    \usetheme{Singapore}
    \usecolortheme{orchid}
    \usepackage[dvipsnames]{xcolor}%before tikz
    \usepackage[absolute,overlay]{textpos} %for positioning
    \usepackage{tikz}
    \usetikzlibrary{calc}
    \usepackage{graphicx} %Allows including images
    \setbeamertemplate{navigation symbols}{} % To remove the navigation symbols from the bottom of all slides uncomment this line

    \usepackage[export]{adjustbox}% http://ctan.org/pkg/adjustbox
    \usetikzlibrary{positioning,shadows,calc,mindmap,trees,shapes,
    decorations.pathreplacing}%calc is already called in the beamerthemeSIgN.sty file!
    \usepackage{pgfplots}
    \pgfplotsset{compat=1.7}%http://tex.stackexchange.com/questions/81899/what-does-running-in-backwards-compatibility-mode-mean-and-what-should-i-fix-t


    \usepackage{multicol}
    \usepackage{multirow}


    %line separator
    \usepackage[object=vectorian]{pgfornament}
    \newcommand{\sectionline}[3]{%
        \nointerlineskip \vspace{.5\baselineskip}\hspace{\fill}{
            \resizebox{0.5\linewidth}{#3}{
                \pgfornament[color = #1]{#2}
            }
        }
        \hspace{\fill}
        \par\nointerlineskip \vspace{.5\baselineskip}
    }


    \usefonttheme{serif} % default family is serif
    \usepackage{fontspec}

    \usepackage{lmodern}% http://ctan.org/pkg/lm
    \defaultfontfeatures{Mapping=tex-text}
}


\begin{document}
%\mode* % same as ignorenonframetext

\section{Unit 1}
\subsection{}
\begin{frame}
\frametitle{My title}
\begin{columns}[T] % align columns
\begin{column}{.4\textwidth}
    \includegraphics[width=\linewidth]{example-image}
\end{column}%
\hfill%
\begin{column}{.6\textwidth}
    \setlength{\leftmargini}{0pt}
    \begin{itemize}
    \itemsep0.5em
        \item Some text here
    \end{itemize}
    \hspace{30pt} More text here...
    %\sectionline{blue}{88}{0.75ex} %I WANT THIS HERE, BUT DOESN'T WORK!
\end{column}%
\end{columns}
\sectionline{blue}{88}{0.75ex} %IT ONLY WORKS HERE
\begin{itemize}
\itemsep0.5em
    \item more and more and more text
    \item and yes! more text
\end{itemize}

\note{}
\end{frame}


\end{document}

这个 MWE 制作了这个这

但是,我希望行分隔符位于图像旁边,而不是位于其下方......

如果我将行分隔符放在列内,我会收到错误:

您不能在水平模式下使用“\prevdepth”。

有什么帮助吗?

答案1

错误消息是您可以在退出水平模式! You can't use '\prevdepth' in horizontal mode.之前添加一个空白行,或者按照 Ignasi 的评论所建议,您可以在第一次调用之前添加到定义中。\sectionline\par\nointerlineskip\sectionline

在此处输入图片描述

\documentclass[xcolor={dvipsnames,table}, hyperref={unicode}]{beamer}
\usepackage{etex}
\reserveinserts{28}
\setbeameroption{hide notes}

\mode<presentation> {
    \usetheme{Singapore}
    \usecolortheme{orchid}
    \usepackage[dvipsnames]{xcolor}%before tikz
    \usepackage[absolute,overlay]{textpos} %for positioning
    \usepackage{tikz}
    \usetikzlibrary{calc}
    \usepackage{graphicx} %Allows including images
    \setbeamertemplate{navigation symbols}{} % To remove the navigation symbols from the bottom of all slides uncomment this line

    \usepackage[export]{adjustbox}% http://ctan.org/pkg/adjustbox
    \usetikzlibrary{positioning,shadows,calc,mindmap,trees,shapes,
    decorations.pathreplacing}%calc is already called in the beamerthemeSIgN.sty file!
    \usepackage{pgfplots}
    \pgfplotsset{compat=1.7}%http://tex.stackexchange.com/questions/81899/what-does-running-in-backwards-compatibility-mode-mean-and-what-should-i-fix-t


    \usepackage{multicol}
    \usepackage{multirow}


    %line separator
    \usepackage[object=vectorian]{pgfornament}
    \newcommand{\sectionline}[3]{%
        \nointerlineskip \vspace{.5\baselineskip}\hspace{\fill}{
            \resizebox{0.5\linewidth}{#3}{
                \pgfornament[color = #1]{#2}
            }
        }
        \hspace{\fill}
        \par\nointerlineskip \vspace{.5\baselineskip}
    }


    \usefonttheme{serif} % default family is serif
    \usepackage{fontspec}

    \usepackage{lmodern}% http://ctan.org/pkg/lm
    \defaultfontfeatures{Mapping=tex-text}
}


\begin{document}
%\mode* % same as ignorenonframetext

\section{Unit 1}
\subsection{}
\begin{frame}
\frametitle{My title}
\begin{columns}[T] % align columns
\begin{column}{.4\textwidth}
    \includegraphics[width=\linewidth]{example-image}

    \sectionline{orange}{88}{0.75ex}
\end{column}%
\hfill%
\begin{column}{.6\textwidth}
    \setlength{\leftmargini}{0pt}
    \begin{itemize}
    \itemsep0.5em
        \item Some text here
    \end{itemize}
    \hspace{30pt} More text here...

    \sectionline{magenta}{88}{0.75ex} %I WANT THIS HERE, BUT DOESN'T WORK!
\end{column}%
\end{columns}
\sectionline{blue}{88}{0.75ex} %IT ONLY WORKS HERE
\begin{itemize}
\itemsep0.5em
    \item more and more and more text
    \item and yes! more text
\end{itemize}

\note{}
\end{frame}


\end{document}

相关内容