1

In my bibliography the last author is separated by "and" which is normal for english texts. I want to change it to "und". I guess I have to change the bibliography style. But I can't find the right position to do so. What do I have to change?

Another thing is I want to write the published year in bold. How can I achieve that?

So my document looks like that:

\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}

the part where my bibliography is (teil-nachspann):

\bibliography{literatur}
\bibliographystyle{myunsrtnat}


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

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

The bibliographystyle myunsrtnat is just unsrtnat where I changed that the first name is not shown completely, just the initials.

  • Welcome to TeX.SX! Please help us (and also you) and add a minimal working example with bibliography (MWEB), that illustrates your problem. Reproducing the problem and finding out what the issue is will be much easier when we see compilable code, starting with \documentclass and ending with \end{document}. – Bobyandbob Aug 3 '17 at 17:51
  • Just out of curiosity: Why on earth would you want to typeset the years in bold? – Mico Aug 3 '17 at 19:19
  • On your first request: Open your file myunsrtnat.bst, and do a global search and replace of the three instances of the string " and " for " und ". – Mico Aug 3 '17 at 19:20
1

With the following 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}

and the following changes in your file myunsrtnat.bst first to change year to be printed in bold add

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

and change

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

To change "and" to "und" change

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$
}

Then the result of compiling the MWE will be

resulting pdf

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.