0

I'm writing a presentation and testing it with one of the default themes of my TeX distribution (TeXLive 2013 on Windows 7) but before submitting the final work I'd like to apply my beamerthemeMyTheme.sty that I have created and downloaded from the this Beamer site. However, when I compile main.tex in TeXMaker - QuickBuild I get errors! Perhaps TeXLive can't recognize the .sty file? I've moved the *.sty file to C:\texlive\2013\texmf-dist\tex\latex\beamer\themes\theme where all other "native" themes are present. Below you'll find a MWE of the main.tex file and the style file. Please help me root out the mistakes.

\documentclass[10pt]{beamer}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{hyperref}
\usepackage{graphicx}

\title{My Presentation}
\author[J. Doe]{Jane Doe \\ \texttt{jdoe@university.edu}}
\date[]{July 2015}
\institute[unika]{University of Know All}

\usetheme{MyTheme}
%\useoutertheme[right]{sidebar}
%\setbeamercovered{dynamic}

\graphicspath{{pictures/}}

\begin{document}

\section{Introduction}
\begin{frame}
\maketitle
\end{frame}

\end{document}

And now the beamerthemeMyTheme.sty file:

\ProvidesPackageRCS $Header: /cvsroot/latex-beamer/latex-beamer/themes/theme/monTheme.sty,v 1.0 23/05/2015 20:23:32 G.FALLOURD-M.LEBRETON Exp $
\mode<presentation>
\definecolor{sectionColor}{RGB}{0,51,102}
\definecolor{subsectionColor}{RGB}{153,0,0}
\definecolor{sectionTextColor}{RGB}{255,255,255}
\definecolor{subsectionTextColor}{RGB}{255,255,255}
\definecolor{leftFootlineColor}{RGB}{102,0,0}
\definecolor{middleFootlineColor}{RGB}{51,0,0}
\definecolor{rightFootlineColor}{RGB}{102,0,0}
\definecolor{authorColor}{RGB}{255,255,255}
\definecolor{footlineTitleColor}{RGB}{255,255,255}
\definecolor{instituteColor}{RGB}{0,0,0}
\definecolor{dateColor}{RGB}{0,0,0}
\definecolor{pageColor}{RGB}{255,255,255}
\definecolor{titleColor}{RGB}{102,0,0}
\definecolor{titleTextColor}{RGB}{255,255,255}
\definecolor{bodyColor}{RGB}{255,255,255}
\definecolor{normalTextColor}{RGB}{0,0,0}
\definecolor{exampleTextColor}{RGB}{51,153,51}
\definecolor{alertTextColor}{RGB}{204,51,51}
\definecolor{chipColor}{RGB}{0,0,102}
\definecolor{chipTextColor}{RGB}{255,255,255}
\definecolor{normalBlockColor}{RGB}{102,153,255}
\definecolor{normalTitleBlockColor}{RGB}{0,0,102}
\definecolor{normalBlockTextColor}{RGB}{255,255,255}
\definecolor{normalBlockTitleTextColor}{RGB}{255,255,255}
\definecolor{exampleBlockColor}{RGB}{0,204,0}
\definecolor{exampleTitleBlockColor}{RGB}{0,153,0}
\definecolor{exampleBlockTextColor}{RGB}{255,255,255}
\definecolor{exampleBlockTitleTextColor}{RGB}{255,255,255}
\definecolor{alertBlockColor}{RGB}{255,153,153}
\definecolor{alertTitleBlockColor}{RGB}{204,51,51}
\definecolor{alertBlockTextColor}{RGB}{255,255,255}
\definecolor{alertBlockTitleTextColor}{RGB}{255,255,255}
\setbeamercolor{section in head/foot}{bg=sectionColor, fg=sectionTextColor}
\setbeamercolor{subsection in head/foot}{bg=subsectionColor, fg=subsectionTextColor}
\setbeamercolor*{block title}{fg=normalBlockTitleTextColor,bg=normalTitleBlockColor}
\setbeamercolor*{block body}{fg=normalBlockTextColor,bg=normalBlockColor}
\setbeamercolor*{block title alerted}{fg=alertBlockTitleTextColor,bg=alertTitleBlockColor}
\setbeamercolor*{block body alerted}{fg=alertBlockTextColor,bg=alertBlockColor}
\setbeamercolor*{block title example}{fg=exampleBlockTitleTextColor,bg=exampleTitleBlockColor}
\setbeamercolor*{block body example}{fg=exampleBlockTextColor,bg=exampleBlockColor}
\setbeamerfont{block title}{size={}}
\setbeamercolor{titlelike}{fg=titleTextColor,bg=titleColor}
\setbeamercolor*{normal text}{fg=normalTextColor,bg=bodyColor}
\setbeamercolor*{example text}{fg=exampleTextColor}
\setbeamercolor*{alerted text}{fg=alertTextColor}
\useinnertheme{default}
\setbeamercolor{item projected}{bg=chipColor,fg=chipTextColor}
\setbeamercolor*{sidebar}{bg=sectionColor, fg=sectionTextColor}
\setbeamercolor*{palette sidebar primary}{bg=subsectionColor,fg=subsectionTextColor}
\setbeamercolor*{palette sidebar secondary}{bg=sectionColor,fg=sectionTextColor}
\newdimen\beamer@sidebarwidth
\newdimen\beamer@headheight
\beamer@sidebarwidth=4.5\baselineskip
\beamer@headheight=2.5\baselineskip
\reset@font
\def\beamer@lefttext{left}
\DeclareOptionBeamer{hideothersubsections}[]{\beamer@nav@subsectionstyle{show/show/hide}}
\DeclareOptionBeamer{hideallsubsections}[]{\beamer@nav@subsectionstyle{hide}}
\DeclareOptionBeamer{width}{\beamer@sidebarwidth=#1}
\DeclareOptionBeamer{height}{\beamer@headheight=#1}
\DeclareOptionBeamer{left}{\def\beamer@sidebarside{left}}
\DeclareOptionBeamer{right}{\def\beamer@sidebarside{right}}
\ExecuteOptionsBeamer{right}
\ProcessOptionsBeamer
\ifdim\beamer@headheight>0pt
\defbeamertemplate*{frametitle}{sidebar theme}
{%
\nointerlineskip%
\vskip-\beamer@headheight%
\vbox to \beamer@headheight{%
\vfil
\leftskip=-\beamer@leftmargin%
\advance\leftskip by0.3cm%
\rightskip=-\beamer@rightmargin%
\advance\rightskip by0.3cm plus1fil%
{\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}%
{\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}%
\vbox{}%
\vskip-1em%
\vfil
}%
}
\defbeamertemplate*{headline}{sidebar theme}
{%
\begin{beamercolorbox}[wd=\paperwidth]{frametitle}
\ifx\beamer@sidebarside\beamer@lefttext%
\else%
\hfill%
\fi%
\ifdim\beamer@sidebarwidth>0pt%
\usebeamercolor[bg]{logo}%
\vrule width\beamer@sidebarwidth height \beamer@headheight%
\hskip-\beamer@sidebarwidth%
\hbox to \beamer@sidebarwidth{\hss\vbox to
\beamer@headheight{\vss\hbox{\color{fg}\insertlogo}\vss}\hss}%
\else%
\vrule width0pt height \beamer@headheight%
\fi%
\end{beamercolorbox}
}
\fi
\def\beamer@sidebarformat#1#2#3{%
\begin{beamercolorbox}[wd=\beamer@sidebarwidth,leftskip=#1,rightskip=1ex plus1fil,vmode]{#2}
\vbox{}%
#3\par%
\vbox{}%
\vskip-1.5ex%
\end{beamercolorbox}
}
\defbeamertemplate*{section in sidebar}{sidebar theme}
{%
\vbox{%
\vskip1ex%
\beamer@sidebarformat{3pt}{section in sidebar}{\insertsectionhead}%
}%
}
\defbeamertemplate*{section in sidebar shaded}{sidebar theme}
{%
\vbox{%
\vskip1ex%
\beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionhead}%
}%
}
\defbeamertemplate*{subsection in sidebar}{sidebar theme}
{%
\beamer@sidebarformat{5pt}{subsection in sidebar}{\insertsubsectionhead}%
}
\defbeamertemplate*{subsection in sidebar shaded}{sidebar theme}
{%
\beamer@sidebarformat{5pt}{subsection in sidebar shaded}{\insertsubsectionhead}%
}
\defbeamertemplate*{subsubsection in sidebar}{sidebar theme}
{%
\beamer@sidebarformat{7pt}{subsubsection in sidebar}{\insertsubsubsectionhead}%
}
\defbeamertemplate*{subsubsection in sidebar shaded}{sidebar theme}
{%
\beamer@sidebarformat{7pt}{subsubsection in sidebar shaded}{\insertsubsubsectionhead}%
}
\ifdim\beamer@sidebarwidth>0pt
\setbeamersize{sidebar width \beamer@sidebarside=\beamer@sidebarwidth}
\defbeamertemplate*{sidebar \beamer@sidebarside}{sidebar theme}
{
\beamer@tempdim=\beamer@sidebarwidth%
\advance\beamer@tempdim by -6pt%
{\usebeamerfont{title in sidebar}%
\vskip1.5em%
\hskip3pt%
\insertshorttitle[width=\beamer@tempdim,center,respectlinebreaks]\par%
\vskip1.25em%
}%
\insertverticalnavigation{\beamer@sidebarwidth}%
\vfill
\ifx\beamer@sidebarside\beamer@lefttext%
\else%
\llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
\vskip2pt%
\fi%
}%
\setbeamersize{text margin left=0.5cm,text margin right=0.5cm}
\fi
\setbeamercolor{author in head/foot}{bg=leftFootlineColor, fg=authorColor}
\setbeamercolor{title in head/foot}{bg=middleFootlineColor, fg=footlineTitleColor}
\setbeamercolor{institute in head/foot}{fg=instituteColor}
\setbeamercolor{date in head/foot}{bg=rightFootlineColor, fg=dateColor}
\defbeamertemplate*{footline}{infolines theme}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor~~
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}
}%
\vskip0pt%
}
\mode
<all>

