配置参考书目样式

配置参考书目样式

在我的参考书目中,最后一位作者用“and”分隔,这在英文文本中很常见。我想将其更改为“und”。我想我必须更改参考书目样式。但我找不到合适的位置。我必须更改什么?

另外我想用粗体显示出版年份。我该如何实现?

我的文档如下所示:

\documentclass[12pt,twoside,bind,ams,a4paper]{hepthesis}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{lmodern,hfoldsty,charter}
\usepackage[square,numbers]{natbib}
\usepackage{amssymb}
\usepackage{pdfpages}
\usepackage{url}
\usepackage[squaren]{SIunits}
\usepackage[printonlyused]{acronym}
\title{-}
\author{Christian}
\usepackage{braket}

\begin{document}
\input{teil-vorspann}
\input{abkuerzungsverzeichnis}

\begin{mainmatter}
\input{kapitel-1}
\input{kapitel-2}
\end{mainmatter}

\begin{appendices}
\input{anhang}
\end{appendices}

\begin{backmatter}
\input{teil-nachspann}
\end{backmatter}

\end{document}

我的参考书目部分(teil-nachspann):

\bibliography{literatur}
\bibliographystyle{myunsrtnat}


\begin{abstract}[Selbstständigkeitserklärung]
\thispagestyle{empty}
\vspace*{2cm}

\flushright{
Rostock, (Datum)
}
\end{abstract}

myunsrtnat我刚刚改变了书目样式unsrtnat,使名字没有完全显示,只显示首字母。

答案1

使用以下 MWE

\RequirePackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{Goossens,
  author    = {Goossens, Michel and Mittelbach, Frank and 
               Samarin, Alexander},
  title     = {The LaTeX Companion},
  edition   = {1},
  publisher = {Addison-Wesley},
  location  = {Reading, Mass.},
  year      = {1994},
}
@Book{adams,
  title     = {The Restaurant at the End of the Universe},
  author    = {Douglas Adams},
  series    = {The Hitchhiker's Guide to the Galaxy},
  publisher = {Pan Macmillan},
  year      = {1980},
}
@article{feynman,
  title     = {Very High-Energy Collisions of Hadrons},
  author    = {Richard P. Feynman},
  journal   = {Phys. Rev. Lett.},
  volume    = {23},
  issue     = {24},
  pages     = {1415--1417},
  year      = {1969},
  month     = {Dec},
  doi       = {10.1103/PhysRevLett.23.1415},
  url       = {http://link.aps.org/doi/10.1103/PhysRevLett.23.1415},
  publisher = {American Physical Society},
}
\end{filecontents}


\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[numbers]{natbib}
\usepackage{hyperref}

\begin{document}

\nocite{*}
\bibliographystyle{myunsrtnat} % <======================================
\bibliography{\jobname}
\end{document}

并在文件中进行以下更改,myunsrtnat.bst首先将年份更改为粗体显示,然后添加

FUNCTION {bold}
{ duplicate$ empty$
    { pop$ "" }
    { "\textbf{" swap$ * "}" * }
  if$
}

并改变

FUNCTION {format.date}
{ year bold duplicate$ empty$
    { "empty year in " cite$ * warning$
       pop$ "" }
    'skip$
  if$
  month empty$
    'skip$
    { month
      " " * swap$ *
    }
  if$
  extra.label *
}

将“and”改为“und”

FUNCTION {format.names}
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
      nameptr #1 >
        { namesleft #1 >
            { ", " * t * }
            { numnames #2 >
                { "," * }
                'skip$
              if$
              t "others" =
                { " et~al." * }
                { " und " * t * }
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}



FUNCTION {format.full.names}
{'s :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
    { namesleft #0 > }
    { s nameptr
      "{vv~}{ll}" format.name$ 't :=
      nameptr #1 >
        {
          namesleft #1 >
            { ", " * t * }
            {
              numnames #2 >
                { "," * }
                'skip$
              if$
              t "others" =
                { " et~al." * }
                { " und " * t * }
              if$
            }
          if$
        }
        't
      if$
      nameptr #1 + 'nameptr :=
      namesleft #1 - 'namesleft :=
    }
  while$
}


FUNCTION {format.lab.names}
{ 's :=
  s #1 "{vv~}{ll}" format.name$
  s num.names$ duplicate$
  #2 >
    { pop$ " et~al." * }
    { #2 <
        'skip$
        { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
            { " et~al." * }
            { " und " * s #2 "{vv~}{ll}" format.name$ * }
          if$
        }
      if$
    }
  if$
}

然后编译 MWE 的结果将是

生成的 pdf

相关内容