Beamer:Biblatex biber,更改全球引文的顏色

Beamer:Biblatex biber,更改全球引文的顏色

我想在全球範圍內更改引文的顏色,但列出的解決方案這裡這裡不為我工作...

截至目前,我必須這樣做:

\textcolor{red}{\cite{Forrest2014}}

有什麼線索嗎?

這是我的 MWE:

\documentclass{beamer}

\usepackage{hyperref}
%hyperref options, no border and url colors
\hypersetup{%
    %pdfborder = {0 0 0},
    colorlinks=true,
    urlcolor=blue,
    linkcolor=
}

\usepackage[style=authoryear, defernumbers=true, sorting=none, backend=biber, dateabbrev=true, maxbibnames=7, minbibnames=7, doi=false, isbn=false, url=false]{biblatex}%
\begin{filecontents}{\jobname.bib}
@article{Forrest2014,
    author = {Forrest, Alistair R. R. and Kawaji, Hideya and Rehli, Michael and {Kenneth Baillie}, J. and de Hoon, Michiel J. L. and Haberle, Vanja and Lassmann, Timo},
    doi = {10.1038/nature13182},
    issn = {0028-0836},
    journal = {Nature},
    pages = {462--470},
    pmid = {24670764},
    title = {{A promoter-level mammalian expression atlas}},
    url = {http://dx.doi.org/10.1038/nature13182{\%}5Cnhttp://www.nature.com/doifinder/10.1038/nature13182},
    volume = {507},
    year = {2014}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\setbeamertemplate{bibliography item}{}

\mode<presentation> {
    \usetheme{Singapore}
}
\begin{document}


\section{Frame 1}
\begin{frame}
\frametitle{Frame 1}
    Here I want a citation:

    %\textcolor{red}{\cite{Forrest2014}}
    \cite{Forrest2014}
\end{frame}


\begin{frame}[allowframebreaks]
\frametitle{References}
    \printbibliography
\end{frame}


\end{document}

答案1

您可以重新定義 cite 指令:

\documentclass{beamer}

\usepackage{hyperref}
%hyperref options, no border and url colors
\hypersetup{%
    %pdfborder = {0 0 0},
    colorlinks=true,
    urlcolor=blue,
    linkcolor=,
    }

\usepackage[style=authoryear, defernumbers=true, sorting=none, backend=biber, dateabbrev=true, maxbibnames=7, minbibnames=7, doi=false, isbn=false, url=false]{biblatex}%

\newcommand\mkbibcolor[2]{\textcolor{#1}{\hypersetup{citecolor=#1}#2}}
\DeclareCiteCommand{\cite}[\mkbibcolor{red}]
  {\usebibmacro{prenote}}%
  {\usebibmacro{citeindex}%
   \usebibmacro{cite}}
  {\multicitedelim}
  {\usebibmacro{postnote}}

\addbibresource{biblatex-examples.bib}
\setbeamertemplate{bibliography item}{}

\mode<presentation> {
    \usetheme{Singapore}
}
\begin{document}


\section{Frame 1}
\begin{frame}
\frametitle{Frame 1}
    Here I want a citation:

     \cite{doody}
\end{frame}


\begin{frame}[allowframebreaks]
\frametitle{References}
    \printbibliography
\end{frame}


\end{document}

在此輸入影像描述

相關內容