调整标题和文本框之间的垂直间距

调整标题和文本框之间的垂直间距

如何调整标题和文本框之间的垂直间距?

我使用了 [t] 选项,但幻灯片上仍然有很大空间。

\documentclass[compress,serif,xcolor=dvipsnames,xetex,t]{beamer}

\usetheme{Madrid}
\definecolor{Setcolor}{HTML}{6698FF}
\usecolortheme[named=Setcolor]{structure}


\usepackage{xltxtra}
\XeTeXlinebreaklocale "th"
\defaultfontfeatures{Scale=1.4}
\renewcommand{\baselinestretch}{1.35}
\setmainfont[Script=Thai]{DilleniaUPC}


\usepackage[all,knot,color]{xy}
\xyoption{arc}
\usepackage{url}


\setbeamertemplate{headline}
{
        \leavevmode%
        \hbox{%

        \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.0ex,center]{section in head/foot}%
                \usebeamerfont{section in head/foot}\textbf{\insertauthor}\hspace*{2ex}%
        \end{beamercolorbox}%

        \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.0ex,center]{subsection in head/foot}%
                \usebeamerfont{subsection in head/foot}\hspace*{2ex}\textbf{\insertsubsectionhead}%
        \end{beamercolorbox}}%

        \vskip0pt%
}

\setbeamertemplate{footline}
{
        \leavevmode%
        \hbox{%

        \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.5ex,dp=1ex,left]{section in head/foot}
                \usebeamerfont{author in head/foot}\enspace \textbf{\insertshorttitle}
        \end{beamercolorbox}%
%
        \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.5ex,dp=1ex,center]{section in head/foot}%
                \usebeamerfont{title in head/foot}\insertsubtitle
        \end{beamercolorbox}%
%
        \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.5ex,dp=1ex,right]{section in head/foot}
                \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
                \textbf{\insertframenumber{} / \inserttotalframenumber}\hspace*{2ex}
        \end{beamercolorbox}}%
%
        \vskip0pt%
}


\makeatletter

\def\beamer@themerounded@shadow{true}
\defbeamertemplate*{title page}{mydefault}[1][]
{
        \vbox{}
        \vfill
        \begin{centering}

                {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
                \begin{beamercolorbox}[sep=8pt,center,#1]{title}
                        \usebeamerfont{title}\inserttitle\par%
                        \ifx\insertsubtitle\@empty%
                        \else%
                        \vskip0.25em%
                        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
                        \fi%
                \end{beamercolorbox}%

                \vskip1em\par

                \begin{beamercolorbox}[sep=8pt,center,#1]{author}
                        \usebeamerfont{author}\insertauthor
                \end{beamercolorbox}

                \begin{beamercolorbox}[sep=8pt,center,#1]{institute}
                        \usebeamerfont{institute}\insertinstitute
                \end{beamercolorbox}

                \begin{beamercolorbox}[sep=8pt,center,#1]{date}
                        \usebeamerfont{date}\insertdate
                \end{beamercolorbox}\vskip0.5em

        \end{centering}
        \vfill
}
%
\setbeamertemplate{title page}[mydefault][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\makeatother


\AtBeginSection[]{
    \setbeamercolor{section in toc shaded}{use=structure,black}
    \setbeamercolor{section in toc}{fg=black}
    \setbeamercolor{subsection in toc shaded}{fg=black}
    \setbeamercolor{subsection in toc}{fg=black}
    \frame<beamer>{
        \begin{multicols}{2}
                \frametitle{\textbf{\insertshorttitle}}
                \setcounter{tocdepth}{2}
                \tableofcontents[currentsection,subsections]
        \end{multicols}
    }
}

\titlegraphic{\includegraphics[height=2.0cm]{./Basic_Fig/BUU_EN.jpg}}
%
\title[\textbf{ABCD (ABCDEFG)}]{\textbf{000000 ABCD}}
\subtitle{\textbf{ABCDEFG}}

\author{\textbf{AAAAA (BBBBBB)}}
\institute{\textbf{CCCCCCCC}}

\date{\textbf{XXXXX   YYYYY}}


\begin{document}
%
\begin{frame}[t]
    \frametitle{\textbf{LaTeX – A document preparation system)}}
    %
    \begin{columns}[t]
            %
            \column{0.85\textwidth}
            %
            \begin{block}{\textbf{LaTeX}}
                    %
                    \textbf{
                            \begin{enumerate}
                                    %
                                    \itemLaTeX the product\\
                                            •LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as free software.\\
                                            •LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as free software.\\
                                    %
                                    \itemLaTeX the product\\
                                            •LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as free software.\\
                                            •LaTeX is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. LaTeX is the de facto standard for the communication and publication of scientific documents. LaTeX is available as free software.\\
                                    %
                            \end{enumerate}
                    }
                    %
            \end{block}
            %
    \end{columns}
    %
\end{frame}
%
%
\end{document}

标题和文本框之间的垂直空间

答案1

看起来columns环境引入了一些垂直移位。在您的示例中,columns用于定义block width。您可以使用minipage不移动块的环境获得相同的结果。下一个代码(我已抑制titlepageAtBeginSection片段)显示使用和columns的结果minipage

\documentclass[compress,serif,xcolor=dvipsnames,xetex,t]{beamer}

\usetheme{Madrid}
\definecolor{Setcolor}{HTML}{6698FF}
\usecolortheme[named=Setcolor]{structure}


\usepackage{xltxtra}
\XeTeXlinebreaklocale "th"
\defaultfontfeatures{Scale=1.4}
\renewcommand{\baselinestretch}{1.35}
%\setmainfont[Script=Thai]{DilleniaUPC}


\usepackage[all,knot,color]{xy}
\xyoption{arc}
\usepackage{url}


\setbeamertemplate{headline}
{
        \leavevmode%
        \hbox{%
        \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.0ex,center]{section in head/foot}%
                \usebeamerfont{section in head/foot}\textbf{\insertauthor}\hspace*{2ex}%
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.5\paperwidth,ht=2.5ex,dp=1.0ex,center]{subsection in head/foot}%
                \usebeamerfont{subsection in head/foot}\hspace*{2ex}\textbf{\insertsubsectionhead}%
        \end{beamercolorbox}}%
        \vskip0pt%
}

\setbeamertemplate{footline}
{
        \leavevmode%
        \hbox{%
        \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.5ex,dp=1ex,left]{section in head/foot}
                \usebeamerfont{author in head/foot}\enspace \textbf{\insertshorttitle}
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.5ex,dp=1ex,center]{section in head/foot}%
                \usebeamerfont{title in head/foot}\insertsubtitle
        \end{beamercolorbox}%
        \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.5ex,dp=1ex,right]{section in head/foot}
                \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
                \textbf{\insertframenumber{} / \inserttotalframenumber}\hspace*{2ex}
        \end{beamercolorbox}}%
        \vskip0pt%
}


