Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Hi I'm preparing a custom theme for beamerposter to align with the theme of my institution. I have to include a figure banner on the headline plus the possibility to include 2 different logos. So far I've done like this in the .sty file

\setbeamertemplate{headline}{  
\leavevmode
 \parbox{\textwidth}{\includegraphics[width=\paperwidth]{poster-banner}}
 \vskip-35ex
 \begin{beamercolorbox}[wd=\paperwidth]{headline}
 \begin{columns}[T]
  \begin{column}{.2\paperwidth}
    \begin{center} 
      \ifdefined\LeftLogo 
      \includegraphics[width=.6\linewidth,keepaspectratio,clip]{\LeftLogo} 
      \else 
      \fi 
    \end{center} 
    \vskip1.5cm 
  \end{column}
  \begin{column}{.65\paperwidth}
    \hskip1ex
    \vskip4ex
    \raggedright
    \usebeamercolor{title in headline}{\color{fg}\textbf{\LARGE{\inserttitle}}\\[1ex]}
    \usebeamercolor{author in headline}{\color{fg}\Large{\insertauthor}\\[0.5ex]}
    \usebeamercolor{institute in headline}{\color{fg}\large{\insertinstitute}\\[1ex]}     
  \end{column}
  \begin{column}{.15\paperwidth}
    \begin{center} 
      \ifdefined\RightLogo 
      \includegraphics[width=.6\linewidth,keepaspectratio,clip]{\RightLogo} 
      \else 
      \fi 
    \end{center} 
    \vskip1.5cm 
\end{column}
\end{columns}
\end{beamercolorbox}}

Where \RightLogo and \LeftLogo have been defined before the

\def\RightLogo{logoa.pdf}
\def\LeftLogo{logob.pdf}
\documentclass[final]{beamer}

The trick work nicely in portrait mode for beamerposter. But whenever I use landscape option the banner is too big in height. So I think I should pass the dimension of the banner and also the amoung of vskip differently according to the option passed to beamerposter (i.e. orientation=portrait, orientation = landscape). But I can't figure out how to infer this options. I hope I explain my self. I know that I should give a MWE but I hope it is sufficient as I've done

share|improve this question

1 Answer 1

up vote 2 down vote accepted

The command \ifportrait detects the value of orientation. So you can replace your line

\parbox{\textwidth}{\includegraphics[width=\paperwidth]{poster-banner}}

with a test and appropriate code for each case

\ifportrait 
  \parbox{\textwidth}{\includegraphics[width=\textwidth]{poster-banner}}
\else
  \parbox{\textwidth}{\includegraphics[width=\textwidth,height=10cm]{poster-banner}}
\fi

The format is \ifportrait <portait-case> \else <landscape-case> \fi. I have made a random choice of a height of 10cm in the landscape case, you will need to write something appropriate four your particular case. For example, you might find a minipage more suitable than a \parbox and could write

\begin{minipage}{\textwidth}
   \centering\includegraphics[width=0.5\textwidth]{poster-banner}
\end{minipage}

in the landscape case.

To use this as a style, put the following in the file beamerthemeProva.sty

\mode<presentation>

\setbeamertemplate{headline}{  
\leavevmode
\ifportrait 
  \parbox{\textwidth}{\includegraphics[width=\textwidth]{example-image-a}}
\else
  \begin{minipage}{\textwidth}\centering\includegraphics[width=0.5\textwidth,height=15cm]{example-image-a}\end{minipage}
\fi
 \vskip-35ex
 \begin{beamercolorbox}[wd=\paperwidth]{headline}
 \begin{columns}[T]
  \begin{column}{.2\paperwidth}
    \begin{center} 
      \ifdefined\LeftLogo 
      \includegraphics[width=.6\linewidth,keepaspectratio,clip]{\LeftLogo} 
      \else 
      \fi 
    \end{center} 
    \vskip1.5cm 
  \end{column}
  \begin{column}{.65\paperwidth}
    \hskip1ex
    \vskip4ex
    \raggedright
    \usebeamercolor{title in headline}{\color{fg}\textbf{\LARGE{\inserttitle}}\\[1ex]}
    \usebeamercolor{author in headline}{\color{fg}\Large{\insertauthor}\\[0.5ex]}
    \usebeamercolor{institute in headline}{\color{fg}\large{\insertinstitute}\\[1ex]}     
  \end{column}
  \begin{column}{.15\paperwidth}
    \begin{center} 
      \ifdefined\RightLogo 
      \includegraphics[width=.6\linewidth,keepaspectratio,clip]{\RightLogo} 
      \else 
      \fi 
    \end{center} 
    \vskip1.5cm 
\end{column}
\end{columns}
\end{beamercolorbox}}

