Closed e71828 closed 11 months ago
可以想如下这般处理,你根据你的需要设置url的长度阈值,我下面的例子中是100,超过100个字符,则不要url。
比如:
% !Mode:: "TeX:UTF-8"
% 用于测试gb7714-2015样式,对于作者姓名格式的控制和选项
% 测试gbnamefmt选项
% 测试bib文件中的nameformat域
\documentclass[twoside]{article}
\usepackage{ctex}
\usepackage{xcolor}
\usepackage[colorlinks]{hyperref}
\usepackage{lipsum}
\usepackage{geometry}
\usepackage[backend=biber,style=gb7714-2015,url=true,doi=false]{biblatex}
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{%
\map[overwrite]{%若url内部长度超过100个字符则不输出
\step[fieldsource=url,match=\regexp{(.{100,})},final]%
\step[fieldset=url,null]%
\step[fieldset=urldate,null]%
}
}
}
\begin{filecontents}[force]{\jobname.bib}
@article{wu2018da,
title = {Assessing River Water Quality Using Water Quality Index in {{Lake Taihu Basin}}, {{China}}},
author = {Wu, Zhaoshi and Wang, Xiaolong and Chen, Yuwei and Cai, Yongjiu and Deng, Jiancai},
date = {2018-01},
journaltitle = {Science of The Total Environment},
shortjournal = {Science of The Total Environment},
volume = {612},
pages = {914--922},
issn = {00489697},
doi = {10.1016/j.scitotenv.2017.08.293},
urldate = {2023-07-19},
url={10.1016/j.scitotenv.2017.08.29310.1016/j.scitotenv.2017.08.29310.1016/j.scitotenv.
2017.08.29310.1016/j.scitotenv.2017.08.29310.1016/j.scitotenv.2017.08.293},
langid = {english},
extradate={1}
}
@article{wu2018d,
title = {Assessing River Water Quality Using Water Quality Index in {{Lake Taihu Basin}}, {{China}}},
author = {Wu, Zhaoshi and Wang, Xiaolong and Chen, Yuwei and Cai, Yongjiu and Deng, Jiancai},
date = {2018-01},
journaltitle = {Science of The Total Environment},
shortjournal = {Science of The Total Environment},
volume = {612},
pages = {914--922},
issn = {00489697},
doi = {10.1016/j.scitotenv.2017.08.293},
url={10.1016/j.scitotenv.2017.08.293},
urldate = {2023-07-19},
langid = {english},
extradate={1}
}
\end{filecontents}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{*}
\printbibliography
\end{document}
结果为:
\DeclareStyleSourcemap{
\maps[datatype=bibtex]{%
\map[overwrite]{%若url内部长度超过100个字符则不输出
\step[fieldsource=url,match=\regexp{(.{100,})},final]%
\step[fieldset=url,null]%
\step[fieldset=urldate,null]%
}
}
}
结题。
你好,
首先感谢这个项目,我用的时候 发现知网抓取的网址信息太长,在打印的时候占了三行。
我看了相关的问题 #67 看到了有人说不显示网址的定制化建议,我的个人想法是对于网址过于长的不显示(一般的标准应该是不超过1行半的字符吧。)