\def\beamer@themerounded@shadow{true}
%

\title[\textbf{ABCD (ABCDEFG)}]{\textbf{000000 ABCD}}
\subtitle{\textbf{ABCDEFG}}

\author{\textbf{AAAAA (BBBBBB)}}
\institute{\textbf{CCCCCCCC}}

\date{\textbf{XXXXX   YYYYY}}


\begin{document}
%
\begin{frame}[t]
    \frametitle{\textbf{Frame with \texttt{columns}}}
    %
    \begin{columns}[t]
            %
            \column{0.85\textwidth}
            %
\begin{block}{\textbf{\LaTeX}}
                    %
                    \textbf{
                            \begin{enumerate}
                                    %
                                    \item \LaTeX\ the product\\
                                            • \LaTeX\ is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. \LaTeX\ is the de facto standard for the communication and publication of scientific documents. \LaTeX\ is available as free software.\\
                                 %
                            \end{enumerate}
                    }
                    %
            \end{block}
            %
\end{columns}
    %
\end{frame}
%

\begin{frame}[t]
    \frametitle{\textbf{Frame with \texttt{minipage}}}
    %
\centering
\begin{minipage}{.85\textwidth}            
\begin{block}{\textbf{\LaTeX}}
                    %
                    \textbf{
                            \begin{enumerate}
                                    %
                                    \item \LaTeX\ the product\\
                                            • \LaTeX\ is a high-quality typesetting system; it includes features designed for the production of technical and scientific documentation. \LaTeX\ is the de facto standard for the communication and publication of scientific documents. \LaTeX\ is available as free software.\\
                                 %
                            \end{enumerate}
                    }
                    %
            \end{block}
            %
    \end{minipage}
    %
\end{frame}
%
\end{document}

在此处输入图片描述

答案2

您也可以\vspace{-X.Ypt)在下方添加\frametitle,其中 X 和 Y 是适合您所需空间大小的数字。例如\vspace{-20.5pt)。如果您想增加空间,只需删除负尺寸并设置数字即可。

相关内容