我希望将所有参考文献的 DOI 采用与文本其他部分相同的字体/大小,但不添加超链接。
这是一个参考文献的例子(我有多个),由于<>
DOI 的原因,我遇到了问题:
Automatically generated by Mendeley Desktop 1.19.3
Any changes to this file will be lost if it is regenerated by Mendeley.
BibTeX export options can be customized via Options -> BibTeX in Mendeley
Desktop
@article{Ludwig1996,
author = {Ludwig, Herbert R. Jr. and Leitch, Jay A.},
doi = {10.1577/1548-8446(1996)021<0014:ITOABV>2.0.CO;2},
journal = {Fisheries},
number = {7},
pages = {14--18},
publisher = {Wiley-Blackwell},
title = {{Interbasin transfer of aquatic biota via anglers' Bait Buckets}},
volume = {21},
year = {1996}
}
根据类似帖子中的建议DOI 的 Natbib 包含错误字符以下代码修复了错误字符,但在 DOI 上有超链接。此外,它使 DOI 文本看起来与其余的引用文本和正文不同。以下是根据我的建议编写的代码:
\documentclass[letterpaper,11pt,oneside, notitlepage]{article}% calls document type
\usepackage[utf8]{inputenc}%forces utf-8 encoding
\usepackage{doi}% suppose to force DOI as verbatim
\usepackage[backend=biber,maxbibnames=99, maxcitenames= 2, bibencoding=utf8,
uniquename=init,giveninits, style=authoryear-comp,isbn=false, url=false,
dashed=false]{biblatex}
\addbibresource{lib.bib}%specifies bib location
\begin{document} %starts document
\raggedright%prevents hyphenation, kick words that make line over full to
next line\end{document}
\section{test}
\cite{Ludwig1996}% citation with < and >
\printbibliography[]
\end{document}
我尝试删除 DOI 上的超链接,并将 DOI 设置为与其余文本相同的字体/大小:
\documentclass[letterpaper,11pt, oneside, notitlepage]{article}% calls document type
\usepackage[utf8]{inputenc}%forces utf-8 encoding
\usepackage{doi}% suppose to force DOI as verbatim
\usepackage[backend=biber,maxbibnames=99, maxcitenames= 2, bibencoding=utf8,
uniquename=init,giveninits, style=authoryear-comp,isbn=false, url=false,
dashed=false]{biblatex}
\addbibresource{lib.bib}%specifies bib location
\DeclareFieldFormat{doi}{%
\mkbibacro{\larger[2]DOI}\addcolon\space{#1}}%makes "DOI" larger and make doi number normal text
\begin{document} %starts document
\raggedright%prevents hyphenation, kick words that make line over full to
next line\end{document}
\section{test}
\cite{Ludwig1996}% citation with < and >
\printbibliography[]
\end{document}
但是,这会导致<
变成倒置的 ! ,而 变成>
倒置的 ?。我将biber
其用作后端,因为我的实际文档具有一些其他(非 DOI)格式,这些格式使用了与 相关的一些灵活性biber
。
任何帮助都将受到赞赏。
答案1
嗯,你可以添加
\hypersetup{hidelinks}
在您的代码中告诉 hyperref (在 中调用doi
) 不要创建链接。
完整代码(查看改变的调用顺序doi
)
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Ludwig1996,
author = {Ludwig, Herbert R. Jr. and Leitch, Jay A.},
doi = {10.1577/1548-8446(1996)021<0014:ITOABV>2.0.CO;2},
journal = {Fisheries},
number = {7},
pages = {14--18},
publisher = {Wiley-Blackwell},
title = {{Interbasin transfer of aquatic biota via anglers' Bait Buckets}},
volume = {21},
year = {1996}
}
\end{filecontents*}
\documentclass[letterpaper,11pt,oneside, notitlepage]{article}% calls document type
\usepackage[utf8]{inputenc}%forces utf-8 encoding
\usepackage[backend=biber,maxbibnames=99, maxcitenames= 2, bibencoding=utf8,
uniquename=init,giveninits, style=authoryear-comp,isbn=false, url=false,
dashed=false]{biblatex}
\addbibresource{\jobname.bib}%specifies bib location
\usepackage{doi}% suppose to force DOI as verbatim
\hypersetup{hidelinks} % <==============================================
\begin{document} %starts document
\raggedright%prevents hyphenation, kick words that make line over full to
next line
\section{test}
\cite{Ludwig1996}% citation with < and >
\printbibliography[]
\end{document}
给出没有 doi 链接的结果:
更新:
添加\urlstyle{same}
您以下的MWE
\RequirePackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@article{Ludwig1996,
author = {Ludwig, Herbert R. Jr. and Leitch, Jay A.},
doi = {10.1577/1548-8446(1996)021<0014:ITOABV>2.0.CO;2},
journal = {Fisheries},
number = {7},
pages = {14--18},
publisher = {Wiley-Blackwell},
title = {{Interbasin transfer of aquatic biota via anglers' Bait Buckets}},
volume = {21},
year = {1996}
}
\end{filecontents*}
\documentclass[letterpaper,11pt,oneside, notitlepage]{article}% calls document type
\usepackage[utf8]{inputenc}%forces utf-8 encoding
\usepackage{hyperref}
\usepackage{url}
\usepackage[backend=biber,maxbibnames=99, maxcitenames= 2, bibencoding=utf8,
uniquename=init,giveninits, style=authoryear-comp,isbn=false, url=false,
dashed=false]{biblatex}
\addbibresource{\jobname.bib}%specifies bib location
\usepackage{hyperref}
\usepackage{url}
\usepackage{doi}% suppose to force DOI as verbatim
\hypersetup{hidelinks} % <==============================================
\urlstyle{same} % <=====================================================
\begin{document} %starts document
\raggedright%prevents hyphenation, kick words that make line over full to
next line
\section{test}
\cite{Ludwig1996}% citation with < and >
\printbibliography[]
\end{document}
结果: