1

After I included the DOI in the references the entry @article shows an [online] after the journal. I would like to remove it. Thanks in advance!

Input document

\documentclass[a4paper,12pt]{article} 
\usepackage[backref=true,backend=biber,style=bath,maxcitenames=2,
            uniquelist=false,sorting=ynt]{biblatex}    
\addbibresource{References.bib}
\usepackage{xpatch}
\xpatchbibmacro{pageref}{parens}{brackets}{}{}
%\usepackage{} etc.
\DefineBibliographyStrings{english}{%
    backrefpage  = {Back to p.}, % for single page number
    backrefpages = {Back to pp.} % for multiple page numbers
}    
\DeclareFieldFormat{doi}{%
        doi\addcolon\space
        \ifhyperref
        {\href{https://doi.org/#1}{\nolinkurl{#1}}}
        {\nolinkurl{#1}}}

\begin{document}
\autocite{ho2015planta}    
\addcontentsline{toc}{section}{References}
\section*{References}
\emergencystretch=1em
\newrefcontext[sorting=nyt]
\printbibliography[heading=none]
\end{document}

Input References

@article{ho2015planta,
title={\textit{In planta} biocontrol of soilborne Fusarium wilt of banana through a plant endophytic bacterium, \textit{Burkholderia cenocepacia} {869T2}},
author={Ho, Ying Ning and Chiang, Hsing Mei and Chao, Chih Ping and Su, Ching Chung and Hsu, Hui Fang and Guo, Chen tong and Hsieh, Ju Liang and Huang, Chieh Chen},
journal={Plant and {S}oil},
volume={387},
number={1-2},
pages={295--306},
year={2015},
doi={10.1007/s11104-014-2297-0},
publisher={Springer}

}

Output

Ho, Y.N., Chiang, H.M., Chao, C.P., Su, C.C., Hsu, H.F., Guo, C.t., Hsieh, J.L., and Huang, C.C., 2015. In planta biocontrol of soilborne fusarium wilt of banana through a plant endophytic bacterium, Burkholderia cenocepacia 869T2. Plant and Soil [Online], 387(1-2), pp.295-306. doi: 10.1007/ s11104-014-2297-0 [Back to p.1].

1
  • 1
    Welcome to TeX.SE. – Mico Sep 8 '20 at 15:01
0

The online marker in biblatex-bath is printed by the following macro from bath.bbx

\newbibmacro*{isonline}{%
  \ifboolexpr{(
      test {\iffieldundef{doi}}
      and
      test {\iffieldundef{url}}
      and
      not test {\ifentrytype{online}}
    ) or
    togl {bbx:onlineshown}
  }{}{%
    \bibstring[\mkbibbrackets]{online}%
    \toggletrue{bbx:onlineshown}}}

There are several things you could to suppress the marker in this instance. A straightforward way is to remove the test for the doi field. But you could add more complex tests

\documentclass[a4paper,12pt]{article}
\usepackage[backend=biber,
  style=bath,
  sorting=ynt,
  maxcitenames=2,
  uniquelist=false,
  backref=true,
]{biblatex}

\renewbibmacro*{isonline}{%
  \ifboolexpr{(
      test {\iffieldundef{url}}
      and
      not test {\ifentrytype{online}}
    ) or
    togl {bbx:onlineshown}
  }{}{%
    \bibstring[\mkbibbrackets]{online}%
    \toggletrue{bbx:onlineshown}}}

\usepackage{xpatch}
\xpatchbibmacro{pageref}{parens}{brackets}{}{}


\DefineBibliographyStrings{english}{
    backrefpage  = {Back to p\adddot},
    backrefpages = {Back to pp\adddot},
}

\DeclareFieldFormat{doi}{%
  doi\addcolon\space
  \ifhyperref
    {\href{https://doi.org/#1}{\nolinkurl{#1}}}
    {\nolinkurl{#1}}}

\begin{filecontents}{\jobname.bib}
@article{ho2015planta,
  title     = {\textit{In planta} Biocontrol of Soilborne {Fusarium} Wilt
               of Banana Through a Plant Endophytic Bacterium,
               \textit{Burkholderia cenocepacia} {869T2}},
  author    = {Ho, Ying Ning and Chiang, Hsing Mei and Chao, Chih Ping
               and Su, Ching Chung and Hsu, Hui Fang and Guo, Chen tong
               and Hsieh, Ju Liang and Huang, Chieh Chen},
  journal   = {Plant and {S}oil},
  volume    = {387},
  number    = {1-2},
  pages     = {295--306},
  year      = {2015},
  doi       = {10.1007/s11104-014-2297-0},
  publisher = {Springer},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\autocite{ho2015planta}
\emergencystretch=1em
\newrefcontext[sorting=nyt]
\printbibliography[heading=bibintoc]
\end{document}

Ho, Y.N., Chiang, H.M., Chao, C.P., Su, C.C., Hsu, H.F., Guo, C.t., Hsieh, J.L., and Huang, C.C., 2015. In planta biocontrol of soilborne Fusarium wilt of banana through a plant endophytic bacterium, Burkholderia cenocepacia 869T2. Plant and Soil, 387(1-2), pp.295–306. doi: 10.1007/s11104-014-2297-0 [Back to p.1].

1
  • Thank you very much! It works perfectly. Upvoted. – Jona Sep 9 '20 at 10:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.