我想全局更改我的引文的颜色,但列出的解决方案这里和这里对我来说不工作……
截至目前,我必须这样做:
\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}