Beamer 主题:使用不同的 PDF 阅读器时会出现意想不到的情况

Beamer 主题:使用不同的 PDF 阅读器时会出现意想不到的情况

我希望在我的论文中使用 hsrmbeamertheme。您可以在此处找到并下载它:https://github.com/benjamin-weiss/hsrmbeamertheme

不幸的是,我发现使用不同的 PDF 阅读器(也运行不同的 PC)会出现很多意想不到的行为。请参阅附件。第一张图片是正确的布局(使用 Foxit Reader 没问题)。第二张和第三张图片是使用 Adob​​e Reader XI 打开的编译后的 PDF 的屏幕截图。您知道我该如何解决这些问题吗?提前谢谢您!

代码在github上:https://github.com/benjamin-weiss/hsrmbeamertheme/archive/master.zip

mwe.tex:

\documentclass[compress]{beamer}
\usetheme{sthlm}

\usepackage{
booktabs,
datetime,
dtklogos,
graphicx,
multicol,
pgfplots,
ragged2e,
tabularx,
tikz,
wasysym
}

\pgfplotsset{compat=1.8}

\usepackage[utf8]{inputenc}
\usepackage{newpxtext,newpxmath}

\usepackage{listings}
\lstset{ %
language=[LaTeX]TeX,
basicstyle=\normalsize\ttfamily,
keywordstyle=,
numbers=left,
numberstyle=\tiny\ttfamily,
stepnumber=1,
showspaces=false,
showstringspaces=false,
showtabs=false,
breaklines=true,
frame=tb,
framerule=0.5pt,
tabsize=4,
framexleftmargin=0.5em,
framexrightmargin=0.5em,
xleftmargin=0.5em,
xrightmargin=0.5em
}

\usetikzlibrary{
backgrounds,
mindmap
}

\setbeameroption{show notes}

\title{Title}
\subtitle{fff}
\date{\small{\jobname}}
\author{\texttt{Lol}}
\institute{Institute}

\begin{document}


\maketitle

\section{Background}
\begin{frame}{Introduction}

\centerline {Beamer is a \LaTeX\ class for creating beautiful     presentations.}  
 \hover<2>{
  \begin{minipage}{0.8\linewidth}
  \begin{block}{A block hovering above the slide}
    \begin{itemize}
    \item point 1
    \item point 2
\end{itemize}
  \end{block}
  \end{minipage}
  }
\end{frame}
\end{document}

beamerthemesthlm.sty:

\ProvidesPackage{beamerthemesthlm}[2013/05/05]

\usepackage{eso-pic}

\newif\if@doSectionPage
\@doSectionPagefalse
\DeclareOption{nosectionpages}{\@doSectionPagetrue}
\ProcessOptions

\mode<presentation>


\useoutertheme[subsection=false,shadow]{miniframes}
\setbeamertemplate{section in toc}[sections numbered]
\setbeamertemplate{subsection in toc}[subsections numbered]

\setbeamertemplate{itemize item}{$\Circle$}
\setbeamertemplate{itemize subitem}{$\circ$ }
\setbeamertemplate{itemize subsubitem}{$\circ$}
\subsection{}
\subsection{}
\subsection{}

\setlength{\parskip}{0.5em}

\definecolor{sthlmLightBlue}{RGB}{90,200,250}
\definecolor{sthlmBlue}{RGB}{52,170,220}
\definecolor{sthlmDarkBlue}{RGB}{0,122,255}
\definecolor{sthlmLightRed}{RGB}{255,45,85}
\definecolor{sthlmRed}{RGB}{255,59,48}
\definecolor{sthlmLightYellow}{RGB}{255,204,0}
\definecolor{sthlmYellow}{RGB}{255,149,0}
\definecolor{sthlmPurple}{RGB}{88,86,214}
\definecolor{sthlmGreen}{RGB}{76,217,100}
\definecolor{sthlmGrey}{RGB}{142,142,147}
\definecolor{sthlmLightGrey}{RGB}{233,233,233}
\definecolor{sthlmDarkGrey}{RGB}{61,61,70}


