Coder Social home page Coder Social logo

Comments (2)

hushidong avatar hushidong commented on June 12, 2024 2

可以想如下这般处理,你根据你的需要设置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} 

结果为:
图片

from biblatex-gb7714-2015.

e71828 avatar e71828 commented on June 12, 2024
\DeclareStyleSourcemap{
    \maps[datatype=bibtex]{%
        \map[overwrite]{%若url内部长度超过100个字符则不输出
            \step[fieldsource=url,match=\regexp{(.{100,})},final]%
            \step[fieldset=url,null]%
            \step[fieldset=urldate,null]%
        }
    }
}

结题。

from biblatex-gb7714-2015.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.