“mon =” 在 bibtex 文件中有用吗?

“mon =” 在 bibtex 文件中有用吗?

在我的一些 bibtex 条目中,我看到了该字段mon,例如,

@Book{Abrial_96,
  author = {Jean-Raymond Abrial},
  title = {The {B}-Book},
  publisher = "Cambridge University Press",
  year = 2005,
  mon = nov
}

“mon” 似乎是“month” 的缩写。是否有任何成熟的、知名的包或程序可以mon以非忽略的方式处理值?我不记得mon自己输入过(除非,假设是为了抑制打印出月份,但将信息保存在源文档内部以备将来使用,尽管我也不记得我有这样的意图)。我查看了我通常使用的某些与书目相关的程序和包的文档(bibtex、biblatex、natbib、biber、multibib),但没有找到对“mon”的任何引用。

答案1

它是可能被任何 bibtex 样式(例如下面的样式)使用的数据,它不需要不同的程序。

在此处输入图片描述

file.tex

\documentclass{article}

\begin{document}

Something about \cite{Abrial_96}.

\bibliographystyle{month}
%\bibliographystyle{plain}
\bibliography{bbook}

\end{document}

bbook.bib

@Book{Abrial_96,
  author = {Jean-Raymond Abrial},
  title = {The {B}-Book},
  publisher = "Cambridge University Press",
  year = 2005,
  mon = nov
}

month.bst

ENTRY
  { address
    author
    booktitle
    chapter
    edition
    editor
    howpublished
    institution
    journal
    key
    mon
    month
    note
    number
    organization
    pages
    publisher
    school
    series
    title
    type
    volume
    year
  }
  {}
  { label }

INTEGERS { output.state before.all mid.sentence after.sentence after.block }

FUNCTION {init.state.consts}
{ #0 'before.all :=
  #1 'mid.sentence :=
  #2 'after.sentence :=
  #3 'after.block :=
}

STRINGS { s t }
MACRO {nov} {"November"}

FUNCTION {output.nonnull}
{ 's :=
  output.state mid.sentence =
    { ", " * write$ }
    { output.state after.block =
        { add.period$ write$
          newline$
          "\newblock " write$
        }
        { output.state before.all =
            'write$
            { add.period$ " " * write$ }
          if$
        }
      if$
      mid.sentence 'output.state :=
    }
  if$
  s
}

FUNCTION {output}
{ duplicate$ empty$
    'pop$
    'output.nonnull
  if$
}

FUNCTION {output.check}
{ 't :=
  duplicate$ empty$
    { pop$ "empty " t * " in " * cite$ * warning$ }
    'output.nonnull
  if$
}

FUNCTION {output.bibitem}
{ newline$
  "\bibitem{" write$
  cite$ write$
  "}" write$
  newline$
  ""
  before.all 'output.state :=
}

FUNCTION {fin.entry}
{ add.period$
  write$
  newline$
}

FUNCTION {new.block}
{ output.state before.all =
    'skip$
    { after.block 'output.state := }
  if$
}


FUNCTION {not}
{   { #0 }
    { #1 }
  if$
}

FUNCTION {and}
{   'skip$
    { pop$ #0 }
  if$
}

FUNCTION {or}
{   { pop$ #1 }
    'skip$
  if$
}

FUNCTION {new.block.checka}
{ empty$
    'skip$
    'new.block
  if$
}

FUNCTION {new.block.checkb}
{ empty$
  swap$ empty$
  and
    'skip$
    'new.block
  if$
}



FUNCTION {field.or.null}
{ duplicate$ empty$
    { pop$ "" }
    'skip$
  if$
}

FUNCTION {emphasize}
{ duplicate$ empty$
    { pop$ "" }
    { "{\em " swap$ * "}" * }
  if$
}

INTEGERS { nameptr namesleft numnames }


FUNCTION {format.mon}
{ mon empty$
    { "" }
    { "Who cares what year or by who, this was written in " mon *}
  if$
}

FUNCTION {format.btitle}
{ title emphasize
}


FUNCTION {book}
{ output.bibitem
  format.btitle "title" output.check
  format.mon output
  new.block
  fin.entry
}


FUNCTION {begin.bib}
{ 
  "\begin{thebibliography}{99}"  write$ newline$
}

READ

EXECUTE {begin.bib}

EXECUTE {init.state.consts}

ITERATE {call.type$}

FUNCTION {end.bib}
{ newline$
  "\end{thebibliography}" write$ newline$
}

EXECUTE {end.bib}

相关内容