一点变化

一点变化

我正在使用natbibunsrtnat.bst。我想更改FUNCTION {format.chapter.pages}FUNCTION {format.in.ed.booktitle}以获得如下结果:

非常好的书,第 5 章第 12-34 页

有什么建议么?

答案1

natbib这实际上可以通过和来完成bibtex,尽管必须花很多精力来确保大小写正确。

您必须修改unstrnat.bst,因此找到它,将其复制到 LaTeX 可以找到的位置,然后将其重命名为myunsrtnat.bst

打开myunsrtnat.bst

查找FUNCTION {format.chapter.pages}并替换为

FUNCTION {format.chapter.pages}
{ chapter empty$
    'format.pages.incoll
    { type empty$
        { "Chapter" }%<--- that is changed
        { type "l" change.case$ }
      if$
      chapter tie.or.space.connect
      pages empty$
        'skip$
        { ", " * format.pages.incoll * }%<--- changed call to format.pages.incoll
      if$
    }
  if$
}

然后将以下内容添加到文件

FUNCTION {format.pages.incoll}
{ pages empty$
    { "" }
    { pages multi.page.check
        { chapter empty$
            { "Page" }
            { "page" }
          if$
          pages n.dashify tie.or.space.connect }
        { chapter empty$
            { "Pages" }
            { "pages" }
          if$
          pages tie.or.space.connect }
      if$
    }
  if$
}

查找FUNCTION {format.in.ed.booktitle}并替换为

FUNCTION {format.in.ed.booktitle}
{ booktitle empty$
    { "" }
    { pages empty$ %<----------- this conditional is new
        { chapter empty$
            { "In " }
            { "in " }
          if$ }
        { "in " }
      if$%<--------------------- here it stops
      editor empty$
        { booktitle emphasize * }%<--- no "in" anymore
        { format.editors * ", " * booktitle emphasize * }%<--- no "in" anymore
      if$
    }
  if$
}

发现FUNCTION {inbook}它包含以下几行

format.bvolume output
format.chapter.pages "chapter and pages" output.check
new.block

将其更改为

format.chapter.pages "chapter and pages" output.check
format.bvolume output
new.block

最后,同样对于FUNCTION {incollection}; 你会发现

  format.in.ed.booktitle "booktitle" output.check
  format.bvolume output
  format.number.series output
  format.chapter.pages output
  new.sentence

将其替换为

  format.chapter.pages output
  format.in.ed.booktitle "booktitle" output.check
  format.bvolume output
  format.number.series output
  new.sentence

在您的文档中,使用\bibliographystyle{myunsrtnat}而不是\bibliographystyle{unsrtnat}

数学家协会

\documentclass{article}
\usepackage{natbib}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{testbook,
  author        = {Walter Ordsmith},
  title         = {The Work},
  subtitle      = {Subtitle},
  year          = {1983},
  publisher     = {P. Ublisher \& Co.},
  address       = {Townsville},
}
@article{testart1,
  author  = {Steven C. Ientist},
  title   = {Thrilling, Intelligent and True Limes of Erudition},
  journal = {Journal of Articles},
  volume  = {20},
  number  = {3},
  year    = {1935},
  pages   = {1--46},
}
@incollection{ordChap1,
  author     = {Walter Ordsmith},
  title      = {A Chapter},
  booktitle  = {The Second Work},
  publisher  = {Academic Press},
  year       = {1977},
  pages      = {12--34},
  chapter    = {2},
}
@incollection{ordChap2,
  author     = {Walter Ordsmith},
  title      = {A Chapter},
  booktitle  = {The Second Work},
  publisher  = {Academic Press},
  year       = {1977},
  pages      = {12--34},
}
@incollection{ordChap3,
  author     = {Walter Ordsmith},
  title      = {A Chapter},
  booktitle  = {The Second Work},
  publisher  = {Academic Press},
  year       = {1977},
}
\end{filecontents*}

\begin{document}
\nocite{*}
\bibliographystyle{myunsrtnat}
\bibliography{\jobname}
\end{document}

给出

在此处输入图片描述

相关内容