从自定义 natbib .bst 输出中删除字符

从自定义 natbib .bst 输出中删除字符

晚上好,

我在尝试修改大学提供的自定义 .bst 时遇到了困难。实际输出如下所示:

Büring, Daniel. (1992). Linking. Dekomposition - Theta-Rollen - Argumentstruktur. In: Vater, Heinz; Lenerz, Jürgen (Hgg.), Kölner Linguistische Arbeiten 27, Hürth-Efferen: Gabel.
Diesing, Molly. (1990). Verb Movement and the Subject Position in Yiddish. Natural Language and Linguistic Theory 8, 1. 41–79. 
Diesing, Molly. (1997). Yiddish VP Order and the Typology of Object Movement.Natural Language and Linguistic Theory 15, 2. 369–427.
Fleischer, Jürg. (2010). Relativsätze im Deutschen und Jiddischen. In: Dammel, Antje; Kürschner, Sebastian; Nübling, Damaris (Hgg.), Kontrastive Germanistische Linguistik, Teilband 1, 145–169. Hildesheim: Olms. 
Fleischer, Jürg; Schäfer, Lea. (2012). Der Kasus nach Präposition in westjiddischen Quellen des (langen) 19. Jahrhunderts. In: Aptroot, Marion; Gal-Ed, Efrat; Gruschka, Roland et al. (Hgg.), Jiddistik heute. Yiddish Studies Today, Band 1, 415–436. Düsseldorf: d|u|p.

我想要实现的是删除作者姓名后的句点,即条目应如下所示:

Büring, Daniel (1992). Linking. Dekomposition - Theta-Rollen - Argumentstruktur. In: Vater, Heinz; Lenerz, Jürgen (Hgg.), Kölner Linguistische Arbeiten 27, Hürth-Efferen: Gabel.
Diesing, Molly (1990). Verb Movement and the Subject Position in Yiddish. Natural Language and Linguistic Theory 8, 1. 41–79. 
Diesing, Molly (1997). Yiddish VP Order and the Typology of Object Movement.Natural Language and Linguistic Theory 15, 2. 369–427.
Fleischer, Jürg (2010). Relativsätze im Deutschen und Jiddischen. In: Dammel, Antje; Kürschner, Sebastian; Nübling, Damaris (Hgg.), Kontrastive Germanistische Linguistik, Teilband 1, 145–169. Hildesheim: Olms. 
Fleischer, Jürg; Schäfer, Lea (2012). Der Kasus nach Präposition in westjiddischen Quellen des (langen) 19. Jahrhunderts. In: Aptroot, Marion; Gal-Ed, Efrat; Gruschka, Roland et al. (Hgg.), Jiddistik heute. Yiddish Studies Today, Band 1, 415–436. Düsseldorf: d|u|p.

听起来很简单,对吧?好吧,花了几天时间修改 .bst(到目前为止已经取得了一些相当不错的结果)后,我发现不可能做出所需的更改。所以,我来了。

我猜这似乎是 .bst 中的相应功能:

FUNCTION {format.names}
{ 'bibinfo :=
  duplicate$ empty$ 'skip$ { 
  's :=
  "" 't :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr
      duplicate$ #1 > 
        { "{vv~}{ll}{, ff}{, jj}" }
        { "{vv~}{ll}{, ff}{, jj}" } 
      if$
      format.name$
      bibinfo bibinfo.check
      't :=
      nameptr #1 >
        {
          namesleft #1 >
            { ", " * t * }
            {
              s nameptr "{ll}" format.name$ duplicate$ "others" =
                { 't := }
                { pop$ }
              if$
              t "others" =
                {
                  " " * bbl.etal *
                }
                {
                  "; "
                  * t *                  
                }
              if$
            }
          if$
        }
        't 
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
  } if$
}

我一点儿也不知道句号从何而来(而且我必须承认,语言并不是很直观)。这个函数

FUNCTION {bbl.etal}
{ "et~al." }

并且该功能

FUNCTION {bibinfo.check}
{ swap$
  duplicate$ missing$
    {
      pop$ pop$
      ""
    }
    { duplicate$ empty$
        {
          swap$ pop$
        }
        { swap$
          pop$
        }
      if$
    }
  if$
}

都用到了,但似乎都与该特定问题无关。输出是在此函数(或类似函数)中生成的,这似乎也不太相关。

