Using textpos with the absolute option causes different output when using pgfpages (it doesn't cause problems with the handout option when not using pgfpages), even when using \nofiles, because the absolute position is in terms of the physical page, not the logical page.
To display a logo in the header, one would ideally use a beamer (outer) theme designed for this purpose, preferably together with the \logo interface that beamer provides, instead of employing textpos. Unfortunately, I am not aware of any existing themes that have the logo where you want it.
The following solution avoids using textpos altogether, and tries to use beamer's \logo feature to some extent (and hopefully still has some sensible behaviour regardless of which template you use), but it is still inelegant:
One cannot just move the logo position in the sidebar right template, as the frametitle gets placed on top of it. Therefore, we can instead switch off \insertlogo in the sidebar right template...
% prevent the logo from appearing in the usual position on pages
\addtobeamertemplate{sidebar right}{%
\let\insertlogo\relax% don't worry, the template is executed in a group!
}{}
...and put another \insertlogo in the frametitle template, appropriately positioned:
% modify the frametitle template in a generic manner
% so that within it, \insertframetitle also inserts a right aligned box (apparently of no height/width) containing the logo
% elsewhere, \insertframetitle behaves as normal and does not include this logo!
\addtobeamertemplate{frametitle}{%
\let\oldinsertframetitle\insertframetitle
\def\insertframetitle{\makebox[\textwidth][l]{\oldinsertframetitle}\vbox to 0pt{\vtop{\vskip-0.6cm\makebox[0pt][r]{\insertlogo}}}}%
}%
{}%
If you want the horizontal position to be more like as in your original example, add \hspace{1.5cm} after \insertlogo in the \def\insertframetitle.
Note that the positioning method for the logo in the frame title is not great.
I have also placed this in the context of your MWE, which I have also made a few changes to:
- Used
\titlegraphic instead of your previous hack for setting the logo on the title page.
- Used
example-image-a from the mwe package, as I (and others) do not have the logo you were using.
- Reduced some of the
pgfpages layout code you were using. Rather than essentially copying the original 2 on 1 definition just to add a border, I just declared a layout that loaded the original definition. Note that it is not identical to your version, however.
- Tried to improve the
\nofiles issue, by ensuring that at least 2 proper LaTeX runs occur before invoking pgfpages and \nofiles. Now the LastPage counters in the footers are correct. (Of course, whether or not you experience any issue depends on how many times you compile the file without the handout mode.) This is why my code is so long...
- Replaced one of the
\documentclass lines with a \PassOptionsToClass line, as it makes the difference clearer and it is only one line to comment/uncomment instead of two.
- Removed a few things that were unneeded.
- Moved the
frametitle patching to the preamble.
Full code:
\PassOptionsToClass{handout}{beamer}% just comment out this line to disable handout mode
\documentclass [11 pt, xcolor=pdftex,x11names,table]{beamer}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage{mwe}% for example-image-a (requiring the package helps the package manager)
\mode<presentation>
{
\usetheme{Madrid}
\usecolortheme{orchid}
\usecolortheme{whale}
}
\title{Hi}
\author{Me}
\date{\today}
% use the \logo and \titlegraphic facilities provided by beamer
\logo{\includegraphics[height=0.8cm]{example-image-a}}
\titlegraphic{\includegraphics[height=1.5cm]{example-image-a}}
% prevent the logo from appearing in the usual position on pages
\addtobeamertemplate{sidebar right}{%
\let\insertlogo\relax% don't worry, the template is executed in a group!
}{}
% modify the frametitle template in a generic manner
% so that within it, \insertframetitle also inserts a right aligned box (apparently of no height/width) containing the logo
% elsewhere, \insertframetitle behaves as normal and does not include this logo!
\addtobeamertemplate{frametitle}{%
\let\oldinsertframetitle\insertframetitle
\def\insertframetitle{\makebox[\textwidth][l]{\oldinsertframetitle}\vbox to 0pt{\vtop{\vskip-0.6cm\makebox[0pt][r]{\insertlogo}}}}%
}%
{}%
\makeatletter
\mode<handout>
{
% based on [Beamer handout: Problem when creating border around frames](http://tex.stackexchange.com/a/53606)
\def\pgfpagesborderstrokeifnotempty{%
\expandafter\ifvoid\csname pgfpages@box@\the\pgf@cpn\endcsname
\else
\expandafter\pgfstroke
\fi
}
% count number of LaTeX runs to attempt to guess if we can activate pgfpages and execute \nofiles
\newcommand*{\IfRanMoreThan}[1]{\ifnum\value{counttexrunsforpgfpages}>#1\relax\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi}%
% following mostly borrowed from counttexruns.sty
% can't just use that package directly;
% have to split because we don't always want to update the counter (breaks latexmk)
% when editing the file, should also delete \jobname.\counttexrunsforpgfpages@extension to allow recompilation enough times
\newcounter{counttexrunsforpgfpages}%
\newwrite\@counttexrunsforpgfpagesfile
\def\counttexrunsforpgfpages@extension{pgfpages.ctr}%
\IfFileExists{\jobname.\counttexrunsforpgfpages@extension}{%
\immediate\openin\@counttexrunsforpgfpagesfile=\jobname.\counttexrunsforpgfpages@extension
\immediate\read\@counttexrunsforpgfpagesfile to \@counttexrunsforpgfpages
\immediate\read\@counttexrunsforpgfpagesfile to \@counttexrunsforpgfpages
\immediate\closein\@counttexrunsforpgfpagesfile
\setcounter{counttexrunsforpgfpages}{\@counttexrunsforpgfpages}
}{}%
\stepcounter{counttexrunsforpgfpages}%
\IfRanMoreThan{2}{%hope file gets compiled enough times without pgfpages being active (only need to ensure the lines \pgfpagesuselayout and \nofiles are in this block, but save time by not loading the packages if not needed in current run)
\usepackage{pgf}
\usepackage{pgfpages}
% extend the default definition of the '2 on 1' layout to add a border to each logical page,
% without having to copy the whole of the original layout definition
\pgfpagesdeclarelayout{2 on 1 boxed}%
{%
\pgfpagesuselayout{2 on 1}%
\edef\pgfpageoptionborder{10pt}%change default value for border shrink
}%
{%
\pgfpageslogicalpageoptions{1}{%
border code=\pgfsetlinewidth{2pt}\pgfpagesborderstrokeifnotempty,
resized width=0.85\pgfphysicalwidth,
}%
\pgfpageslogicalpageoptions{2}{%
border code=\pgfsetlinewidth{2pt}\pgfpagesborderstrokeifnotempty,
resized width=0.85\pgfphysicalwidth,
}%
}%
\pgfpagesuselayout{2 on 1 boxed}[letterpaper, border shrink=5mm]
\nofiles
}{%
% save the number of runs to the file! also adjusted from counttexruns.sty
\immediate\openout\@counttexrunsforpgfpagesfile=\jobname.\counttexrunsforpgfpages@extension
\catcode`\%=11\relax
\immediate\write\@counttexrunsforpgfpagesfile{%% This file
'\jobname.\counttexrunsforpgfpages@extension' was not really generated by the package counttexruns}
\catcode`\%=14\relax
\immediate\write\@counttexrunsforpgfpagesfile{\arabic{counttexrunsforpgfpages}}
\immediate\closeout\@counttexrunsforpgfpagesfile
}%
}% end \mode<handout>
\makeatother
\begin{document}
% \titlepage doesn't use \frametitle, so the logo only appears there in the \titlegraphic
\begin{frame}
\titlepage
\end{frame}
\begin{frame}
\frametitle{Hi}
HEY
\end{frame}
\begin{frame}
\frametitle{Material?}
My book
\end{frame}
\begin{frame}
\frametitle{Course Website}
Nothing
\end{frame}
\end{document}

absoluteoption from thetextpospackage doesn't really solve the problem (the logo disappears) it's not clear that the linked question is a pure duplicate. – Alan Munn Jan 05 '13 at 17:08textpospackage. – cyberSingularity Jan 05 '13 at 18:22