更改超链接颜色会改变投影仪部分标题的颜色

更改超链接颜色会改变投影仪部分标题的颜色

当我使用\hypersetup更改演示文稿轮廓的链接颜色时,它也会更改标题中部分和子部分标题的颜色。我有一些代码,我认为应该根据 覆盖它\patchcmd,但它似乎不起作用。当我添加\tracingpatches它时没有报告任何问题。我怎样才能让部分/子部分显示为白色而不是黑色?

梅威瑟:

\documentclass{beamer}

\usetheme{AnnArbor}

\usepackage{multicol}

\definecolor{beamer@myBlue}{RGB}{19,41,75}
\definecolor{beamer@myOrange}{RGB}{232,74,39}
\definecolor{beamer@myGray}{RGB}{210,210,210}

\setbeamercolor{frametitle}{fg=beamer@myBlue,bg=beamer@myGray}
\setbeamercolor{normal text}{fg=black}
\setbeamercolor{title}{fg=beamer@myBlue,bg=beamer@myOrange!75}
\setbeamercolor{item projected}{fg=white,bg=beamer@myOrange}
\setbeamercolor{block title}{fg=beamer@myBlue,bg=beamer@myOrange}
\setbeamercolor{block body}{fg=blue,bg=beamer@myBlue!80}
\setbeamercolor{title in head/foot}{fg=beamer@myBlue,bg=beamer@myGray}
\setbeamercolor{author in head/foot}{fg=white,bg=beamer@myBlue}
\setbeamercolor{institute in head/foot}{fg=white,bg=beamer@myOrange}
\setbeamercolor{date in head/foot}{fg=white,bg=beamer@myOrange}
\setbeamercolor{section in head/foot}{fg=white,bg=beamer@myBlue}
\setbeamercolor{subsection in head/foot}{fg=white,bg=beamer@myOrange}

\hypersetup{colorlinks,linkcolor=black}

\makeatletter
\renewcommand\insertshorttitle[1][]{%
    \beamer@setupshort{#1}%
    \let\thanks=\@gobble%
    \ifnum\c@page=1%
    \hyperlinkpresentationend{\beamer@insertshort{\usebeamercolor*[fg]{title in head/foot}\beamer@shorttitle}}%
    \else%
    \hyperlinkpresentationstart{\beamer@insertshort{\usebeamercolor*[fg]{title in head/foot}\beamer@shorttitle}}%
    \fi}
\makeatother

\makeatletter
\patchcmd{\beamer@section}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
{\def\insertsectionhead{\hyperlink{Navigation\the\c@page}{\usebeamercolor*[fg]{section in head/foot}#1}}}
{}{}
\patchcmd{\beamer@subsection}
{\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{#1}}}
{\def\insertsubsectionhead{\hyperlink{Navigation\the\c@page}{\usebeamercolor*[fg]{subsection in head/foot}#1}}}
{}{}
\makeatother

\beamertemplatenavigationsymbolsempty

\begin{document}

%% Presentation info
\title[Test]{
This is a test of my template
}

\author[J.~Smith]{John Smith}

\institute[A]{Affiliation}

\date[Jan. 15, 2019]{January 15, 2019}
%%%%

%% Titlepage
\begin{frame}[plain]
\titlepage
\end{frame}
%%%%

%% Outline
\begin{frame}
    \frametitle{Outline}
    \begin{multicols}{2}
        \tableofcontents
    \end{multicols}
\end{frame}
%%%%

%%% Other slides start here

\section{Introduction}
\subsection{Overview}

\begin{frame}
\frametitle{Example}
\begin{itemize}
    \item Here is a list:
    \begin{itemize}
        \item A
        \item B
        \item C
        \item D
        \item E
    \end{itemize}
    \item And another one:
    \begin{itemize}
        \item 1
        \item 2
        \item 3
    \end{itemize}
\end{itemize}
\end{frame}

\section{Conclusion}
\subsection{Review}

\begin{frame}
\frametitle{Example}
\begin{itemize}
    \item Here is a list:
    \begin{itemize}
        \item A
        \item B
        \item C
        \item D
        \item E
    \end{itemize}
    \item And another one:
    \begin{itemize}
        \item 1
        \item 2
        \item 3
    \end{itemize}
\end{itemize}
\end{frame}

\newcounter{finalframe}
\setcounter{finalframe}{\value{framenumber}}

\end{document}

答案1

\hypersetup你可以使用以下命令更改目录条目的颜色,而不是弄乱\setbeamercolor{section in toc}{fg=green}

\documentclass{beamer}

\usetheme{AnnArbor}

\usepackage{multicol}

\definecolor{beamer@myBlue}{RGB}{19,41,75}
\definecolor{beamer@myOrange}{RGB}{232,74,39}
\definecolor{beamer@myGray}{RGB}{210,210,210}

\setbeamercolor{frametitle}{fg=beamer@myBlue,bg=beamer@myGray}
\setbeamercolor{normal text}{fg=black}
\setbeamercolor{title}{fg=beamer@myBlue,bg=beamer@myOrange!75}
\setbeamercolor{item projected}{fg=white,bg=beamer@myOrange}
\setbeamercolor{block title}{fg=beamer@myBlue,bg=beamer@myOrange}
\setbeamercolor{block body}{fg=blue,bg=beamer@myBlue!80}
\setbeamercolor{title in head/foot}{fg=beamer@myBlue,bg=beamer@myGray}
\setbeamercolor{author in head/foot}{fg=white,bg=beamer@myBlue}
\setbeamercolor{institute in head/foot}{fg=white,bg=beamer@myOrange}
\setbeamercolor{date in head/foot}{fg=white,bg=beamer@myOrange}
\setbeamercolor{section in head/foot}{fg=white,bg=beamer@myBlue}
\setbeamercolor{subsection in head/foot}{fg=white,bg=beamer@myOrange}

\setbeamercolor{section in toc}{fg=green}
\setbeamercolor{subsection in toc}{fg=green}

\beamertemplatenavigationsymbolsempty

%% Presentation info
\title[Test]{
This is a test of my template
}

\author[J.~Smith]{John Smith}

\institute[A]{Affiliation}

\date[Jan. 15, 2019]{January 15, 2019}

\begin{document}


%%%%

%% Titlepage
\begin{frame}[plain]
\titlepage
\end{frame}
%%%%

%% Outline
\begin{frame}
    \frametitle{Outline}
    \begin{multicols}{2}
        \tableofcontents
    \end{multicols}
\end{frame}
%%%%

%%% Other slides start here

\section{Introduction}
\subsection{Overview}

\begin{frame}
\frametitle{Example}
\begin{itemize}
    \item Here is a list:
    \begin{itemize}
        \item A
        \item B
        \item C
        \item D
        \item E
    \end{itemize}
    \item And another one:
    \begin{itemize}
        \item 1
        \item 2
        \item 3
    \end{itemize}
\end{itemize}
\end{frame}

\section{Conclusion}
\subsection{Review}

\begin{frame}
\frametitle{Example}
\begin{itemize}
    \item Here is a list:
    \begin{itemize}
        \item A
        \item B
        \item C
        \item D
        \item E
    \end{itemize}
    \item And another one:
    \begin{itemize}
        \item 1
        \item 2
        \item 3
    \end{itemize}
\end{itemize}
\end{frame}

\newcounter{finalframe}
\setcounter{finalframe}{\value{framenumber}}

\end{document}

在此处输入图片描述

相关内容