FUNCTION {inproceedings}
{ output.bibitem
  format.authors "author" output.check
  author format.key output
  format.date "year" output.check
  date.block
  format.title "title" output.check
  new.block
  crossref missing$
    { format.in.ed.booktitle "booktitle" output.check
      format.bvolume output
      format.bpartvolume output
      format.number.series output
      add.comma
      format.addendum output
      format.pages output
      new.sentence
      publisher empty$
        { format.organization.address output }
        { organization "organization" bibinfo.check output
          format.publisher.address output
        }
      if$
    }
    { format.incoll.inproc.crossref output.nonnull
      format.pages output
    }
  if$
  format.doi output
  new.block
  format.url output
  new.block
  format.note output
  fin.entry
}

如果有人能找到解决方案那就太好了。如果你完全理解语言的话,这可能很简单。但我真的一点也不理解。

如果您需要任何进一步的信息,我很乐意提供所需的一切信息。

在此先向大家表示感谢,因为这个网站已经被证明多次有帮助。

(以防万一:完整的 .bst 可以在这里找到:自定义 .bst 正在建设中

答案1

正如您所指出的,问题的原因并不容易确定。它出现在函数中output.nonnull,该函数由 调用output.check,该函数由 调用,inproceedings在以下行中:

format.authors "author" output.check

我建议您执行以下操作:

  • 找到函数output.nonnull。(我相信它从第 69 行开始。)

  • 在此函数中,更改行

        { output.state before.all =
            'write$
            { add.period$ " " * write$ }
          if$
        }
    

        { output.state before.all =
            'write$
            { " " * write$ }
          if$
        }
    

如果应用此修改,则需要.在字段末尾pages(如果存在)为 、 等类型的条目@inproceedings添加句点(“句号”,“ ”) @inbook。我相信这种权衡是可以接受的。(更完整的解决方案,即不需要修改某些pages字段的解决方案,可能是通过运行makebst实用程序从头开始创建定制样式文件。但是,由于您正在使用的样式文件已经过广泛修改以满足您的特定需求,因此完全重新开始运行makebst实际上可能会给您带来更多工作,因为您必须(重新)应用所有以前的修改。)

完整的 MWE(文件的修改版本thesis.bst称为mythesis.bst;该filecontents包用于zzz.bib动态创建 bib 文件):

在此处输入图片描述

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{zzz.bib}
@string{ _dup = "d$\vert$u$\vert$p" }
@string{ _nllt= "Natural Language and Linguistic Theory" }
@incollection{yyy,
  author = "B{\"u}ring, Daniel",
  year   = 1992,
  title  = "Linking. Dekomposition -- Theta-Rollen -- Argumentstruktur",
  editor = "Vater, Heinz and Lenerz, J{\"u}rgen",
  booktitle = "K{\"o}lner Linguistische Arbeiten 27",
  publisher = "Gabel",
  address   = "H{\"u}rth-Efferen",
}
@article{d:1990,
  author  = "Diesing, Molly",
  year    = 1990,
  title   = "Verb Movement and the Subject Position in Yiddish",
  journal = _nllt,
  volume  = 8, 
  number  = 1,
  pages   = "41-79",
}
@article{d:1997, 
  author  = "Diesing, Molly",
  year    = 1997,
  title   = "Yiddish VP Order and the Typology of Object Movement",
  journal = _nllt,
  volume  = 15,
  number  = 2,
  pages   = "369-427",
}
@inproceedings{fl:2010,
  author  = "Fleischer, J{\"u}rg",
  year    = 2010,
  title   = "Relativs{\"a}tze im Deutschen und Jiddischen",
  editor  = "Dammel, Antje and K{\"u}rschner, Sebastian and N{\"u}bling, Damaris",
  booktitle= "Kontrastive Germanistische Linguistik",
  partvolume = 1,
  pages   = "145-169.", 
  address = "Hildesheim",
  publisher= "Olms",
} 
@incollection{uuu,
  author  = "Fleischer, J{\"u}rg and Sch{\"a}fer, Lea",
  year    = 2012,
  title   = "Der Kasus nach Pr{\"a}position in westjiddischen Quellen des (langen) 19.\ Jahrhunderts",
  editor  = "Aptroot, Marion and Gal-Ed, Efrat and Gruschka, Roland and Neuberg, Simon",
  booktitle = "Jiddistik heute. Yiddish Studies Today",
  volume    = 1,
  pages     = "415-436.",
  address   = "D{\"u}sseldorf",
  publisher = _dup,
}
\end{filecontents}

\usepackage{natbib}
\usepackage[ngerman]{babel}
\bibliographystyle{mythesis}

\begin{document}
\nocite{*}
\bibliography{zzz}
\end{document}

相关内容