在 beamercolorbox 中调整徽标

在 beamercolorbox 中调整徽标

我正在制作演示文稿,我想在除 之外的所有框架的右下角添加徽标titlepage。首先,我设置了四个beamercolorboxes,最后一个用于徽标。它对齐得不太好。然后,将徽标添加到第三个beamercolorbox。它似乎对齐了,但是,它使日期和页码看起来模糊不清,而且图像本身的颜色已从白色更改为 的颜色beamercolorbox。我希望图像出现在前面。

平均能量损失

\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[export]{adjustbox}
\usepackage{tikz}
\usetikzlibrary{positioning}
\setbeamertemplate{headline}{}
\setbeamercovered{transparent}
\usetheme{Madrid}
\useoutertheme{miniframes} 
\useinnertheme{circles}
\setbeamercolor{subsection in head/foot}{bg=black,fg=white}

\def\logo{%
    \includegraphics[fbox, ,width=1cm, height=3ex,raise=-0.6ex]{polyLogo.pdf}%
}

\setbeamerfont{footline}{size=\fontsize{6}{6}\selectfont}
\setbeamercolor{section in foot}{bg=gray,fg=white}
\setbeamercolor{subsection in foot}{bg=black,fg=white}


\setbeamertemplate{footline}
{
    \hbox{%
        \begin{beamercolorbox}[wd=.35\paperwidth,ht=2.6ex,dp=1ex,center]{section in foot}%
            \usebeamerfont{section in foot}\insertshortauthor
        \end{beamercolorbox}%
    % here I replace \insertsubtitle with \insertshorttitle
        \begin{beamercolorbox}[wd=.30\paperwidth,ht=2.6ex,dp=1ex,center]{subsection in foot}%
            \usebeamerfont{section in foot}\insertshorttitle
        \end{beamercolorbox}%
        \pgfsetfillopacity{0.5}\begin{beamercolorbox}[wd=.35\paperwidth,ht=2.6ex,dp=1ex,center]{subsection in foot}%
            \usebeamerfont{section in foot} \text{\today} \hspace{0.1 in} \insertframenumber/\inserttotalframenumber\hfill\setlength\fboxrule{0pt}\logo\hfill
        \end{beamercolorbox}%
    }%
    
    \vskip0pt%
}