EDIT: Here is a snapshot of TexMaker's error memory. Does anyone know what that means? enter image description here

WobblyWindows
  • 1,519
  • 2
  • 22
  • 42
  • Have you tried putting beamerthemeMyTheme.sty in the same folder as your presentation? – samcarter_is_at_topanswers.xyz May 25 '15 at 20:06
  • Yes, that's the first thing I did but it didn't catch it! Next, I tried to put the style file in the pathfile I mentioned above (C:\texlive\...\theme). Is there some kind of button or command that updates beamer's folder in TexLive running on Windows? Something like "texhash"? – WobblyWindows May 25 '15 at 22:02
  • I uploaded both files intoWin8.1 using Texmakerand MikTeX 2.9. And your MyTheme is found when in the same folder as the main file. However, your theme.sty file has an error in it I cannot find. I suspect that you have either omitted a mandatory argument or have mismatched grouping symbols some where in the first 50 line. It begins to choke at line 20. I recommend you run the compile with the F6 button and not quick build, as that hides error messages. – R. Schumacher May 26 '15 at 00:22
  • Nice theme, have you made it yourself from scratch? –  May 26 '15 at 14:04
  • @R.Schumacher In addition to the file in the C:\texlive\… path, I've kept a copy of the sty file in the working folder, together with the * main.tex** file and then compiled the main-file in TeXmaker with pdflatex. I got back a number of errors so I've uploaded a snapshot above: what is it trying to say? – WobblyWindows May 26 '15 at 14:13

