2

I am trying to make a beamer poster. I'm working on customizing the headers for the "block" environment. So far, I'm having trouble in that there is not enough vertical padding between the title text and the edge of the block title bar.

enter image description here

I am customizing the block title font, but the problem appears when I try to get rounded box corners. If I remove the following line, the boxes have sufficient padding:

% Use rounded blocks
\setbeamertemplate{blocks}[rounded]

It would be best if I could manually specify a height for the beamer box title bars. In addition to this vertical padding issue, the bars look strange side-by-side because they are all different heights.

Working example

Document

\documentclass[]{beamer}
\usepackage[orientation=landscape,size=custom,width=165,height=105,scale=1.47,debug]{beamerposter}
\usetheme{Modified}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\title{Title}
\author[]{Authors}
\institute[]{Institute}
\begin{document}

% beamer has a problem filling vertical space in columns
% have to manually specify column heights 
% 
\newlength{\colheightb}
\setlength{\colheightb}{0.85\paperheight}

\begin{frame}{}
\begin{columns}[T, totalwidth=\textwidth]
\begin{column}{.225\linewidth}
\vbox to \colheightb{%
    \begin{block}{Section}
    \end{block} 
    \vfill
}
\end{column}

\begin{column}{.225\linewidth}
\vbox to \colheightb{%
    \begin{block}{Section p}
    \end{block}
    \vfill
}
\end{column}

\begin{column}{.265\linewidth}
\vbox to \colheightb{%
    \begin{block}{Section y}
    \end{block}
    \vfill
}
\end{column}

\begin{column}{.275\linewidth}
\vbox to \colheightb{%
    \begin{block}{Section 4}
    \end{block}
    \vfill
}
\end{column}

\end{columns}
\end{frame}
\end{document}

Style

\usepackage{grffile}
\usepackage{calc}
\usepackage{tcolorbox}  
\usepackage{lmodern}

\DeclareOptionBeamer{compress}{\beamer@compresstrue}
\ProcessOptionsBeamer
\mode<presentation>
\setbeamercolor{section in head/foot}{use=structure,bg=structure.fg!25!bg}
\useoutertheme[subsection=false]{miniframes}
\setbeamertemplate{frametitle}[default][center]
\AtBeginDocument{%
  {
    \usebeamercolor{section in head/foot}
  } 
  \pgfdeclareverticalshading{beamer@headfade}{\paperwidth}
  {%
    color(0cm)=(bg);
    color(1.25cm)=(section in head/foot.bg)%
  }
  \setbeamercolor{section in head/foot}{bg=}
}
\beamertemplatedotitem
\mode
<all>

\setbeamercolor{headline}{bg=black,fg=white}
\setbeamercolor{title in headline}{bg=black,fg=white}
\setbeamercolor{author in headline}{bg=black,fg=white}
\setbeamercolor{institute in headline}{bg=black,fg=white}
\setbeamercolor{date in headline}{bg=black,fg=white}
\setbeamercolor{block body}{bg=white,fg=black}
\setbeamercolor{block title}{bg=black,fg=white}

\setbeamertemplate{headline}{  
\leavevmode
\begin{beamercolorbox}[wd=\paperwidth]{headline}
\vskip1cm
\raggedright
\usebeamercolor{title in headline}{
\color{fg}{\fontsize{110}{110}\selectfont {\inserttitle}}\\[3ex]}
\usebeamercolor{author in headline}{
\color{fg}\LARGE{\insertauthor}\\[1ex]}
\usebeamercolor{institute in headline}{
\color{fg}\large{\insertinstitute}\\[1ex]}  
\vskip2ex
\end{beamercolorbox}
\begin{beamercolorbox}[wd=\paperwidth]{lower separation line head}
\rule{0pt}{3pt}
\end{beamercolorbox}
}
% no navigation on a poster
\setbeamertemplate{navigation symbols}{}  


% Use rounded blocks
\setbeamertemplate{blocks}[rounded]

% Larger titles for the block
\makeatletter 
\newcommand\semiHuge{\@setfontsize\semiHuge{48}{45}}
\makeatother
\setbeamerfont*{block title}{family=\sffamily,series=\bfseries,size=\semiHuge}
  • Welcome to TeX.SX! Please help us help you and add a minimal working example (MWE) that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass{...} and ending with \end{document}. See also "<meta.tex.stackexchange.com/q/228>" for more information. – erik Sep 30 '15 at 16:33
  • Yes, I've been working on generating said example. There is a lot of complexity here. I thought maybe if there was an obvious way to specify the bar height, someone might know that. I'll put up the minimal working example as soon as I am able to create it. – MRule Sep 30 '15 at 16:40
3

enter image description here

\documentclass[]{beamer}
\usepackage[orientation=landscape,size=custom,width=165,height=105,scale=1.47,debug]{beamerposter}
\usetheme{Modified}
\usepackage[T1]{fontenc}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\title{Title}
\author[]{Authors}
\institute[]{Institute}
\begin{document}

% beamer has a problem filling vertical space in columns
% have to manually specify column heights 
% 
\newlength{\colheightb}
\setlength{\colheightb}{.85\paperheight}
\newcommand{\addheight}{\parbox{0pt}{\rule{0pt}{2cm}}}

\begin{frame}{}
\begin{columns}[T, totalwidth=\textwidth]
\begin{column}{.225\linewidth}
\vbox to \colheightb{%
    \begin{block}{Section\addheight}
    \end{block} 
    \vfill
}
\end{column}

\begin{column}{.225\linewidth}
\vbox to \colheightb{%
    \begin{block}{Section p\addheight}
    \end{block}
    \vfill
}
\end{column}

\begin{column}{.265\linewidth}
\vbox to \colheightb{%
    \begin{block}{Section y\addheight}
    \end{block}
    \vfill
}
\end{column}

\begin{column}{.275\linewidth}
\vbox to \colheightb{%
    \begin{block}{Section 4\addheight}
    \end{block}
    \vfill
}
\end{column}

\end{columns}
\end{frame}
\end{document}

You can add the height you want through a macro like this:

\newcommand{\addheight}{\parbox{0pt}{\rule{0pt}{2cm}}}

Then, in each block title, you just add the \addheight command. Alternatively, you can add the following two lines to the preamble, as suggested by @GonzaloMedina, to automate this:

\newcommand{\addheight}{\parbox{0pt}{\rule{0pt}{2cm}}}
\setbeamerfont*{block title}{family=\sffamily,series=\bfseries\addheight,size=\semiHuge} 

Then, there is no need to repeat \addheight in each block title. You can also change the value of 2cm as per your needs.

  • Using this trick \setbeamerfont*{block title}{family=\sffamily,series=\bfseries\addheight,size=\semiHuge} there's no need to manually include the command in every block. – Gonzalo Medina Sep 30 '15 at 22:36
  • @GonzaloMedina -- Thank you, I added your suggestion to the answer. I was just too lazy to do it for a single-page document. – AboAmmar Sep 30 '15 at 23:50

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.