我在工作中使用了这个 BibTeX 参考资料
@Misc{oai:CiteSeerPSU:562256,
title = "Gerris: {A} Tree-Based Adaptive Solver For The
Incompressible Euler Equations In Complex Geometries",
author = "St Ephane Popinet",
year = "2002",
month = sep # "~08",
abstract = "An adaptive mesh projection method for the
time-dependent incompressible Euler equations is
presented. The domain is spatially discretised using
quad/octrees and a multilevel Poisson solver is used to
obtain the pressure. Complex solid boundaries are
represented using a volume-of-fluid approach.
Second-order convergence in space and time is
demonstrated on regular, statically and dynamically
refined grids. The quad/octree discretisation proves to
be very flexible and allows accurate and efficient
tracking of flow features. The source code of the
method implementation is freely available.",
citeseer-references = "oai:CiteSeerPSU:500259; oai:CiteSeerPSU:27423;
oai:CiteSeerPSU:16254; oai:CiteSeerPSU:395363;
oai:CiteSeerPSU:436925; oai:CiteSeerPSU:90307;
oai:CiteSeerPSU:391348; oai:CiteSeerPSU:137987;
oai:CiteSeerPSU:442611; oai:CiteSeerPSU:44620;
oai:CiteSeerPSU:150038; oai:CiteSeerPSU:433875;
oai:CiteSeerPSU:441861; oai:CiteSeerPSU:526586",
bibsource = "OAI-PMH server at cs1.ist.psu.edu",
language = "en",
oai = "oai:CiteSeerPSU:562256",
rights = "unrestricted",
URL = "http://citeseer.ist.psu.edu/562256.html;
http://gfs.sf.net/gerris.pdf",
}
但在参考书目中,我没有获得两个 URL 的两个单独链接,而是将两个 URL 合并为一个链接,如下所示:http://citeseer.ist.psu.edu/562256.html;http://gfs.sf.net/gerris.pdf。有什么方法可以让我把两个 url 分开,并为每个 ulr 获取一个链接?坦白说,我不知道参考书目中 url 链接的最佳做法是什么,但我现在的做法毫无用处。
编辑:我正在使用 JabRef,它修改了我链接到的网页上的 bibtex 代码
url = "http://citeseer.ist.psu.edu/562256.html; http://gfs.sf.net/gerris.pdf"
到
url = {http://citeseer.ist.psu.edu/562256.html; http://gfs.sf.net/gerris.pdf}
。
换句话说,它删除了引号并插入了花括号。我不知道,也许这会引起一些问题?
答案1
url
大多数书目样式使用命令直接格式化字段\url
。
您可以使用该字段note
添加未格式化的文本:
NOTE = "\url{http://citeseer.ist.psu.edu/562256.html} and
\url{http://gfs.sf.net/gerris.pdf}",
答案2
您可以\url
通过重新定义修改该命令以考虑两个 URL:
\RequirePackage{filecontents}
\begin{filecontents}{test3.bib}
@Misc{oai:CiteSeerPSU:562256,
title = "Gerris: {A} Tree-Based Adaptive Solver For The
Incompressible Euler Equations In Complex Geometries",
author = "St Ephane Popinet",
year = "2002",
month = sep # "~08",
abstract = "An adaptive mesh projection method for the
time-dependent incompressible Euler equations is
presented. The domain is spatially discretised using
quad/octrees and a multilevel Poisson solver is used to
obtain the pressure. Complex solid boundaries are
represented using a volume-of-fluid approach.
Second-order convergence in space and time is
demonstrated on regular, statically and dynamically
refined grids. The quad/octree discretisation proves to
be very flexible and allows accurate and efficient
tracking of flow features. The source code of the
method implementation is freely available.",
citeseer-references = "oai:CiteSeerPSU:500259; oai:CiteSeerPSU:27423;
oai:CiteSeerPSU:16254; oai:CiteSeerPSU:395363;
oai:CiteSeerPSU:436925; oai:CiteSeerPSU:90307;
oai:CiteSeerPSU:391348; oai:CiteSeerPSU:137987;
oai:CiteSeerPSU:442611; oai:CiteSeerPSU:44620;
oai:CiteSeerPSU:150038; oai:CiteSeerPSU:433875;
oai:CiteSeerPSU:441861; oai:CiteSeerPSU:526586",
bibsource = "OAI-PMH server at cs1.ist.psu.edu",
language = "en",
oai = "oai:CiteSeerPSU:562256",
rights = "unrestricted",
URL = "http://citeseer.ist.psu.edu/562256.html;
http://gfs.sf.net/gerris.pdf",
}
\end{filecontents}
\documentclass{article}
\usepackage[english]{babel}
\usepackage{url}
\usepackage[backend=biber]{biblatex}
\usepackage{hyperref}
\addbibresource{test3.bib}
\let\URL\url
\makeatletter
\def\url#1{\@URL#1;;\@nil}
\def\@URL#1;#2;#3\@nil{%
\URL{#1}\ifx\relax#2\relax\else; \URL{#2}\fi}
\makeatother
%url = {http://citeseer.ist.psu.edu/562256.html; http://gfs.sf.net/gerris.pdf}
\begin{document}
foo\cite{oai:CiteSeerPSU:562256}
\printbibliography
\end{document}
答案3
我不会对 Herbert 的回答发表评论。因此,根据他的回答:
- 当你将其复制到你自己的代码中时,请确保将其放在后您包括像
url
或这样的包hyperref
。 要使用空格代替分号,只需将分号替换为空格即可。这对于 Mendeley 生成的 BibTeX 文件非常有用。当两个空格紧挨在一起时,您必须转义其中一个空格,以免它们消失,即
;;
变成\
(反斜杠周围有两个空格)。这是一个版本,我另外删除了第三个参数(第二个空格),因为它显然没有必要(?),所以也不再有反斜杠了。\let\URL\url \makeatletter \def\url#1{\@URL#1 \@nil} \def\@URL#1 #2\@nil{\URL{#1}\ifx\relax#2\relax \else; \URL{#2}\fi} \makeatother
请注意,我保留了“输出分号”,因为我认为它看起来不错。从技术上讲,您可以在此处写入任何内容,包括任意命令。
要将其扩展到
N
URL,您必须使用第二个参数递归调用该宏(它将包含其余的N-1
空格分隔的 URL)。出于某种原因,需要额外的操作\relax
才能使其工作,这是偶然发现的:\let\URL\url \makeatletter \def\url#1{\@URL#1 \@nil} \def\@URL#1 #2\@nil{\URL{#1}\ifx\relax#2\relax \else; \url{#2\relax}\fi} \makeatother
要正确处理带有百分号
%
和哈希符号的URL#
,可以从中汲取一些灵感在一个命令中更改 _ 的 catcode?并进一步调整定义如下:\let\URL\url \makeatletter \def\url{\begingroup \catcode`\%=12\catcode`\#=12\relax\printurl} \def\printurl#1{\@URL#1 \@nil\endgroup} \def\@URL#1 #2\@nil{\URL{#1}\ifx\relax#2\relax \else; \url{#2\relax}\fi} \makeatother
答案4
关于@Marco Daniel 的note
回答,我建议使用addendum
而不是, note
以确保 URL 和字段一样放在条目末尾URL
。事实上,note
在某些样式中,它打印在条目中间。
使用addendum
:
参赛代码:
@book{Roland_Gautier,
address = {Tours},
author = {Gautier, Léon},
keywords = {ling},
publisher = {Alfred Mame et Fils},
title = {La Chanson de Roland},
year = {1872},
Addendum = {\textsc{url} : \url{https://gallica.bnf.fr/ark:/12148/bpt6k102947j} (t. \textsc{i}), \url{https://gallica.bnf.fr/ark:/12148/bpt6k102948x} (t. \textsc{ii})},
volumes = {2}
}