natbib解决方案

natbib解决方案

我使用jf.bst书目样式和jf.sty包。我正在尝试解决与书目条目格式相关的两个问题。

1.如果标题以问号结尾,如何删除标题字段后的逗号?

例如

显示为:Bollen, Nicolas PB 和 Robert E Whaley,2004 年,《净购买压力是否影响隐含波动率的形状》功能?, 金融杂志 59,711–753。

我需要的是:Bollen, Nicolas PB 和 Robert E Whaley,2004 年,《净购买压力是否影响隐含波动率的形状》功能? 金融杂志 59,711–753。

2.如果论文是工作论文且没有出版信息,如何删除期刊和最后一个句号之间的空格。

例如

显示为:Mellow, Craig,2018 年 7 月 11 日,《中国找到了一条更缓慢、更稳定的增长道路》,巴伦周刊。

我需要的是:Mellow, Craig,2018 年 7 月 11 日,《中国找到了一条更缓慢、更稳定的增长道路》,巴伦周刊。

答案1

natbib解决方案

以下是基于这个答案。这很简单,而且可以快速为您提供所需的结果。但是,更好的解决方案是修复文件bst或移至biblatex(下方)。

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{bollen+whaley:2004,
  author = {Bollen, Nicolas PB and Whaley, Robert E},
  year = {2004},
  title = {Does Net Buying Pressure Affect the Shape of Implied Volatility Functions?\killpunct},
  journal = {Journal of Finance},
  volume = {59},
  pages = {711-753}
}
@unpublished{mellow:2018,
  author = {Mellow, Craig},
  year = {2018},
  title = {July 11, {China} Finds a Slower, Steadier Growth Path, {Barron's}.\killpunct}
}
\end{filecontents}
\usepackage{natbib}
\newcommand{\killpunct}[1]{}
\begin{document}
\nocite{*}
\bibliographystyle{jf}
\bibliography{\jobname}
\end{document}

在此处输入图片描述

biblatex解决方案

作为参考,这应该可以帮助您入门biblatex。更多代码,但更灵活。并且不涉及滥用bib文件中的字段。

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{bollen+whaley:2004,
  author = {Bollen, Nicolas PB and Whaley, Robert E},
  date = {2004},
  title = {Does Net Buying Pressure Affect the Shape of Implied Volatility Functions?},
  journaltitle = {Journal of Finance},
  volume = {59},
  pages = {711-753}
}
@unpublished{mellow:2018,
  author = {Mellow, Craig},
  date = {2018-07-11},
  title = {{China} Finds a Slower, Steadier Growth Path, {Barron's}}
}
\end{filecontents}
\usepackage[style=authoryear]{biblatex}
\addbibresource{\jobname.bib}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{title}{#1}
\DeclareFieldFormat{titlecase}{\MakeSentenceCase*{#1}}
\DeclareFieldFormat{journaltitlecase}{#1}
\DeclareFieldFormat[article,inbook,incollection,inproceedings,patent,thesis,unpublished]{volume}{\mkbibemph{#1}}
\DeclareFieldFormat{pages}{#1}
\renewcommand{\newunitpunct}{\addcomma\space}
\renewbibmacro*{in:}{}
\renewbibmacro*{date+extradate}{%
  \iffieldundef{labelyear}
    {}
    {\newunit
     \printdateextra}}
\newbibmacro*{journal}{%
  \ifboolexpr{
    test {\iffieldundef{journaltitle}}
    and
    test {\iffieldundef{journalsubtitle}}
  }
    {}
    {\printtext[journaltitle]{%
       \printfield[journaltitlecase]{journaltitle}%
       \setunit{\subtitlepunct}%
       \printfield[journaltitlecase]{journalsubtitle}}}}
\DefineBibliographyExtras{english}{%
  \protected\def\mkbibdatelong#1#2#3{%
    \iffieldundef{#1}
      {}
      {\printfield{#1}%
       \iffieldundef{#2}
         {}
         {\addcomma\space
          \mkbibmonth{\thefield{#2}}%
          \iffieldundef{#3}
            {}
            {\nobreakspace
             \stripzeros{\thefield{#3}}}}}}%
}
\pagestyle{empty}
\begin{document}
\nocite{*}
\printbibliography
\end{document}

相关内容