2

I am trying to build my own sty for beamer from the Berlin theme. I want to add logos to the footers of my slides. I am a little confused on how to do this with the sty. I don't know where should I put the logo tag. Any help?

\ProvidesPackageRCS $Header: /Users/joseph/Documents/LaTeX/beamer/base/themes/theme/beamerthemeBerlin.sty,v d02a7cf4d8ae 2010/06/17 09:11:41 rivanvx $

 \DeclareOptionBeamer{compress}{\beamer@compresstrue}
 \ProcessOptionsBeamer

 \mode<presentation>

 \useoutertheme[footline=authorinstitutetitle]{miniframes}
 \usecolortheme{whale}
 \usecolortheme{orchid}
 \useinnertheme{rectangles}

 \setbeamerfont{block title}{size={}}
 \logo{%
   \makebox[0.95\paperwidth]{%
    \includegraphics[width=1cm,keepaspectratio]{cern_logo_white.jpg}%
   \hfill%
    \includegraphics[width=1cm,keepaspectratio]{ntua-logo.jpg}%
    DEF
   }%
  }

  \mode
  <all>
5
  • Do you really need to create your own beamer style, instead of just copy & paste the relevant pars of an existing talk?
    – vonbrand
    Nov 1, 2015 at 1:33
  • 1
    Welcome! So you've defined your logo using the \logo command. What is the question exactly?
    – cfr
    Nov 1, 2015 at 2:14
  • Probably you want to put the logo in the footline template rather than using the \logo command. What you have seems to work fine as a logo in Beamer's sense, so I assume you don't want a logo like that.
    – cfr
    Nov 1, 2015 at 2:26
  • @cfr How I put the logo in the footline?
    – xeon123
    Nov 1, 2015 at 6:17
  • @vonbrand I don't know if I need to create my own style. I just want to put the logo in the footline.
    – xeon123
    Nov 1, 2015 at 6:18

1 Answer 1

1

Something like this?

double trouble

\begin{filecontents}{\jobname.sty}
\DeclareOptionBeamer{compress}{\beamer@compresstrue}
\ProcessOptionsBeamer

\def\beamer@theme@footline@doubletrouble{% modified from tex/latex/beamer/themes/outer/beamerouterthememiniframes.sty
  \defbeamertemplate*{footline}{miniframes theme}
  {%
    \begin{beamercolorbox}[colsep=1.5pt]{upper separation line foot}
    \end{beamercolorbox}
    \begin{beamercolorbox}[ht=3.625ex,dp=0ex,%
      leftskip=.3cm,rightskip=.3cm plus1fil]{author in head/foot}%
      \leavevmode{\usebeamerfont{author in head/foot}\includegraphics[height=3.0625ex,width=10mm,keepaspectratio]{\doubletrouble@logo@left}\quad
        \raisebox{.375ex}{\doubletrouble@text@left}}%
      \hfill%
      {\usebeamerfont{title in head/foot}\usebeamercolor[fg]{title in head/foot}\includegraphics[height=3.0625ex,width=10mm,keepaspectratio]{\doubletrouble@logo@right}\quad
        \raisebox{.375ex}{\doubletrouble@text@right}}%
    \end{beamercolorbox}%
    \begin{beamercolorbox}[colsep=1.5pt]{lower separation line foot}
    \end{beamercolorbox}
  }
}

\mode<presentation>

\useoutertheme[footline=doubletrouble]{miniframes}
\usecolortheme{whale}
\usecolortheme{orchid}
\useinnertheme{rectangles}

\setbeamerfont{block title}{size={}}

\newcommand*\doubletrouble@logo@left{example-image-a}
\newcommand*\doubletrouble@logo@right{example-image-b}
\newcommand\doubletrouble@text@left{}
\newcommand\doubletrouble@text@right{}
\newcommand*\logoleft[1]{\renewcommand*\doubletrouble@logo@left{#1}}
\newcommand*\logoright[1]{\renewcommand*\doubletrouble@logo@right{#1}}
\newcommand\logotextleft[1]{\renewcommand\doubletrouble@text@left{#1}}
\newcommand\logotextright[1]{\renewcommand\doubletrouble@text@right{#1}}

\mode
<all>
\endinput
\end{filecontents}
\documentclass{beamer}
\usepackage{\jobname}
\logoleft{tiger}
\logoright{cath}
\logotextright{DEF}
\begin{document}
\begin{frame}
some text
\end{frame}
\end{document}
5
  • I tried your example, but I am full of errors. ! Undefined control sequence. <argument> \doubletrouble@logo@left l.51 \begin{document} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., \hobx'), type I' and the correct spelling (e.g., I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! LaTeX Error: File ' not found. Your example goes into a single latex file?
    – xeon123
    Nov 1, 2015 at 17:07
  • @xeon123 It works fine here. It is a single file just for convenience in making the example. The bit in the filecontents environment gets written to \jobname.sty where \jobname is typically the name of your .tex file, minus the extension. This then gets loaded by the \usepackage{} line. But if you were to use this, you'd just put the package code in your .sty file in the usual way. Does my example exactly as written give you an error?
    – cfr
    Nov 1, 2015 at 18:54
  • Yes, maybe because I named the text file workshop.tex and not jobname.tex
    – xeon123
    Nov 1, 2015 at 19:40
  • Yes, it didn't work becaus I have named the file workshop.tex. Now, with jobname.tex works. Thanks.
    – xeon123
    Nov 1, 2015 at 19:46
  • It shouldn't matter what you name the .tex file. If you call it squigglydoo.tex, \jobname will, by default, be squigglydoo.
    – cfr
    Nov 2, 2015 at 2:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .