Biblatex - numeric-comp - 抑制期刊的 doi 和 url,除非文章没有页码

Biblatex - numeric-comp - 抑制期刊的 doi 和 url,除非文章没有页码

我正在使用numeric-compBiber 和 biblatex 的引用样式。我遇到的问题是,它默认显示我参考书目中所有期刊文章的 URL 和 DOI。我不想这样。通过设置,关闭 DOI 很简单\usepackage[style=numeric-comp,sorting=none,backend=biber,isbn=false,doi=false]{biblatex}

然而,这似乎意味着对于那些没有页码和卷号的文章,它不会重新添加 DOI,而我认为这是它应该自动执行的操作。

删除 URL 比较复杂。如果我简单地将 URL 添加url=false到设置中,它确实会删除期刊的 URL,但它也会删除我引用的所有网站的 URL,这绝对不应该发生。

我知道我可以使用的一种方法是简单地删除我的 bibtex 文件中所有期刊文章的所有 URL,例如这里但这意味着,如果没有页码或 DOI,我也会错过 URL 信息(我的收藏中有一两篇文章被归类为期刊,但只能通过 URL 访问)。

因此我的问题是:

1) 为什么当我禁用 DOI 时,biblatex 不会将其重新插入到需要的位置?我该如何让它这样做?

2) 为什么url=false还要禁用网站中的 URL?我以为我的手动设置在需要时会自动被覆盖。

编辑:我已按要求在下面插入了 MWE。我发现这里的一个问题是,Mendeley 似乎将网站保存为“misc”而不是“online”。但这还不能解释 dois 的问题。Mendeley 还错误地导出专利,这意味着网站和专利被归入同一类别(参见Sato1986biblatex 文件)。