\setbeamercolor{normal text}{fg=sthlmDarkGrey}
\setbeamercolor{structure}{fg=sthlmDarkGrey}
\setbeamercolor{alerted text}{fg=sthlmRed}
\setbeamercolor{example text}{fg=white}
\setbeamercolor{copyright text}{fg=sthlmLightBlue}
\setbeamercolor{palette primary}{fg=sthlmDarkGrey}
\setbeamercolor{palette secondary}{fg=sthlmDarkGrey,bg=sthlmLightGrey}
\setbeamercolor{palette tertiary}{fg=black,bg=sthlmDarkGrey}
\setbeamercolor{palette quaternary}{fg=white, bg=sthlmDarkGrey}

\setbeamercolor{mini frame}{bg=sthlmLightGrey}
\setbeamercolor{section in head/foot}{fg=sthlmDarkGrey, bg=sthlmLightGrey}

% Titlepage
\setbeamercolor{title}{parent=normal text}
\setbeamercolor{subtitle}{parent=normal text}
\setbeamercolor{institute}{parent=normal text}
% Content
\setbeamercolor{frametitle}{parent=palette quaternary}
% Blocks
\setbeamercolor{block title}{fg=white,bg=sthlmDarkBlue}
\setbeamercolor{block body}{fg=sthlmDarkGrey, bg=sthlmLightGrey}
\setbeamercolor{block title example}{fg=black, bg=sthlmGreen}
\setbeamercolor{block body example}{fg=sthlmDarkGrey, bg=sthlmLightGrey}
\setbeamercolor{block title alerted}{fg=black, bg=sthlmLightRed}
\setbeamercolor{block body alerted}{fg=sthlmDarkGrey, bg=sthlmLightGrey}
% Notes
\setbeamercolor{note page}{fg=sthlmDarkGrey,bg=sthlmLightGrey}
\setbeamercolor{note title}{fg=white, bg=sthlmDarkGrey}
\setbeamercolor{note date}{parent=note title}
% Page Number
\setbeamercolor{page number in head/foot}{fg=sthlmDarkGrey}

\setbeamercolor{qed}{fg=sthlmGrey}
 \setbeamercolor{itemize item}{fg=sthlmDarkBlue}
\setbeamercolor{itemize subitem}{fg=sthlmLightRed}
\setbeamercolor{itemize subsubitem}{fg=sthlmBlue}

% Titlepage
%\setbeamerfont{title}{size=\fontsize{20}{20}}
\setbeamerfont{title}{size=\fontsize{15}{15}}
\setbeamerfont{subtitle}{size=\fontsize{12}{14}}
\setbeamerfont{date}{size=\fontsize{8}{10}}
\setbeamerfont{author}{size=\fontsize{12}{15}}
\setbeamerfont{institute}{size=\fontsize{8}{10}}
% Section
\setbeamerfont{section title}{size=\LARGE}
% Content
\setbeamerfont{frametitle}{size=\large}
\setbeamerfont{copyright text}{size=\tiny}
\setbeamerfont{block title}{family=\sffamily,series=\bf, size=\large}
\setbeamerfont{block title alerted}{family=\sffamily,series=\bf,     size=\large}
\setbeamerfont{alerted text}{series=\scshape}
% Captions
\setbeamerfont{caption name}{}

% Titlepage structure
\def\maketitle{\ifbeamer@inframe\titlepage\else\frame[plain]{\titlepage}\fi}
\def\titlepage{\usebeamertemplate{title page}}
\setbeamertemplate{title page}
{
    % Add background to title page
    %\AddToShipoutPictureFG*{\includegraphics[width=\paperwidth]    {background.pdf}}
    \begin{minipage}[b][\paperheight]{\textwidth}
    %\vspace*{5mm}
    %\includegraphics[height=14mm]{./logo}\par
    \vspace*{24mm}
    \ifx\insertsubtitle\@empty%
    \else%
        {\usebeamerfont{title}\usebeamercolor[fg]    {title}\MakeUppercase{\inserttitle}\par}%
    \fi%
    \ifx %\insertsubtitle\@empty%
    \else%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]    {subtitle}\insertsubtitle\par}%
        \vspace*{5mm}
    \fi%
    \ifx\insertdate\@empty%
    \else%
%       {\usebeamerfont{date}\usebeamercolor[fg]{date}\insertdate\par}%
    \fi% 

    \vfill

\ifx\insertauthor\@empty%
\else%
    {\usebeamerfont{author}\usebeamercolor[fg]{author}\insertauthor\par}%