\usepackage{xcolor}
\usepackage{booktabs}
\setbeamercolor{framesource}{fg=gray}
\setbeamerfont{framesource}{size=\tiny}
\newcommand{\source}[1]{\begin{textblock*}{4cm}(8.7cm,8.6cm)
        \begin{beamercolorbox}[ht=0.5cm,right]{framesource}
            \usebeamerfont{framesource}\usebeamercolor[fg]{framesource} Source: {#1}
        \end{beamercolorbox}
\end{textblock*}}
\title[VeryCoolVeryCool]{\small\textbf{\documenttitle}}
\subtitle{\small DVeryCoolVeryCoolVeryCool}
\author[VeryCoolVeryCoolVeryCool] {VeryCoolVeryCool}
\institute[]
{} 
\date[Winter 2021] % (optional)
{VeryCoolVeryCoolVeryCoolVeryCoolVeryCool \vspace{0.1 in}}
\newcommand{\documenttitle}{VeryCoolVeryCoolVeryCoolVeryCoolVeryCoolVeryCoolVeryCoolVeryCool}


\begin{document}
    \begin{frame}[plain]
        \titlepage
    \end{frame}
\section{Outline}
\begin{frame}
    \frametitle[allowframebreaks]{Outline}
    \tableofcontents
\end{frame}
\section[intro]{A Cool Theory}
\begin{frame}{Rules}
    \frametitle{Brief History }
        These are the principal rules:
\end{frame}
\end{document}

编辑:无法上传图像polyLogo.pdf,因此上传了 .PNG 版本。因此,只需将其替换为 即可polyLogo.PNG

在此处输入图片描述

任何解决办法都将受到赞赏。

答案1

  • 由于徽标具有透明背景,因此背景颜色会更改为脚线的颜色。如果您想保留白色背景,可以将徽标放入\colorbox

  • 徽标的颜色发生了变化,因为您\pgfsetfillopacity{0.5}在最后一个框中使用了不同的颜色。这会带来各种问题,在某些查看器上可能会导致您描述的文本模糊。不要更改不透明度,而是将颜色更改为您想要的灰色

  • 您可以通过设置宽度和高度来扭曲图像。您应该只设置其中一个,或者如果您确实必须同时设置两个,请使用keepaspectratio选项


\documentclass[11pt]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[export]{adjustbox}
\usepackage{tikz}
\usetikzlibrary{positioning}
\setbeamertemplate{headline}{}
\setbeamercovered{transparent}
\usetheme{Madrid}
\useoutertheme{miniframes} 
\useinnertheme{circles}
\setbeamercolor{subsection in head/foot}{bg=black,fg=white}

\def\logo{%
    \includegraphics[fbox, ,width=1cm, height=3ex,raise=-0.6ex,keepaspectratio]{polyLogo}%
}

\setbeamerfont{footline}{size=\fontsize{6}{6}\selectfont}
\setbeamercolor{section in foot}{bg=gray,fg=white}
\setbeamercolor{subsection in foot}{bg=black,fg=white}

\setbeamercolor{date in foot}{bg=gray,fg=lightgray}

\setbeamertemplate{footline}
{
    \hbox{%
        \begin{beamercolorbox}[wd=.35\paperwidth,ht=2.6ex,dp=1ex,center]{section in foot}%
            \usebeamerfont{section in foot}\insertshortauthor
        \end{beamercolorbox}%
    % here I replace \insertsubtitle with \insertshorttitle
        \begin{beamercolorbox}[wd=.30\paperwidth,ht=2.6ex,dp=1ex,center]{subsection in foot}%
            \usebeamerfont{section in foot}\insertshorttitle
        \end{beamercolorbox}%
%        \pgfsetfillopacity{0.5}
        \begin{beamercolorbox}[wd=.35\paperwidth,ht=2.6ex,dp=1ex,center]{date in foot}%
            \usebeamerfont{section in foot} \text{\today} \hspace{0.1 in} \insertframenumber/\inserttotalframenumber\hfill\setlength\fboxrule{0pt}\colorbox{white}{\logo}\hfill
        \end{beamercolorbox}%
    }%
    
    \vskip0pt%
}

\usepackage{xcolor}
\usepackage{booktabs}
\setbeamercolor{framesource}{fg=gray}
\setbeamerfont{framesource}{size=\tiny}
\newcommand{\source}[1]{\begin{textblock*}{4cm}(8.7cm,8.6cm)
        \begin{beamercolorbox}[ht=0.5cm,right]{framesource}
            \usebeamerfont{framesource}\usebeamercolor[fg]{framesource} Source: {#1}
        \end{beamercolorbox}
\end{textblock*}}
\title[VeryCoolVeryCool]{\small\textbf{\documenttitle}}
\subtitle{\small DVeryCoolVeryCoolVeryCool}
\author[VeryCoolVeryCoolVeryCool] {VeryCoolVeryCool}
\institute[]
{} 
\date[Winter 2021] % (optional)
{VeryCoolVeryCoolVeryCoolVeryCoolVeryCool \vspace{0.1 in}}
\newcommand{\documenttitle}{VeryCoolVeryCoolVeryCoolVeryCoolVeryCoolVeryCoolVeryCoolVeryCool}


\begin{document}
    \begin{frame}[plain]
        \titlepage
    \end{frame}
\section{Outline}
\begin{frame}
    \frametitle[allowframebreaks]{Outline}
    \tableofcontents
\end{frame}
\section[intro]{A Cool Theory}
\begin{frame}{Rules}
    \frametitle{Brief History }
        These are the principal rules:
\end{frame}
\end{document}

在此处输入图片描述

答案2

嗯,仍然不知道为什么polyLogo.pdf会模糊beamercolorbox,但用它的版本替换它.PNG,问题最终得到解决。

相关内容