\mode<all>

and then you can have a main document (a variation on the standard example in the beamerposter distribution) such as the following

\def\RightLogo{example-image-a.pdf}
\def\LeftLogo{example-image-b.pdf}
\documentclass[final]{beamer}

\mode<presentation> { \usetheme{Berlin} 
\usepackage{times}
\usepackage{amsmath,amsthm, amssymb, latexsym}
\boldmath
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[orientation=landscape,size=a0,scale=1.4,debug]{beamerposter}
\usetheme{Prova} }

  \graphicspath{{figures/}}
  \title[Fancy Posters]{Making Really Fancy Posters with \LaTeX}
  \author[Dreuw \& Deselaers]{Philippe Dreuw and Thomas Deselaers}
  \institute[RWTH Aachen University]{Human Language Technology and Pattern Recognition, RWTH Aachen University}
  \date{Jul. 31th, 2007}


  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
  \begin{document}
  \begin{frame}{} 
    \vfill
    \begin{block}{\large Fontsizes}
      \centering
      {\tiny tiny}\par
      {\scriptsize scriptsize}\par
      {\footnotesize footnotesize}\par
      {\normalsize normalsize}\par
      {\large large}\par
      {\Large Large}\par
      {\LARGE LARGE}\par
      {\veryHuge VeryHuge}\par
      {\VeryHuge VeryHuge}\par
      {\VERYHuge VERYHuge}\par
    \end{block}
    \vfill
    \vfill
    \begin{block}{\large Fontsizes}
      \centering
      {\tiny tiny}\par
      {\scriptsize scriptsize}\par
      {\footnotesize footnotesize}\par
      {\normalsize normalsize}\par
      {\large large}\par
      {\Large Large}\par
      {\LARGE LARGE}\par
      {\veryHuge VeryHuge}\par
      {\VeryHuge VeryHuge}\par
      {\VERYHuge VERYHuge}\par
    \end{block}
    \vfill
    \begin{columns}[t]
      \begin{column}{.48\linewidth}
        \begin{block}{Introduction}
          \begin{itemize}
          \item some items
          \item some items
          \item some items
          \item some items
          \end{itemize}
        \end{block}
      \end{column}
      \begin{column}{.48\linewidth}
        \begin{block}{Introduction}
          \begin{itemize}
          \item some items and $\alpha=\gamma, \sum_{i}$
          \item some items
          \item some items
          \item some items
          \end{itemize}
          $$\alpha=\gamma, \sum_{i}$$
        \end{block}

        \begin{block}{Introduction}
          \begin{itemize}
          \item some items
          \item some items
          \item some items
          \item some items
          \end{itemize}
        \end{block}

        \begin{block}{Introduction}
          \begin{itemize}
          \item some items and $\alpha=\gamma, \sum_{i}$
          \item some items
          \item some items
          \item some items
          \end{itemize}
          $$\alpha=\gamma, \sum_{i}$$
        \end{block}
      \end{column}
    \end{columns}
  \end{frame}
\end{document}

You can now change the orinetation from landscape to portrait and get different effects.

share|improve this answer
    
I've tried the suggestion given but for some reason whenever I used the \ifportrait <portrait-case> \else landscape \fi give me an error (like ! LaTeX Error: Missing \begin{document}.) and ad the end forcing compilation give me a two page document with the first page with only the title –  Nicola Vianello Sep 10 '12 at 15:20
    
That sounds like some missing bracket problem. I have added a complete document to my answer, taking your original material and including my suggestion. –  Andrew Swann Sep 10 '12 at 19:15
    
As I suspected. The suggestion works whenever you include the code provided in the main source document. Actually I'm trying to create a .sty file in order not to remember all the stuff. And if included in a (said beamerthemeProva.sty) and calling in the form \usetheme{Prova} the solution does not work. –  Nicola Vianello Sep 11 '12 at 11:57
    
It is no problem to put this in an external file. I have change my complete example to demonstrate this. Make sure you put the style file somewhere LaTeX will find it. E.g. in the same directory as your main .tex file. –  Andrew Swann Sep 11 '12 at 15:24
    
Finally I succeed in making it to work. The problem was the order which I used to load all the packages in the Preamble as I use to load the theme Prova before loading the beamerposter package. Very stupid error indeed –  Nicola Vianello Sep 12 '12 at 8:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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