\fi%
\ifx\insertinstitut\@empty%
\else%
    \vspace*{3mm}
    {\usebeamerfont{institute}\usebeamercolor[fg]    {institute}\insertinstitute\par}%
    \fi% 
    \vspace*{5mm}
    \end{minipage}
}

% Make Sectionhead uppercase
\newcommand{\insertsectionHEAD}{%
    \expandafter\insertsectionHEADaux\insertsectionhead}
    \newcommand{\insertsectionHEADaux}[3]{\MakeUppercase{#3}
}

\if@doSectionPage\@empty
\else
% Insert frame with section title at every section start
\AtBeginSection[]
{
\begingroup
\setbeamercolor{background canvas}{bg=sthlmDarkGrey}
\begin{frame}[plain]
\centering
\vfill\usebeamerfont{section title}\textcolor{white}    {\insertsectionHEAD}\vfill
\end{frame}
\endgroup
}
\fi

\def\progressbar@progressbar{} % the progress bar
\newcount\progressbar@tmpcounta% auxiliary counter
\newcount\progressbar@tmpcountb% auxiliary counter
\newdimen\progressbar@pbht %progressbar height
\newdimen\progressbar@pbwd %progressbar width
\newdimen\progressbar@tmpdim % auxiliary dimension

\progressbar@pbwd=\paperwidth
\progressbar@pbht=1.0ex

% the progress bar
\def\progressbar@progressbar{%
    \progressbar@tmpcounta=\insertframenumber
    \progressbar@tmpcountb=\inserttotalframenumber
\progressbar@tmpdim=\progressbar@pbwd
    \divide\progressbar@tmpdim by 1000
\multiply\progressbar@tmpdim by \progressbar@tmpcounta
\divide\progressbar@tmpdim by \progressbar@tmpcountb
    \multiply\progressbar@tmpdim by 1000
  \begin{tikzpicture}[very thin]

    \shade[top color=sthlmLightGrey,bottom color=sthlmLightGrey,middle     color=sthlmLightGrey]
      (0pt, 0pt) rectangle ++ (\progressbar@pbwd, \progressbar@pbht);

      \shade[draw=sthlmDarkBlue,top color=sthlmDarkBlue,bottom     color=sthlmDarkBlue,middle color=sthlmDarkBlue] %
        (0pt, 0pt) rectangle ++ (\progressbar@tmpdim, \progressbar@pbht);

  \end{tikzpicture}%
}

\setbeamertemplate{headline}{

  \begin{beamercolorbox}[wd=\paperwidth,ht=1.0ex,center,dp=1ex]    {sthlmLightGrey}%
    \progressbar@progressbar%
  \end{beamercolorbox}%
}


    \setbeamertemplate{frametitle}
    {
    \begin{beamercolorbox}        [wd=\paperwidth,leftskip=0.3cm,rightskip=0.3cm,ht=3ex,dp=1.5ex]{frametitle}
         \usebeamerfont{frametitle}\MakeUppercase{\insertframetitle}%
    \end{beamercolorbox}
    }


\usenavigationsymbolstemplate{}
\setbeamertemplate{footline}
{%
\begin{beamercolorbox}    [wd=\textwidth,ht=3ex,dp=1.5ex,leftskip=0.3cm,rightskip=0.3cm]{structure}%
\hfill\usebeamerfont{page number in head/foot}%
\insertframenumber%
\end{beamercolorbox}%
}

\setbeamertemplate{caption label separator}{: }

\setbeamertemplate{block begin}
{
  \setbeamercolor{item}{parent=block body}
  \par\vskip\medskipamount%
  \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex]    {block title}
    \usebeamerfont*{block title}\insertblocktitle%
  \end{beamercolorbox}%
  {\parskip0pt\par}%
  {\nointerlineskip\vskip-0.5pt}%
  \usebeamerfont{block body}%
  \begin{beamercolorbox}    [sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex,vmode]{block body}%
}
\setbeamertemplate{block end}  
{\end{beamercolorbox}\vskip\smallskipamount}

\setbeamertemplate{block alerted begin}
{
  \setbeamercolor{item}{parent=block body alerted}
  \par\vskip\medskipamount%
  \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex]    {block title alerted}
    \usebeamerfont*{block title alerted}\insertblocktitle%
  \end{beamercolorbox}%
  {\parskip0pt\par}%
  {\nointerlineskip\vskip-0.5pt}%
  \usebeamerfont{block body alerted}%
  \begin{beamercolorbox}    [sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex,vmode]{block body alerted}%
}
\setbeamertemplate{block alerted end}
{\end{beamercolorbox}\vskip\smallskipamount}