\documentclass[a4paper]{article}
\usepackage[style=numeric-comp,sorting=none,backend=biber,isbn=false,date=year,doi=false,url=false]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Lapkin2017,
author = {Lapkin, Alexei A. and Heer, Parminder K and Jacob, P.-M. and Hutchby, Marc and Cunningham, William and Bull, S. D. and Davidson, Matthew G},
doi = {10.1039/C7FD00073A},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Lapkin et al. - 2017 - Automation of route identification and optimisation based on data-mining and chemical intuition.pdf:pdf},
issn = {1359-6640},
journal = {Faraday Discuss.},
keywords = {chemoinformatics,network of organic chemistry,networks,shortest path,shortest path criteria},
mendeley-tags = {chemoinformatics,network of organic chemistry,networks,shortest path,shortest path criteria},
title = {{Automation of route identification and optimisation based on data-mining and chemical intuition}},
year = {2017}
}
@article{Gibb2013,
author = {Gibb, Bruce C},
doi = {10.1038/nchem.1604},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Gibb - 2013 - Big (chemistry) data.pdf:pdf},
issn = {1755-4330},
journal = {Nature Chemistry},
keywords = {network of organic chemistry},
mendeley-tags = {network of organic chemistry},
month = {mar},
number = {4},
pages = {248--249},
pmid = {23511403},
publisher = {Nature Publishing Group},
title = {{Big (chemistry) data}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/23511403 http://www.nature.com/doifinder/10.1038/nchem.1604},
volume = {5},
year = {2013}
}
@misc{AirLiquide2013,
author = {{Air Liquide}},
keywords = {exergy analysis},
mendeley-tags = {exergy analysis},
title = {{Gas Encyclopedia - Air Liquide}},
url = {http://encyclopedia.airliquide.com/encyclopedia.asp?LanguageID=11},
urldate = {2015-11-11},
year = {2013}
}
@misc{Sato1986,
author = {Sato, H and Ishii, N and Hirose, K},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Sato, Ishii, Hirose - 1986 - Selective catalytic dealkylation of 1, 4-dialkylbenzenes.pdf:pdf},
keywords = {terpenes},
mendeley-tags = {terpenes},
publisher = {European Patent Office},
title = {{Selective catalytic dealkylation of 1, 4-dialkylbenzenes}},
url = {http://www.freepatentsonline.com/EP0231569.html},
year = {1986}
}
\end{filecontents}
\begin{document}

\cite{Lapkin2017} \cite{Gibb2013} \cite{AirLiquide2013} \cite{Sato1986}

\printbibliography
\end{document}

答案1

要保留没有页面的条目的 doi,您可以反过来做,只删除有页面的条目的 doi。

以同样的方式,您可以清除所有非杂项条目的 url(如果 menedeley 不会干扰使用url=false,那么更改@misc@online会是更好的方法)。

\documentclass[a4paper]{article}
\usepackage[style=numeric-comp,sorting=none,backend=biber,isbn=false,date=year]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@article{Lapkin2017,
author = {Lapkin, Alexei A. and Heer, Parminder K and Jacob, P.-M. and Hutchby, Marc and Cunningham, William and Bull, S. D. and Davidson, Matthew G},
doi = {10.1039/C7FD00073A},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Lapkin et al. - 2017 - Automation of route identification and optimisation based on data-mining and chemical intuition.pdf:pdf},
issn = {1359-6640},
journal = {Faraday Discuss.},
keywords = {chemoinformatics,network of organic chemistry,networks,shortest path,shortest path criteria},
mendeley-tags = {chemoinformatics,network of organic chemistry,networks,shortest path,shortest path criteria},
title = {{Automation of route identification and optimisation based on data-mining and chemical intuition}},
year = {2017}
}
@article{Gibb2013,
author = {Gibb, Bruce C},
doi = {10.1038/nchem.1604},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Gibb - 2013 - Big (chemistry) data.pdf:pdf},
issn = {1755-4330},
journal = {Nature Chemistry},
keywords = {network of organic chemistry},
mendeley-tags = {network of organic chemistry},
month = {mar},
number = {4},
pages = {248--249},
pmid = {23511403},
publisher = {Nature Publishing Group},
title = {{Big (chemistry) data}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/23511403 http://www.nature.com/doifinder/10.1038/nchem.1604},
volume = {5},
year = {2013}
}
@misc{AirLiquide2013,
author = {{Air Liquide}},
keywords = {exergy analysis},
mendeley-tags = {exergy analysis},
title = {{Gas Encyclopedia - Air Liquide}},
url = {http://encyclopedia.airliquide.com/encyclopedia.asp?LanguageID=11},
urldate = {2015-11-11},
year = {2013}
}
@misc{Sato1986,
author = {Sato, H and Ishii, N and Hirose, K},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Sato, Ishii, Hirose - 1986 - Selective catalytic dealkylation of 1, 4-dialkylbenzenes.pdf:pdf},
keywords = {terpenes},
mendeley-tags = {terpenes},
publisher = {European Patent Office},
title = {{Selective catalytic dealkylation of 1, 4-dialkylbenzenes}},
url = {http://www.freepatentsonline.com/EP0231569.html},
year = {1986}
}
\end{filecontents*}


\AtEveryBibitem{
    \iffieldundef{pages}{}{\clearfield{doi}}
    \ifentrytype{misc}{\iflistundef{publisher}{}{\clearfield{url}}}{\clearfield{url}}
}


\begin{document}


\cite{Lapkin2017} \cite{Gibb2013} \cite{AirLiquide2013} \cite{Sato1986}

\printbibliography
\end{document}

在此处输入图片描述


基于关键字的第二种解决方案

这假设你编辑了 Mendeley 中所有专利的关键字字段

在此处输入图片描述

\documentclass[a4paper]{article}
\usepackage[style=numeric-comp,sorting=none,backend=biber,isbn=false,date=year]{biblatex}
\addbibresource{\jobname.bib}

\usepackage{filecontents}

\begin{filecontents*}{\jobname.bib}
@article{Lapkin2017,
author = {Lapkin, Alexei A. and Heer, Parminder K and Jacob, P.-M. and Hutchby, Marc and Cunningham, William and Bull, S. D. and Davidson, Matthew G},
doi = {10.1039/C7FD00073A},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Lapkin et al. - 2017 - Automation of route identification and optimisation based on data-mining and chemical intuition.pdf:pdf},
issn = {1359-6640},
journal = {Faraday Discuss.},
keywords = {chemoinformatics,network of organic chemistry,networks,shortest path,shortest path criteria},
mendeley-tags = {chemoinformatics,network of organic chemistry,networks,shortest path,shortest path criteria},
title = {{Automation of route identification and optimisation based on data-mining and chemical intuition}},
year = {2017}
}
@article{Gibb2013,
author = {Gibb, Bruce C},
doi = {10.1038/nchem.1604},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Gibb - 2013 - Big (chemistry) data.pdf:pdf},
issn = {1755-4330},
journal = {Nature Chemistry},
keywords = {network of organic chemistry},
mendeley-tags = {network of organic chemistry},
month = {mar},
number = {4},
pages = {248--249},
pmid = {23511403},
publisher = {Nature Publishing Group},
title = {{Big (chemistry) data}},
url = {http://www.ncbi.nlm.nih.gov/pubmed/23511403 http://www.nature.com/doifinder/10.1038/nchem.1604},
volume = {5},
year = {2013}
}
@misc{AirLiquide2013,
author = {{Air Liquide}},
keywords = {exergy analysis},
mendeley-tags = {exergy analysis},
title = {{Gas Encyclopedia - Air Liquide}},
url = {http://encyclopedia.airliquide.com/encyclopedia.asp?LanguageID=11},
urldate = {2015-11-11},
year = {2013},
keywords = {website}
}
@misc{Sato1986,
author = {Sato, H and Ishii, N and Hirose, K},
file = {:D$\backslash$:/pmj27/Mendeley/Library/Sato, Ishii, Hirose - 1986 - Selective catalytic dealkylation of 1, 4-dialkylbenzenes.pdf:pdf},
keywords = {patent},
mendeley-tags = {terpenes},
publisher = {European Patent Office},
title = {{Selective catalytic dealkylation of 1, 4-dialkylbenzenes}},
url = {http://www.freepatentsonline.com/EP0231569.html},
year = {1986}
}
\end{filecontents*}


\AtEveryBibitem{
    \iffieldundef{pages}{}{\clearfield{doi}}
    \ifentrytype{misc}{\iffieldequalstr{keywords}{patent}{\clearfield{url}}{}}{\clearfield{url}}
}


\begin{document}


\cite{Lapkin2017} \cite{Gibb2013} \cite{AirLiquide2013} \cite{Sato1986}

\printbibliography
\end{document}

相关内容