2

How to adjust vertical space between headline and text box?

I used [t] option but there is still a big space on the slide.

\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}

vertical space between headline and text box

  • 1
    Try adding \addtobeamertemplate{block begin}{\vspace{-25pt}}{} in your preamble. – karlkoeller Jul 30 '13 at 5:43
  • @karlkoeller not a good solution with beamerposter since it has multiple blocks. – Fuhrmanator Mar 27 '16 at 14:52
  • It's worth adding that this problem applies to beamerposter as well. – Fuhrmanator Mar 27 '16 at 14:53
1

It looks like columns environment introduces some vertical shift. In your example, columns is used to define block width. You can get same results with minipage environments which don't shift the block. Next code (I've suppressed titlepage and AtBeginSection fragments) shows results with columns and 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}

enter image description here

2

You can also add \vspace{-X.Ypt) just below \frametitle, where X and Y are numbers that suit the space size you want. For example \vspace{-20.5pt). If you want to increase the space, you just remove the minus size and set the number.

  • This solution worked best for me with beamerposter, because I'm using the column environment in a frame (actually it's a LyX template). I wish there were some way to control this better; tweaking \vspace is a hack and requires more tweaking if you change font size, etc. – Fuhrmanator Mar 27 '16 at 14:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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