运行此示例:
% How does 'filecontents' keep LaTeX parsing while temporarily stop writing output
% https://tex.stackexchange.com/questions/104159/how-does-filecontents-keep-latex
\RequirePackage{filecontents}
\begin{filecontents*}{references.bib}
@book{koma-scrguien,
author = {Markus Kohm},
edition = {2017-04-13},
howpublished = {\url{http://mirrors.ibiblio.org/CTAN/.../scrguien.pdf}},
publisher = {Online Material; \url{https://www.ctan.org/pkg/koma-script}},
title = {The Guide KOMA -Script},
urlaccessdate = {2017-08-28},
year = {2017}
}
\end{filecontents*}
\PassOptionsToPackage{brazil,main=english}{babel}
\documentclass[
10pt,
a5paper,
twoside
chapter=TITLE,
section=TITLE
]{abntex2}
\pdfstringdefDisableCommands{\let\uppercase\relax}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
style=abnt,
language=english,
backref=true,
backend=biber,
citecounter=true
]{biblatex}
\addbibresource{references.bib}
\usepackage{csquotes}
\hypersetup{colorlinks=true}
\begin{document}
Citing \cite[p. 47-52 and 135]{koma-scrguien}
\printbibliography
\end{document}
我们得到了以下输出:
KOHM
和之间的逗号2017
也是绿色的。是否可以将其颜色更改为黑色,就像下面的蒙太奇一样?
有关的:
答案1
abnt.cbx
包含以下行
\savebibmacro{cite}%
\renewbibmacro*{cite}{%% >>>2
\printtext[citehyperref]{%
\restorebibmacro{cite}%
\usebibmacro{cite}}%
}% <<<2
这有效地将 的整个输出包装cite
到 中citehyperref
,以便将其全部链接起来。
如果我们
\DeclareFieldFormat{citehyperref}{#1}
这会取消上面的线条,使它们不再起作用。由于 的大部分内容cite
仍然使用得bibhyperref
相当广泛,因此您可以保留所需的链接。
\PassOptionsToPackage{brazil,main=english}{babel}
\documentclass[
10pt,
a5paper,
twoside
chapter=TITLE,
section=TITLE
]{abntex2}
\pdfstringdefDisableCommands{\let\uppercase\relax}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[
style=abnt,
language=english,
backref=true,
backend=biber,
citecounter=true
]{biblatex}
\addbibresource{biblatex-examples.bib}
\usepackage{csquotes}
\hypersetup{colorlinks=true}
\DeclareFieldFormat{citehyperref}{#1}
\begin{document}
Citing \cite[\ppno~47-52 and 135]{nussbaum}
\printbibliography
\end{document}