\setbeamertemplate{block example begin}
{
  \par\vskip\medskipamount%
  \begin{beamercolorbox}[sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex]    {block title example}
    \usebeamerfont*{block title example}\insertblocktitle%
  \end{beamercolorbox}%
  {\parskip0pt\par}%
  {\nointerlineskip\vskip-0.5pt}%
  \usebeamerfont{block body example}%
  \begin{beamercolorbox}    [sep=.5ex,dp=0.6ex,leftskip=0.5ex,rightskip=0.5ex,vmode]{block body example}%
}
\setbeamertemplate{block example end}
{\end{beamercolorbox}\vskip\smallskipamount}


\newcommand<>{\hover}[1]{\uncover#2{%
    \begin{tikzpicture}[remember picture,overlay]%
    \draw[fill,opacity=0.4] (current page.south west)
    rectangle (current page.north east);
    \node at (current page.center) {#1};
    \end{tikzpicture}}
    }



\usepackage{environ}% Required for \NewEnviron, i.e. to read the whole body of the environment

\newcounter{acolumn}%  Number of current column
\newlength{\acolumnmaxheight}%   Maximum column height


% `column` replacement to measure height
\newenvironment{@acolumn}[1]{%
    \stepcounter{acolumn}%
    \begin{lrbox}{\@tempboxa}%
    \begin{minipage}{#1}%
}{%
    \end{minipage}
    \end{lrbox}
    \@tempdimc=\dimexpr\ht\@tempboxa+\dp\@tempboxa\relax
    % Save height of this column:
    \expandafter\xdef\csname     acolumn@height@\roman{acolumn}\endcsname{\the\@tempdimc}%
    % Save maximum height
    \ifdim\@tempdimc>\acolumnmaxheight
        \global\acolumnmaxheight=\@tempdimc
    \fi
}

    % `column` wrapper which sets the height beforehand
\newenvironment{@@acolumn}[1]{%
    \stepcounter{acolumn}%
    % The \autoheight macro contains a \vspace macro with the maximum height     minus the natural column height
    \edef\autoheight{\noexpand\vspace*{\dimexpr\acolumnmaxheight-\csname     acolumn@height@\roman{acolumn}\endcsname\relax}}%
    % Call original `column`:
    \orig@column{#1}%
}{%
\endorig@column
}

% Save orignal `column` environment away
\let\orig@column\column
\let\endorig@column\endcolumn

% `columns` variant with automatic height adjustment
\NewEnviron{acolumns}[1][]{%
    % Init vars:
    \setcounter{acolumn}{0}%
    \setlength{\acolumnmaxheight}{0pt}%
    \def\autoheight{\vspace*{0pt}}%
        % Set `column` environment to special measuring environment
\let\column\@acolumn
\let\endcolumn\end@acolumn
\BODY% measure heights
% Reset counter for second processing round
\setcounter{acolumn}{0}%
% Set `column` environment to wrapper
\let\column\@@acolumn
\let\endcolumn\end@@acolumn
% Finally process columns now for real
\begin{columns}[#1]%
    \BODY
\end{columns}%
}

\newbox\mytempbox
\newdimen\mytempdimen

\newcommand\includegraphicscopyright[3][]{%
          \leavevmode\vbox{\vskip3pt\raggedright\setbox\mytempbox=\hbox{\includegraphics[#1]{#2}}%
\mytempdimen=\wd\mytempbox\box\mytempbox\par\vskip1pt%
\usebeamerfont{copyright text}{\usebeamercolor[fg]{copyright text}    {\vbox{\hsize=\mytempdimen#3}}}\vskip3pt%
}}

\mode
<all>

正确的布局 “beamer 是什么?”应为白色 背景颜色应为灰色

答案1

Beamer 规则“无论使用哪台计算机或查看器程序,您的演示文稿看起来都完全相同。”如果这不会发生,您必须检查 pdf 查看器中的“辅助功能选项”并禁用不需要的选项。使用 Adob​​e Reader(例如):

在此处输入图片描述

相关内容