1 Answers1

2

The theme works for me too if I have the .sty file in the same directory as the presentation.

There's a \begin{colorbox} missing in your theme. I suspect that the 8th line from the end should contain \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{page in head/foot}% or something similar.

Here's the full theme with this line added:

\ProvidesPackageRCS $Header: /cvsroot/latex-beamer/latex-beamer/themes/theme/monTheme.sty,v 1.0 23/05/2015 20:23:32 G.FALLOURD-M.LEBRETON Exp $
\mode<presentation>
\definecolor{sectionColor}{RGB}{0,51,102}
\definecolor{subsectionColor}{RGB}{153,0,0}
\definecolor{sectionTextColor}{RGB}{255,255,255}
\definecolor{subsectionTextColor}{RGB}{255,255,255}
\definecolor{leftFootlineColor}{RGB}{102,0,0}
\definecolor{middleFootlineColor}{RGB}{51,0,0}
\definecolor{rightFootlineColor}{RGB}{102,0,0}
\definecolor{authorColor}{RGB}{255,255,255}
\definecolor{footlineTitleColor}{RGB}{255,255,255}
\definecolor{instituteColor}{RGB}{0,0,0}
\definecolor{dateColor}{RGB}{0,0,0}
\definecolor{pageColor}{RGB}{255,255,255}
\definecolor{titleColor}{RGB}{102,0,0}
\definecolor{titleTextColor}{RGB}{255,255,255}
\definecolor{bodyColor}{RGB}{255,255,255}
\definecolor{normalTextColor}{RGB}{0,0,0}
\definecolor{exampleTextColor}{RGB}{51,153,51}
\definecolor{alertTextColor}{RGB}{204,51,51}
\definecolor{chipColor}{RGB}{0,0,102}
\definecolor{chipTextColor}{RGB}{255,255,255}
\definecolor{normalBlockColor}{RGB}{102,153,255}
\definecolor{normalTitleBlockColor}{RGB}{0,0,102}
\definecolor{normalBlockTextColor}{RGB}{255,255,255}
\definecolor{normalBlockTitleTextColor}{RGB}{255,255,255}
\definecolor{exampleBlockColor}{RGB}{0,204,0}
\definecolor{exampleTitleBlockColor}{RGB}{0,153,0}
\definecolor{exampleBlockTextColor}{RGB}{255,255,255}
\definecolor{exampleBlockTitleTextColor}{RGB}{255,255,255}
\definecolor{alertBlockColor}{RGB}{255,153,153}
\definecolor{alertTitleBlockColor}{RGB}{204,51,51}
\definecolor{alertBlockTextColor}{RGB}{255,255,255}
\definecolor{alertBlockTitleTextColor}{RGB}{255,255,255}
\setbeamercolor{section in head/foot}{bg=sectionColor, fg=sectionTextColor}
\setbeamercolor{subsection in head/foot}{bg=subsectionColor, fg=subsectionTextColor}
\setbeamercolor*{block title}{fg=normalBlockTitleTextColor,bg=normalTitleBlockColor}
\setbeamercolor*{block body}{fg=normalBlockTextColor,bg=normalBlockColor}
\setbeamercolor*{block title alerted}{fg=alertBlockTitleTextColor,bg=alertTitleBlockColor}
\setbeamercolor*{block body alerted}{fg=alertBlockTextColor,bg=alertBlockColor}
\setbeamercolor*{block title example}{fg=exampleBlockTitleTextColor,bg=exampleTitleBlockColor}
\setbeamercolor*{block body example}{fg=exampleBlockTextColor,bg=exampleBlockColor}
\setbeamerfont{block title}{size={}}
\setbeamercolor{titlelike}{fg=titleTextColor,bg=titleColor}
\setbeamercolor*{normal text}{fg=normalTextColor,bg=bodyColor}
\setbeamercolor*{example text}{fg=exampleTextColor}
\setbeamercolor*{alerted text}{fg=alertTextColor}
\useinnertheme{default}
\setbeamercolor{item projected}{bg=chipColor,fg=chipTextColor}
\setbeamercolor*{sidebar}{bg=sectionColor, fg=sectionTextColor}
\setbeamercolor*{palette sidebar primary}{bg=subsectionColor,fg=subsectionTextColor}
\setbeamercolor*{palette sidebar secondary}{bg=sectionColor,fg=sectionTextColor}
\newdimen\beamer@sidebarwidth
\newdimen\beamer@headheight
\beamer@sidebarwidth=4.5\baselineskip
\beamer@headheight=2.5\baselineskip
\reset@font
\def\beamer@lefttext{left}
\DeclareOptionBeamer{hideothersubsections}[]{\beamer@nav@subsectionstyle{show/show/hide}}
\DeclareOptionBeamer{hideallsubsections}[]{\beamer@nav@subsectionstyle{hide}}
\DeclareOptionBeamer{width}{\beamer@sidebarwidth=#1}
\DeclareOptionBeamer{height}{\beamer@headheight=#1}
\DeclareOptionBeamer{left}{\def\beamer@sidebarside{left}}
\DeclareOptionBeamer{right}{\def\beamer@sidebarside{right}}
\ExecuteOptionsBeamer{right}
\ProcessOptionsBeamer
\ifdim\beamer@headheight>0pt
\defbeamertemplate*{frametitle}{sidebar theme}
{%
\nointerlineskip%
\vskip-\beamer@headheight%
\vbox to \beamer@headheight{%
\vfil
\leftskip=-\beamer@leftmargin%
\advance\leftskip by0.3cm%
\rightskip=-\beamer@rightmargin%
\advance\rightskip by0.3cm plus1fil%
{\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}%
{\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}%
\vbox{}%
\vskip-1em%
\vfil
}%
}
\defbeamertemplate*{headline}{sidebar theme}
{%
\begin{beamercolorbox}[wd=\paperwidth]{frametitle}
\ifx\beamer@sidebarside\beamer@lefttext%
\else%
\hfill%
\fi%
\ifdim\beamer@sidebarwidth>0pt%
\usebeamercolor[bg]{logo}%
\vrule width\beamer@sidebarwidth height \beamer@headheight%
\hskip-\beamer@sidebarwidth%
\hbox to \beamer@sidebarwidth{\hss\vbox to
\beamer@headheight{\vss\hbox{\color{fg}\insertlogo}\vss}\hss}%
\else%
\vrule width0pt height \beamer@headheight%
\fi%
\end{beamercolorbox}
}
\fi
\def\beamer@sidebarformat#1#2#3{%
\begin{beamercolorbox}[wd=\beamer@sidebarwidth,leftskip=#1,rightskip=1ex plus1fil,vmode]{#2}
\vbox{}%
#3\par%
\vbox{}%
\vskip-1.5ex%
\end{beamercolorbox}
}
\defbeamertemplate*{section in sidebar}{sidebar theme}
{%
\vbox{%
\vskip1ex%
\beamer@sidebarformat{3pt}{section in sidebar}{\insertsectionhead}%
}%
}
\defbeamertemplate*{section in sidebar shaded}{sidebar theme}
{%
\vbox{%
\vskip1ex%
\beamer@sidebarformat{3pt}{section in sidebar shaded}{\insertsectionhead}%
}%
}
\defbeamertemplate*{subsection in sidebar}{sidebar theme}
{%
\beamer@sidebarformat{5pt}{subsection in sidebar}{\insertsubsectionhead}%
}
\defbeamertemplate*{subsection in sidebar shaded}{sidebar theme}
{%
\beamer@sidebarformat{5pt}{subsection in sidebar shaded}{\insertsubsectionhead}%
}
\defbeamertemplate*{subsubsection in sidebar}{sidebar theme}
{%
\beamer@sidebarformat{7pt}{subsubsection in sidebar}{\insertsubsubsectionhead}%
}
\defbeamertemplate*{subsubsection in sidebar shaded}{sidebar theme}
{%
\beamer@sidebarformat{7pt}{subsubsection in sidebar shaded}{\insertsubsubsectionhead}%
}
\ifdim\beamer@sidebarwidth>0pt
\setbeamersize{sidebar width \beamer@sidebarside=\beamer@sidebarwidth}
\defbeamertemplate*{sidebar \beamer@sidebarside}{sidebar theme}
{
\beamer@tempdim=\beamer@sidebarwidth%
\advance\beamer@tempdim by -6pt%
{\usebeamerfont{title in sidebar}%
\vskip1.5em%
\hskip3pt%
\insertshorttitle[width=\beamer@tempdim,center,respectlinebreaks]\par%
\vskip1.25em%
}%
\insertverticalnavigation{\beamer@sidebarwidth}%
\vfill
\ifx\beamer@sidebarside\beamer@lefttext%
\else%
\llap{\usebeamertemplate***{navigation symbols}\hskip0.1cm}%
\vskip2pt%
\fi%
}%
\setbeamersize{text margin left=0.5cm,text margin right=0.5cm}
\fi
\setbeamercolor{author in head/foot}{bg=leftFootlineColor, fg=authorColor}
\setbeamercolor{title in head/foot}{bg=middleFootlineColor, fg=footlineTitleColor}
\setbeamercolor{institute in head/foot}{fg=instituteColor}
\setbeamercolor{date in head/foot}{bg=rightFootlineColor, fg=dateColor}
\defbeamertemplate*{footline}{infolines theme}
{
\leavevmode%
\hbox{%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
\usebeamerfont{author in head/foot}\insertshortauthor~~
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
\usebeamerfont{title in head/foot}\insertshorttitle
\end{beamercolorbox}%
\begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{page in head/foot}%
\insertframenumber{} / \inserttotalframenumber\hspace*{2ex}
\end{beamercolorbox}
}%
\vskip0pt%
}
\mode
<all>
  • I "made" this theme by imitating my University's color. I didn't write the code from scratch, just customised it from this website and that's why I couldn'd detect the error that you quickly catched (thank you!). I suppose when I get a free weekend I'll have to read the beamer documentation and learn how to code my own personalised theme. – WobblyWindows May 26 '15 at 14:28
  • 1
    @WobblyWindows I've been working on a theme for my own university and I must say that the documentation is not especially helpful. It doesn't really cover how to create a theme, just how to customize existing ones. This and this guide have helped me a lot :) –  May 26 '15 at 17:46