【问题标题】:Latex Beamer: Increase spacing between sections in section navigation barLatex Beamer:增加部分导航栏中部分之间的间距
【发布时间】:2018-03-22 20:11:18
【问题描述】:

我想修改我的 Latex Beamer 模板。 因此,我想增加部分导航栏中显示部分之间的空间。目前,它们是缩进的,但这些部分是靠在一起的。

我使用以下代码生成标题:

setbeamertemplate{headline}{%
    \leavevmode%
    \hbox{%
        \begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1.125ex]{palette tertiary}%
        \insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}                 
        \end{beamercolorbox}%
    }
}

如何修改显示部分之间的间距?

【问题讨论】:

    标签: latex beamer


    【解决方案1】:

    您在导航后插入的水滴填充plus1filll 使其与左侧齐平。如果您删除它,这些部分将自动分布在可用的纸张宽度内:

    \documentclass{beamer}
    
    \setbeamertemplate{headline}{%
        \leavevmode%
        \hbox{%
            \begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1.125ex]{palette tertiary}%
            \insertsectionnavigationhorizontal{\paperwidth}{}{}
            \end{beamercolorbox}%
        }
    }
    
    \begin{document}
    
    \section{title}
    \begin{frame}
    content...
    \end{frame}
    
    \section{title}
    \begin{frame}
    content...
    \end{frame}
    
    \end{document}
    

    如果您想保持这些部分向左对齐并在它们之间添加一些额外的空间:

    \documentclass{beamer}
    
    \setbeamertemplate{headline}{%
        \leavevmode%
        \hbox{%
            \begin{beamercolorbox}[wd=\paperwidth,ht=3ex,dp=1.125ex]{palette tertiary}%
            \insertsectionnavigationhorizontal{\paperwidth}{}{\hskip0pt plus1filll}
            \end{beamercolorbox}%
        }
    }
    
    \setbeamertemplate{section in head/foot}{\insertsectionhead\hspace{0.5cm}}
    
    \begin{document}
    
    \section{title}
    \begin{frame}
    content...
    \end{frame}
    
    \section{title}
    \begin{frame}
    content...
    \end{frame}
    
    \end{document}
    

    【讨论】: