我正在尝试设计一种方法来显示 URL,即超链接的“URL”存根,而不是完整的字符串。文档的最终打印版本中浪费纸张的前景并不令人兴奋。我读过这个答案但它似乎只适用于 BibTeX 默认样式?
我正在使用经过修改的biblatex
Biber 后端样式,其中我重新定义了各种参数,以使参考文献看起来符合我最终希望在论文中看到的样子。
链接答案中的工作流程是否仍然以某种方式适用,即找到相应的.bst
文件并进行相应修改?
以下是引用样式参数的当前状态:
\usepackage
[backend=biber,
bibencoding=utf8,
style=authoryear-comp,
citestyle=authoryear-icomp,
maxcitenames=2, % sets limit for et al in citations
maxbibnames=99, % frees up limits to authors listed in references
giveninits=true, % initialise each author
sorting=nyt, % sort by name, author and publication title
uniquename=false,
uniquelist=false, % turns off author first names disambiguation
sortcites=true,
hyperref=true]{biblatex} % citation hyperlinks
\defbibenvironment{bibliography}
{\enumerate{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endenumerate}
{\item}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldset=issn, null]
}
}
}
%Corrections to referencing style
\DeclareFieldFormat*{title}{{#1}} % * clears formatting of publication titles
\DeclareFieldFormat*{journaltitle}{\mkbibemph{#1}\isdot} % italicised journal titles
\DeclareFieldFormat*[inbook]{volume}{\mkbibbold{#1}\isdot} % italicised journal titles
\renewbibmacro{volume+number+eid}{%
\setunit{\adddot\addspace}%
\printfield{volume}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}} % changed volume-number-pages layout
\renewcommand*{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addcomma\space}}% colon between volume numbers and pages
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}} % parentheses around volume number
\DeclareDelimFormat{translatortypedelim}{\addspace} % parentheses bracket around Ed.
\DeclareNameAlias{sortname}{family-given} % puts given names after surname
\DeclareFieldFormat{postnote}{#1}% no postnote prefix in "normal" citation commands
\DeclareFieldFormat{multipostnote}{#1}% no postnote prefix in "multicite" commands
\DeclareFieldFormat[article]{pages}{#1}% no prefix for the `pages` field in the articles within bibliography
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1}}%emboldens volume #
\renewbibmacro{in:}{}
\newcommand{\biband}{\ifcurrentname{labelname}{\bibstring{and}}{\&}} % changes citation 'and' to ampersand
\renewcommand*\finalnamedelim{ \& } % references delimiter becomes ampersand
\renewcommand*{\nameyeardelim}{\addcomma\space} % adds comma between cited author and year
\renewcommand*{\compcitedelim}{\addsemicolon\space} % semicolons instead of commas between same author citations
\AtEveryBibitem{\clearfield{month}} % remove month from year-published
% print url if no doi
\renewbibmacro*{doi+eprint+url}{%
\printfield{doi}%
\newunit\newblock%
\iftoggle{bbx:eprint}{%
\usebibmacro{eprint}%
}{}%
\newunit\newblock%
\iffieldundef{doi}{%
\usebibmacro{url+urldate}}%
{}%
}
\addbibresource{Bib/Mendeley/library.bib}
目前bib
条目:
@incollection{Zharikov2007,
abstract = {A Study Group was set up under the leadership of N. Pertsev to consider the nomenclature of metasomatism and metasomatic processes. This paper reports the conclusions of that group. The term metasomatism was introduced by Naumann (1826). Metasomatism, metasomatic process and metasomatose are synonyms although some authors use metasomatose as a name for specific varieties of metasomatism (e.g. Na-metasomatose, Mg-metasomatose, etc.).},
author = {Zharikov, V. A. and Pertsev, N. N. and Rusinov, V. L. and Callegari, E. and Fettes, D. J.},
booktitle = {Recommendations by the IUGS Subcommission on the Systematics of Metamorphic Rocks},
chapter = {9},
file = {:C$\backslash$:/Users/User/Mendeleyed Refs/Zharikov et al/Zharikov et al.. 2007. Metasomatism and metasomatic rocks.pdf:pdf},
keywords = {Metasomatism},
number = {July},
pages = {17},
title = {{Metasomatism and metasomatic rocks}},
url = {http://stuff.mit.edu/afs/athena/course/12/12.115/www/12.114 Papers/BGS/Metamorphic/DetailedMetamorphic/9 Metasomatism and metasomatic rocks.pdf{\%}5Cnwww.bgs.ac.uk/scmr/home.html},
year = {2007}
}
显示为
- Zharikov, VA、Pertsev, NN、Rusinov, VL、Callegari, E. 和 Fettes, DJ (2007)。交代作用和交代岩。IUGS 变质岩系统学小组委员会的建议。7 月。第 9 章,第 17 页。网址:http://stuff.mit.edu/afs/athena/course/12/12.115/www/12.114%20Papers/BGS/Metamorphic/DetailedMetamorphic/9%20Metasomatism%20and%20metasomatic%20rocks.pdf%7B%5C%%7D5Cnwww.bgs.ac.uk/scmr/home.html。
就像我希望的那样
- Zharikov, VA、Pertsev, NN、Rusinov, VL、Callegari, E. 和 Fettes, DJ (2007)。交代作用和交代岩。IUGS 变质岩系统学小组委员会的建议。7 月。第 9 章,第 17 页。网址
我正在使用最新版本的 TeXStudio 和 Mendeley 自动更新的.bib
源文件来调用每个条目。
答案1
这样biblatex
做就像更改字段格式一样简单url
来自标准(l. 582 in biblatex.def
,v3.15a)
\DeclareFieldFormat{url}{\mkbibacro{URL}\addcolon\space\url{#1}}
到
\DeclareFieldFormat{url}{\href{#1}{\mkbibacro{URL}}}
在 MWE 中,我简化并现代化了您的一些修改(特别是我摆脱了一些多余的加载时间选项)
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber,
style=authoryear-icomp,
maxcitenames=2,
maxbibnames=99,
giveninits=true,
uniquename=false,
uniquelist=false,
]{biblatex}
\usepackage{hyperref}
\renewcommand*{\compcitedelim}{\addsemicolon\space}
\DeclareNameAlias{sortname}{family-given}
\DeclareDelimFormat{finalnamedelim}{\addspace\&\space}
\DeclareDelimFormat{nameyeardelim}{\addcomma\space}
\DeclareDelimFormat{translatortypedelim}{\addspace}
\DeclareFieldFormat*{title}{#1}
\DeclareFieldFormat*{journaltitle}{\mkbibemph{#1}\isdot}
\DeclareFieldFormat*[inbook]{volume}{\mkbibbold{#1}\isdot}
\renewbibmacro{in:}{}
\DeclareFieldFormat[article]{number}{\mkbibparens{#1}}
\DeclareFieldFormat[article]{volume}{\mkbibbold{#1}}
\renewbibmacro{volume+number+eid}{%
\setunit{\adddot\addspace}%
\printfield{volume}%
\printfield{number}%
\setunit{\addcomma\space}%
\printfield{eid}}
\renewcommand*{\bibpagespunct}{%
\ifentrytype{article}{\addcolon}{\addcomma\space}}
\DeclareFieldFormat{postnote}{#1}
\DeclareFieldFormat{multipostnote}{#1}
\DeclareFieldFormat[article]{pages}{#1}
\DeclareFieldFormat{url}{\href{#1}{\mkbibacro{URL}}}
\renewbibmacro*{doi+eprint+url}{%
\printfield{doi}%
\newunit\newblock%
\iftoggle{bbx:eprint}
{\usebibmacro{eprint}}
{}%
\newunit\newblock%
\iffieldundef{doi}
{\usebibmacro{url+urldate}}%
{}}
\AtEveryBibitem{\clearfield{month}}
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map{
\step[fieldset=issn, null]
}
}
}
\defbibenvironment{bibliography}
{\enumerate{}
{\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibitemsep}%
\setlength{\parsep}{\bibparsep}}}
{\endenumerate}
{\item}
\begin{filecontents}{\jobname.bib}
@incollection{Zharikov2007,
author = {Zharikov, V. A. and Pertsev, N. N. and Rusinov, V. L.
and Callegari, E. and Fettes, D. J.},
title = {Metasomatism and Metasomatic Rocks},
booktitle = {Recommendations by the {IUGS} Subcommission
on the Systematics of Metamorphic Rocks},
chapter = {9},
keywords = {Metasomatism},
number = {July},
pages = {17},
url = {http://stuff.mit.edu/afs/athena/course/12/12.115/www/12.114 Papers/BGS/Metamorphic/DetailedMetamorphic/9 Metasomatism and metasomatic rocks.pdf},
year = {2007},
}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem \autocite{sigfridsson,Zharikov2007}
\printbibliography
\end{document}
请注意,条目中的 URLZharikov2007
看起来有点错误。{\%}5Cnwww.bgs.ac.uk/scmr/home.html
末尾的 似乎毫无用处。
看起来number = {July},
也有点奇怪。
答案2
在 biblio 文件中添加hyperref
包并使用url = {\href{http://stuff.mit.edu/afs/athena/course/12/12.115/www/12.114%20Papers/BGS/Metamorphic/DetailedMetamorphic/9%20Metasomatism%20and%20metasomatic%20rocks.pdf%7B%5C%%7D5Cnwww.bgs.ac.uk/scmr/home.html}{source}},