% \iffalse
% jurabib.dtx
%
% Docstrip archive, run jurabib.ins through LaTeX.
%
% Run jbgerdoc.tex through LaTeX for German documentation.
%
% Run jbendoc.tex through LaTeX for English documentation.
% 
% Copyright (C) 1999, 2000, 2001, 2002 Jens Berger
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
% as published by the Free Software Foundation; either version 2
% of the License, or (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
%
%<*driver>
\documentclass{ltxdoc}
\begin{document}\DocInput{jurabib.dtx}\end{document}
%</driver>
% \fi
% \ClassError{jurabib}{The German jurabib documentation will no longer be\MessageBreak
%               produced by LaTeX'ing the file jurabib.dtx!\MessageBreak 
%               Please use `latex jbgerdoc.tex' instead. You will\MessageBreak 
%               find this file on CTAN and on www.jurabib.org}%
% \endinput
%<*package>
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{jurabib}[2002/09/29 v0.52p Extended citations]
\RequirePackage{ifthen}
\RequirePackage{calc}
\RequirePackage{keyval}
\RequirePackage{url}
\RequirePackage{array}
\newcommand*{\jb@pkg@name}{jurabib}
\newif\ifjb@abbrv
\newif\ifjbidemabbrvwithperiod
\newif\ifjb@all@titles
\newif\ifjb@all@full
\newif\ifjb@allow@adding@of@pagerange
\newif\ifjb@allow@adding@of@pagerange@for@first@cite
\newif\ifjb@allow@dot@for@lookat
\newif\ifjb@allow@lookat@for@fullcite
\newif\ifjb@allow@howcited@art@period
\newif\ifjb@allow@hyper@cite@nobib
\newif\ifjb@allow@hyper@cite
\newif\ifjb@allow@nobib
\newif\ifjb@alphanum
\newif\ifjb@always@pageranges
\newif\ifjbaltformat
\newif\ifjb@author@year
\newif\ifjb@babel
\newif\ifjb@backref
\newif\ifjb@before@title@separator
\newif\ifjb@bib@hang
\newif\ifjb@bibetal\jb@bibetaltrue
\newif\ifjb@biblikecite
\newif\ifjb@bibssed
\newif\ifjb@change@fonts@for@fullcite
\newif\ifjb@cite
\newif\ifjb@cite@title
\newif\ifjb@cite@no@title
\newif\ifjb@coauthor@last
\newif\ifjb@compare@title@fields
\newif\ifjb@comma@before@rest
\newif\ifjb@compressed@bib
\newif\ifjb@citetoend
\newif\ifjbcross
\newif\ifjb@debug
\newif\ifjb@debug@br
\newif\ifjb@dot
\newif\ifjb@dynamic@author@fonts
\newif\ifjb@dynamic@crossrefs
\newif\ifjb@edby
\newif\ifjb@endnotes
\newif\ifjbetal
\newif\ifjb@fn
\newif\ifjb@foot
\newif\ifjb@footnote@period
\newif\ifjb@footnote@period@ibidem
\newif\ifjb@first@cite
\newif\ifjb@firstcite@full
\newif\ifjb@first@author@reversed
\newif\ifjb@formatted@pages
\newif\ifjb@fullcite@again
\newif\ifjblookforgender
\newif\ifjb@howcited
\newif\ifjb@howcited@all
\newif\ifjb@howcited@normal
\newif\ifjb@howcited@compare
\newif\ifjb@howcited@multiple
\newif\ifjb@humanbst@loaded
\newif\ifjb@hyper
\newif\ifjb@ibidem
\newif\ifjb@ibidem@pagewise
\newif\ifjb@ibidem@double@pagewise
\newif\ifjb@ibidem@with@name
\newif\ifjb@ibidem@with@short@name
\newif\ifjb@ibidem@with@name@and@title
\newif\ifjb@ibidem@with@name@and@title@auto
\newif\ifjb@same@author@different@work
\newif\ifjb@idem
\newif\ifjb@idem@pagewise
\newif\ifjb@idem@double@pagewise
\newif\ifjb@ignore@varioref
\newif\ifjb@index
\newif\ifjb@index@bib
\newif\ifjb@jura
\newif\ifjb@jureco
\newif\ifjb@kv@recognized
\newif\ifjb@lookat
\newif\ifjb@no@bib\global\jb@no@bibfalse
\newif\ifjb@no@lookat@for@bib
\newif\ifjb@no@nested@crossrefs
\newif\ifjb@no@title@replace
\newif\ifjb@no@firstname
\newif\ifjb@numbered@bib
\newif\ifjb@natbib@opt@arg@order
\newif\ifjb@noauthorforcitetitle
\newif\ifjbnoformatafterstartpage
\newif\ifjb@opcit
\newif\ifjb@@opcit
\newif\ifjb@period
\newif\ifjb@ragged
\newif\ifjb@bibformat@ibidem
\newif\ifjb@reverse@all@names
\newif\ifjb@reverse@names@in@citation
\newif\ifjb@same@fullauthor
%\newif\ifjb@same@fulltitle % ... later
\newif\ifjb@see
\newif\ifjb@second@extra@space
\newif\ifjb@suppress@dot@for@howcited
\newif\ifjb@third@extra@space
\newif\ifjb@tabular
\newif\ifjb@tested@pageranges
\newif\ifjb@save@allfull@status
\newif\ifjb@save@lookat@status
\newif\ifjb@suppress@etal@dot
\newif\ifjb@ssed@after@author
\newif\ifjb@ssed@all
\newif\ifjb@ssed@commented
\newif\ifjb@ssed@kerning@wanted
\newif\ifjb@ssed@recent@kerned
\newif\ifjb@ssed@mult@works
\newif\ifjb@ssed@sw
\newif\ifjb@starred@cite
\newif\ifjb@start@page
\newif\ifjb@switchidemofflocally
\newif\ifjb@url
\newif\ifjbuseidemhrule
\newif\ifjb@vario
\newif\ifjbweareinbib
\newif\ifjbweareinhowcited
\newif\ifjb@yearafterauthor
\newif\ifjb@yearaftertitle
\jb@allow@adding@of@pagerangetrue
\jb@allow@dot@for@lookattrue
\jb@allow@lookat@for@fullcitetrue
\jb@allow@hyper@cite@nobibtrue
\jb@allow@hyper@citetrue
\jb@bib@hangtrue
\jb@coauthor@lasttrue
\jb@second@extra@spacetrue
\jb@third@extra@spacetrue
\jbnoformatafterstartpagetrue
% default changed for 0.5e
%\jb@no@nested@crossrefstrue
% simulate natbib to avoid problems with \cite and the french packages ***
\newcommand*{\NAT@citex}{}%
% some redefinitions for babel support
\def\bbl@cite@choice{%
  \global\let\bibcite\bbl@bibcite
  \@ifpackageloaded{jurabib}{\global\let\bibcite\org@bibcite}{}%
  \global\let\bbl@cite@choice\relax
}%
\edef\jbselectlanguage{\noexpand\protect%
 \expandafter\noexpand\csname jbselectlanguage \endcsname}%
%                     important whitespace!---^
\expandafter\def\csname jbselectlanguage \endcsname#1{%
%               important whitespace!---^
 \edef\languagename{\ifnum\escapechar=\expandafter`\string#1\@empty%
 \else \string#1\@empty\fi}\select@language{\languagename}%
% analogous to the definition in switch.def from babel,
% but with this command we can avoid the lots of unwanted write's
% into the .aux file by deleting the \addtocontents commands.
}%
%
\let\jb@typeout\typeout
\let\jb@package@warning\PackageWarning
\let\jb@package@warningNoLine\PackageWarningNoLine
\def\jb@info#1{\PackageInfo{\jb@pkg@name}{#1}}%
\newcommand*{\jbsilent}{%
  \jb@info{*** Silent Mode ON ***}%
  \let\jb@package@warning\@gobbletwo
  \let\jb@package@warningNoLine\@gobbletwo
  \let\jb@typeout\@gobble%
}%
\newcommand*{\jbauthorfont}{}%
\newcommand*{\jborgauthorfont}{}%
\newcommand*{\jbcoauthorfont}{}%
\newcommand*{\jbtitlefont}{}%
\newcommand*{\jbactualauthorfont}{\textit}%
% to restore for bib in crossrefs
\newcommand*{\jbapifont}{\jbtitlefont}%
\newcommand*{\jbbtitlefont}{\normalfont}%
\newcommand*{\jbauthorfnfont}{\normalfont}%
\newcommand*{\jbactualauthorfnfont}{\textit}%
% to restore for bib in crossrefs
\newcommand*{\jbauthorfontifcoauthor}{\jborgauthorfont}%
\newcommand*{\jbignorevarioref}{\global\jb@ignore@varioreftrue}%
% default changed for 0.5e
\newcommand*{\jbdisablecitationcrossref}{\jb@no@nested@crossrefstrue}%
\newcommand*{\jbdotafterbibentry}{\jb@dottrue}%
\newcommand*{\jbdotafterendnote}{\AtBeginDocument{\def\@endanenote{\unskip.\par\endgroup}}}%
\newcommand*{\jbsseditionkerned}{\jb@ssed@kerning@wantedtrue}%
\newcommand*{\jbsuperscripteditionafterauthor}{\jb@ssed@after@authortrue}%
\newcommand*{\jbssedbd}{}\let\jbssedbd\@gobble
% SU: changed: For packages that mustn't be loaded before jurabib,
% the check \AtBeginDocument might be too late (no need to delay it
% anyway): We need to check for hyperref *before* reading \jobname.url.
\@ifpackageloaded{bibunits}{%
  \ClassError{\jb@pkg@name}{Please load `bibunits' after `jurabib'}{%
   Just put the command `\string\usepackage{bibunits}' %
   after `\string\usepackage{jurabib}',\MessageBreak
   otherwise these packages won't work together.}}{\relax}
\@ifpackageloaded{hyperref}{% NOTE: there's another check for hyperref \AtBeginDocument
  \ClassError{\jb@pkg@name}{Please load `jurabib' before `hyperref'}{%
   Just put the command `\string\usepackage{hyperref}' %
   after `\string\usepackage{jurabib}',\MessageBreak
   otherwise these packages won't work together.}}{\relax}%
\newcommand*{\jbyearaftertitle}{%
  \AtBeginDocument{%
    \global\jb@yearafterauthorfalse
    \global\jb@yearaftertitletrue
  }%
}
% CH 0.51w reworked
\newcommand*{\bibauthormultiple}{%
    \stepcounter{multiple@author}% to suppress inside bibliographic entry
    \ifthenelse{\boolean{jblookforgender}}{%
        \ifthenelse{\equal{\jb@@gender}{sm}}{%
            \bibibidfont{\bibidemSmname}%
        }{%
            \ifthenelse{\equal{\jb@@gender}{pm}}{%
                \bibibidfont{\bibidemPmname}%
            }{%
                \ifthenelse{\equal{\jb@@gender}{sf}}{%
                    \bibibidfont{\bibidemSfname}%
                }{%
                    \ifthenelse{\equal{\jb@@gender}{pf}}{%
                        \bibibidfont{\bibidemPfname}%
                    }{%
                        \ifthenelse{\equal{\jb@@gender}{sn}}{%
                            \bibibidfont{\bibidemSnname}%
                        }{%
                            \ifthenelse{\equal{\jb@@gender}{pn}}{%
                                \bibibidfont{\bibidemPnname}%
                            }{%
                                \ifthenelse{\equal{\jb@@gender}{}}{%
                                    \jb@package@warningNoLine{\jb@pkg@name}{%
                                      You are using \string\jblookforgender,\MessageBreak
                                      but gender field for `\jb@key'\MessageBreak
                                      is empty}%
                                    \bibibidfont{\bibidemSmname}%
                                }{%
                                    \jb@package@warningNoLine{\jb@pkg@name}{%
                                      You are using \string\jblookforgender,\MessageBreak
                                      but gender field for `\jb@key'\MessageBreak
                                      is not valid}%                                
                                    \bibibidfont{\bibidemSmname}%
                                }%
                            }%
                        }%
                    }%
                }%
            }%
        }%
        \bibansep{}%
    }{%
        \ifjbuseidemhrule
            \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{8pt}%
        \else
            \bibibidfont{\bibidemSmname}%
            %
            \ifthenelse{\equal{\jb@@testlast@au@or@ed}{au}%
                        \and\equal{\jb@@test@au@or@ed}{ed}%
            }{%
                \space\bibEIMfont{\editorname}%
            }{}%
            %
            \bibansep{}%
        \fi
    }%
}%
\newcommand*{\jbmultfootsep}{\textsuperscript{,\,}}%
\AtBeginDocument{%
% CHANGED 0.52j No special code for loaded footmisc, exceeded TeX capacity if `multiple' option was used.
    \@ifpackageloaded{footmisc}{}{%
        \let\jb@@footnote\footnote
        \renewcommand\footnote[2][]{\def\@tempa{#1}%
          \ifx\@tempa\@empty\jb@@footnote{#2}\else
          \jb@@footnote[#1]{#2}\fi
          \futurelet\@let@token\@next@footnote}%
        \let\jb@@footnotemark\footnotemark
        \renewcommand\footnotemark[1][]{\def\@tempa{#1}%
          \ifx\@tempa\@empty\jb@@footnotemark\else
          \jb@@footnotemark[2]\fi
          \futurelet\@let@token\@next@footnote}%
    }%
}%
\def\@next@footnote{%
% \typeout{lettoken: \meaning\@let@token}%
 \ifx\@let@token\footnote
   \jbmultfootsep%
 \else
   \ifx\@let@token\footnotemark
     \jbmultfootsep%
   \else
     \ifx\@let@token\footcite
       \jbmultfootsep%
     \else
       \ifx\@let@token\footfullcite
         \jbmultfootsep%
       \else
         \ifx\@let@token\footcitetitle
           \jbmultfootsep%
         \else
           \ifx\@let@token\footcitep
             \jbmultfootsep%
           \else
             \ifx\@let@token\footcitet
               \jbmultfootsep%
             \else
               \ifx\@let@token\footcitealp
                 \jbmultfootsep%
               \else
                 \ifx\@let@token\footcitealt
                   \jbmultfootsep%
                 \else
                   \ifx\@let@token\footciteauthor
                     \jbmultfootsep%
                   \else
                     \ifx\@let@token\footciteyear
                       \jbmultfootsep%
                     \else
                       \ifx\@let@token\footciteyearpar
                         \jbmultfootsep%
                       \else
                         \ifx\@let@token\cite
                           \ifjb@citetoend\jbmultfootsep\fi
                         \else
                           \ifx\@let@token\fullcite
                             \jbmultfootsep%
                           \else
                             \ifx\@let@token\citetitle
                               \ifjb@citetoend\jbmultfootsep\fi
                             \else
                               \ifx\@let@token\citep
                                 \ifjb@citetoend\jbmultfootsep\fi
                               \else
                                 \ifx\@let@token\citet
                                   \ifjb@citetoend\jbmultfootsep\fi
                                 \else
                                   \ifx\@let@token\citealp
                                     \ifjb@citetoend\jbmultfootsep\fi
                                   \else
                                     \ifx\@let@token\citealt
                                        \ifjb@citetoend\jbmultfootsep\fi
                                     \else
                                       \ifx\@let@token\citeauthor
                                          \ifjb@citetoend\jbmultfootsep\fi
                                       \else
                                         \ifx\@let@token\citeyear
                                            \ifjb@citetoend\jbmultfootsep\fi
                                         \else
                                           \ifx\@let@token\citeyearpar
                                             \ifjb@citetoend\jbmultfootsep\fi
                                           \fi
                                         \fi
                                       \fi
                                     \fi
                                   \fi
                                 \fi
                               \fi
                             \fi
                           \fi
                         \fi
                       \fi
                     \fi
                   \fi
                 \fi
               \fi
             \fi
           \fi
         \fi
       \fi
     \fi
   \fi
 \fi
}%
\providecommand\textitswitch[1]{\textit{#1}}%
\providecommand\Wrapquotes[1]{``#1''}%
\newcommand*{\jbdy}{}\global\let\jbdy\@gobble % !!! dummy year for .bst label generating mechanism
% NEW 0.52p no double output of year for @article type (generated shorttitle contains `journal year')
\newcommand*{\jbsy}[1]{\ifjb@author@year\else#1\fi}%
\DeclareRobustCommand{\jbissn}[1]{\unskip,\space ISSN #1}%
\DeclareRobustCommand{\jbisbn}[1]{\unskip,\space ISBN #1}%
% CH 0.51w completely reworked editor macros
\DeclareRobustCommand{\fsted}[1]{%
    \ifjbaltformat
        \ifjbweareinbib\else
            \space\bibEIMfont{#1}%
        \fi
    \else
        \space\bibEIMfont{#1}%
    \fi
}%
% 0.51x changed
\DeclareRobustCommand{\snded}[1]{%
    \ifjbaltformat
        \ifjbweareinbib
            \begingroup
                \def\bibfnfont{\textnormal}%
                #1\bibansep%
            \endgroup
        \else\fi
    \else\fi
}%
\DeclareRobustCommand{\bibedformat}[1]{%% exists only in jhuman.bst = \fsted!
    \ifjbaltformat
        \ifjbweareinbib\else
            \space\edfont{#1}%
        \fi
    \else
        \space\edfont{#1}%
    \fi
}%
\DeclareRobustCommand{\bibedinformat}[1]{\unskip\unskip\space\edfont{#1}}%
% 0.51v space added
\newcommand*{\addtoalllanguages}{}%
\newcommand*{\bibsall}{\addto\addtoalllanguages}%
\AtBeginDocument{\ifjbaltformat\else\let\snded\@gobble\fi}
\newcommand*{\jbedseplikecite}{%
  \ifjb@before@title@separator
   \AtBeginDocument{%
     \renewcommand\bibaesep{%
      \ifjb@reverse@all@names
         \bibefnfont{\jbhowsepbeforetitle}%
      \else
         \bibelnfont{\jbhowsepbeforetitle}%
      \fi
      \space%
     }%
   }%
  \fi
}%
% (btasep= between two author sep) for only two authors
\DeclareRobustCommand{\jbbtasep}{{\normalfont\slash}}
% (bfsasep= between first and second author sep)
\DeclareRobustCommand{\jbbfsasep}{{\normalfont\slash}}
% (bstasep= between second and third author sep)
\DeclareRobustCommand{\jbbstasep}{{\normalfont\slash}}
% same for ed's ...
% (btasep= between two editor sep) for only two editors
\DeclareRobustCommand{\jbbtesep}{{\normalfont\slash}}
% (bfsasep= between first and second editor sep)
\DeclareRobustCommand{\jbbfsesep}{{\normalfont\slash}}
% (bstasep= between second and third editor sep)
\DeclareRobustCommand{\jbbstesep}{{\normalfont\slash}}
\DeclareRobustCommand{\jbatsep}{,}
% NEW 0.5e after editionname sep
\DeclareRobustCommand{\jbaensep}{.}
% markup for the .bst extra.label
\DeclareRobustCommand\el[1]{#1}%
\DeclareRobustCommand\bibel[1]{}%
\newcommand*{\jbshowbibextralabel}{\renewcommand\bibel[1]{##1}}%
\newcommand*{\jblookforgender}{%
    \AtBeginDocument{%
        \ifthenelse{%
            \equal{\bbl@main@language}{german}%
            \or
            \equal{\bbl@main@language}{ngerman}%
        }{%
            \global\jblookforgendertrue
        }{%
            \jb@package@warningNoLine{\jb@pkg@name}{%
               You are not using German as main language.\MessageBreak
               Gender fields are only implemented for German\MessageBreak
               at the moment. Please contact jb@jurabib.org}%
            \global\jblookforgenderfalse
        }%
% REMOVED 0.52a
%       \global\jblookforgenderfalse        
    }%
}%
\newcommand*{\jbuseidemhrule}{%
    \global\jbuseidemhruletrue
    \global\jblookforgenderfalse
}%
\newcommand*{\jbrealcitation}[2]{\@gobble}
\newcommand*{\jbcitationyearformat}[1]{(#1)}
% NEW 0.5f separate command for bibliography year
\newcommand*{\jbbibyearformat}[1]{(#1)}
\newcommand*{\jbindexbib}{\jb@index@bibtrue}
\newcommand*{\jb@reset@look@label@for}{}%
\newcommand*{\jb@reset@opcit@label@for}{}%
\newcommand*{\jb@authorlist}{}%
\newcommand*{\jb@savelist}{}%
\newcommand*{\jb@append@to}[2]{%
  \let\jb@savelist=#1%
  \ifx\jb@savelist\@empty
    \protected@xdef#1{#2}%
  \else
    \protected@xdef#1{\jb@savelist; #2}%
  \fi
}%
\newcommand*{\jb@fornoop}{}\newcommand*{\@jb@for}{}
\newcommand*{\jb@forloop}{}\newcommand*{\jb@if@forloop}{}
\def\jb@fornoop#1\@@#2#3{}
\long\def\jb@for#1:=#2\do#3{%
  \expandafter\def\expandafter\jb@fortmp\expandafter{#2}%
  \ifx\jb@fortmp\@empty \else\expandafter\jb@forloop#2; %
  \@nil; \@nil\@@#1{#3}\fi}
\long\def\jb@forloop#1; #2; #3\@@#4#5{%
  \def#4{#1}\ifx #4\@nnil \else
  #5\def#4{#2}\ifx #4\@nnil \else#5\jb@if@forloop #3\@@#4{#5}\fi\fi}
\long\def\jb@if@forloop#1; #2\@@#3#4{%
  \def#3{#1}\ifx #3\@nnil\expandafter\jb@fornoop \else
  #4\relax\expandafter\jb@if@forloop\fi#2\@@#3{#4}}
% NEW 0.5e, better code for indexing, once again contributed by Stefan Ulrich
\newcommand*{\jbindextype}{}
\newcommand*{\jb@do@index}[1]{%
  \@ifundefined{@indexfile}{}{%
    \@bsphack\begingroup\def~{\string~}\@wrindex{#1}%
  }%
}
\newcommand*{\jb@do@index@alt}[1]{%
    \mbox{}\index[\jbindextype]{#1}%
}
\newcommand*{\jb@index@as@alias}[1]{%
    \ifjb@index
      \@ifundefined{Idx@alias#1}{}{%
         \protected@edef\@tempb{\csname Idx@alias#1\endcsname}%
         \jb@for\@tempa:=\@tempb\do{%
           \protected@edef\@tempc{\jb@index@markup{\@tempa}}%<= contributed by Stefan Ulrich
           \expandafter\jb@do@index\expandafter{\@tempc}}%
      }%
    \fi
}%
\newcommand{\jbmakeindexactual}{@}%
\newcommand{\jbauthorindexfont}{}%
\newcommand{\jb@index@markup}[1]{#1\jbmakeindexactual\jbauthorindexfont{#1}}%
\newcommand*{\jb@define@alias}[2]{%
%  \@ifundefined{@indexfile}{}{%
      \ifthenelse{\equal{#2}{}}{%
            \jb@package@warning{\jb@pkg@name}{%
               key `#1' has no author list\MessageBreak(not indexing it)}%
         \global\@namedef{Idx@alias#1}{}%
      }{%
         \@ifundefined{Idx@alias#1}{%
             \global\@namedef{Idx@alias#1}{#2}%
         }{\relax}%
      }%
%  }%
}%
\AtEndDocument{\ifjb@index\let\jb@define@alias\@gobbletwo\fi}%
% to issue warning about non-indexed keys only once
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
\newcommand*{\jb@inside@author}{}
\newcommand*{\jb@inside@editor}{}
% NEW 0.5f ibidem for multiple authors
\newcounter{ibidem@author}
\newcounter{multiple@author}% counter will be set by \bibauthormultiple
\newcommand*{\jb@last@ibidem@author}{}
% NEW 0.5f we have to define this command, otherwise we are getting error messages inside \bib*nf macros while testing if we are on same page
\def\jb@tempcntc{}%
\newcommand*{\jb@bib@gender@checked}{%
  \ifthenelse{\equal{\jb@@gender}{sm}}{%
      \ifthenelse{\boolean{jb@edby}}{%
          \@ifundefined{jb@morethanonecite}{\idemSmedbyname}{\idemsmedbyname}%
      }{%
          \@ifundefined{jb@morethanonecite}{\ifjbcross\idemSmname\else\bibidemSmname\fi}{\idemsmname}%
      }%
  }{%
      \ifthenelse{\equal{\jb@@gender}{pm}}{%
          \ifthenelse{\boolean{jb@edby}}{%
              \@ifundefined{jb@morethanonecite}{\idemPmedbyname}{\idempmedbyname}%
          }{%
              \@ifundefined{jb@morethanonecite}{\ifjbcross\idemPmname\else\bibidemPmname\fi}{\idempmname}%
          }%
      }{%
          \ifthenelse{\equal{\jb@@gender}{sf}}{%
              \ifthenelse{\boolean{jb@edby}}{%
                  \@ifundefined{jb@morethanonecite}{\idemSfedbyname}{\idemsfedbyname}%
              }{%
                  \@ifundefined{jb@morethanonecite}{\ifjbcross\idemSfname\else\bibidemSfname\fi}{\idemsfname}%
              }%
          }{%
              \ifthenelse{\equal{\jb@@gender}{pf}}{%
                  \ifthenelse{\boolean{jb@edby}}{%
                      \@ifundefined{jb@morethanonecite}{\idemPfedbyname}{\idempfedbyname}%
                  }{%
                      \@ifundefined{jb@morethanonecite}{\ifjbcross\idemPfname\else\bibidemPfname\fi}{\idempfname}%
                  }%
              }{%
                  \ifthenelse{\equal{\jb@@gender}{sn}}{%
                      \ifthenelse{\boolean{jb@edby}}{%
                          \@ifundefined{jb@morethanonecite}{\idemSnedbyname}{\idemsnedbyname}%
                      }{%
                          \@ifundefined{jb@morethanonecite}{\ifjbcross\idemSnname\else\bibidemSnname\fi}{\idemsnname}%
                      }%
                  }{%
                      \ifthenelse{\equal{\jb@@gender}{pn}}{%
                          \ifthenelse{\boolean{jb@edby}}{%
                              \@ifundefined{jb@morethanonecite}{\idemPnedbyname}{\idempnedbyname}%
                          }{%
                              \@ifundefined{jb@morethanonecite}{\ifjbcross\idemPnname\else\bibidemPnname\fi}{\idempnname}%
                          }%
                      }{%
                          \@ifundefined{jb@morethanonecite}{\ifjbcross\idemSmname\else\bibidemSmname\fi}{\idemsmname}%
                      }%
                  }%
              }%
          }%
      }%
  }%
}
% completely redefined for v0.5 (jurabib.bst replaces jurplain.bst and jurabbrv.bst)
%
%\newcommand\jbRevedFirstOnlyLast{\biblnfmt{\jbLast}}%
%\newcommand\jbRevedFirstNoVonNoJr{\biblnfmt{\jbLast, }\bibfnfmt{\jbCheckedFirst\unskip}}%
%\newcommand\jbRevedFirstNoVonJr{\biblnfmt{\jbLast, \jbJunior}\bibfnfmt{\jbCheckedFirst\unskip}}%
%\newcommand\jbRevedFirstVonNoJr{\biblnfmt{\jbLast}\bibfnfmt{\jbCheckedFirst\jbVon}}%
%\newcommand\jbRevedFirstVonJr{\biblnfmt{\jbLast, \jbJunior}\bibfnfmt{\jbCheckedFirst\jbVon}}%
%\newcommand\jbRevedNotFirstOnlyLast{\biblnfmt{\jbLast}}%
%\newcommand\jbRevedNotFirstNoVonNoJr{\bibfnfmt{\jbCheckedFirst}\biblnfmt{\jbLast}}%
%\newcommand\jbRevedNotFirstNoVonJr{\bibfnfmt{\jbCheckedFirst}\biblnfmt{\jbLast, \jbJunior}}%
%\newcommand\jbRevedNotFirstVonNoJr{\bibfnfmt{\jbCheckedFirst\jbVon~}\biblnfmt{\jbLast}}%
%\newcommand\jbRevedNotFirstVonJr{\bibfnfmt{\jbCheckedFirst\jbVon~}\biblnfmt{\jbLast, \jbJunior}}%
%\newcommand\jbNotRevedOnlyLast{\biblnfmt{\jbLast}}%
%%\newcommand\jbNotRevedNoVonNoJr{\biblnfmt{\jbLast}\bibfnfmt{\jbCheckedFirst\unskip}}%
%\newcommand\jbNotRevedNoVonNoJr{\biblnfmt{\jbLast}\bibfnfmt{\jbCheckedFirst\unskip}}%
%\newcommand\jbNotRevedNoVonJr{\biblnfmt{\jbLast, \jbJunior}\bibfnfmt{\jbCheckedFirst\unskip}}%
%\newcommand\jbNotRevedVonNoJr{\biblnfmt{\jbLast, }\bibfnfmt{\jbCheckedFirst\jbVon}}%
%\newcommand\jbNotRevedVonJr{\biblnfmt{\jbLast, \jbJunior}\bibfnfmt{\jbCheckedFirst\jbVon}}%
%\newcommand\jbIndOnlyLast{\jb@append@to\jb@authorlist{\jbLast}}%
%    \newcommand\jbnfIndOnlyLast{\jbIndOnlyLast}%
%    \newcommand\jbrnfIndOnlyLast{\jbIndOnlyLast}%
%    \newcommand\jbenfIndOnlyLast{\jbIndOnlyLast}%
%    \newcommand\jbrenfIndOnlyLast{\jbIndOnlyLast}%
%\newcommand\jbIndNoVonNoJr{\jb@append@to\jb@authorlist{\jbLast\jbCheckedFirst\unskip}}%
%    \newcommand\jbnfIndNoVonNoJr{\jbIndNoVonNoJr}%
%    \newcommand\jbrnfIndNoVonNoJr{\jbIndNoVonNoJr}%
%    \newcommand\jbenfIndNoVonNoJr{\jbIndNoVonNoJr}%
%    \newcommand\jbrenfIndNoVonNoJr{\jbIndNoVonNoJr}%
%\newcommand\jbIndNoVonJr{\jb@append@to\jb@authorlist{\jbLast, \jbJunior\jbCheckedFirst\unskip}}%
%    \newcommand\jbnfIndNoVonJr{\jbIndNoVonJr}%
%    \newcommand\jbrnfIndNoVonJr{\jbIndNoVonJr}%
%    \newcommand\jbenfIndNoVonJr{\jbIndNoVonJr}%
%    \newcommand\jbrenfIndNoVonJr{\jbIndNoVonJr}%
%\newcommand\jbIndVonNoJr{\jb@append@to\jb@authorlist{\jbLast\jbCheckedFirst\jbVon}}%
%    \newcommand\jbnfIndVonNoJr{\jbIndVonNoJr}%
%    \newcommand\jbrnfIndVonNoJr{\jbIndVonNoJr}%
%    \newcommand\jbenfIndVonNoJr{\jbIndVonNoJr}%
%    \newcommand\jbrenfIndVonNoJr{\jbIndVonNoJr}%
%\newcommand\jbIndVonJr{\jb@append@to\jb@authorlist{\jbLast, \jbJunior\jbCheckedFirst\jbVon}}%
%    \newcommand\jbnfIndVonJr{\jbIndVonJr}%
%    \newcommand\jbrnfIndVonJr{\jbIndVonJr}%
%    \newcommand\jbenfIndVonJr{\jbIndVonJr}%
%    \newcommand\jbrenfIndVonJr{\jbIndVonJr}%
% CH 0.52p new switch `\ifjb@no@firstname' introduced, allows to suppress the first name in full citations
% LATER in 0.52p: undo because of enormuous problems
\newcommand\jbCheckedFirst{\ifjb@abbrv\jbFirstAbbrv\else\jbFirst\fi}
%\newcommand\jbCheckedFirst{%
%    \ifjbweareinbib
%	\ifjb@first@author@reversed\else, \fi
%        \ifjb@abbrv\jbFirstAbbrv\else\jbFirst\fi
%	\ifjb@first@author@reversed\space\fi
%    \else 
%        \ifjb@no@firstname\else
%            \ifjb@reverse@names@in@citation\else, \fi
%            \ifjb@abbrv\jbFirstAbbrv\else\jbFirst\fi
%            \ifjb@first@author@reversed\space\else
%              \ifjb@reverse@names@in@citation\space\fi
%            \fi		
%        \fi
%    \fi
%}%
%% Reved=reversed, NotReved=not reversed, First=First author, NotFirst=Not the first author
%% NoVon=No von Part given, NoJr=No junior part given
%% Von=von Part given, Jr=junior part given
%% Ind=for indexing macros
% The old ones
  \newcommand\jbRevedFirstOnlyLast{\biblnfmt{\jbLast}}%
  \newcommand\jbRevedFirstNoVonNoJr{\biblnfmt{\jbLast, }\bibfnfmt{\jbCheckedFirst}}%
  \newcommand\jbRevedFirstNoVonJr{\biblnfmt{\jbLast, \jbJunior, }\bibfnfmt{\jbCheckedFirst}}%
  \newcommand\jbRevedFirstVonNoJr{\biblnfmt{\jbLast, }\bibfnfmt{\jbCheckedFirst\space\jbVon}}%
  \newcommand\jbRevedFirstVonJr{\biblnfmt{\jbLast, \jbJunior, }\bibfnfmt{\jbCheckedFirst\space\jbVon}}%
  %
  \newcommand\jbRevedNotFirstOnlyLast{\biblnfmt{\jbLast}}%
  \newcommand\jbRevedNotFirstNoVonNoJr{\bibfnfmt{\jbCheckedFirst\space}\biblnfmt{\jbLast}}%
  \newcommand\jbRevedNotFirstNoVonJr{\bibfnfmt{\jbCheckedFirst\space}\biblnfmt{\jbLast, \jbJunior}}%
  \newcommand\jbRevedNotFirstVonNoJr{\bibfnfmt{\jbCheckedFirst\space\jbVon~}\biblnfmt{\jbLast}}%
  \newcommand\jbRevedNotFirstVonJr{\bibfnfmt{\jbCheckedFirst\space\jbVon~}\biblnfmt{\jbLast, \jbJunior}}%
  %
  \newcommand\jbNotRevedOnlyLast{\biblnfmt{\jbLast}}%
  \newcommand\jbNotRevedNoVonNoJr{\biblnfmt{\jbLast, }\bibfnfmt{\jbCheckedFirst}}%
  \newcommand\jbNotRevedNoVonJr{\biblnfmt{\jbLast, \jbJunior, }\bibfnfmt{\jbCheckedFirst}}%
  \newcommand\jbNotRevedVonNoJr{\biblnfmt{\jbLast, }\bibfnfmt{\jbCheckedFirst\space\jbVon}}%
  \newcommand\jbNotRevedVonJr{\biblnfmt{\jbLast, \jbJunior, }\bibfnfmt{\jbCheckedFirst\space\jbVon}}%
  %
  \newcommand\jbIndOnlyLast{\jb@append@to\jb@authorlist{\jbLast}}%
      \newcommand\jbnfIndOnlyLast{\jbIndOnlyLast}%
      \newcommand\jbrnfIndOnlyLast{\jbIndOnlyLast}%    
      \newcommand\jbenfIndOnlyLast{\jbIndOnlyLast}%
      \newcommand\jbrenfIndOnlyLast{\jbIndOnlyLast}%    
  \newcommand\jbIndNoVonNoJr{\jb@append@to\jb@authorlist{\jbLast, \jbCheckedFirst}}%
      \newcommand\jbnfIndNoVonNoJr{\jbIndNoVonNoJr}%
      \newcommand\jbrnfIndNoVonNoJr{\jbIndNoVonNoJr}%
      \newcommand\jbenfIndNoVonNoJr{\jbIndNoVonNoJr}%
      \newcommand\jbrenfIndNoVonNoJr{\jbIndNoVonNoJr}%
  \newcommand\jbIndNoVonJr{\jb@append@to\jb@authorlist{\jbLast, \jbJunior, \jbCheckedFirst}}%
      \newcommand\jbnfIndNoVonJr{\jbIndNoVonJr}%
      \newcommand\jbrnfIndNoVonJr{\jbIndNoVonJr}%    
      \newcommand\jbenfIndNoVonJr{\jbIndNoVonJr}%
      \newcommand\jbrenfIndNoVonJr{\jbIndNoVonJr}%    
  \newcommand\jbIndVonNoJr{\jb@append@to\jb@authorlist{\jbLast, \jbCheckedFirst\space\jbVon}}%
      \newcommand\jbnfIndVonNoJr{\jbIndVonNoJr}%
      \newcommand\jbrnfIndVonNoJr{\jbIndVonNoJr}%
      \newcommand\jbenfIndVonNoJr{\jbIndVonNoJr}%
      \newcommand\jbrenfIndVonNoJr{\jbIndVonNoJr}%
  \newcommand\jbIndVonJr{\jb@append@to\jb@authorlist{\jbLast, \jbJunior, \jbCheckedFirst\space\jbVon}}%
      \newcommand\jbnfIndVonJr{\jbIndVonJr}%
      \newcommand\jbrnfIndVonJr{\jbIndVonJr}%    
      \newcommand\jbenfIndVonJr{\jbIndVonJr}%
      \newcommand\jbrenfIndVonJr{\jbIndVonJr}%    
%
%% #1 = last #2 = first #3 = f. #4 = von #5 = jr.
\DeclareRobustCommand{\bibnf}[5]{%
  \def\biblnfmt{\biblnfont}%
  \def\bibfnfmt{\bibfnfont}%
  \def\jbLast{#1}\def\jbFirst{#2}\def\jbFirstAbbrv{#3}\def\jbVon{#4}\def\jbJunior{#5}% NEW 0.51f
  \stepcounter{ibidem@author}\def\jb@ibidem@author{#1#2#3#4#5}%
  \ifthenelse{\equal{#2}{\@empty}}{%
%      \jb@append@to\jb@authorlist{#1}%
      \jbIndOnlyLast%
  }{%
      \ifthenelse{\equal{#4}{\@empty}}{%
%      `von' empty
          \ifthenelse{\equal{#5}{\@empty}}{%
%               `jr.' empty
%                \jb@append@to\jb@authorlist{#1, \ifjb@abbrv#3\else#2\fi}%
                \jbnfIndNoVonNoJr%
          }{%
%              `von' empty, `jr.' not empty
%                \jb@append@to\jb@authorlist{#1, #5, \ifjb@abbrv#3\else#2\fi}%
                \jbnfIndNoVonJr%
          }%
      }{%
%         `von' not empty
          \ifthenelse{\equal{#5}{\@empty}}{%
%               `von' not empty, `jr.' empty
%                \jb@append@to\jb@authorlist{#1, \ifjb@abbrv#3\else#2\fi\space#4}%
                \jbnfIndVonNoJr%
          }{%
%               `von' not empty, `jr.' not empty
%                \jb@append@to\jb@authorlist{#1, #5, \ifjb@abbrv#3\else#2\fi\space#4}%
                \jbnfIndVonJr%
          }%
      }%
  }%
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
%  temporarily removed  \def\jb@inside@editor{#1#2#3#4#5}%
%  temporarily removed  \ifthenelse{%
%  temporarily removed       \equal{\jb@inside@author}{\jb@inside@editor}%
%  temporarily removed       \and
%  temporarily removed       \boolean{jb@idem}%
%  temporarily removed       \and
%  temporarily removed       \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
%  temporarily removed              \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
%  temporarily removed       \and\boolean{jbweareinbib}%
%  temporarily removed  }{%
%  temporarily removed% NEW 0.5f we make a difference between english and other language output of idem,
%  temporarily removed% for oxford should appear an uppercase Idem after "in:", suggested by Maarten Wisse
%  temporarily removed       \ifthenelse{\equal{\bbl@main@language}{english}\and\boolean{jboxford}}{%
%  temporarily removed% NEW 0.51x new switch \jbuseidemhrule
%  temporarily removed            \ifjbuseidemhrule
%  temporarily removed                \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{3pt}%
%  temporarily removed            \else       
%  temporarily removed                \edfont{\idemname}%
%  temporarily removed            \fi
%  temporarily removed       }{%
%  temporarily removed% NEW 0.51d gender + case check for bibliography idem
%  temporarily removed% NEW 0.51x new switch \jbuseidemhrule
%  temporarily removed            \ifjbuseidemhrule
%  temporarily removed                \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{3pt}%
%  temporarily removed            \else       
%  temporarily removed                \edfont{\jb@bib@gender@checked}%
%  temporarily removed            \fi
%  temporarily removed       }%
%  temporarily removed% we are switching off et~al. output
%  temporarily removed       \jb@bibetalfalse
%  temporarily removed  }{%
      \ifthenelse{\boolean{jb@bibformat@ibidem}%
                    \and\not
                  \boolean{jbcross}%
                    \and
                  \theibidem@author=1%
                    \and
                  \themultiple@author<1%
                    \and
                  \equal{\jb@ibidem@author}{\jb@last@ibidem@author}%
                    \and
                  \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
                         \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
      }{%
            \bibauthormultiple%
      }{%
         \ifjb@first@author@reversed
           \@ifundefined{jb@first@author}{%
                \@namedef{jb@first@author}{}%
                \ifthenelse{\equal{#2}{\@empty}}{%
%                     \biblnfont{#1}%
                     \jbRevedFirstOnlyLast
                }{%
                     \ifthenelse{\equal{#4}{\@empty}}{%
%                          `von' empty
                           \ifthenelse{\equal{#5}{\@empty}}{%
%                              `jr.' empty
%                               \biblnfont{#1, }\bibfnfont{\ifjb@abbrv#3\else#2\fi}%
                               \jbRevedFirstNoVonNoJr%
                           }{%
%                              `von' empty, `jr.' not empty
%                               \biblnfont{#1, #5, }\bibfnfont{\ifjb@abbrv#3\else#2\fi}%
                               \jbRevedFirstNoVonJr%
                           }%
                     }{%
%                          `von' not empty
                           \ifthenelse{\equal{#5}{\@empty}}{%
%                             `von' not empty, `jr.' empty
%                               \biblnfont{#1, }\bibfnfont{\ifjb@abbrv#3\else#2\fi\space#4}%
                               \jbRevedFirstVonNoJr%
                           }{%
%                             `von' not empty, `jr.' not empty
%                               \biblnfont{#1, #5, }\bibfnfont{\ifjb@abbrv#3\else#2\fi\space#4}%
                               \jbRevedFirstVonJr%
                           }%
                     }%
                }%
           }{% not first author!
                \ifthenelse{\equal{#2}{\@empty}}{%
%                     \biblnfont{#1}%
                     \jbRevedNotFirstOnlyLast%
                }{%
                     \ifthenelse{\equal{#4}{\@empty}}{%
%                         `von' empty
                          \ifthenelse{\equal{#5}{\@empty}}{%
%                           `jr.' empty
%                             \bibfnfont{\ifjb@abbrv#3\else#2\fi\space}\biblnfont{#1}%
                             \jbRevedNotFirstNoVonNoJr%
                          }{%
%                            `von' empty, `jr.' not empty
%                             \bibfnfont{\ifjb@abbrv#3\else#2\fi\space}\biblnfont{#1, #5}%
                             \jbRevedNotFirstNoVonJr%
                          }%
                     }{%
%                         `von' not empty
                          \ifthenelse{\equal{#5}{\@empty}}{%
%                            `von' not empty, `jr.' empty
%                             \bibfnfont{\ifjb@abbrv#3\else#2\fi\space#4~}\biblnfont{#1}%
                             \jbRevedNotFirstVonNoJr%
                          }{%
%                            `von' not empty, `jr.' not empty
%                             \bibfnfont{\ifjb@abbrv#3\else#2\fi\space#4~}\biblnfont{#1, #5}%
                             \jbRevedNotFirstVonJr%
                          }%
                     }%
                }%
           }%
         \else
           \ifthenelse{\equal{#2}{\@empty}}{%
%                \biblnfont{#1}%
                \jbNotRevedOnlyLast
           }{%
                \ifthenelse{\equal{#4}{\@empty}}{%
%                    `von' empty
                     \ifthenelse{\equal{#5}{\@empty}}{%
%                       `jr.' empty
%                        \biblnfont{#1, }\bibfnfont{\ifjb@abbrv#3\else#2\fi}%
                        \jbNotRevedNoVonNoJr%
                     }{%
%                       `von' empty, `jr.' not empty
%                        \biblnfont{#1, #5, }\bibfnfont{\ifjb@abbrv#3\else#2\fi}%
                        \jbNotRevedNoVonJr%
                     }%
                }{%
%                    `von' not empty
                     \ifthenelse{\equal{#5}{\@empty}}{%
%                       `von' not empty, `jr.' empty
%                        \biblnfont{#1, }\bibfnfont{\ifjb@abbrv#3\else#2\fi\space#4}%
                        \jbNotRevedVonNoJr%
                     }{%
%                       `von' not empty, `jr.' not empty
%                        \biblnfont{#1, #5, }\bibfnfont{\ifjb@abbrv#3\else#2\fi\space#4}%
                        \jbNotRevedVonJr%
                     }%
                }%
           }%
         \fi
      }%
%  temporarily removed   }%
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
% here we save all five args to identify author=editor
  \gdef\jb@inside@author{#1#2#3#4#5}%
%  temporarily removed  \gdef\jb@inside@editor{#1#2#3#4#5}%
  \ifjbcross\else\gdef\jb@last@ibidem@author{#1#2#3#4#5}\fi
}%
\DeclareRobustCommand{\bibrnf}[5]{%
  \def\biblnfmt{\biblnfont}%
  \def\bibfnfmt{\bibfnfont}%
  \def\jbLast{#1}\def\jbFirst{#2}\def\jbFirstAbbrv{#3}\def\jbVon{#4}\def\jbJunior{#5}% NEW 0.51f
  \stepcounter{ibidem@author}\def\jb@ibidem@author{#1#2#3#4#5}%
  \ifthenelse{\equal{#2}{\@empty}}{%
%      \jb@append@to\jb@authorlist{#1}%
      \jbIndOnlyLast%
  }{%
       \ifthenelse{\equal{#4}{\@empty}}{%
%           `von' empty
            \ifthenelse{\equal{#5}{\@empty}}{%
%               `jr.' empty
%                \jb@append@to\jb@authorlist{#1, \ifjb@abbrv#3\else#2\fi}%
                \jbrnfIndNoVonNoJr%
            }{%
%               `von' empty, `jr.' not empty
%                \jb@append@to\jb@authorlist{#1, #5, \ifjb@abbrv#3\else#2\fi}%
                \jbrnfIndNoVonJr%
            }%
       }{%
%           `von' not empty
            \ifthenelse{\equal{#5}{\@empty}}{%
%               `von' not empty, `jr.' empty
%                \jb@append@to\jb@authorlist{#1, \ifjb@abbrv#3\else#2\fi\space#4}%
                \jbrnfIndVonNoJr%
            }{%
%               `von' not empty, `jr.' not empty
%                \jb@append@to\jb@authorlist{#1, #5, \ifjb@abbrv#3\else#2\fi\space#4}%
                \jbrnfIndVonJr%
            }%
       }%
  }%
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
%  temporarily removed  \def\jb@inside@editor{#1#2#3#4#5}%
%  temporarily removed  \ifthenelse{%
%  temporarily removed       \equal{\jb@inside@author}{\jb@inside@editor}%
%  temporarily removed       \and
%  temporarily removed       \boolean{jb@idem}%
%  temporarily removed       \and
%  temporarily removed       \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
%  temporarily removed              \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
%  temporarily removed       \and\boolean{jbweareinbib}%
%  temporarily removed  }{%
%  temporarily removed% NEW 0.5f we make a difference between english and other language output of idem,
%  temporarily removed% for oxford should appear an uppercase Idem after "in:", suggested by Maarten Wisse
%  temporarily removed       \ifthenelse{\equal{\bbl@main@language}{english}\and\boolean{jboxford}}{%
%  temporarily removed% NEW 0.51x new switch \jbuseidemhrule
%  temporarily removed            \ifjbuseidemhrule
%  temporarily removed                \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{3pt}%
%  temporarily removed            \else       
%  temporarily removed                \edfont{\idemname}%
%  temporarily removed            \fi
%  temporarily removed       }{%
%  temporarily removed% NEW 0.51d gender + case check for bibliography idem
%  temporarily removed% NEW 0.51x new switch \jbuseidemhrule
%  temporarily removed            \ifjbuseidemhrule
%  temporarily removed                \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{3pt}%
%  temporarily removed            \else       
%  temporarily removed                \edfont{\jb@bib@gender@checked}%
%  temporarily removed            \fi
%  temporarily removed       }%
%  temporarily removed% we are switching off et~al. output
%  temporarily removed       \jb@bibetalfalse
%  temporarily removed  }{%
      \ifthenelse{\boolean{jb@bibformat@ibidem}%
                    \and\not
                  \boolean{jbcross}%
                    \and
                  \theibidem@author=1%
                    \and
                  \themultiple@author<1%
                    \and
                  \equal{\jb@ibidem@author}{\jb@last@ibidem@author}%
                    \and
                  \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
                         \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
      }{%
            \bibauthormultiple%
      }{%
          \ifthenelse{\equal{#2}{\@empty}}{%
%              \biblnfont{#1}%
              \jbRevedNotFirstOnlyLast%
          }{%
              \ifthenelse{\equal{#4}{\@empty}}{%
%                 `von' empty
                  \ifthenelse{\equal{#5}{\@empty}}{%
%                      `jr.' empty
%                       \bibfnfont{\ifjb@abbrv#3\else#2\fi\space}\biblnfont{#1}%
                       \jbRevedNotFirstNoVonNoJr%
                  }{%
%                      `von' empty, `jr.' not empty
%                       \bibfnfont{\ifjb@abbrv#3\else#2\fi\space}\biblnfont{#1, #5}%
                       \jbRevedNotFirstNoVonJr%                       
                  }%
              }{%
%                 `von' not empty
                  \ifthenelse{\equal{#5}{\@empty}}{%
%                      `von' not empty, `jr.' empty
%                       \bibfnfont{\ifjb@abbrv#3\else#2\fi\space#4~}\biblnfont{#1}%
                       \jbRevedNotFirstVonNoJr%                       
                  }{%
%                      `von' not empty, `jr.' not empty
%                       \bibfnfont{\ifjb@abbrv#3\else#2\fi\space#4~}\biblnfont{#1, #5}%
                       \jbRevedNotFirstVonJr%
                  }%
              }%
          }%
      }%
%  temporarily removed  }%
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
% here we save all five args to identify author=editor
  \gdef\jb@inside@author{#1#2#3#4#5}%
%  temporarily removed  \gdef\jb@inside@editor{#1#2#3#4#5}%
  \ifjbcross\else\gdef\jb@last@ibidem@author{#1#2#3#4#5}\fi
}%
\DeclareRobustCommand{\bibenf}[5]{%
  \def\biblnfmt{\bibelnfont}%
  \def\bibfnfmt{\bibefnfont}%
  \def\jbLast{#1}\def\jbFirst{#2}\def\jbFirstAbbrv{#3}\def\jbVon{#4}\def\jbJunior{#5}% NEW 0.51f
  \stepcounter{ibidem@author}\def\jb@ibidem@author{#1#2#3#4#5}%
  \ifthenelse{\equal{#2}{\@empty}}{%
%      \jb@append@to\jb@authorlist{#1}%
      \jbIndOnlyLast%
  }{%
      \ifthenelse{\equal{#4}{\@empty}}{%
%          `von' empty
           \ifthenelse{\equal{#5}{\@empty}}{%
%               `jr.' empty
%                \jb@append@to\jb@authorlist{#1, \ifjb@abbrv#3\else#2\fi}%
                \jbenfIndNoVonNoJr%
           }{%
%               `von' empty, `jr.' not empty
%                \jb@append@to\jb@authorlist{#1, #5, \ifjb@abbrv#3\else#2\fi}%
                \jbenfIndNoVonJr%
           }%
      }{%
%          `von' not empty
           \ifthenelse{\equal{#5}{\@empty}}{%
%               `von' not empty, `jr.' empty
%                \jb@append@to\jb@authorlist{#1, \ifjb@abbrv#3\else#2\fi\space#4}%
                \jbenfIndVonNoJr%
           }{%
%               `von' not empty, `jr.' not empty
%                \jb@append@to\jb@authorlist{#1, #5, \ifjb@abbrv#3\else#2\fi\space#4}%
                \jbenfIndVonJr%
           }%
      }%
  }%
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
  \def\jb@inside@editor{#1#2#3#4#5}%
  \ifthenelse{%
       \equal{\jb@inside@author}{\jb@inside@editor}%
       \and
       \boolean{jb@idem}%
%  temporarily removed       \and
%  temporarily removed       \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
%  temporarily removed              \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
%       \and\boolean{jbweareinbib}% NO !!!!!!!!!!!!
  }{%
% NEW 0.5f we make a difference between english and other language output of idem,
% for oxford should appear an uppercase Idem after "in:", suggested by Maarten Wisse
       \ifthenelse{\equal{\bbl@main@language}{english}\and\boolean{jboxford}}{%
% NEW 0.51x new switch \jbuseidemhrule
            \ifjbuseidemhrule
                \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{3pt}%
            \else       
                \edfont{\idemname}%
            \fi
       }{%
% NEW 0.51d gender + case check for bibliography idem
% NEW 0.51x new switch \jbuseidemhrule
            \ifjbuseidemhrule
                \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{3pt}%
            \else       
                \edfont{\jb@bib@gender@checked}%
            \fi
       }%
% we are switching off et~al. output
       \jb@bibetalfalse
 }{%
   \ifthenelse{\boolean{jb@bibformat@ibidem}%
                 \and\not
               \boolean{jbcross}%
                 \and
               \theibidem@author=1%
                 \and
               \themultiple@author<1%
                 \and
               \equal{\jb@ibidem@author}{\jb@last@ibidem@author}%
                 \and
               \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
                      \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
   }{%
         \bibauthormultiple%
   }{%
        \ifjb@first@author@reversed
             \@ifundefined{jb@first@editor}{%
                 \@namedef{jb@first@editor}{}%
                 \ifthenelse{\equal{#2}{\@empty}}{%
%                      \bibelnfont{#1}%
                      \jbRevedFirstOnlyLast%
                 }{%
                      \ifthenelse{\equal{#4}{\@empty}}{%
%                           `von' empty
                            \ifthenelse{\equal{#5}{\@empty}}{%
%                                `jr.' empty
%                                 \bibelnfont{#1, }\bibefnfont{\ifjb@abbrv#3\else#2\fi}%
                                 \jbRevedFirstNoVonNoJr%
                            }{%
%                                `von' empty, `jr.' not empty
%                                 \bibelnfont{#1, #5, }\bibefnfont{\ifjb@abbrv#3\else#2\fi}%
                                 \jbRevedFirstNoVonJr%
                            }%
                      }{%
%                           `von' not empty
                            \ifthenelse{\equal{#5}{\@empty}}{%
%                                `von' not empty, `jr.' empty
%                                 \bibelnfont{#1, }\bibefnfont{\ifjb@abbrv#3\else#2\fi\space#4}%
                                 \jbRevedFirstVonNoJr%                                 
                            }{%
%                                `von' not empty, `jr.' not empty
%                                 \bibelnfont{#1, #5, }\bibefnfont{\ifjb@abbrv#3\else#2\fi\space#4}%
                                 \jbRevedFirstVonJr%                                 
                            }%
                      }%
                 }%
             }{% not first author!
                 \ifthenelse{\equal{#2}{\@empty}}{%
%                      \bibelnfont{#1}%
                      \jbRevedNotFirstOnlyLast%
                 }{%
                      \ifthenelse{\equal{#4}{\@empty}}{%
%                          `von' empty
                           \ifthenelse{\equal{#5}{\@empty}}{%
%                               `jr.' empty
%                                \bibefnfont{\ifjb@abbrv#3\else#2\fi\space}\bibelnfont{#1}%
                                \jbRevedNotFirstNoVonNoJr%
                           }{%
%                               `von' empty, `jr.' not empty
%                                \bibefnfont{\ifjb@abbrv#3\else#2\fi\space}\bibelnfont{#1, #5}%
                                \jbRevedNotFirstNoVonJr%
                           }%
                      }{%
%                          `von' not empty
                           \ifthenelse{\equal{#5}{\@empty}}{%
%                               `von' not empty, `jr.' empty
%                                \bibefnfont{\ifjb@abbrv#3\else#2\fi\space#4~}\bibelnfont{#1}%
                                \jbRevedNotFirstVonNoJr%
                           }{%
%                               `von' not empty, `jr.' not empty
%                                \bibefnfont{\ifjb@abbrv#3\else#2\fi\space#4~}\bibelnfont{#1, #5}%
                                \jbRevedNotFirstVonJr%
                           }%
                      }%
                 }%
             }%
        \else
             \ifthenelse{\equal{#2}{\@empty}}{%
%                  \bibelnfont{#1}%
                  \jbNotRevedOnlyLast%
             }{%
                  \ifthenelse{\equal{#4}{\@empty}}{%
%                      `von' empty
                       \ifthenelse{\equal{#5}{\@empty}}{%
%                           `jr.' empty
%                            \bibelnfont{#1, }\bibefnfont{\ifjb@abbrv#3\else#2\fi}%
                            \jbNotRevedNoVonNoJr%
                       }{%
%                           `von' empty, `jr.' not empty
%                            \bibelnfont{#1, #5, }\bibefnfont{\ifjb@abbrv#3\else#2\fi}%
                            \jbNotRevedNoVonJr%
                       }%
                  }{%
%                      `von' not empty
                       \ifthenelse{\equal{#5}{\@empty}}{%
%                           `von' not empty, `jr.' empty
%                            \bibelnfont{#1, }\bibefnfont{\ifjb@abbrv#3\else#2\fi\space#4}%
                            \jbNotRevedVonNoJr%
                       }{%
%                           `von' not empty, `jr.' not empty
%                            \bibelnfont{#1, #5, }\bibefnfont{\ifjb@abbrv#3\else#2\fi\space#4}%
                            \jbNotRevedVonJr%
                       }%
                  }%
             }%
        \fi
     }%
  }%
% NEW 0.5f make \jb@inside@author empty, otherwise for more than
%          one and different editors we will get:
%          `author: [...] editor1, editor2 and idem, editors:'
%                                              ^^^^!
%  \def\jb@inside@author{}%
  \gdef\jb@inside@author{#1#2#3#4#5}%
  \gdef\jb@inside@editor{#1#2#3#4#5}%
  \ifjbcross\else\gdef\jb@last@ibidem@author{#1#2#3#4#5}\fi
}%
\DeclareRobustCommand{\bibrenf}[5]{%
  \def\biblnfmt{\bibelnfont}%
  \def\bibfnfmt{\bibefnfont}%
  \def\jbLast{#1}\def\jbFirst{#2}\def\jbFirstAbbrv{#3}\def\jbVon{#4}\def\jbJunior{#5}% NEW 0.51f
  \stepcounter{ibidem@author}\def\jb@ibidem@author{#1#2#3#4#5}%
  \ifthenelse{\equal{#2}{\@empty}}{%
%      \jb@append@to\jb@authorlist{#1}%
      \jbIndOnlyLast%
  }{%
       \ifthenelse{\equal{#4}{\@empty}}{%
%           `von' empty
            \ifthenelse{\equal{#5}{\@empty}}{%
%                `jr.' empty
%                \jb@append@to\jb@authorlist{#1, \ifjb@abbrv#3\else#2\fi}%
                \jbrenfIndNoVonNoJr%
            }{%
%                `von' empty, `jr.' not empty
%                \jb@append@to\jb@authorlist{#1, #5, \ifjb@abbrv#3\else#2\fi}%
                \jbrenfIndNoVonJr%
            }%
       }{%
%           `von' not empty
            \ifthenelse{\equal{#5}{\@empty}}{%
%                `von' not empty, `jr.' empty
%                \jb@append@to\jb@authorlist{#1, \ifjb@abbrv#3\else#2\fi\space#4}%
                \jbrenfIndVonNoJr%
            }{%
%                `von' not empty, `jr.' not empty
%                \jb@append@to\jb@authorlist{#1, #5, \ifjb@abbrv#3\else#2\fi\space#4}%
                \jbrenfIndVonJr%
            }%
       }%
  }%
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
  \def\jb@inside@editor{#1#2#3#4#5}%
  \ifthenelse{%
       \equal{\jb@inside@author}{\jb@inside@editor}%
       \and
       \boolean{jb@idem}%
%  temporarily removed       \and
%  temporarily removed       \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
%  temporarily removed              \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
%       \and\boolean{jbweareinbib}% NO !!!!!!!!!!!!
  }{%
% NEW 0.5f we make a difference between english and other language output of idem,
% for oxford should appear an uppercase Idem after "in:", suggested by Maarten Wisse
       \ifthenelse{\equal{\bbl@main@language}{english}\and\boolean{jboxford}}{%
% NEW 0.51x new switch \jbuseidemhrule
            \ifjbuseidemhrule
                \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{3pt}%
            \else       
                \edfont{\idemname}%
            \fi
       }{%
% NEW 0.51d gender + case check for bibliography idem
% NEW 0.51x new switch \jbuseidemhrule
            \ifjbuseidemhrule
                \leavevmode\vrule height 2pt depth -1.6pt width 21pt\hspace{3pt}%
            \else       
                \edfont{\jb@bib@gender@checked}%
            \fi
       }%
% we are switching off et~al. output
       \jb@bibetalfalse
  }{%
      \ifthenelse{\boolean{jb@bibformat@ibidem}%
                    \and\not
                  \boolean{jbcross}%
                    \and
                  \theibidem@author=1%
                    \and
                  \themultiple@author<1%
                    \and
                  \equal{\jb@ibidem@author}{\jb@last@ibidem@author}%
                    \and
                  \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
                         \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
      }{%
            \bibauthormultiple%
      }{%
           \ifthenelse{\equal{#2}{\@empty}}{%
%                \bibelnfont{#1}%
                \jbRevedNotFirstOnlyLast
           }{%
                \ifthenelse{\equal{#4}{\@empty}}{%
%                    `von' empty
                     \ifthenelse{\equal{#5}{\@empty}}{%
%                         `jr.' empty
%                          \bibefnfont{\ifjb@abbrv#3\else#2\fi\space}\bibelnfont{#1}%
                          \jbRevedNotFirstNoVonNoJr%
                     }{%
%                         `von' empty, `jr.' not empty
%                          \bibefnfont{\ifjb@abbrv#3\else#2\fi\space}\bibelnfont{#1, #5}%
                          \jbRevedNotFirstNoVonJr%
                     }%
                }{%
%                    `von' not empty
                     \ifthenelse{\equal{#5}{\@empty}}{%
%                         `von' not empty, `jr.' empty
%                          \bibefnfont{\ifjb@abbrv#3\else#2\fi\space#4~}\bibelnfont{#1}%
                          \jbRevedNotFirstVonNoJr%
                     }{%
%                         `von' not empty, `jr.' not empty
%                          \bibefnfont{\ifjb@abbrv#3\else#2\fi\space#4~}\bibelnfont{#1, #5}%
                          \jbRevedNotFirstVonJr%
                     }%
                }%
           }%
      }%
  }%
% NEW 0.5f make \jb@inside@author empty, otherwise for more than
%          one and different editors we will get:
%          `author: [...] editor1, editor2 and idem, editors:'
%                                              ^^^^!
%  \def\jb@inside@author{}%
  \gdef\jb@inside@author{#1#2#3#4#5}%
  \gdef\jb@inside@editor{#1#2#3#4#5}%
  \ifjbcross\else\gdef\jb@last@ibidem@author{#1#2#3#4#5}\fi
}%
% NEW 0.5f
% lenf = lonely editor name format: font for editor(s), if no author is given.
% rlenf = reversed lonely editor name format: font for editor(s), if no author is given.
\DeclareRobustCommand{\biblenf}[5]{\bibenf{#1}{#2}{#3}{#4}{#5}}
\DeclareRobustCommand{\bibrlenf}[5]{\bibrenf{#1}{#2}{#3}{#4}{#5}}
\newcommand*{\jblinebreak}{\linebreak[4]}%
\newcommand*{\jb@check@language@start}{%
 \ifjb@debug\ifjb@babel
  \iflanguage{german}{\textcolor{red}{[}}{%
   \iflanguage{english}{\textcolor{blue}{[}}{%
    \iflanguage{dutch}{\textcolor{green}{[}}{%
     \iflanguage{french}{\textcolor{yellow}{[}}{}}}}%
 \fi\fi
}%
\newcommand*{\jb@check@language@end}{%
 \ifjb@debug\ifjb@babel
  \iflanguage{german}{\textcolor{red}{]\textsuperscript{\tiny de}}}{%
   \iflanguage{english}{\textcolor{blue}{]\textsuperscript{\tiny en}}}{%
    \iflanguage{dutch}{\textcolor{green}{]\textsuperscript{\tiny du}}}{%
     \iflanguage{french}{\textcolor{yellow}{]\textsuperscript{\tiny fr}}}{}}}}%
 \fi\fi
}%
\DeclareRobustCommand{\biblnfont}{\textbf}%
\DeclareRobustCommand{\bibfnfont}{\textbf}%
\DeclareRobustCommand{\bibelnfont}{\textbf}%
\DeclareRobustCommand{\bibefnfont}{\textbf}%
\DeclareRobustCommand{\bibtfont}{}%
\DeclareRobustCommand{\bibbtfont}{}%
\DeclareRobustCommand{\bibjtfont}{}%
\DeclareRobustCommand{\bibapifont}{}%
% ibid font for `derselbe', `dieselbe' ....
\DeclareRobustCommand{\bibibidfont}{\biblnfont}%
% intermediate font for `and' and `,'
% CHANGED 0.5f make a difference between bibliography and text
% CH 0.51t \bibfnfont instead of \biblnfont
\newcommand{\bibimfont}{\bibfnfont}%
\newcommand{\jbimfont}{\textnormal}%
% CH 0.51t \bibefnfont instead of \bibelnfont
\newcommand{\bibeimfont}{\bibefnfont}%
\newcommand{\jbeimfont}{\textnormal}%
\DeclareRobustCommand{\bibIMfont}[1]{%
    \ifjbweareinbib
        \ifjbweareinhowcited
           \jbimfont{#1}%
        \else
           \bibimfont{#1}%
        \fi
    \else
        \jbimfont{#1}%
    \fi
}%
\DeclareRobustCommand{\bibEIMfont}[1]{%
    \ifjbweareinbib
        \ifjbweareinhowcited
           \jbeimfont{#1}%
        \else
           \bibeimfont{#1}%
        \fi
    \else
        \jbeimfont{#1}%
    \fi
}%
\DeclareRobustCommand{\edfont}[1]{%
    \ifjbweareinbib
        \ifjbweareinhowcited
           \jbeimfont{#1}%
        \else
           \bibeimfont{#1}%
        \fi
    \else
        \jbeimfont{#1}%
    \fi
}%
%\DeclareRobustCommand{\bibIMfont}[1]{%
%  \ifthenelse{\equal{\biblnfont}{\textsc}}{%
%   \textnormal{#1}}{\biblnfont{#1}}%
%}%
%\DeclareRobustCommand{\edfont}[1]{%
%  \ifthenelse{\equal{\bibelnfont}{\textsc}}{%
%   \textnormal{#1}}{\bibelnfont{#1}}%
%}%
\DeclareRobustCommand{\bibbtasep}{{\normalfont\slash}}%
\DeclareRobustCommand{\bibbfsasep}{{\normalfont\slash}}%
\DeclareRobustCommand{\bibbstasep}{{\normalfont\slash}}%
\DeclareRobustCommand{\Bibbtasep}{\bibbtasep\ifjb@tabular\jblinebreak\fi}%
\DeclareRobustCommand{\Bibbfsasep}{\bibbfsasep\ifjb@tabular\jblinebreak\fi}%
\DeclareRobustCommand{\Bibbstasep}{\bibbstasep\ifjb@tabular\jblinebreak\fi}%
%
\DeclareRobustCommand{\bibbtesep}{{\normalfont\slash}}%
\DeclareRobustCommand{\bibbfsesep}{{\normalfont\slash}}%
\DeclareRobustCommand{\bibbstesep}{{\normalfont\slash}}%
\DeclareRobustCommand{\Bibbtesep}{\bibbtesep\ifjb@tabular\jblinebreak\fi}%
\DeclareRobustCommand{\Bibbfsesep}{\bibbfsesep\ifjb@tabular\jblinebreak\fi}%
\DeclareRobustCommand{\Bibbstesep}{\bibbstesep\ifjb@tabular\jblinebreak\fi}%
%
\DeclareRobustCommand{\bibansep}{\bibfnfont{: }}%
\DeclareRobustCommand{\bibaesep}{\bibefnfont{: }}%
\DeclareRobustCommand{\bothaesep}{\ifjbweareinbib\bibaesep\else\jbhowsepbeforetitleae\fi}%
\DeclareRobustCommand{\bibatsep}{}\renewcommand*{\bibatsep}{.}%
\DeclareRobustCommand{\bibbdsep}{,}%
\DeclareRobustCommand{\bibBTsep}{\def\jb@first@editor{}\bibbtsep}%
\DeclareRobustCommand{\bibJTsep}{\def\jb@first@editor{}\bibjtsep}%
%                                ^^^^^^^^^^^^^^^^^^^^^^
% added in 0.5e, suggested by Joachim Trinkwitz (jtr@uni-bonn.de),
% no reversed editors for authorformat=firstnotreversed, makes no sense, but if one want to have it: See definition of \jbbibargs too.
%                            \DeclareRobustCommand{\bibBTsep}{\bibbtsep}%
%                            \DeclareRobustCommand{\bibJTsep}{\bibjtsep}%
% NEW 0.5f changed \jb@first@author to \jb@first@editor to make it easier to allow this feature.
% NEW 0.5e \bibbtsep default now `in: '
% CH 0.52o \bibbtsep default now `\inname ' in order to make it language dependent
\DeclareRobustCommand{\bibbtsep}{\inname{} }%
\DeclareRobustCommand{\bibjtsep}{}%
\DeclareRobustCommand{\bibaldelim}{}%
\DeclareRobustCommand{\bibardelim}{}%
\DeclareRobustCommand{\bibpldelim}{[}%
\DeclareRobustCommand{\bibprdelim}{]}%
\DeclareRobustCommand{\bibapyldelim}{}%
\DeclareRobustCommand{\bibapyrdelim}{}%
\DeclareRobustCommand{\dateldelim}{}%
\DeclareRobustCommand{\daterdelim}{}%
\DeclareRobustCommand{\bpubaddr}{:}% between publisher and address
\DeclareRobustCommand{\apyformat}[1]{%
  \ifjb@bibssed
    \let\jbedition\@gobble%
    \unskip\unskip\space%
    \bibapyldelim{}\ifthenelse{\equal{\jb@@edition}{\@empty}}{}{%
    \textsuperscript{\jb@@edition}}#1\bibapyrdelim{}%
  \else
      \bibapyldelim{}#1\bibapyrdelim{}%
  \fi
}%
\DeclareRobustCommand{\ajtsep}{}
% URL stuff
\DeclareRobustCommand{\jblangle}{\raisebox{.15ex}{$\langle$}}
\DeclareRobustCommand{\jbrangle}{\raisebox{.15ex}{$\rangle$}}
\DeclareRobustCommand{\biburlprefix}{\jblangle{}URL: }
\DeclareRobustCommand{\biburlsuffix}{\jbrangle{}}
%\DeclareRobustCommand{\biburl}[1]{\biburlprefix\biburlfont{#1}\biburlsuffix}
%\DeclareRobustCommand{\biburlfont}{\texttt}
% NEW 0.5f changed interface to format url
\DeclareRobustCommand{\biburlfont}[1]{\urlstyle{#1}}%
\DeclareRobustCommand{\urldatecomment}{}
% NEW 0.51x
\DeclareRobustCommand{\bibbudcsep}{~--\space}
%
\DeclareRobustCommand{\bibcommenthowcited}{}
\DeclareRobustCommand{\bibartperiodhowcited}{}
\DeclareRobustCommand{\bibnotcited}{}
\DeclareRobustCommand{\bibhowcited}{}
\DeclareRobustCommand{\howcitedprefix}{}
\DeclareRobustCommand{\howcitedsuffix}{}
\DeclareRobustCommand{\bibvolumecomment}{}
\DeclareRobustCommand{\volumeofname}{}
\DeclareRobustCommand{\alsothesisname}{}
% crossref editor sep.
\DeclareRobustCommand{\bibces}{: }
\DeclareRobustCommand{\bibcrossrefcite}{}
\DeclareRobustCommand{\bibcrossrefciteagain}{}
\DeclareRobustCommand{\bibincollcrossrefcite}{}
\DeclareRobustCommand{\bibincollcrossrefciteagain}{}
% series number font
\DeclareRobustCommand{\bibsnfont}{}%
% NEW 0.5f volumetitle font
\DeclareRobustCommand{\bibvtfont}{\textit}%
% `original' stuff
\DeclareRobustCommand{\osep}{%
    \ifjbweareinbib
        \ifjboxford;\else.\fi % Maarten wishes semi-colon
    \else
        \ifjboxford
            ;% Maarten wishes semi-colon
        \else
            \ifjbchicago
                ;%
            \else
                .%
            \fi
        \fi
    \fi
}%
\DeclareRobustCommand{\reprintname}{\ifjbweareinbib\Reprint\else\reprint\fi}%
\newcommand*{\jbedafti}[1]{}%
\newcommand*{\jbtiafed}[1]{#1}%
\newcommand*{\jbbookedaftertitle}{%
    \renewcommand\jbedafti[1]{##1}%
    \renewcommand\jbtiafed[1]{}}
\providecommand{\J@LongToc}{}
\providecommand{\addto}{\g@addto@macro}
\def\jb@add@to#1#2{\addto{#1}{#2}#2}% <=== ?????
%\def\jb@add@to#1#2{\addto{#1}{#2}}%
% macro for changing macros inside \bibs<language>, thanks to Bernard Gaulle
\def\AddTo#1#2{\AtBeginDocument{\jb@add@to#1{#2}}}%
% macros for adding definitions via \addto
\newcommand*{\jbonlyforcitations}{}
\newcommand*{\jbonlyforbib}{}
\newcommand*{\jbonlyforfirstcitefullbegin}{}
\newcommand*{\jbonlyforfirstcitefullend}{}
% NO starred '\[re]newcommand*' for the annote commands !!!!!!!!!!!! Causes problems when using \par inside annote
\newcommand{\bibAnnote}[1]{}
\newcommand{\bibAnnoteFile}[1]{}
\newcommand{\bibAnnotePath}[1]{\def\jb@ann@input@path{#1}}
\ifx\jb@ann@input@path\@undefined\let\jb@ann@input@path\input@path\fi
% 0.51t \par inserted, suggested by Robert Schlicht
\newcommand{\jbannoteformat}[1]{{\small#1\par}}% Grouping is important!
% NEW 0.5f, english is default, if babel is not loaded
\providecommand{\bbl@main@language}{english}%
\newif\ifjbhum
\newif\ifjboxford
\newif\ifjbchicago
% NEW 0.52e
\newcommand*{\aftervolsep}{,}%
% NEW 0.52e ------------------------------------------vvvvvvvvvvvv
\DeclareRobustCommand{\volumeformat}[1]{\Volumename~#1\aftervolsep}%
\DeclareRobustCommand{\artvolumeformat}[1]{#1}%
\DeclareRobustCommand{\pervolumeformat}[1]{#1}%
\DeclareRobustCommand{\artnumberformat}[1]{\unskip,\space Nr.~#1}%
\DeclareRobustCommand{\pernumberformat}[1]{\unskip\space Nr.~#1}%
\DeclareRobustCommand{\artyearformat}[1]{\bibaldelim#1\bibardelim}%
\DeclareRobustCommand{\peryearformat}[1]{\bibpldelim#1\bibprdelim}%
% NEW 0.5f combined command for jox.bst
\DeclareRobustCommand{\artvolnumformat}[2]{%
    \ifthenelse{\equal{#1}{}}{%
        #2%
    }{%
        \ifthenelse{\equal{#2}{}}{%
           #1%
        }{%
            \artvolumeformat{#1}\artnumberformat{#2}%
        }%
    }%
}%
% NEW 0.5f
\DeclareRobustCommand{\translator}[3]{%
% NEW 0.52e
   \unskip\unskip\space%
   \ifthenelse{\equal{#1}{}}{% translator missing
        \ifjboxford\transfrom\else\Transfrom\fi\jbflanguage{#2}%
   }{% translator given
        \ifthenelse{\equal{\bbl@main@language}{german}}{% main language german
            \ifthenelse{\equal{#2}{}}{% language missing
                {\"U}bers. \transby{} #1%
            }{% language given
                \ifjboxford\transfrom\else\Transfrom\fi\jbflanguage{#2} ^^fcbers. \transby{} #1%
            }%
        }{%
            \ifthenelse{\equal{#2}{}}{% language missing
                \trans{} \transby{} #1%
            }{% language given
                \trans{} \transfrom{}\jbflanguage{#2} \transby{} #1%
%                                    ^ space removed for empty \transfrom macro for french                 
            }%
        }%
   }% dot or not?
   \ifjbchicago
      \ifthenelse{\equal{#3}{1}}{% \(type=incollection \and editor given\) \or type=article
        \bibatsep{}%
      }{}%
   \else
      \ifthenelse{\equal{#3}{1}\and\not\boolean{jboxford}}{%
        \bibatsep{}%
      }{}%
   \fi
}%
\DeclareRobustCommand{\jbflanguage}[1]{%
    \unskip\space% prevent from additional spaces for empty \transfrom macros
    \ifthenelse{\equal{#1}{german}}{%
        \fromgerman%
    }{%
        \ifthenelse{\equal{#1}{english}}{%
             \fromenglish%
        }{%
             \ifthenelse{\equal{#1}{french}}{%
                \fromfrench%
             }{%
                \ifthenelse{\equal{#1}{dutch}}{%
                    \fromdutch%
                }{%
                    \ifthenelse{\equal{#1}{spanish}}{%
                        \fromspanish%
                    }{%
                        \ifthenelse{\equal{#1}{italian}}{%
                            \fromitalian%
                        }{%
                            \ifthenelse{\equal{#1}{norsk}}{%
                                \fromnorsk%
                            }{%
                                \relax
                            }%
                        }%
                    }%
                }%
            }%
        }%
    }%
}%
\renewcommand*{\bibstyle}[1]{%
  \ifthenelse{\equal{#1}{jox}}{%
    \global\jb@humanbst@loadedtrue
    \global\jboxfordtrue
  }{%
      \ifthenelse{\equal{#1}{jchicago}}{%
        \global\jb@author@yeartrue
        \global\jb@yearafterauthortrue
      }{%
          \ifthenelse{\equal{#1}{jureco}}{%
            \global\jb@jurecotrue
% The jureco-defaults:
            \global\jb@author@yeartrue
            \global\jb@yearafterauthortrue
            \global\jb@yearaftertitlefalse
          }{%
% reintroduced for backward compatibility with old jhuman users
              \ifthenelse{\equal{#1}{jhuman}}{\global\jb@humanbst@loadedtrue}{}%
          }%
      }%
  }%
}%
% article incollection title font (in citations)
\DeclareRobustCommand{\jbapifont}[1]{#1}%
\DeclareRobustCommand{\jbbtfont}{}%
% NEW 0.5e op.cit. feature for recurring citations, which aren't immediately following
\newif\ifjbopcit
\newcommand*{\opcit}{\textit{op.\,cit.}}%
% NEW 0.5f rewritten code for op. cit. for linking to the first citation.
\newcommand*{\OpCit}{%
 \ifjbweareinbib\else
   \ifjb@opcit
     \ifjb@@opcit
       \unskip\unskip,%
% NEW 0.51h some new kerning code
       \ifjb@ssed@recent@kerned
         \jb@do@ssed@kerning%
       \else
         \space%  space part of the opcit hyperlink?
       \fi
       \ifjb@allow@hyper@cite\hyper@jblinkend\fi
       \endgroup   % <=== here we are ending with the link to the bibliography
       \begingroup % <=== here we are starting a new hyperlink to the source citation of the opcit-sequence
         \ifjb@allow@hyper@cite\hyper@jblinkstart{opcit.\@citeb.\jb@reset@opcit@label@for}\fi
         \opcit%
% we need to check if we are in a crossref, it overrides the settings of the main citation
%         \ifjbcross\else
            \ifthenelse{\equal{\jb@@newpagecite}{}}{\ifjb@lookat\else\global\jb@footnote@periodfalse\fi}{}%
%         \fi
%         \ifthenelse{\equal{\jb@@newpagecite}{}}{\ifjb@lookat\else\global\jb@footnote@periodfalse\fi}{}%
         \ifjb@allow@hyper@cite\hyper@jblinkend\fi % <=== we are closing the opcit hyperlink ...
       \endgroup
       \begingroup
       \ifjb@allow@hyper@cite\hyper@jblinkstart{\@citeb}\fi % <=== ... an reopen the hyperlink to the bibliography
       \jb@extract
     \fi
   \fi
 \fi
}%
% citation parentheses
\newcommand*{\jb@open}{}%
\newcommand*{\jb@close}{}%
% crossref parentheses
\newcommand*{\jb@cr@open}{}%
\newcommand*{\jb@cr@close}{}%
% incoll crossref parentheses
\newcommand*{\jb@incoll@cr@open}{}%
\newcommand*{\jb@incoll@cr@close}{}%
% article crossref parentheses
\newcommand*{\jb@art@cr@open}{}%
\newcommand*{\jb@art@cr@close}{}%
\DeclareRobustCommand{\jbpages}{}%
\DeclareRobustCommand{\jbedition}[1]{%
    \unskip\unskip\ifjb@humanbst@loaded\else\space\fi#1}%
%                  ^^^^^^^^^^^^^^^^^^^^^^^^^      ^^^
% NEW 0.5f added, because jhuman.bst places a comma inside \jbedition
% NEW 0.5e command for jchicago.bst
\DeclareRobustCommand{\jbPAGES}{}
% NEW 0.5f Reduced to one command, formatting by \jbprformat
%\DeclareRobustCommand{\jbPage}[1]{%
%  \unskip\unskip\ifjbweareinbib, \else
%  \ifjb@comma@before@rest, \else\space\fi\fi
%  \ifjb@formatted@pages\jbpagename~#1\else#1\fi
%}%
\DeclareRobustCommand{\jbPages}[1]{%
  \unskip\unskip\ifjbweareinbib, \else
  \ifjb@comma@before@rest, \else\space\fi\fi
  \ifjb@formatted@pages\jbprformat{#1}\else#1\fi
}%
% NEW 0.5f special article pages, suggested by Alp Aker
% NEW 0.5f Reduced to one command, formatting by \jbprformat
%\DeclareRobustCommand{\jbartPage}[1]{%
%  \ifjbchicago
%      \unskip:\space
%  \else
%      \unskip\unskip\ifjbweareinbib, \else
%      \ifjb@comma@before@rest, \else\space\fi\fi
%  \fi
%  \ifjb@formatted@pages\jbpagename~#1\else#1\fi
%}%
\DeclareRobustCommand{\jbartPages}[1]{%
  \ifjbchicago
      \unskip:\space
  \else
      \unskip\unskip\ifjbweareinbib, \else
      \ifjb@comma@before@rest, \else\space\fi\fi
  \fi
  \ifjb@formatted@pages\jbprformat{#1}\else#1\fi
}%
% save the definition for the pages in bib
\let\origPAGES\jbPAGES
\let\origpages\jbpages
\let\origPages\jbPages
% NEW 0.5f Reduced to one command, formatting by \jbprformat
%\let\origPage\jbPage
% NEW 0.5f Reduced to one command, formatting by \jbprformat
%\let\origartPage\jbartPage
\let\origartPages\jbartPages
\newcommand*{\jb@endnote}{}%
\DeclareRobustCommand{\jbendnote}[1]{}% default
\DeclareRobustCommand{\jbnote}[2]{%
    \ifjbweareinbib
        \ifthenelse{\equal{#1}{1}}{\unskip\unskip, #2}{#2}%
    \fi
}%
\newcommand*{\jb@open@clean@for@crossref}{%
  \jb@no@lookat@for@bibtrue
  \jbcrosstrue
% REMOVED in 0.51i
% \jb@indexfalse
% The following is needed to achieve a clear handling
% of crossref's, it's now a absolutely separate level
% of citations, independent of the main citations!
% crossref's are managed by \bib[incoll]crossrefcite
% and the crossref-options.
  \ifjb@all@full
   \jb@save@allfull@statustrue
%  to suppress allfull for crossrefs in bib
   \jb@all@fullfalse
%  to suppress allfull for crossrefs in citations
   \jb@fullcite@againfalse
  \fi
% if lookat is active, save (it could be redef'd)%
% and suppress it in crossrefs
  \ifjb@lookat
   \jb@save@lookat@statustrue
   \jb@lookatfalse
  \fi
% NEW 0.5f No ibid. for crossref's
  \noibidem
  \let\jbauthorfont\biblnfont
  \let\jbauthorfnfont\bibfnfont
  \let\jbactualauthorfont\biblnfont
  \let\jbactualauthorfnfont\bibfnfont
% REMOVED 0.5e for correct sep handling for crossrefs
%  \let\jbhowsepbeforetitle\bibansep
% REINTRODUCED, but only for bibliography!
  \ifjbweareinbib
    \let\jbhowsepbeforetitle\bibansep
    \let\jbhowsepbeforetitleae\bibaesep
  \fi
  \let\jbbtasep\bibbtasep
  \let\jbbfsasep\bibbfsasep
  \let\jbbstasep\bibbstasep
%
  \let\jbbtesep\bibbtesep
  \let\jbbfsesep\bibbfsesep
  \let\jbbstesep\bibbstesep
%
  \let\jbtitlefont\bibtfont
  \let\jbbtitlefont\bibbtfont
  \let\jbapifont\bibapifont
  \let\jb@extraspace\space
}%
\newcommand*{\jb@close@clean@for@crossref}{%
% restore allfull if it was chosen
  \ifjb@save@allfull@status
   \jb@all@fulltrue
   \jb@save@allfull@statusfalse
  \fi
% restore lookat
  \ifjb@save@lookat@status
   \jb@lookattrue
   \jb@save@lookat@statusfalse
  \fi
  \jb@no@lookat@for@bibfalse
  \jbcrossfalse
  \jb@indextrue
% NEW 0.5f No idem after crossref:
% _______________
% ²bar in: foo, baz.
% ³idem (should be foo!), bar.
  \noidem
% NEW 0.5f No dot after op. cit. in a crossref
%  \ifthenelse{\equal{\jb@@newpagecite}{}}{\ifjb@lookat\else\global\jb@footnote@periodfalse\fi}{}%
}%
\DeclareRobustCommand{\jbcrossrefchecked}[2][]{%
 \begingroup
 \jb@open@clean@for@crossref
% NEW 0.5f work, which were cited first as a crossref, should then be
% cited with short form, if `citefull=first' is active
   \ifjb@firstcite@full\ifjb@all@full\else
     \@ifundefined{citefull@#2}{%
         \global\@namedef{citefull@#2}{citefull}%
     }{}%
   \fi\fi
   \ifthenelse{\equal{#1}{}}{%
    \jb@cr@open%
     \inname{} %
      % make a difference between first crossref cite
      % and again crossref cite (ONLY FOR CITATION! 0.5e)
     \ifjbweareinbib
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
% But here we have to make sure that it is only suppressed if no \jbindexbib is given
        \ifjb@index@bib\else\jb@indexfalse\fi\bibcrossrefcite{#2}%
     \else
      \@ifundefined{NORMCR@#2}{%
        \global\@namedef{NORMCR@#2}{}%
        \bibcrossrefcite{#2}%
      }{%
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
         \jb@indexfalse\bibcrossrefciteagain{#2}%
      }%
     \fi
    \jb@cr@close%
   }{%
    \jb@cr@open%
     \ifjboxford\volumename\else\Volumename\fi~#1 \volumeofname{} %
      % make a difference between first crossref cite
      % and again crossref cite (ONLY FOR CITATION! 0.5e)
     \ifjbweareinbib
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
% But here we have to make sure that it is only suppressed if no \jbindexbib is given
        \ifjb@index@bib\else\jb@indexfalse\fi\bibcrossrefcite{#2}%
     \else
      \@ifundefined{NORMCR@#2}{%
        \global\@namedef{NORMCR@#2}{}%
        \bibcrossrefcite{#2}%
      }{%
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
        \jb@indexfalse\bibcrossrefciteagain{#2}%
      }%
     \fi
    \jb@cr@close%
   }%
  \jb@close@clean@for@crossref
 \endgroup
%^^^^^^^^^ Grouping (otherwise fonts changed if `howcited')
}%
\DeclareRobustCommand{\jbartcrossrefchecked}[2][]{{%
 \jb@open@clean@for@crossref
% NEW 0.5f work, which were cited first as a crossref, should then be
% cited with short form, if `citefull=first' is active
   \ifjb@firstcite@full\ifjb@all@full\else
     \@ifundefined{citefull@#2}{%
         \global\@namedef{citefull@#2}{citefull}%
     }{}%
   \fi\fi
   \ifthenelse{\equal{#1}{}}{%
      \jb@art@cr@open%
        \inname{} %
        % make a difference between first crossref cite
        % and again crossref cite (ONLY FOR CITATION! 0.5e)
         \ifjbweareinbib
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
% But here we have to make sure that it is only suppressed if no \jbindexbib is given
          \ifjb@index@bib\else\jb@indexfalse\fi\bibcrossrefcite{#2}%
         \else
          \@ifundefined{ARTCR@#2}{%
            \global\@namedef{ARTCR@#2}{}%
            \bibcrossrefcite{#2}%
          }{%
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
            \jb@indexfalse\bibcrossrefciteagain{#2}%
          }%
         \fi
      \jb@art@cr@close%
   }{%
      \jb@art@cr@open%
        \Volumename~#1 \volumeofname{} %
        % make a difference between first crossref cite
        % and again crossref cite (ONLY FOR CITATION! 0.5e)
         \ifjbweareinbib
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
% But here we have to make sure that it is only suppressed if no \jbindexbib is given
        \ifjb@index@bib\else\jb@indexfalse\fi\bibcrossrefcite{#2}%
         \else
          \@ifundefined{ARTCR@#2}{%
            \global\@namedef{ARTCR@#2}{}%
            \bibcrossrefcite{#2}%
          }{%
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
            \jb@indexfalse\bibcrossrefciteagain{#2}%
          }%
         \fi
      \jb@art@cr@close%
   }%
 \jb@close@clean@for@crossref
 }%
}%
% NEW 0.5f To check: do we really need the full name (with `eds.') in the crossref citations for oxford?
\newcommand*{\fullnameoxfordcrossref}[1]{%
       \ifjb@debug
           \ifjb@debug@br[\fi
                \textcolor[named]{Dandelion}{\citefield{author}{#1}\jbhowsepbeforetitle\citefield{title}{#1}}%
           \ifjb@debug@br]\fi
       \else
          \citefield{author}{#1}\jbhowsepbeforetitle\citefield{title}{#1}%
       \fi
}
\newcommand*{\jbedbyincollcrossreflong}[1]{%
      \ifjbweareinbib
         \bibtfont{\citefield{title}{#1}}%
      \else
         \jbbtfont{\citefield{title}{#1}}%
      \fi
      \bibatsep{} %
      \ifthenelse{\equal{\bibatsep}{.}}{\Edbyname{} }{\edbyname{} }%
      \citefield{author}{#1}%
      \unskip\ifjbetal\jbetalfalse\else.\fi\space%
      \citefield{apy}{#1}%
      \unskip\unskip%
}
\newcommand*{\jbedbyincollcrossrefshortwithapy}[1]{%
      \ifjbweareinbib
         \bibtfont{\citefield{shorttitle}{#1}}%
      \else
         \jbbtfont{\citefield{shorttitle}{#1}}%
      \fi
      \bibatsep{} %
      \ifthenelse{\equal{\bibatsep}{.}}{\Edbyname{} }{\edbyname{} }%
      \citefield{shortauthor}{#1}%
      \unskip\ifjbetal\jbetalfalse\else.\fi\space%
      \citefield{apy}{#1}%
      \unskip\unskip%
}
\newcommand*{\jbedbyincollcrossrefshortnoapy}[1]{%
      \ifjbweareinbib
         \bibtfont{\citefield{shorttitle}{#1}}%
      \else
         \jbbtfont{\citefield{shorttitle}{#1}}%
      \fi
      \bibatsep{} %
      \ifthenelse{\equal{\bibatsep}{.}}{\Edbyname{} }{\edbyname{} }%
      \citefield{shortauthor}{#1}%
      \unskip\unskip%
}
\newcommand*{\jbedbyincollcrossrefshort}[1]{%
      \citefield{shortauthor}{#1}%
      \unskip\unskip%
}
\DeclareRobustCommand{\jbincollcrossref}[2]{%
 \begingroup
% REMOVED in 0.51i
% \jb@indexfalse
 \jb@open@clean@for@crossref
 \jb@incoll@cr@open%
% NEW 0.5f works, which were cited first as a crossref, should then be
% cited with short form, if `citefull=first' is active
 \ifjb@firstcite@full\ifjb@all@full\else
     \@ifundefined{citefull@#1}{%
         \global\@namedef{citefull@#1}{citefull}%
     }{}%
 \fi\fi
% NEW 0.5e suggested by Maarten Wisse, crossref entries in chicago
% should also be formatted with edby
 \ifthenelse{%
      \boolean{jb@edby}%
      \and
      \boolean{jbchicago}%
      \and
      \equal{#2}{1}% is there an editor???
 }{%
      \let\bibedformat\@gobble % exists only in jhuman.bst
      \incollinname{} %
      \hyper@jblinkstart{#1}%
      \ifjbweareinbib
         \jbedbyincollcrossrefcite{#1}%
      \else
         \@ifundefined{INCCR@#1}{%
            \global\@namedef{INCCR@#1}{}%
            \jbedbyincollcrossrefcite{#1}%
         }{%
            \jbedbyincollcrossrefciteagain{#1}%
         }%
      \fi
      \hyper@jblinkend%
 }{%
      \incollinname{} %
      % make a difference between first crossref cite
      % and again crossref cite (ONLY FOR CITATION! 0.5e)
      \ifjbweareinbib
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
% But here we have to make sure that it is only suppressed if no \jbindexbib is given
        \ifjb@index@bib\else\jb@indexfalse\fi\bibincollcrossrefcite{#1}%
      \else
        \@ifundefined{INCCR@#1}{%
           \global\@namedef{INCCR@#1}{}%
           \bibincollcrossrefcite{#1}%
        }{%
% NEW 0.51i [Editors of crossref'ed works] should appear each 
% time when an essay from their collection is cited for the first time ...
           \jb@indexfalse\bibincollcrossrefciteagain{#1}%
        }%
      \fi
 }%
 \jb@incoll@cr@close%
 \jb@close@clean@for@crossref
 \endgroup
%^^^^^^^^^ Grouping (otherwise fonts changed if `howcited')
}%
%\DeclareRobustCommand{\numberandseries}[2]{%
% \ifthenelse{\equal{#2}{}}{#1}{\unskip\unskip,\space\bibsnfont{#2}~#1}}%
\DeclareRobustCommand{\numberandseries}[2]{%
    \unskip\unskip,\space\bibsnfont{#2}%
    \ifthenelse{\equal{#1}{}}{}{~#1}%
}%
% NEW 0.5e Format the ed
% #1=editor, #2=more than one ed switch #3=booktitle, #4=volume, #5=booktitleaddon switch (1=yes)
\newcommand*{\jb@@tempa}{.}%
\newcommand*{\edbysep}{\bibatsep{} }%
\newcommand*{\incolledformat}[5]{%
 \bibBTsep%
 \ifjb@edby
    #3%
    \ifx\relax#1\relax
     \ifx\relax#5\relax\else
      \ifx\relax#4\relax
        \bibatsep{}%
      \else
        \bibatsep{}\space%
      \fi
     \fi
    \else
        \ifx\relax#5\relax
            \ifjb@humanbst@loaded\edbysep{}\fi
            \ifx\bibatsep\jb@@tempa\Edbyname{} \else\edbyname{} \fi
        \else
            \edbysep{}%
            \ifx\bibatsep\jb@@tempa\Edbyname{} \else\edbyname{} \fi
        \fi
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
% we have to group the ed, otherwise the et~al. is suppressed for the author too
        \begingroup
            #1%
        \endgroup
    \fi
    \ifx\relax#4\relax\else
      \ifx\relax#1\relax\else
        \ifx\relax#5\relax
          .\space%
        \else
          \bibatsep{} %
        \fi
      \fi
%      \volumeformat{#4}%      
      \Volumename~#4%
    \fi
    \ifx\relax#1\relax
     \ifx\relax#4\relax\else.\fi % volume empty
    \else
      \ifjb@humanbst@loaded\else
        \ifjbchicago\else.\fi
      \fi
    \fi
 \else
  \ifx\relax#1\relax\else
% NEW 0.5f idem should work inside bibliographic entries too (If author = editor)
% we have to group the ed, otherwise the et~al. is suppressed for the author too
      \begingroup
          #1 % editor
      \endgroup
      \ifx\relax#2\relax\else#2\fi
      \bothaesep%
    \fi
    #3%
    \ifx\relax#4\relax
% CH 0.51v hardcoded dot replaced by \bibatsep
      \ifx\relax#5\relax\else% No volume, but booktitleaddon
        \bibatsep%
      \fi
    \else
      \ifx\relax#5\relax\else,\space\fi% volume and booktitleaddon
      \volumeformat{#4}%      
%      \Volumename~#4.%
    \fi
 \fi
}
% NEW 0.5f: contributed by Stefan Ulrich
% ------------------------- NEW URL Interface --------------------------------
% for defining URLs in the bibliography. These might be used in other
% places as well (such as footnotes), so we use url.sty's \urldef
% to define aliases in the form `\jburl@<citation-key>' for them
% (this alias is unique, since each bib entry can only have one
% URL field).
% To make this work with hyperref, the aliases need to be written
% to a separate auxiliary file (we can't use \@auxout, since this is
% read \AtBeginDocument, after hyperref, but an incompatibility
% between hyperref and url makes it necessary to use \urldef *before*
% loading hyperref).
% As with url.sty, the URL may contain arbitrary characters,
% but `{}' must be properly nested.
% In 0.5f beta 25 Stefan Ulrich contributed a solution for the 
% `%\n' BibTeX bug, similar to the solution in hyperref. 
% Very special thanks!
\newcommand\jburldef{}
\newcommand\jb@urldef{}
\newcommand\jb@returnAfterFi{}
\long\def\jb@returnAfterFi#1\fi{\fi#1}
\newcommand*\jb@remove@percentCr{}% see hyperref.sty's \Hy@RemovePercentCr
\begingroup % no `%' inside this group! (Changing \endlinechar makes this easier).
% Following implements deletion of `%\n' in \jburldef like in hyperref (url.sty
% doesn't do this).
% Inside \jburldef, `^^M' needs to be active so that it expands to a space when
% writing to \jb@urlfile; `%' only needs to have catcode 12.
\endlinechar\m@ne
\catcode`\^^M\active
\catcode`\%=12
\gdef\jburldef#1{
    \begingroup
    \def\jb@bbl@key{#1}
    \let\do\@makeother\dospecials
    \catcode`{\@ne \catcode`}\tw@
    \catcode`\^^M\active
    \def^^M{ }
    \jb@urldef
}
\gdef\jb@remove@percentCr#1%^^M#2\@nil{
    #1
    \ifx\limits#2\limits
    \else
        \jb@returnAfterFi\jb@remove@percentCr#2\@nil
    \fi
}
\gdef\jb@urldef#1{
    \edef\@tempa{\jb@remove@percentCr#1%^^M\@nil}
    \immediate\write\jb@urlfile{
        \string\expandafter\string\urldef\string\csname\space
        jburl@\jb@bbl@key\string\endcsname\string\url\string{\@tempa\string}
    }
    \endgroup
}
\endgroup
\DeclareRobustCommand*\jburluse[1]{%
  \biburlprefix\csname jburl@#1\endcsname\biburlsuffix%
}
\newwrite\jb@urlfile
% load our url file:
\InputIfFileExists{\jobname.url}{}{}
% Now to some interface paranoia ;-)
% Since we'll try to write to \jobname.url, which is not a standard
% LaTeX .aux file, the user might have a file with the same name
% somewhere in TeX's search path. We don't want to overwrite such a
% file; therefore we check whether the first line equals a special
% `signature' line and only in this case overwrite the file.
\newread\jb@tempfile
\newcommand*\testnosig{}%
{% no spaces or percents in this group! (Changing \endlinechar makes this easier).
\catcode`\ =12
\catcode`\%=12
\endlinechar\m@ne
% CH 0.52o year + version removed, so warning should not appear when the file was created by jurabib
\gdef\jb@signature@line{%%% jurabib url repository}
\gdef\jb@if@no@sigline#1#2{\ifx#1\jb@signature@line\else#2\fi}}
\newcommand*\jb@chk@overwrite[1]{%
    \bgroup
    \openin\jb@tempfile=#1\relax
        \let\do\@makeother \dospecials
        \endlinechar\m@ne
        \ifeof\jb@tempfile
            % \typeout{File `#1' doesn't exist}%
        \else
            \read\jb@tempfile to\@tempa
            \ifeof\jb@tempfile
                % \typeout{File `#1' is empty}%
            \else
                \jb@if@no@sigline{\@tempa}{%
                    \ClassError{jurabib}{%
                        file `#1' not written by jurabib%
                    }{%
                        This doesn't look like a file written by jurabib.^^J%
                        Please save any valuable information contained in this file^^J%
                        to another place.^^J%
                        If you hit RETURN now, the file will be overwritten.^^J%
                    }%
                }%
            \fi
        \fi
    \closein\jb@tempfile
    \egroup
% arrive here only if the user didn't abort, erase the file:
    \immediate\openout\jb@urlfile#1
% ... and write our `signature line' to it:
    \immediate\write\jb@urlfile{\jb@signature@line}%
    \AtEndDocument{\closeout\jb@urlfile}
}
\jb@chk@overwrite{\jobname.url}
% ------------------------- NEW URL Interface --------------------------------
\DeclareRobustCommand{\lookatprefix}{}%
\DeclareRobustCommand{\lookatsuffix}{}%
\newcommand*{\noibidem}{%
  \gdef\jb@@lastauthorcite{}%
  \gdef\jb@@lastcoauthorcite{}%
  \gdef\jb@@lastpagecite{}%
}%
% NEW 0.5e
\newcommand*{\noidem}{%
  \gdef\jb@@last@@author{}%
  \gdef\jb@@last@@title{}%
}%
\newcommand*{\nextcitefull}[1]{%
 {\@for\@tempa:=#1\do{%
    \global\@namedef{\@tempa}{allnextfull}}}%
}%
\newcommand*{\nextciteshort}[1]{%
  {\@for\@tempa:=#1\do{%
    \global\@namedef{\@tempa}{allnextshort}}}%
}%
\newcommand*{\nextcitenotitle}[1]{%
  {\@for\@tempa:=#1\do{%
    \global\@namedef{\@tempa}{allnextnotitle}}}%
}%
\newcommand*{\nextcitereset}[1]{%
  {\@for\@tempa:=#1\do{%
    \global\@namedef{\@tempa}{}}}%
}%
\newcommand*{\citeswithoutentry}[1]{%
  {\@for\@tempa:=#1\do{%
    \global\@namedef{NOBIB@\@tempa}{suppress}}}%
}%
% NEW 0.52p, suppress first names for full (first or not) citations
\newcommand*{\nofirstnameforcitation}{\jb@no@firstnametrue}%
% NEW v0.5b, to provide an interface where the publication types can be given
% for those the title should appear, mainly used for legal articles ...
% special thanks to Stefan Ulrich (once again)
\newcommand*{\jb@cite@title@types}{}%
\newcommand*{\jb@cite@notitle@types}{}%
\newcommand*{\citetitlefortype}[1]{\gdef\jb@cite@title@types{#1}}%
\newcommand*{\citenotitlefortype}[1]{\gdef\jb@cite@notitle@types{#1}}%
\newcommand*{\jb@cite@title@for@type@hook}{%
    \@for\@tempa:=\jb@cite@title@types\do{%
        \protected@edef\@tempb{\jb@@type}%
%       comparing: \@tempa-\@tempb
        \ifx\@tempa\@tempb
%           Match!!
            \def\jb@@title@switch{1}%
        \fi
    }%
}%
\newcommand*{\jb@cite@no@title@for@type@hook}{%
    \@for\@tempa:=\jb@cite@notitle@types\do{%
        \protected@edef\@tempb{\jb@@type}%
%       comparing: \@tempa-\@tempb
        \ifx\@tempa\@tempb
%           Match!!
            \def\jb@@title@switch{-1}%
        \fi
    }%
}%
% NEW 0.52n, \citefullfirstfortype{<typelist>} allows to specify a list of publication types for which `citefull=first' works.
\def\jb@@cite@fullfirst@switch{}%
\newcommand*{\jb@cite@full@first@types}{}%
\newcommand*{\citefullfirstfortype}[1]{\gdef\jb@cite@full@first@types{#1}}%
\newcommand*{\jb@cite@full@first@fortype@hook}{%
    \@for\@tempa:=\jb@cite@full@first@types\do{%
        \protected@edef\@tempb{\jb@@type}%
        \ifx\@tempa\@tempb
            \def\jb@@cite@fullfirst@switch{1}%
        \fi
    }%
}%
\citefullfirstfortype{article,book,booklet,commented,inbook,incollection,inproceedings,jurthesis,manual,mastersthesis,misc,periodical,phdthesis,proceedings,techreport,unpublished,www}
% NEW 0.52n, \citeworkwithtitle allows to specify a list of works, for those the title should always be printed.
\newcommand*{\jb@cite@title@work}{}%
\newcommand*{\citeworkwithtitle}[1]{\gdef\jb@cite@title@work{#1}}%
\newcommand*{\jb@cite@title@for@work@hook}{%
    \@for\@tempa:=\jb@cite@title@work\do{%
        \protected@edef\@tempb{\jb@@newauthorcite}%
        \ifx\@tempa\@tempb
            \def\jb@@mult@switch{1}%
        \fi
    }%
}%
% NEW 0.5f special pages format possible for all publication types
\newcommand*{\jb@start@page@for@types}{}%
\newcommand*{\jb@start@page@for@types@arg}{}%
\newcommand*{\jb@start@page@for@type@hook}{%
    \@for\@tempa:=\jb@start@page@for@types\do{%
        \protected@edef\@tempb{\jb@@type}%
        \ifx\@tempa\@tempb
            \def\jb@start@page@for@types@arg{1}%
        \fi
    }%
}%
% NEW 0.5e support for jchicago.bst
\newcommand*{\jb@formatted@year}{\nobreakspace\textup{\jbcitationyearformat{\jb@@year}}}%
%                                             ^^^^^^^ to protect from smallcaps and ...
\DeclareRobustCommand{\jbyear}{% NEW 0.5c
  \ifjb@author@year
   \ifthenelse{\equal{\jb@@year}{}}{%
      \@ifundefined{NOYEAR@\jb@@newauthorcite}{%
        \global\@namedef{NOYEAR@\jb@@newauthorcite}{}%
        \jb@package@warningNoLine{\jb@pkg@name}{%
        No year for `\jb@@newauthorcite'!}}{\relax}%
        \let\jbcitationyearformat\@empty
   }{%
      \jb@formatted@year%
   }%
  \fi
}%
% NEW 0.5f improved \bibYear macro, difference between citation and 
% bibliography introduced (suggested by Uwe Kellermann)
\DeclareRobustCommand{\bibYear}[1]{% only for jureco.bst
  \ifx\relax#1\relax\else
     \nobreakspace\bibfnfont{%
        \textup{%
%       ^^^^^^^ to protect from smallcaps and ...
            \ifjbweareinbib
                \jbbibyearformat{#1}%
            \else
                \jbcitationyearformat{#1}%
            \fi
        }%
     }%
  \fi
}%
\DeclareRobustCommand{\jbts}{\textsuperscript}%
\newcommand*{\bibleftcolumn}{\textwidth /3}
\newcommand*{\bibrightcolumn}{\textwidth-\bibleftcolumn-1cm}
\newcommand*{\bibleftcolumnadjust}{\raggedright}%
\newcommand*{\bibrightcolumnadjust}{\raggedright}%
\newcommand*{\bibaltformatalign}{\relax}%
\newcommand*{\jbdebug}{\jb@debugtrue
  \jb@info{*** Debugging ON ***}%
  \footnote{\textcolor[named]{Blue}{[volles Erstzitat]}}%
  \footnote{\textcolor[named]{Red}{[volles Wiederholungszitat]}}%
  \footnote{\textcolor[named]{Dandelion}{[Kurzzitat]}}%
  \footnote{\textcolor[named]{WildStrawberry}{[ibidem]}}%
  \footnote{\textcolor[named]{Gray}{[Titel ersetzt]}}%
% \renewcommand*{\@biblabel}[1]{%
% \footnotesize\textcolor[named]{NavyBlue}{##1}}%
  \setcounter{footnote}{0}%
}%
\DeclareRobustCommand{\jbhowsepcoauthorlast}{{\normalfont\slash}}%
\DeclareRobustCommand{\jbhowsepbeforetitle}{\space}%
% special separation after ed's.
\DeclareRobustCommand{\jbhowsepbeforetitleae}{\jbhowsepbeforetitle}%
\DeclareRobustCommand{\jbhowsepbeforetitleibidemname}{,}%
\DeclareRobustCommand{\jbhowsepcoauthorfirst}{}%
% 0.51p changed, bug reported by Tilman Finke
\newcommand*{\jbbeforestartpagesep}{\space}%
\renewcommand*{\@biblabel}[1]{}%
% added
\newcommand*{\jb@firstofseven}  [7]{#1}%
\newcommand*{\jb@secondofseven} [7]{#2}%
\newcommand*{\jb@thirdofseven}  [7]{#3}%
\newcommand*{\jb@fourthofseven} [7]{#4}%
\newcommand*{\jb@fifthofseven}  [7]{#5}%
\newcommand*{\jb@sixthofseven}  [7]{#6}%
\newcommand*{\jb@seventhofseven}[7]{#7}%
\def\jb@@author{\expandafter\jb@firstofseven\jb@tempa\@empty}% Never add \unskip HERE !!!!!
\def\jb@@shorttitle{\expandafter\jb@secondofseven\jb@tempa\@empty}% Never add \unskip HERE !!!!!
% \jb@thirdofseven=\jb@tempb !!!!
% \jb@fourthofseven=\jb@tempc !!!!
\def\jb@@fullname{\expandafter\jb@fifthofseven\jb@tempa\@empty}% Never add \unskip HERE !!!!!
% \jb@@fullname test for empty doesn't give the right results!!
\def\jb@@fulltitle{\expandafter\jb@sixthofseven\jb@tempa\@empty\unskip}%
%\jb@seventhofseven=\@empty !!!!
\newcommand*{\jb@firstofnine}  [9]{#1}%
\newcommand*{\jb@secondofnine} [9]{#2}%
\newcommand*{\jb@thirdofnine}  [9]{#3}%
\newcommand*{\jb@fourthofnine} [9]{#4}%
\newcommand*{\jb@fifthofnine}  [9]{#5}%
\newcommand*{\jb@sixthofnine}  [9]{#6}%
\newcommand*{\jb@seventhofnine}[9]{#7}%
\newcommand*{\jb@eighthofnine} [9]{#8}%
\newcommand*{\jb@ninethofnine} [9]{#9}%
\def\jb@@mult@switch{\expandafter\jb@firstofnine\jb@tempb}%
\def\jb@@howcited{\expandafter\jb@secondofnine\jb@tempb}%
\def\jb@@type{\expandafter\jb@thirdofnine\jb@tempb}%
\def\jb@@year{\expandafter\jb@fourthofnine\jb@tempb}%
\def\jb@@edition{\expandafter\jb@fifthofnine\jb@tempb}%
\def\jb@@edition@switch{\expandafter\jb@sixthofnine\jb@tempb}%
\def\jb@@language{\expandafter\jb@seventhofnine\jb@tempb}%
\def\jb@@pages{\expandafter\jb@eighthofnine\jb@tempb}%
\def\jb@@apy{\expandafter\jb@ninethofnine\jb@tempb}%
%
\def\jb@@title{\expandafter\jb@firstofnine\jb@tempc}%
\def\jb@@gender{\expandafter\jb@secondofnine\jb@tempc}%
%
%\def\jb@@{\expandafter\jb@fourthofnine\jb@tempc}%
%\def\jb@@{\expandafter\jb@fifthofnine\jb@tempc}%
%\def\jb@@{\expandafter\jb@sixthofnine\jb@tempc}%
%\def\jb@@{\expandafter\jb@seventhofnine\jb@tempc}%
%\def\jb@@{\expandafter\jb@eighthofnine\jb@tempc}%
%\def\jb@@{\expandafter\jb@ninethofnine\jb@tempc}%
\def\jb@@title@switch{}%
% NEW 0.5f new command
\newcommand*{\jb@extract}{%
   \protected@edef\jb@tempa{\csname b@\@citeb\@extra@b@citeb\endcsname}%
   \protected@edef\jb@tempb{\expandafter\jb@thirdofseven\jb@tempa\@empty}%
   \protected@edef\jb@tempc{\expandafter\jb@fourthofseven\jb@tempa\@empty}%
}%
\def\jb@use@fullcite{%
 \ifthenelse{\equal{\jb@@author}{empty}}{%
     \ifthenelse{\equal{\jb@@fullname}{\@empty}}{%
        \jb@@fulltitle%
     }{%
        \jb@@fullname\normalfont{\jbhowsepbeforetitle}\jb@@fulltitle\unskip%
     }%
 }{%
     \ifthenelse{\equal{\jb@@fullname}{\@empty}}{%
        \jbauthorfont{\jb@@author}\normalfont{\jbhowsepbeforetitle}\jb@@fulltitle%
     }{%
        \jb@@fullname\normalfont{\jbhowsepbeforetitle}\jb@@fulltitle\unskip%
     }%
 }%
}%
\newcommand*{\jb@extraspace}{\space}%
% chapterbib compatibility
\@ifundefined{@extra@b@citeb}{\def\@extra@b@citeb{}}{}%
% bibunits compatibility
\newcommand*{\jb@save@auxfile}{\let\jb@auxout@bak\@auxout}%
\newcommand*{\jb@restore@auxfile}{\let\@auxout\jb@auxout@bak}
\providecommand\hyper@natlinkstart[1]{}%
\providecommand\hyper@natlinkend{}%
\providecommand\hyper@natanchorstart[1]{}%
\providecommand\hyper@natanchorend{}%
\def\hyper@jblinkstart{\hyper@natlinkstart}
\def\hyper@jblinkend{\hyper@natlinkend}
\def\hyper@jbanchorstart{\hyper@natanchorstart}
\def\hyper@jbanchorend{\hyper@natanchorend}
\def\NAT@parse{}%
\def\Hy@reserved@a{}%
\newcounter{jbbibcnt}%
\newcounter{jbbibcnta}%
\newcounter{idemcnt}% NEW 0.5e idem feature
\newcounter{bibnamereplace}%
\newcounter{citefull}%
\newcounter{opcit}%
% NEW 0.52l
\newcounter{jb@cites@in@footnote}
\newcommand*{\samepageibidemname}{\ibidemname}
\newcommand*{\samepageibidemmidname}{\ibidemmidname}
\newcommand*{\diffpageibidemname}{\ibidemname}
\newcommand*{\diffpageibidemmidname}{\ibidemmidname}
\newcommand*{\IbidemName}{\ifthenelse{\equal{\jb@@newpagecite}{\jb@@lastpagecite}}{\samepageibidemname}{\diffpageibidemname}}
\newcommand*{\IbidemMidName}{\ifthenelse{\equal{\jb@@newpagecite}{\jb@@lastpagecite}}{\samepageibidemmidname}{\diffpageibidemmidname}}
\newcommand*{\jb@@lastpagecite}{}%
\newcommand*{\jb@@lastcoauthorcite}{}%
\newcommand*{\jb@@lastauthorcite}{}%
\newcommand*{\jb@getsecondarg}{}%
\long\def\jb@getsecondarg#1#2#3\@nil{#2}%
\newcommand*{\jb@simple@pageref@by@heiko}[1]{%
  \expandafter\expandafter\expandafter\jb@getsecondarg
  \csname r@#1\endcsname{??}\@nil}%
\newcommand*{\jb@checked@edition}{}%
\newcommand*{\jb@aftertitleedition}{}%
\newcommand*{\jb@handle@superscript@ed}{%
 \let\jb@checked@edition\@empty      % complete removal of superscript edition or
 %\let\jb@kerning@title@ed\@empty    % only removal of kerning?
 %\let\jb@kerning@notitle@ed\@empty  %
}%
% changed for 05.f
\newcommand*{\jb@formatted@author}{%
    \ifjbcross
        \ifthenelse{%
            \equal{\jb@inside@author}{\jb@inside@editor}%
            \and\boolean{jb@idem}%
        }{%
            \jb@@fullname% contains `idem, editor'
        }{%
            \jbauthorfont{\jb@@author}\ifjb@yearafterauthor\jbyear\fi
        }%
    \else
        \jbauthorfont{\jb@@author}\ifjb@yearafterauthor\jbyear\fi
    \fi
}%
\newcommand*{\jb@formatted@co@author}{%
  \jbcoauthorfont{\jb@@newcoauthorcite}}%
% changed for 0.5e
\newcommand*{\jb@formatted@co@author@see}{%
    \textup{\jb@@newcoauthorcite}\ifthenelse{\equal{\jb@@newcoauthorcite}{}}{}{\space}}%
\newcommand*{\jb@formatted@co@author@in}{%
  \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{\relax}{%
  \jbcoauthorfont{\jb@@newcoauthorcite}\jbhowsepcoauthorfirst}}%
\newcommand*{\jb@checked@title}{%
  \ifjbhum
    \ifthenelse{\equal{\jb@@type}{book}}{%
        \let\jbtitlefont\jbbtfont}{\let\jbtitlefont\jbapifont}%
  \fi
  \ifthenelse{\equal{\jb@@shorttitle}{}}{%
    \ifthenelse{%
        \not\boolean{jb@author@year}%
        \or
        \(
          \boolean{jb@all@titles}%
          \and\boolean{jb@author@year}%
        \)
    }{%
     \ifjb@no@title@replace\else
       \ifjb@noauthorforcitetitle\else
         \normalfont{\jbhowsepbeforetitle}%
       \fi
     \fi
     \ifjb@no@title@replace\else
      \@ifundefined{REPL@\jb@@newauthorcite}{%
       \global\@namedef{REPL@\jb@@newauthorcite}{}%
       \jb@package@warning{\jb@pkg@name}{%
         `shorttitle' for `\jb@@newauthorcite'\MessageBreak
         is missing -- replacing  with `title'\MessageBreak
         field}}{}%
       \ifjb@debug
         \textcolor[named]{Gray}{%
           \ifjb@debug@br[\fi
             \jbtitlefont{\jb@@title}%
           \ifjb@debug@br]\fi
         }%
       \else
         \jbtitlefont{\jb@@title}%
       \fi%
     \fi
    }{}%
  }{%
    \ifthenelse{%
        \not\boolean{jb@author@year}%
        \or
        \(
          \boolean{jb@all@titles}%
          \and\boolean{jb@author@year}%
        \)
    }{%
       \ifjb@noauthorforcitetitle\else
            \normalfont{\jbhowsepbeforetitle}%
       \fi
       \jbtitlefont{\jb@@shorttitle}%
    }{}%
    \@ifundefined{TITLE@\jb@@newauthorcite}{%
        \global\@namedef{TITLE@\jb@@newauthorcite}{used}%
    }{}%
  }%
}% 
%\newcommand*{\jb@checked@title}{%
%  \ifjbhum
%    \ifthenelse{\equal{\jb@@type}{book}}{%
%        \let\jbtitlefont\jbbtfont}{\let\jbtitlefont\jbapifont}%
%  \fi
%  \ifthenelse{\equal{\jb@@shorttitle}{}}{%
%    \ifjb@author@year\else% NEW 0.52i, no title, but shorttitle  if `authorformat=year' is used.
%     \ifjb@no@title@replace\else
%       \ifjb@noauthorforcitetitle\else
%         \normalfont{\jbhowsepbeforetitle}%
%       \fi
%     \fi
%     \ifjb@no@title@replace\else
%      \@ifundefined{REPL@\jb@@newauthorcite}{%
%       \global\@namedef{REPL@\jb@@newauthorcite}{}%
%       \jb@package@warning{\jb@pkg@name}{%
%         `shorttitle' for `\jb@@newauthorcite'\MessageBreak
%         is missing -- replacing  with `title'\MessageBreak
%         field}}{}%
%       \ifjb@debug
%         \textcolor[named]{Gray}{%
%           \ifjb@debug@br[\fi
%             \jbtitlefont{\jb@@title}%
%           \ifjb@debug@br]\fi
%         }%
%       \else
%         \jbtitlefont{\jb@@title}%
%       \fi%
%     \fi
%    \fi
%  }{%
% NEW 0.52p no additional shorttitle, if `authorformat=year' is used
%    \ifjb@author@year\else
%       \ifjb@noauthorforcitetitle\else
%            \normalfont{\jbhowsepbeforetitle}%
%       \fi
%       \jbtitlefont{\jb@@shorttitle}
%    \fi
% NEW 0.5f: switch for howcited=compare, we have to know, if the shorttitle was used.
%    \@ifundefined{TITLE@\jb@@newauthorcite}{%
%        \global\@namedef{TITLE@\jb@@newauthorcite}{used}%
%    }{}%
%  }%
%}%
% NEW 0.5f analogous to previous command, primarily for oxford crossref command
\newcommand*{\jb@checked@author}{%
   \ifthenelse{\equal{\jb@@fullname}{}}{%
      \ifthenelse{\equal{\jb@@author}{}}{%
          \relax
       }{%
          \jbauthorfont{\jb@@author}%
       }%
   }{%
      \jbauthorfont{\jb@@fullname}%
   }%
}%
\newcommand*{\jb@make@coauthor@emph}{%
  \ifjb@dynamic@author@fonts%
    \let\jbcoauthorfont\jbactualauthorfont%
    \let\jbauthorfont\jbauthorfontifcoauthor%
  \fi
}%
\newcommand*{\jb@make@author@emph}{%
  \ifjb@dynamic@author@fonts%
    \let\jbauthorfont\jbactualauthorfont%
    \let\jbcoauthorfont\normalfont%
  \fi
}%
\newcommand*{\jb@relaxcommandsforfullcite}{%
 \let\IbidemName\@empty
 \let\jb@@author\@empty
 \let\jb@@title\@empty
% NEW 0.5e bug removed for ibidem'ed citations, wrong error message about missing shorttitle
% (although given), submitted by Andreas K. Foerster (<AKFoerster@nikocity.de>)
% changed \@empty to \relax
 \let\jb@@shorttitle\relax
% NEW 0.5c
 \let\jbyear\@empty
 \let\jb@checked@edition\@empty
 \let\jb@@newcoauthorcite\@empty
 \let\jbhowsepbeforetitle\@empty
% NEW 0.5e humanities stuff
 \let\jbapifont\@empty
 \let\jbbtfont\@empty
% NEW 0.5f avoid output of \jb@formatted@author after fullcite's
 \let\jb@formatted@author\@empty
% CHANGED 0.51h kerning routine removed 
% \ifjb@ssed@kerning@wanted
% % no ssedkerning for fullcite
%   \setlength{\jb@length@i}{0pt}%
%   \setlength{\jb@length@ii}{0pt}%
%   \setlength{\jb@length@iii}{0pt}%
%   \renewcommand*{\jb@kern@before@sepi}{}%
%   \renewcommand*{\jb@kern@before@sepii}{}%
%   \renewcommand*{\jb@kern@before@sepiii}{}%
%   \renewcommand*{\jb@kern@after@sepi}{ }%
%   \renewcommand*{\jb@kern@after@sepii}{ }%
%   \renewcommand*{\jb@kern@after@sepiii}{ }%
% \fi
}%
\newcommand*{\jb@checkperiod}[1]{\jb@periodfalse\jb@@checkperiod#1.\jb@@end}%
\newcommand*{\jb@@checkperiod}{}%
\long\def\jb@@checkperiod#1.#2\jb@@end{%
 \ifthenelse{\equal{#1}{}}{\jb@periodtrue\let\ecmd\relax}{%
 \ifthenelse{\equal{#2}{}}{\let\ecmd\relax}{%
 \def\ecmd{\jb@@checkperiod#2\jb@@end}}}\ecmd}%
\newlength{\jbbibhang}
\setlength{\jbbibhang}{2.5em}
\newlength{\jbnumberbibwidth}
\settowidth{\jbnumberbibwidth}{8888.\,}
\DeclareRobustCommand{\jb@checked@bibetal}{%
 \ifjb@bibetal
    \unskip\nobreakspace%
     \ifjb@cite@no@title
        \ifx\jb@@newpagecite\@empty
            \bibIMfont{\etalnamenodot}%
        \else
            \bibIMfont{\etalname}%
        \fi
     \else
        \bibIMfont{\etalname}%
     \fi
 \fi
}
\DeclareRobustCommand{\Bibetal}{\jb@checked@bibetal\global\jbetaltrue}
% CHANGED rewritten in 0.5f
\newcommand*{\jb@checked@etal}{%
  \let\@latex@info\@gobble
  \DeclareRobustCommand{\Bibetal}{%
      \bibIMfont{\etalname}%
      \ifthenelse{\equal{\jb@@newpagecite}{}%
                  \or
                  \(
                      \boolean{jb@firstcite@full}%
                      \and
                      \equal{\jb@@newpagecite}{}%
                      \and
                      \equal{\@nameuse{citefull@\jb@@newauthorcite}}{citefull}%
                  \)
      }{%
% CHANGED 0.5f, boole'd
           \ifthenelse{%
                \not\boolean{jbcross}% NEW, otherwise missing footnote period for citations containing crossref's
                \and
                \not\boolean{jb@lookat}%
                \and
                \not\boolean{jb@author@year}%
                \and
                \not\boolean{jb@fullcite@again}%
                \and
                \not\equal{\jb@@mult@switch}{1}%
           }{%
                \global\jb@footnote@periodfalse
           }{}%
      }{}%
 }%
}%
\newcommand*{\jb@missing@ldf@files}[1]{\ClassError{\jb@pkg@name}{You are in trouble here.\MessageBreak%
    File `#1' not found}{Make sure that all .ldf files are living in the jurabib directory!}}%
\gdef\@bibsfrench{\InputIfFileExists{frjbbib.ldf}{}{\jb@missing@ldf@files{frjbbib.ldf}}}%
\gdef\@bibsgerman{\InputIfFileExists{dejbbib.ldf}{}{\jb@missing@ldf@files{dejbbib.ldf}}}%
\gdef\@bibsaustrian{\InputIfFileExists{dejbbib.ldf}{}{\jb@missing@ldf@files{dejbbib.ldf}}\def\janname{J{^^e4}nner}}%
\gdef\@bibsenglish{\InputIfFileExists{enjbbib.ldf}{}{\jb@missing@ldf@files{enjbbib.ldf}}}%
\gdef\@bibsdutch{\InputIfFileExists{dujbbib.ldf}{}{\jb@missing@ldf@files{dujbbib.ldf}}}%
\gdef\@bibsspanish{\InputIfFileExists{spjbbib.ldf}{}{\jb@missing@ldf@files{spjbbib.ldf}}}%
\gdef\@bibsitalian{\InputIfFileExists{itjbbib.ldf}{}{\jb@missing@ldf@files{itjbbib.ldf}}}%
\gdef\@bibsnorsk{\InputIfFileExists{nojbbib.ldf}{}{\jb@missing@ldf@files{nojbbib.ldf}}}%
\newcommand*{\jb@kv@warning}[2]{%
  \jb@package@warningNoLine{\jb@pkg@name}{%
   unrecognized value `#1'\MessageBreak
   for key `#2' ignored}}
\define@key{jb}{authorformat}{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{smallcaps}}{%
    \jb@kv@recognizedtrue
    \renewcommand*{\jbauthorfont}{\textsc}%
    \renewcommand*{\jbauthorfnfont}{\textsc}%
    \renewcommand*{\jborgauthorfont}{\textsc}%
    \renewcommand*{\jbcoauthorfont}{\textsc}%
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{italic}}{%
    \jb@kv@recognizedtrue
    \renewcommand*{\jbauthorfont}{\textit}%
    \renewcommand*{\jbauthorfnfont}{\textit}%
    \renewcommand*{\jborgauthorfont}{\textit}%
    \renewcommand*{\jbcoauthorfont}{\textit}%
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{dynamic}}{%
    \jb@kv@recognizedtrue
    \jb@dynamic@author@fontstrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{citationreversed}}{%
    \jb@kv@recognizedtrue
    \jb@reverse@names@in@citationtrue
    \jb@reverse@all@namesfalse
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{firstnotreversed}}{%
    \jb@kv@recognizedtrue
    \jb@first@author@reversedtrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{allreversed}}{%
    \jb@kv@recognizedtrue
    \jb@reverse@all@namestrue
    \global\let\bibnf\bibrnf
    \global\let\bibenf\bibrenf
% NEW 0.5f
    \global\let\biblenf\bibrlenf
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{reducedifibidem}}{%
    \jb@kv@recognizedtrue
    \jb@ibidem@with@short@nametrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{year}}{%
    \jb@kv@recognizedtrue
    \jb@author@yeartrue
    \jb@yearafterauthortrue
    \jbshowbibextralabel
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{indexed}}{%
    \jb@kv@recognizedtrue
    \jb@indextrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{and}}{%
    \jb@kv@recognizedtrue
    \addto\@bibsgerman{%
      \DeclareRobustCommand\jbbtasep  { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\jbbfsasep {\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\jbbstasep { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\bibbtasep { \bibIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbfsasep{\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\bibbstasep{ \bibIMfont{\bibandname} }%
% ed section
      \DeclareRobustCommand\jbbtesep  { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\jbbfsesep {\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\jbbstesep { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\bibbtesep { \bibEIMfont{\bibeandname} }%
      \DeclareRobustCommand\bibbfsesep{\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\bibbstesep{ \bibEIMfont{\bibeandname} }%
    }%
    \addto\@bibsenglish{%
      \DeclareRobustCommand\jbbtasep  { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\jbbfsasep {\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\jbbstasep {\unskip\bibIMfont{\commaname{} \textandname} }%
      \DeclareRobustCommand\bibbtasep { \bibIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbfsasep{\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\bibbstasep{\unskip\bibIMfont{\commaname{} \bibandname} }%
% ed section
      \DeclareRobustCommand\jbbtesep  { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\jbbfsesep {\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\jbbstesep {\unskip\bibEIMfont{\commaename{} \texteandname} }%
      \DeclareRobustCommand\bibbtesep { \bibEIMfont{\bibeandname} }%
      \DeclareRobustCommand\bibbfsesep{\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\bibbstesep{\unskip\bibEIMfont{\commaename{} \bibeandname} }%
    }%
    \addto\@bibsfrench{%
      \DeclareRobustCommand\jbbtasep  { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\jbbfsasep {\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\jbbstasep { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\bibbtasep { \bibIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbfsasep{\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\bibbstasep{ \bibIMfont{\bibandname} }%
% ed section
      \DeclareRobustCommand\jbbtesep  { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\jbbfsesep {\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\jbbstesep { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\bibbstasep{ \bibEIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbtesep { \bibEIMfont{\bibeandname} }%
      \DeclareRobustCommand\bibbfsesep{\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\bibbstesep{ \bibEIMfont{\bibeandname} }%
    }%
    \addto\@bibsdutch{%
      \DeclareRobustCommand\jbbtasep  { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\jbbfsasep {\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\jbbstasep { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\bibbtasep { \bibIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbfsasep{\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\bibbstasep{ \bibIMfont{\bibandname} }%
% ed section
      \DeclareRobustCommand\jbbtesep  { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\jbbfsesep {\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\jbbstesep { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\bibbstasep{ \bibEIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbtesep { \bibEIMfont{\bibeandname} }%
      \DeclareRobustCommand\bibbfsesep{\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\bibbstesep{ \bibEIMfont{\bibeandname} }%
    }%
    \addto\@bibsspanish{%
      \DeclareRobustCommand\jbbtasep  { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\jbbfsasep {\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\jbbstasep { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\bibbtasep { \bibIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbfsasep{\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\bibbstasep{ \bibIMfont{\bibandname} }%
% ed section
      \DeclareRobustCommand\jbbtesep  { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\jbbfsesep {\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\jbbstesep { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\bibbstasep{ \bibEIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbtesep { \bibEIMfont{\bibeandname} }%
      \DeclareRobustCommand\bibbfsesep{\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\bibbstesep{ \bibEIMfont{\bibeandname} }%
    }%
    \addto\@bibsitalian{%
      \DeclareRobustCommand\jbbtasep  { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\jbbfsasep {\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\jbbstasep { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\bibbtasep { \bibIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbfsasep{\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\bibbstasep{ \bibIMfont{\bibandname} }%
% ed section
      \DeclareRobustCommand\jbbtesep  { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\jbbfsesep {\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\jbbstesep { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\bibbstasep{ \bibEIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbtesep { \bibEIMfont{\bibeandname} }%
      \DeclareRobustCommand\bibbfsesep{\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\bibbstesep{ \bibEIMfont{\bibeandname} }%
    }%
    \addto\@bibsnorsk{%
      \DeclareRobustCommand\jbbtasep  { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\jbbfsasep {\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\jbbstasep { \bibIMfont{\textandname} }%
      \DeclareRobustCommand\bibbtasep { \bibIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbfsasep{\unskip\bibIMfont{\commaname} }%
      \DeclareRobustCommand\bibbstasep{ \bibIMfont{\bibandname} }%
% ed section
      \DeclareRobustCommand\jbbtesep  { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\jbbfsesep {\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\jbbstesep { \bibEIMfont{\texteandname} }%
      \DeclareRobustCommand\bibbstasep{ \bibEIMfont{\bibandname} }%
      \DeclareRobustCommand\bibbtesep { \bibEIMfont{\bibeandname} }%
      \DeclareRobustCommand\bibbfsesep{\unskip\bibEIMfont{\commaename} }%
      \DeclareRobustCommand\bibbstesep{ \bibEIMfont{\bibeandname} }%
    }%
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{abbrv}}{%
    \jb@kv@recognizedtrue
    \jb@abbrvtrue
  }{\relax}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{authorformat}\fi
 }%
}%
\define@key{jb}{coauthorformat}{%
% NEW 0.5d
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{italic}}{%
    \jb@kv@recognizedtrue
    \renewcommand*{\jbcoauthorfont}{\textit}%
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{normal}}{%
    \jb@kv@recognizedtrue
    \renewcommand*{\jbcoauthorfont}{\normalfont}%
  }{\relax}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{coauthorformat}\fi
 }%
}%
\define@key{jb}{superscriptedition}[commented]{%
% NEW 0.5d
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{all}}{%
    \jb@kv@recognizedtrue\jb@ssed@alltrue}{}%
  \ifthenelse{\equal{\jb@val}{commented}}{%
    \jb@kv@recognizedtrue\jb@ssed@commentedtrue}{}%
  \ifthenelse{\equal{\jb@val}{switch}}{%
    \jb@kv@recognizedtrue\jb@ssed@swtrue}{}%
  \ifthenelse{\equal{\jb@val}{bib}\or\equal{\jb@val}{address}}{%
    \jb@kv@recognizedtrue\jb@bibssedtrue
% NEW 0.5f gobbling \jbedition inside \apyformat causes errors in first bibliographic entry,
% bug reported by Andrea Heilmann (<andrea.heilmann@t-online.de>)
    \let\jbedition\@gobble}{}%
  \ifthenelse{\equal{\jb@val}{multiple}}{%
    \jb@kv@recognizedtrue\jb@ssed@mult@workstrue}{}%
  \ifthenelse{\equal{\jb@val}{kerning}}{%
    \jb@kv@recognizedtrue\jb@ssed@kerning@wantedtrue}{}%
% NEW 0.51j
  \ifthenelse{\equal{\jb@val}{year}}{\jb@kv@recognizedtrue
      \renewcommand*{\jbssedbd}{\textsuperscript}%
      \let\jbedition\@gobble\DeclareRobustCommand{\apyformat}[1]{%
      \unskip\unskip\space\bibapyldelim{}##1\bibapyrdelim{}}
  }{}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{superscriptedition}\fi
 }%
}%
\define@key{jb}{titleformat}{%
% NEW 0.5d
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{italic}}{%
    \jb@kv@recognizedtrue
    \DeclareRobustCommand{\jbtitlefont}{\textit}%
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{all}}{%
    \jb@kv@recognizedtrue
    \ifjb@no@title@replace
        \global\jb@no@title@replacefalse
        \jb@package@warningNoLine{\jb@pkg@name}{%
        `titleformat=all' and `titleformat=noreplace'\MessageBreak
         cannot be used together. I will replace missing\MessageBreak
         shorttitles to avoid ambiguity of citations}%
    \fi
    \jb@all@titlestrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{noreplace}}{%
    \jb@kv@recognizedtrue
    \jb@no@title@replacetrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{commasep}}{%
    \jb@kv@recognizedtrue
    \jb@before@title@separatortrue
% NEW 0.5e making \jbhowsepbeforetitle again a two char command
    \renewcommand*{\jbhowsepbeforetitle}{, }%
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{colonsep}}{%
    \jb@kv@recognizedtrue
    \jb@before@title@separatortrue
% NEW 0.5e making \jbhowsepbeforetitle again a two char command
    \renewcommand*{\jbhowsepbeforetitle}{: }%
  }{\relax}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{titleformat}\fi
 }%
}%
\define@key{jb}{din}[true]{%
  \AtEndOfPackage{%
   \DeclareRobustCommand{\biblnfont}{\textsc}%
   \DeclareRobustCommand{\bibfnfont}{\normalfont}%
   \DeclareRobustCommand{\bibbtfont}{\textit}%
   \DeclareRobustCommand{\bibtfont}{\textit}%
   \DeclareRobustCommand{\bibjtfont}{\textit}%
   \DeclareRobustCommand{\bibapifont}{\normalfont}%
   \DeclareRobustCommand{\bibatsep}{.}%
   \DeclareRobustCommand{\bibbtsep}{\inname: }%
   \DeclareRobustCommand{\bibjtsep}{\inname: }%
  }%
}%
\define@key{jb}{howcited}[normal]{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{all}}{%
    \jb@kv@recognizedtrue
    \jb@howcitedtrue
    \jb@howcited@alltrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{normal}}{%
    \jb@kv@recognizedtrue
    \jb@howcitedtrue
    \jb@howcited@normaltrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{multiple}}{%
    \jb@kv@recognizedtrue
    \jb@howcitedtrue
    \jb@howcited@multipletrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{compare}}{%
    \jb@kv@recognizedtrue
    \jb@howcitedtrue
    \jb@howcited@comparetrue
  }{\relax}%
 \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{howcited}\fi
 }%
 \renewcommand*{\jbrealcitation}[2]{%
  \@ifundefined{b@##2@C}{\global\@namedef{b@##2@C}{cite}}{\relax}%
  \ifthenelse{\equal{##1}{citetitle}}{%
    \global\@namedef{b@##2@C}{citetitle}}{\relax}%
  \ifthenelse{\equal{##1}{citenotitle}}{%
    \global\@namedef{b@##2@C}{citenotitle}}{\relax}}%
}%
\define@key{jb}{cofirstsep}{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{#1}{comma}}{%
      \jb@kv@recognizedtrue
      \jb@coauthor@lastfalse
      \renewcommand*{\jbhowsepcoauthorfirst}{, }%
  }{\relax}%
  \ifthenelse{\equal{#1}{in}}{%
      \jb@kv@recognizedtrue
      \jb@coauthor@lastfalse
      \renewcommand*{\jbhowsepcoauthorfirst}{~in: }%
  }{\relax}%
  \ifjb@kv@recognized\else\jb@kv@warning{#1}{cofirstsep}\fi
}%
\define@key{jb}{colastsep}{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{#1}{divis}}{%
      \jb@kv@recognizedtrue
      \jb@coauthor@lasttrue
      \renewcommand*{\jbhowsepcoauthorlast}{--}%
  }{\relax}%
  \ifjb@kv@recognized\else\jb@kv@warning{#1}{colastsep}\fi
}%
\define@key{jb}{commabeforerest}[true]{\jb@comma@before@resttrue\renewcommand*{\jbbeforestartpagesep}{,\space}}%
\define@key{jb}{bibformat}{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{compress}}{%
    \jb@kv@recognizedtrue
    \jb@compressed@bibtrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{raggedright}}{%
    \jb@kv@recognizedtrue
    \addto\jbonlyforbib{\raggedright}
    \let\bibaltformatalign\raggedright
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{tabular}}{%
    \jb@kv@recognizedtrue
    \jb@tabulartrue\jb@bib@hangfalse
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{numbered}}{%
    \jb@kv@recognizedtrue
    \jb@numbered@bibtrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{ibidem}}{%
    \jb@kv@recognizedtrue
    \jb@bibformat@ibidemtrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{ibidemalt}}{%
    \jb@kv@recognizedtrue
    \jb@bibformat@ibidemtrue
    \jbaltformattrue
% CH 0.51w removed    
%    \let\fsted\@gobble
%    \let\bibedformat\@gobble
    \jb@compressed@bibtrue % make a compressed list
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{nohang}}{%
    \jb@kv@recognizedtrue
    \jb@bib@hangfalse
  }{\relax}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{bibformat}\fi
 }%
}%
\define@key{jb}{citefull}[all]{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{first}}{%
    \jb@kv@recognizedtrue
    \jb@change@fonts@for@fullcitetrue
    \jb@firstcite@fulltrue
    \jb@allow@nobibtrue
    \global\jb@coauthor@lastfalse
    % make sure see is off for `in'
    \ifjb@see\else\renewcommand*{\jbhowsepcoauthorfirst}{~in: }\fi
    \jb@all@fullfalse
  }{%
    \ifthenelse{\equal{\jb@val}{all}}{%
      \jb@kv@recognizedtrue
      \jb@all@fulltrue
      \jb@allow@nobibtrue
      \global\jb@howcitedfalse
      \global\jb@coauthor@lastfalse
      % make sure see is off for `in'
      \ifjb@see\else\renewcommand*{\jbhowsepcoauthorfirst}{~in: }\fi
      \jb@firstcite@fullfalse
    }{\relax}%
  }%
  \ifthenelse{\equal{\jb@val}{chapter}}{%
    \jb@kv@recognizedtrue
    \@ifundefined{chapter}{%
     \ClassError{\jb@pkg@name}{%
      Sorry, `citefull=chapter' makes no sense for\MessageBreak
      classes without \string\chapter%
     }{Try `citefull=section' for an article class}}{}%
    \setkeys{jb}{citefull=first}%
    \@addtoreset{citefull}{chapter}%
    \def\jb@resetfor{chapter}%
    \def\jb@reset@look@label@for{\thechapter}% for lookat
  }{%
      \ifthenelse{\equal{\jb@val}{section}}{%
        \jb@kv@recognizedtrue
        \@ifundefined{chapter}{}{%
         \jb@package@warningNoLine{\jb@pkg@name}{%
          `citefull=section' was designed for use with\MessageBreak
          an article class, note that it's not well\MessageBreak
          tested for use with book or report classes}}%
        \setkeys{jb}{citefull=first}%
        \@addtoreset{citefull}{section}%
        \def\jb@resetfor{section}%
        \def\jb@reset@look@label@for{\thesection}% for lookat, to check
      }{%
% NEW 0.5e false value to override .cfg settings with \AtBeginDocument{\setkeys{jb}{citefull=false}}
          \ifthenelse{\equal{\jb@val}{false}}{%
              \jb@kv@recognizedtrue
              \global\jb@all@fullfalse
              \global\jb@allow@nobibfalse
              \global\jb@firstcite@fullfalse
          }{\relax}%
      }%
  }%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{citefull}\fi
 }%
}%
\define@key{jb}{see}[true]{%
    \jb@seetrue\jb@coauthor@lastfalse
% space removed for 0.5e
    \renewcommand*{\jbhowsepcoauthorfirst}{}%
    \renewcommand*{\jbcoauthorfont}{\normalfont}%
% NEW 0.5e
    \let\jb@formatted@co@author\jb@formatted@co@author@see
%
    \let\jb@formatted@co@author@in\jb@formatted@co@author@see
}%
% NEW 0.5e nested tests to avoid \jb@val=\@nil
\define@key{jb}{ibidem}[strict]{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{false}}{%
    \jb@kv@recognizedtrue
    \AtBeginDocument{%
        \global\jb@ibidemfalse
        \global\jb@ibidem@pagewisefalse
        \global\jb@ibidem@double@pagewisefalse
        \global\jb@ibidem@with@namefalse
        \global\jb@ibidem@with@name@and@titlefalse
    }%
  }{%
    \ifthenelse{\equal{\jb@val}{strict}}{%
        \jb@kv@recognizedtrue
        \jb@ibidemtrue
        \jb@ibidem@pagewisetrue
        \jb@ibidem@double@pagewisefalse
    }{%
      \ifthenelse{\equal{\jb@val}{strictdoublepage}}{%
            \jb@kv@recognizedtrue
            \jb@ibidemtrue
            \jb@ibidem@pagewisetrue
            \if@twoside\jb@ibidem@double@pagewisetrue
            \else\jb@ibidem@double@pagewisefalse\fi
      }{%
          \ifthenelse{\equal{\jb@val}{nostrict}}{%
                \jb@kv@recognizedtrue
                \jb@ibidemtrue
                \jb@ibidem@pagewisefalse
                \jb@ibidem@double@pagewisefalse
          }{%
          \ifthenelse{\equal{\jb@val}{name}}{%
                \jb@kv@recognizedtrue
                %% first make citefull=first
                \setkeys{jb}{citefull=first}%
                \jb@ibidemfalse
                \global\jb@ibidem@with@nametrue
          }{%
              \ifthenelse{\equal{\jb@val}{name&title}}{%
                    \jb@kv@recognizedtrue
                    %% first make citefull=first
                    \setkeys{jb}{citefull=first}%
                    \jb@ibidemfalse
                    \jb@ibidem@with@nametrue
                    \jb@ibidem@with@name@and@titletrue
              }{%
% NEW 0.5f
                  \ifthenelse{\equal{\jb@val}{name&title&auto}}{%
                        \jb@kv@recognizedtrue
                        %% first make citefull=first
                        \setkeys{jb}{citefull=first}%
                        \jb@ibidemfalse
                        \jb@ibidem@with@nametrue
                        \jb@ibidem@with@name@and@title@autotrue
              }{\relax}}}}}}}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{ibidem}\fi
 }%
}%
\define@key{jb}{idem}[strict]{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{false}}{%
    \jb@kv@recognizedtrue
    \AtBeginDocument{%
        \global\jb@idemfalse
        \global\jb@idem@pagewisefalse
        \global\jb@idem@double@pagewisefalse
    }%
  }{%
    \ifthenelse{\equal{\jb@val}{strict}}{%
        \jb@kv@recognizedtrue
        \jb@idemtrue
        \jb@idem@pagewisetrue
        \jb@idem@double@pagewisefalse
    }{%
      \ifthenelse{\equal{\jb@val}{strictdoublepage}}{%
            \jb@kv@recognizedtrue
            \jb@idemtrue
            \jb@idem@pagewisetrue
            \if@twoside\jb@idem@double@pagewisetrue
            \else\jb@idem@double@pagewisefalse\fi
      }{%
          \ifthenelse{\equal{\jb@val}{nostrict}}{%
                \jb@kv@recognizedtrue
                \jb@idemtrue
                \jb@idem@pagewisefalse
                \jb@idem@double@pagewisefalse
          }{\relax}}}}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{idem}\fi
 }%
}%
\define@key{jb}{footnotes}{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{marginal}}{%
    \jb@kv@recognizedtrue
% The code here is originally from myfootnote.sty by Stefan Ulrich, posted in d.c.t.t.
    \newlength\jbfootnoteindent
    \setlength\jbfootnoteindent{\parindent}%
    \newlength\jbfootnotenumwidth
    \settowidth\jbfootnotenumwidth{99}%
    \newcommand*{\jbfootnotenumalign}{r}%
    \newcommand*{\jbfootnoteformat}{\textsuperscript}%
    \renewcommand\@makefntext[1]{\@setpar{\@@par
      \@tempdima\hsize\advance\@tempdima-\jbfootnoteindent
      \parshape\@ne\jbfootnoteindent\@tempdima}%
      \parindent 1em\par\noindent
      \makebox[0pt][r]{\makebox[\jbfootnoteindent][r]{%
      \makebox[\jbfootnotenumwidth][\jbfootnotenumalign]{%
      \jbfootnoteformat{\@thefnmark}}\hspace*{\fill}}}##1}%
    \AtBeginDocument{%
     \ifjb@endnotes
        \def\enoteformat{\@setpar{\@@par\@tempdima\hsize
        \advance\@tempdima-\jbfootnoteindent
        \parshape\@ne\jbfootnoteindent\@tempdima}%
        \parindent 1em\par\noindent
        \makebox[0pt][r]{\makebox[\jbfootnoteindent][r]{%
         \makebox[\jbfootnotenumwidth][\jbfootnotenumalign]{%
         \jbfootnoteformat{\@theenmark}}\hspace*{\fill}}}}%
     \fi
    }%
  }{\relax}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{footnotes}\fi
 }%
}%
\define@key{jb}{natoptargorder}[true]{\jb@natbib@opt@arg@ordertrue}%
\define@key{jb}{round}[true]{%
  \renewcommand*{\jb@open}{(}%
  \renewcommand*{\jb@close}{)}%
}%
\define@key{jb}{square}[true]{%
  \renewcommand*{\jb@open}{[}%
  \renewcommand*{\jb@close}{]}%
}%
\define@key{jb}{lookat}[true]{\jb@lookattrue}%
% NEW 0.5e nested tests to avoid \jb@val=\@nil
\define@key{jb}{crossref}[normal]{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{dynamic}}{%
      \jb@kv@recognizedtrue
      \global\jb@dynamic@crossrefstrue
      \setkeys{jb}{crossref=long}%
  }{%
      \ifthenelse{\equal{\jb@val}{short}}{%
          \jb@kv@recognizedtrue
% NEW 0.5e \AtBeginDocument added, otherwise the default [normal] won't be overridden
          \AtBeginDocument{%
           \ifjb@dynamic@crossrefs
               \renewcommand*{\bibcrossrefcite}{\citetitle}%
               \renewcommand*{\bibcrossrefciteagain}{\cite}%
               \renewcommand*{\bibincollcrossrefcite}{\citetitle}%
               \renewcommand*{\bibincollcrossrefciteagain}{\cite}%
               \let\jbedbyincollcrossrefcite\jbedbyincollcrossrefshortnoapy
               \let\jbedbyincollcrossrefciteagain\jbedbyincollcrossrefshort
           \else
               \renewcommand*{\bibcrossrefcite}{\cite}%
               \renewcommand*{\bibcrossrefciteagain}{\cite}%
               \renewcommand*{\bibincollcrossrefcite}{\cite}%
               \renewcommand*{\bibincollcrossrefciteagain}{\cite}%
               \let\jbedbyincollcrossrefcite\jbedbyincollcrossrefshort
               \let\jbedbyincollcrossrefciteagain\jbedbyincollcrossrefshort
           \fi
          }%
      }{%
          \ifthenelse{\equal{\jb@val}{normal}}{%
              \jb@kv@recognizedtrue
              \AtBeginDocument{%
               \ifjb@dynamic@crossrefs
                   \renewcommand*{\bibcrossrefcite}{\citetitle}%
                   \renewcommand*{\bibincollcrossrefcite}{\citetitle}%
                   \renewcommand*{\bibcrossrefciteagain}{\cite}%
                   \renewcommand*{\bibincollcrossrefciteagain}{\cite}%
                   \let\jbedbyincollcrossrefcite\jbedbyincollcrossrefshortwithapy
                   \let\jbedbyincollcrossrefciteagain\jbedbyincollcrossrefshortnoapy
               \else
                   \renewcommand*{\bibcrossrefcite}{\citetitle}%
                   \renewcommand*{\bibincollcrossrefcite}{\citetitle}%
                   \renewcommand*{\bibcrossrefciteagain}{\citetitle}%
                   \renewcommand*{\bibincollcrossrefciteagain}{\citetitle}%
                   \let\jbedbyincollcrossrefcite\jbedbyincollcrossrefshortwithapy
                   \let\jbedbyincollcrossrefciteagain\jbedbyincollcrossrefshortwithapy
               \fi
              }%
          }{%
              \ifthenelse{\equal{\jb@val}{long}}{%
                  \jb@kv@recognizedtrue
                  \AtBeginDocument{%
                   \ifjb@dynamic@crossrefs
                       \renewcommand*{\bibcrossrefcite}{\fullcite}%
                       \renewcommand*{\bibincollcrossrefcite}{\fullcite}%
                       \renewcommand*{\bibcrossrefciteagain}{\citetitle}%
                       \renewcommand*{\bibincollcrossrefciteagain}{\citetitle}%
                       \let\jbedbyincollcrossrefcite\jbedbyincollcrossreflong
                       \let\jbedbyincollcrossrefciteagain\jbedbyincollcrossrefshortwithapy
                   \else
                       \renewcommand*{\bibcrossrefcite}{\fullcite}%
                       \renewcommand*{\bibincollcrossrefcite}{\fullcite}%
                       \renewcommand*{\bibcrossrefciteagain}{\fullcite}%
                       \renewcommand*{\bibincollcrossrefciteagain}{\fullcite}%
                       \let\jbedbyincollcrossrefcite\jbedbyincollcrossreflong
                       \let\jbedbyincollcrossrefciteagain\jbedbyincollcrossreflong
                   \fi
                  }%
          }{\relax}}}}%
 \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{crossref}\fi
 }%
}%
\define@key{jb}{pages}{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{format}}{%
      \jb@kv@recognizedtrue
      \jb@formatted@pagestrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{always}}{%
      \jb@kv@recognizedtrue
      \jb@always@pagerangestrue
  }{\relax}%
  \ifthenelse{\equal{\jb@val}{test}}{%
      \jb@kv@recognizedtrue
      \jb@tested@pagerangestrue
  }{\relax}%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{pages}\fi
 }%
}%
\define@key{jb}{oxford}[true]{%
  \jb@kv@recognizedtrue
  \global\jbhumtrue
  \global\jboxfordtrue\global\jbchicagofalse
  \setkeys{jb}{%
      authorformat={citationreversed},see,%
      titleformat=commasep,%
  }%
  \jbdotafterbibentry
  \AtEndOfPackage{%
   \ifjboxford
% NEW 0.5e
   \ifjb@biblikecite\else
    \jb@info{*** jurabib set up for oxford style ***}%
    %%%%%% bibliographic font commands %%%%%%%%%
    \renewcommand*{\bibfnfont}{}%                 first name font
    \renewcommand*{\biblnfont}{}%                 last name font
    \renewcommand*{\bibefnfont}{}%                editor first name font
    \renewcommand*{\bibelnfont}{}%                editor last name font
    \renewcommand*{\bibtfont}{\textit}%           title font
    \renewcommand*{\bibbtfont}{\textit}%          booktitle font
    \renewcommand*{\bibjtfont}{\textit}%          journal title font
    \renewcommand*{\bibapifont}[1]{`##1'}%        bib article/incollection title font
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \renewcommand*{\jbapifont}[1]{`##1'}%         text article/incollection title font
    \renewcommand*{\jbtitlefont}{}%               text title font
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \renewcommand*{\bibansep}{,}%                 author name sep
    \renewcommand*{\bibaesep}{, }%                after editor sep
    \renewcommand*{\bibatsep}{,}%                 after title sep
    \DeclareRobustCommand{\bibapyldelim}{(}%      always parentheses for oxford!
    \DeclareRobustCommand{\bibapyrdelim}{)}%      always parentheses for oxford!
    \DeclareRobustCommand{\dateldelim}{(}%        enclose the date in parentheses
    \DeclareRobustCommand{\daterdelim}{)}%        enclose the date in parentheses
    %%%%%% author separation bibliography %%%%%%
    \renewcommand*{\bibbtasep}{ \ }%             between two authors sep
    \renewcommand*{\bibbfsasep}{, }%              between first  second author sep
    \renewcommand*{\bibbstasep}{ \ }%            between second  third author sep
    %%%%%% editor separation bibliography %%%%%%
    \renewcommand*{\bibbtesep}{ \ }%             between two editors sep
    \renewcommand*{\bibbfsesep}{, }%              between first  second editor sep
    \renewcommand*{\bibbstesep}{ \ }%            between second  third editor sep
    %%%%%% author separation citation %%%%%%%%%%
    %  already done by authorformat=and
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \renewcommand*{\bibbtsep}{\inname: }%         booktitle sep
    \renewcommand*{\jb@cr@open}{}%                crossref left delimiter
    \renewcommand*{\jb@cr@close}{}%               crossref right delimiter
    \renewcommand*{\jb@art@cr@open}{}%            article crossref left delimiter
    \renewcommand*{\jb@art@cr@close}{}%           article crossref right delimiter
    \renewcommand*{\jb@incoll@cr@open}{}%         incoll crossref left delimiter
    \renewcommand*{\jb@incoll@cr@close}{}%        incoll crossref right delimiter
    \renewcommand*{\bibaldelim}{(}%               article year left delimiter
    \renewcommand*{\bibardelim}{)}%               article year right delimiter
   \fi\fi
  }%
  \addto\jbonlyforbib{\renewcommand*{\bibansep}{, }}% make sure that a space appear
  \DeclareRobustCommand{\artnumberformat}[1]{\unskip:##1}%
  \ifjb@kv@recognized\else\jb@kv@warning{#1}{oxford}\fi
}%
\define@key{jb}{chicago}[true]{%
  \jb@kv@recognizedtrue
%  \global\jbhumtrue
  \global\jbchicagotrue\global\jboxfordfalse
  \setkeys{jb}{%
      authorformat={citationreversed,firstnotreversed},edby,see,%
      bibformat=ibidem,%
      citefull=first,%
%      authorformat=and,% (also set by humtrue!)
      titleformat=commasep,%
      commabeforerest,%
  }%
  \jbdotafterbibentry% (added in 0.5f)
  \AtEndOfPackage{%
   \ifjbchicago
   \ifjb@biblikecite\else
    \jb@info{*** jurabib set up for chicago style ***}%
    %%%%%% bibliographic font commands %%%%%%%%%
    \renewcommand*{\bibfnfont}{}%                                first name font
    \renewcommand*{\biblnfont}{}%                                last name font
    \renewcommand*{\bibefnfont}{}%                               editor first name font
    \renewcommand*{\bibelnfont}{}%                               editor last name font
    \renewcommand*{\bibtfont}{\textit}%                          title font
    \renewcommand*{\bibbtfont}{\textit}%                         booktitle font
    \renewcommand*{\bibjtfont}{\textit}%                         journal title font
    \renewcommand*{\bibapifont}[1]{``##1''}%                     bib article/incollection title font (changed in 0.5f)
    \renewcommand*{\bibsnfont}{}%                                series name font
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \renewcommand*{\jbapifont}[1]{``##1''}%                      text article/incollection title font (changed in 0.5f)
    \renewcommand*{\jbtitlefont}{}%                              text title font
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \renewcommand*{\bibansep}{. }%                               author name sep (changed in 0.5f)
    \renewcommand*{\bibaesep}{, }%                               after editor sep
    \renewcommand*{\bibatsep}{,}%                                after title sep
    \renewcommand*{\bibbdsep}{,}%                                before date sep (changed in 0.5f)
    %%%%%% author separation bibliography %%%%%%
    \renewcommand*{\bibbtasep}{ \bibIMfont{\bibandname} }%       between two authors sep             (changed in 0.5f)
    \renewcommand*{\bibbfsasep}{\unskip\bibIMfont{\commaname} }% between first and second author sep (changed in 0.5f)
    \renewcommand*{\bibbstasep}{ \bibIMfont{\bibandname} }%      between second and third author sep (changed in 0.5f)
    %%%%%% editor separation bibliography %%%%%%
    \renewcommand*{\bibbtesep}{ \bibEIMfont{\bibandname} }%       between two editors sep             (changed in 0.5f)
    \renewcommand*{\bibbfsesep}{\unskip\bibEIMfont{\commaname} }% between first and second editor sep (changed in 0.5f)
    \renewcommand*{\bibbstesep}{ \bibEIMfont{\bibandname} }%      between second and third editor sep (changed in 0.5f)
    %%%%%% author separation citation %%%%%%%%%%
    \renewcommand*{\jbbtasep}{ \bibIMfont{\textandname} }%       between two authors sep             (changed in 0.5f)
    \renewcommand*{\jbbfsasep}{\unskip\bibIMfont{\commaname} }%  between first and second author sep (changed in 0.5f)
    \renewcommand*{\jbbstasep}{ \bibIMfont{\textandname} }%      between second and third author sep (changed in 0.5f)
    %%%%%% editor separation citation %%%%%%
    \renewcommand*{\jbbtesep}{ \bibEIMfont{\texteandname} }%      between two editors sep             (changed in 0.5f)
    \renewcommand*{\jbbfsesep}{\unskip\bibEIMfont{\commaename} }% between first and second editor sep (changed in 0.5f)
    \renewcommand*{\jbbstesep}{ \bibEIMfont{\texteandname} }%     between second and third editor sep (changed in 0.5f)
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \renewcommand*{\bibbtsep}{\inname{} }%                       booktitle sep (changed in 0.5f)
    \renewcommand*{\jb@cr@open}{}%                               crossref left delimiter
    \renewcommand*{\jb@cr@close}{}%                              crossref right delimiter
    \renewcommand*{\jb@art@cr@close}{}%                          article crossref left delimiter
    \renewcommand*{\jb@art@cr@close}{}%                          article crossref right delimiter
    \renewcommand*{\jb@incoll@cr@open}{}%                        incoll crossref left delimiter
    \renewcommand*{\jb@incoll@cr@close}{}%                       incoll crossref right delimiter
    \renewcommand*{\bibaldelim}{(}%                              article year left delimiter
    \renewcommand*{\bibardelim}{)}%                              article year right delimiter
    \renewcommand*{\artnumberformat}[1]{,\space{}no.~##1}%       article number format (added in 0.5f)
    \renewcommand*{\pernumberformat}[1]{,\space{}no.~##1}%       periodical format (added in 0.5f)
    \renewcommand*{\edbysep}{, }%                                (added in 0.5f)
    \def\bibauthormultiple{%
        \stepcounter{multiple@author}% to suppress inside bibliographic entry
        \leavevmode\vrule height 2pt depth -1.6pt width 3em\hspace{1pt}.\space}% (added in 0.5f)
    \DeclareRobustCommand{\jbnote}[2]{%
        \ifjbweareinbib
            \ifthenelse{\equal{##1}{1}}{\unskip\unskip\bibatsep{} ##2}{##2}%
        \fi
    }% (added in 0.5f)
% only parentheses in text, not in the bibliography!
    \ifjbweareinbib\else
      \renewcommand*{\bibapyldelim}{\unskip\space(}%
      \renewcommand*{\bibapyrdelim}{)}%
    \fi
    \addto\jbonlyforbib{%
      \DeclareRobustCommand\incollinname{\inname{} }%            (added in 0.5f)
      \DeclareRobustCommand{\bibbtsep}{\inname{} }%              (added in 0.5f)
%     \DeclareRobustCommand{\bibapyldelim}{\unskip\unskip.\space}% dot removed, suggested by Robert Schlicht
      \DeclareRobustCommand{\bibapyldelim}{\unskip\unskip\space}%
      \DeclareRobustCommand{\bibapyrdelim}{}%
      \DeclareRobustCommand{\bibatsep}{.}%                       (added in 0.5f)
      \DeclareRobustCommand{\dateldelim}{\unskip.}%
      \DeclareRobustCommand{\daterdelim}{}%
    }%
    \AddTo\bibsenglish{%
        \def\incollinname{in}%                                   (added in 0.5f)
        \def\inname{in}%                                         (added in 0.5f)
        \def\editorname{\unskip,\space{}ed.}%                    (added in 0.5f)
        \def\editorsname{\unskip,\space{}eds.}%                  (added in 0.5f)
        \def\edbyname{ed.}%                                      (added in 0.5f)
        \def\Edbyname{Ed.}%                                      (added in 0.5f)
        \def\volumename{vol.}%                                   (added in 0.5f)
        \def\Volumename{Vol.}%                                   (added in 0.5f)
        \def\firstedname{1st}%                                   (added in 0.5f)
        \def\secondedname{2nd}%                                  (added in 0.5f)
        \def\thirdedname{3rd}%                                   (added in 0.5f)
        \def\fourthedname{4th}%                                  (added in 0.5f)
        \def\fifthedname{5th}%                                   (added in 0.5f)
        \def\thedname{th}%                                       (added in 0.5f)
%       \def\editionname{ed.}%                                   (added in 0.5f)
        \def\editionname{ed}% dot removed, suggested by Robert Schlicht
   }%
   \fi\fi
  }%
  \addto\jbonlyforbib{\renewcommand*{\bibansep}{. }}% make sure that a space appear
  \ifjb@kv@recognized\else\jb@kv@warning{#1}{chicago}\fi
}%
\define@key{jb}{human}[true]{\global\jbhumtrue}
\define@key{jb}{edby}[true]{\global\jb@edbytrue}
\define@key{jb}{endnote}[true]{%
  \DeclareRobustCommand{\jbnote}[2]{\unskip}%
  \DeclareRobustCommand{\jbendnote}[1]{\def\jb@endnote{\unskip\unskip\ifjb@dot\else,\fi\space##1}}%
}
\define@key{jb}{biblikecite}[true]{%
     \global\jb@biblikecitetrue
     \AtBeginDocument{% <== to make redefintions work
        \global\let\biblnfont\jbauthorfont
        \global\let\bibfnfont\jbauthorfnfont
        \global\let\bibelnfont\jbauthorfont
        \global\let\bibefnfont\jbauthorfnfont
        \global\let\bibbtfont\jbtitlefont
        \global\let\bibtfont\jbtitlefont
        \global\let\bibapifont\jbapifont
% to think about ...
%        \global\let\bibbtasep\jbbtasep
%        \global\let\bibbfsasep\jbbfsasep
%        \global\let\bibbstasep\jbbstasep
%        \global\let\bibbtesep\jbbtesep
%        \global\let\bibbfsesep\jbbfsesep
%        \global\let\bibbstesep\jbbstesep
     }%
}
\define@key{jb}{opcit}[true]{%
 \@for\jb@val:=#1\do{%
  \jb@kv@recognizedfalse
  \ifthenelse{\equal{\jb@val}{true}}{%
    \jb@kv@recognizedtrue
    \jb@opcittrue
% NEW 0.5f opcit uses now shorttitle to avoid ambiguity
%    \jb@author@yeartrue
%    \jb@yearaftertitletrue
  }{}%
  \ifthenelse{\equal{\jb@val}{chapter}}{%
    \jb@kv@recognizedtrue
    \global\jb@opcittrue
% NEW 0.5f opcit uses now shorttitle to avoid ambiguity
%    \jb@author@yeartrue
%    \jb@yearaftertitletrue
    \@ifundefined{chapter}{%
     \ClassError{\jb@pkg@name}{%
      Sorry, `opcit=chapter' makes no sense for\MessageBreak
      classes without \string\chapter%
     }{Try `opcit=section' for an article class}}{}%
    \@addtoreset{opcit}{chapter}%
    \def\jb@reset@opcit@for{chapter}%
    \def\jb@reset@opcit@label@for{\thechapter}% for opcit
  }{%
      \ifthenelse{\equal{\jb@val}{section}}{%
        \jb@kv@recognizedtrue
        \global\jb@opcittrue
% NEW 0.5f opcit uses now shorttitle to avoid ambiguity
%        \jb@author@yeartrue
%        \jb@yearaftertitletrue
        \@ifundefined{chapter}{}{%
         \jb@package@warningNoLine{\jb@pkg@name}{%
          `opcit=section' was designed for use with\MessageBreak
          an article class, note that it's not well\MessageBreak
          tested for use with book or report classes}}%
        \@addtoreset{opcit}{section}%
        \def\jb@reset@opcit@for{section}%
        \def\jb@reset@opcit@label@for{\thesection}% for opcit
      }{}%
  }%
  \ifjb@kv@recognized\else\jb@kv@warning{\jb@val}{opcit}\fi
 }%
}%
% CH 0.51s \bibAnnotePath introduced
\define@key{jb}{annote}[true]{%
    \renewcommand{\bibAnnote}[1]{%
        \ifjb@tabular
           \par%
           \begin{minipage}[t]{\bibleftcolumn}%
               \renewcommand*{\bibansep}{}%
               \bibleftcolumnadjust\mbox{}%
           \end{minipage}%
           \ifjb@numbered@bib\hspace{15mm}\else\hspace{10mm}\fi
           \begin{minipage}[t]{\bibrightcolumn}%
               \bibrightcolumnadjust%
               \jbannoteformat{##1}%
           \end{minipage}%
        \else
           \par\jbannoteformat{##1}%
        \fi
    }%
    \renewcommand{\bibAnnoteFile}[1]{%
        \ifjb@tabular
           \par%
           \begin{minipage}[t]{\bibleftcolumn}%
               \renewcommand*{\bibansep}{}%
               \bibleftcolumnadjust\mbox{}%
           \end{minipage}%
           \ifjb@numbered@bib\hspace{15mm}\else\hspace{10mm}\fi
           \begin{minipage}[t]{\bibrightcolumn}%
               \bibrightcolumnadjust%
               \begingroup
                  \let\input@path\jb@ann@input@path
                  \IfFileExists{##1}{\ProvidesFile{##1.tex}%
                    [Bibliography annote file]\jbannoteformat{\input{##1}}}{}%
               \endgroup
           \end{minipage}%
        \else
            \begingroup
               \let\input@path\jb@ann@input@path
               \IfFileExists{##1}{\ProvidesFile{##1.tex}%
                 [Bibliography annote file]\par\jbannoteformat{\input{##1}}}{}%
            \endgroup
        \fi
    }%
}
\define@key{jb}{citetoend}[true]{\jb@citetoendtrue}
% NEW 0.51c Option to switch off automated hyperlinks when using hyperref package
% ADDED 0.51m check for loaded hyperref package added
% REMOVED 0.51u check for loaded hyperref package removed, caused wrong hyperlinks
\define@key{jb}{hypercite}{%
    \ifthenelse{\equal{#1}{true}}{\jb@allow@hyper@citetrue}{%
    \ifthenelse{\equal{#1}{false}}{\jb@allow@hyper@citefalse}{\relax}}%
}
\newcommand*{\jb@enotes@warning}{%
    \PackageWarning{\jb@pkg@name}{%
      I assume you know what you are doing!\MessageBreak
      You are using `\string\cite' or something similar inside\MessageBreak
      a footnote while using endnotes.sty. This will\MessageBreak
      produce ambiguous references and not the\MessageBreak
      expected results. If you are unsure what\MessageBreak
      to do, use \string\cite\space or \string\footcite\space\MessageBreak
      instead}%
}
% REMOVED 0.5f, suggested by Stefan Ulrich
%\@ifpackageloaded{bibunits-jur}{\global\@bu@before@jbtrue}{\relax}%
%\@ifpackageloaded{hyperref}{\global\@hy@before@jbtrue}{\relax}%
\AtBeginDocument{%
  \setkeys{jb}{crossref=normal}% set the default crossref option
  \ifjbhum
    \setkeys{jb}{authorformat=and}%
    \DeclareRobustCommand{\jbbtfont}{\textit}%
    \jb@typeout{^^JPackage jurabib Info: *** jurabib set up for humanities stuff ***^^J}%
  \fi
  \renewcommand*{\SS}{\S\kern-.8pt\S\relax}%
  \@ifclassloaded{jura}{\global\jb@juratrue\global\jb@alphanumtrue}{\relax}%
  \@ifpackageloaded{alphanum}{\global\jb@alphanumtrue}{\relax}%
  \@ifpackageloaded{ragged2e}{\global\jb@raggedtrue}{\relax}%
  \@ifpackageloaded{url}{\global\jb@urltrue}{\relax}%
  \@ifpackageloaded{index}{\let\jb@do@index\jb@do@index@alt}{\relax}%
  \@ifpackageloaded{babel}{\global\jb@babeltrue}{\relax}%
  \@ifpackageloaded{varioref}{\ifjb@ignore@varioref\global\jb@variofalse\else\global\jb@variotrue\fi}{\relax}%
  \@ifpackageloaded{hyperref}{%
    \@ifpackageloaded{tex4ht}{}{% Hook for tex4ht added
    \global\jb@hypertrue
     \long\def\@footnotetext#1{%
        \H@@footnotetext{%
          \jb@fntrue% we are in footnote, borrowed from camel.sty
          \def\baselinestretch{1}% no spacing in footnotes (jura.cls!)
          \ifHy@nesting
              \hyper@@anchor{\@currentHref}{#1}%
          \else
              \Hy@raisedlink{\hyper@@anchor{\@currentHref}{\relax}}#1%
          \fi
% NEW 0.52l reset the counter for citations inside a footnote at the end of the footnote    
          \setcounter{jb@cites@in@footnote}{0}%    
        }%
     }%
     }{\relax}%
  }{\relax}%
  \@ifpackageloaded{backref}{\global\jb@backreftrue}{\relax}%
  \@ifpackageloaded{bibtopic}{\global\jb@all@titlestrue%
% NEW 0.52o No warning about ambiguous citations if `authorformat=year' is used
    \ifjb@author@year\else
        \jb@package@warningNoLine{\jb@pkg@name}{%
        All titles are cited, you're using `bibtopic'!\MessageBreak
        Make sure that the `shorttitle' fields are not\MessageBreak
        empty, otherwise I'll using the `title' fields for\MessageBreak
        replacement. See the package documentation for\MessageBreak
        further explanation}%
    \fi
  }{\relax}%
  \ifjb@babel
    \jb@typeout{^^JPackage jurabib Info: *** jurabib set up for babel ***^^J}%
%    chose the main language, the *last* given in \usepackage[german,english]{babel}
%                                                                    ^^^^^^^ !!!!!!!
    \ifthenelse{\equal{\bbl@main@language}{german}}{\@bibsgerman\bibsgerman}{%
% NEW 0.5f ngerman added, bug reported by Robert Schlicht (schlicht@informatik.hu-berlin.de)
     \ifthenelse{\equal{\bbl@main@language}{ngerman}}{\@bibsgerman\bibsgerman}{%
      \ifthenelse{\equal{\bbl@main@language}{french}}{\@bibsfrench\bibsfrench}{%
       \ifthenelse{\equal{\bbl@main@language}{english}}{\@bibsenglish\bibsenglish}{%
        \ifthenelse{\equal{\bbl@main@language}{dutch}}{\@bibsdutch\bibsdutch}{%
         \ifthenelse{\equal{\bbl@main@language}{spanish}}{\@bibsspanish\bibsspanish}{%
          \ifthenelse{\equal{\bbl@main@language}{italian}}{\@bibsitalian\bibsitalian}{%
           \ifthenelse{\equal{\bbl@main@language}{norsk}}{\@bibsnorsk\bibsnorsk}{}}}}}}}}%
  \else
% NEW 0.5f defining \bbl@mainlaguage also, if babel isn't loaded
    \@ifpackageloaded{german}{\@bibsgerman\bibsgerman\renewcommand{\bbl@main@language}{german}}{%
     \@ifpackageloaded{ngerman}{\@bibsgerman\bibsgerman\renewcommand{\bbl@main@language}{german}}{
      \@ifpackageloaded{french}{\@bibsfrench\bibsfrench\renewcommand{\bbl@main@language}{french}}{%
       \@ifpackageloaded{frenchle}{\@bibsfrench\bibsfrench\renewcommand{\bbl@main@language}{french}}{%
          \@bibsenglish\bibsenglish}}}}%
  \fi
  \ifjb@hyper
      \let\J@SetCurrent\relax
      \def\toclevel@lvla{0}\def\toclevel@lvlb{1}
      \def\toclevel@lvlc{2}\def\toclevel@lvld{3}
      \def\toclevel@lvle{4}\def\toclevel@lvlf{5}
      \def\toclevel@lvlg{6}\def\toclevel@lvlh{7}
      \def\toclevel@lvli{8}\def\toclevel@lvlj{9}
      \def\toclevel@lvlj{10}\def\toclevel@lvll{11}
      \newcommand*{\theHlvla}{\J@Number}\newcommand*{\theHlvlb}{\J@Number}
      \newcommand*{\theHlvlc}{\J@Number}\newcommand*{\theHlvld}{\J@Number}
      \newcommand*{\theHlvle}{\J@Number}\newcommand*{\theHlvlf}{\J@Number}
      \newcommand*{\theHlvlg}{\J@Number}\newcommand*{\theHlvlh}{\J@Number}
      \newcommand*{\theHlvli}{\J@Number}\newcommand*{\theHlvlj}{\J@Number}
      \newcommand*{\theHlvlk}{\J@Number}\newcommand*{\theHlvll}{\J@Number}
      \renewcommand*{\J@LongToc}[2][]{%
       \@startsection{lvl\alph{tiefe}}{\number\value{tiefe}}{0pt}%
       {\ifnum\value{tiefe}=1 -4ex plus-1,5ex minus-0,ex\else%
       -2,7ex plus-0,8ex minus-0,2ex\fi}{\ifnum\value{tiefe}>7 %
       -1em plus-0,5em\relax\else 0,6ex plus0,3ex minus0,1ex\fi}%
       {\sectfont\csname lvl\alph{tiefe}style\endcsname}[#1]{#2}%
      }%
  \fi
  \ifjb@hyper
%    \DeclareRobustCommand{\biburlfont}[1]{\url{#1}}%
%      \def\Hy@backout#1{%
%       \@bsphack
%        \ifx\@empty\@currentlabel\else
%  %      no backref for crossref citations in bib, produces
%  %      very strange (not existing) footnote numbers!
%          \ifjbweareinbib\else
%  %       only one backref for the same citation!
%            \@ifundefined{BACK@#1@\@currentHref}{%
%             \global\@namedef{BACK@#1@\@currentHref}{}%
%               \protected@write\@auxout{}{%
%                \string\@writefile{brf}{%
%                \string\backcite{#1}{%
%                {\thepage}{\jbts{\@currentlabel}}{\@currentHref}}}}%
%            }{}%
%          \fi
%        \fi
%       \@esphack%
%      }%
%      \def\backcite#1#2{%
%       \@for\x:=#1\do{%
%       \edef\x{\expandafter\@firstofone\x\@empty}%
%       \expandafter\protected@xdef\csname br@\x\endcsname{%
%       \expandafter\ifx\csname br@\x\endcsname\relax\else
%       \csname br@\x\endcsname\jbts{,} \fi\protect\backrefxxx#2}}%
%      }%
    \def\BR@@lbibitem[#1]#2#3\par{\BRorg@bibitem[#1]{#2}#3\par}%
%  \else
%     \ifjb@url
%       \DeclareRobustCommand{\biburlfont}{\begingroup\urlstyle{tt}\Url}%
%     \fi
  \fi
  \@ifundefined{chapter}{%
      \let\jb@orig@section\section % chapterbib.sty + numberedbib
      \renewcommand*{\section}{\setcounter{jbbibcnta}{0}\jb@orig@section}%
  }{%
      \let\jb@orig@chapter\chapter % chapterbib.sty + numberedbib
       \renewcommand*{\chapter}{\setcounter{jbbibcnta}{0}\jb@orig@chapter}%
  }%
% 0.5e: moved from \AtEndOfPackage because of problems, if setspace.sty is loaded after jurabib
% reported by Hubert Selhofer (<hubert.selhofer@telering.at>)
  \ifjb@hyper\else
   \long\def\@footnotetext#1{\insert\footins{%
    \jb@fntrue% we are in footnote, borrowed from camel.sty
    \def\baselinestretch{1}% no spacing in footnotes (jura.cls!)
    \reset@font\footnotesize
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\footnotesep
    \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
    \hsize\columnwidth \@parboxrestore
    \let\@tempa\protect
    \def\protect{\noexpand\protect\noexpand}%
    \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}%
    \let\protect\@tempa
    \color@begingroup
      \normalcolor
      \@makefntext{%
        \rule\z@\footnotesep\ignorespaces#1%
    \@finalstrut\strutbox}
    \color@endgroup%
% NEW 0.52l reset the counter for citations inside a footnote at the end of the footnote    
    \setcounter{jb@cites@in@footnote}{0}%    
    }%
   }%
  \fi
% NEW 0.5f \jb@enote@hook introduced for compatibility with endnotes.sty
  \@ifundefined{@xendnotenext}{\relax}{%
    \global\jb@endnotestrue
    \let\jb@orig@citex\@citex
    \let\orig@emulate@nat@cite\jb@emulate@nat@cite
    \def\@citex[#1][#2]#3{%
        \ifjbcross % no extra endnote for crossref's
            \jb@orig@citex[#1][#2]{#3}%
        \else
          \ifjbweareinbib % no extra endnote for howcited's
            \jb@orig@citex[#1][#2]{#3}%
          \else
              \ifjb@fn
                    \jb@enotes@warning\jb@orig@citex[#1][#2]{#3}%
              \else
                  \ifthenelse{\boolean{jb@foot}\or\boolean{jb@citetoend}}{%
                    \expandafter\endnote\expandafter{\jb@enote@hook\jb@orig@citex[#1][#2]{#3}}%
                  }{\jb@enote@hook\jb@orig@citex[#1][#2]{#3}}%
              \fi
          \fi
        \fi
    }%
    \def\jb@emulate@nat@cite[#1][#2]#3{%
        \ifjbcross % no extra endnote for crossref's
            \orig@emulate@nat@cite[#1][#2]{#3}%
        \else
          \ifjbweareinbib % no extra endnote for howcited's
            \orig@emulate@nat@cite[#1][#2]{#3}%
          \else
              \ifjb@fn
                    \jb@enotes@warning\orig@emulate@nat@cite[#1][#2]{#3}%
              \else
                  \ifthenelse{\boolean{jb@foot}\or\boolean{jb@citetoend}}{%
                      \expandafter\endnote\expandafter{\jb@enote@hook\orig@emulate@nat@cite[#1][#2]{#3}}%
                  }{\jb@enote@hook\orig@emulate@nat@cite[#1][#2]{#3}}%
              \fi
          \fi
        \fi
    }%
  }%
% NEW 0.5f a warning if makeidx.sty isn't loaded
  \@ifpackageloaded{index}{\relax}{%
    \ifjb@index
     \@ifundefined{@indexfile}{%
       \jb@package@warningNoLine{\jb@pkg@name}{%
         The `makeidx' package is not loaded,\MessageBreak
          `authorformat=indexed' will not work}%
     }{}%
    \fi
  }%
}%
\AtEndOfPackage{%
  \ifjb@ragged
    \renewcommand*{\bibleftcolumnadjust}{\RaggedRight}%
    \renewcommand*{\bibrightcolumnadjust}{\RaggedRight}%
  \fi
% 0.5e: moved to \AtBeginDocument because of problems if setspace.sty is loaded after jurabib,
% reported by Hubert Selhofer (<hubert.selhofer@telering.at>)
%   \long\def\@footnotetext#1{\insert\footins{ ...%
}%
\def\jurabibsetup{\setkeys{jb}}
\let\jb@origExecuteOptions\ExecuteOptions
\let\ExecuteOptions\jurabibsetup
\def\ProcessOptionsWithKV#1{%
  \let\@tempa\@empty
  \@for\CurrentOption:=\@classoptionslist\do{%
  \@ifundefined{KV@#1@\CurrentOption}%
  {}{\edef\@tempa{\@tempa,\CurrentOption,}}}%
  \edef\@tempa{%
  \noexpand\setkeys{#1}{\@tempa\@ptionlist{\@currname.\@currext}}}%
  \@tempa%
  \AtEndOfPackage{\let\@unprocessedoptions\relax}%
}%
\ProcessOptionsWithKV{jb}%
\let\ExecuteOptions\jb@origExecuteOptions
\@ifundefined{bib@heading}{%
  \@ifundefined{chapter}{%
    \newcommand*{\bib@heading}%
      {\section*{\refname\@mkboth{\refname}{\refname}}}%
  }{%
    \newcommand*{\bib@heading}%
      {\chapter*{\bibname\@mkboth{\bibname}{\bibname}}}%
  }%
}{%
   \relax
}%
\newcommand*{\jbmakeinbiblist}{}%
\newcommand*{\jbmakeinbib}{%
  \jbweareinbibtrue
  \jbonlyforbib%
  \let\jbPAGES\origPAGES
  \let\jbpages\origpages
  \let\jbPages\origPages
% NEW 0.5f Reduced to one command, formatting by \jbprformat
%  \let\jbPage\origPage
% NEW 0.5f
  \let\jbartPages\origartPages
% NEW 0.5f Reduced to one command, formatting by \jbprformat
%  \let\jbartPage\origartPage
  \jb@lookatfalse
  \let\jbatsep\@empty
  \jb@third@extra@spacefalse
  \jb@ibidemfalse
  \jb@ibidem@pagewisefalse
  \jb@ibidem@double@pagewisefalse
  \jb@ibidem@with@namefalse
  \jb@ibidem@with@short@namefalse
  \jb@ibidem@with@name@and@titlefalse
  \jb@no@lookat@for@bibtrue
% NEW 0.5e: disable `crossref=dynamic' for bibliography
% NEW 0.5f: different handling for oxford crossrefs (do we need `ed.' inside the crossref)????
  \ifjb@dynamic@crossrefs
%      \ifjboxford
%          \renewcommand*{\bibcrossrefcite}{\fullnameoxfordcrossref}%
%          \renewcommand*{\bibincollcrossrefcite}{\fullnameoxfordcrossref}%
%          \renewcommand*{\bibcrossrefciteagain}{\fullnameoxfordcrossref}%
%          \renewcommand*{\bibincollcrossrefciteagain}{\fullnameoxfordcrossref}%
%      \else
          \renewcommand*{\bibcrossrefcite}{\citetitle}%
          \renewcommand*{\bibincollcrossrefcite}{\citetitle}%
          \renewcommand*{\bibcrossrefciteagain}{\citetitle}%
          \renewcommand*{\bibincollcrossrefciteagain}{\citetitle}%
%      \fi
  \fi
% NEW 0.5f make memory empty when starting bibliography
  \let\jb@last@ibidem@author\@empty
  \let\jb@ibidem@author\@empty
}%
\renewenvironment{thebibliography}[1]{%
  \bib@heading
  \jbmakeinbib%
% INSERTED because of problems using \typearea from the KOMA-bundle after loading jurabib
% calculation should be done here, suggested by Tilman Finke
  \addtolength{\jb@biblaw@entry@width}{\textwidth}%
  \list{\relax}{%
% NEW 0.5e compressed bibliography
     \ifjb@compressed@bib
        \setlength{\parsep}{0.2ex plus 0.1ex minus 0.1ex}%
        \setlength{\itemsep}{0.2ex plus 0.1ex minus 0.1ex}%
     \fi
     \jbmakeinbiblist% NEW 0.5e make \itemsep configurable with \addto
     \ifjb@bib@hang%
        \setlength{\itemindent}{-\jbbibhang}%
        \setlength{\leftmargin}{\jbbibhang}%
     \else
        \setlength{\itemindent}{0pt}%
        \setlength{\leftmargin}{0pt}%
     \fi
    }%
  \sloppy\clubpenalty4000\widowpenalty4000%
  \sfcode`\.=\@m%
 }%
 {\def\@noitemerr
   {\@latex@warning{Empty `thebibliography' environment}%
 }\endlist\jbweareinbibfalse%
}%
\newcommand*{\jb@make@howcited}{% @* except of ...
 \renewcommand*{\bibhowcited}{%
   \jbweareinhowcitedtrue 
   \space\howcitedprefix%
   \jb@specialcite{\jb@key}%
   \howcitedsuffix\jbweareinhowcitedfalse}}%
\newcommand*{\jb@make@comment@howcited}{% ... @COMMENTED
   \renewcommand*{\bibcommenthowcited}{%
     \jbweareinhowcitedtrue   
     \space\howcitedprefix%
     \jb@specialcite[][Bearbeiter]{\jb@key}%
     \howcitedsuffix\jbweareinhowcitedfalse}}%
\newcommand*{\jb@make@artperiod@howcited}{% ... @ARTICLE and @PERIODICAL
 \ifjb@allow@howcited@art@period
    \renewcommand*{\bibartperiodhowcited}{%
      \jbweareinhowcitedtrue
      \space\howcitedprefix%
      \jb@specialcite{\jb@key}%
      \howcitedsuffix\jbweareinhowcitedfalse}%
 \fi}%
\newcommand*{\jb@make@all@howcited@empty}{%
 \let\bibhowcited\@empty
 \let\bibcommenthowcited\@empty
 \ifjb@allow@howcited@art@period
   \let\bibartperiodhowcited\@empty
 \fi
}%
% NEW 0.5c; special command, inspired by Christian Meyn, declares a work which isn't really cited, but
% should appear in the bibliography _with_ a howcited note (perhaps given by the howcited field),
% see also the changed command \jb@make@howcited@compare
% Usage: \nocitebuthowcited{<key>}
\newcommand*{\nocitebuthowcited}[1]{%
  \if@filesw\immediate\write\@auxout{%
      \string\citation{#1}^^J%
      \string\jbrealcitation{cite}{#1}}
  \fi
}%
\newcommand*{\jbhowcitedcomparepart}{%
  \ifthenelse{\equal{\jb@@howcited}{}}{%
     \ifthenelse{\equal{\jb@@shorttitle}{\@empty}}{%
         \jb@make@all@howcited@empty
     }{%
         \ifthenelse{\equal{\jb@@shorttitle}{\jb@@title}}{%
            \jb@make@all@howcited@empty
         }{%
            \ifthenelse{\equal{\jb@@author}{empty}}{%
               \jb@make@all@howcited@empty
            }{%
% NEW 0.5f: only howcited remark, if shorttitle != title AND shorttitle was _used_!
               \ifthenelse{%
                   \equal{\@nameuse{TITLE@\jb@key}}{used}%
%                   \and\not
% NEW 0.5f: should compare ignore multiple citations???
%                   \equal{\jb@@mult@switch}{1}%
               }{%
                   \jb@suppress@dot@for@howcitedtrue
                   \jb@make@howcited%
                   \jb@make@comment@howcited%
                   \jb@make@artperiod@howcited%
               }{%
                   \jb@make@all@howcited@empty
               }%
            }%
         }%
     }%
  }{%
     \ifthenelse{\equal{\jb@@howcited}{1}}{%
% should the howcited field be ignored in compare mode???
          \ifthenelse{%
              \equal{\@nameuse{TITLE@\jb@key}}{used}%
          }{%
              \jb@suppress@dot@for@howcitedtrue
              \jb@make@howcited%
              \jb@make@comment@howcited%
              \jb@make@artperiod@howcited%
          }{%
              \jb@make@all@howcited@empty
          }%
     }{%
          \renewcommand*{\bibhowcited}{%
            \space\howcitedprefix \jb@@howcited\howcitedsuffix}%
          \renewcommand*{\bibcommenthowcited}{%
            \space\howcitedprefix \jb@@howcited\howcitedsuffix}%
          \ifjb@allow@howcited@art@period
            \renewcommand*{\bibartperiodhowcited}{%
              \space\howcitedprefix \jb@@howcited\howcitedsuffix}%
          \fi
     }%
  }%
}%
\newcommand*{\jbhowcitednormalpart}{%
  \ifthenelse{\equal{\jb@@howcited}{}}{% %
     \jb@make@all@howcited@empty
  }{%
     \ifthenelse{\equal{\jb@@howcited}{1}}{%
        \jb@suppress@dot@for@howcitedtrue
        \jb@make@howcited%
        \jb@make@comment@howcited%
        \jb@make@artperiod@howcited%
     }{%
        \renewcommand*{\bibhowcited}{%
          \space\howcitedprefix \jb@@howcited\howcitedsuffix}%
        \renewcommand*{\bibcommenthowcited}{%
          \space\howcitedprefix \jb@@howcited\howcitedsuffix}%
        \ifjb@allow@howcited@art@period
          \renewcommand*{\bibartperiodhowcited}{%
            \space\howcitedprefix \jb@@howcited\howcitedsuffix}%
        \fi
     }%
  }%
}
\newcommand*{\jbaddtomakehowcited}{}
\newcommand*{\jb@make@the@howcited}{%
  \ifthenelse{\boolean{jb@howcited@normal}}{%
      % NORMAL=TRUE
      \ifthenelse{\boolean{jb@howcited@compare}}{%
          % NORMAL=TRUE, COMPARE=TRUE
          \ifthenelse{\boolean{jb@howcited@multiple}}{%
              % NORMAL=TRUE, COMPARE=TRUE, MULTIPLE=TRUE
%              \jb@typeout{Using howcited=normal AND howcited=compare AND howcited=multiple}%
              \ifthenelse{\equal{\jb@@mult@switch}{1}}{% multiple part start
                 \jb@make@howcited
                 \jb@make@comment@howcited
                 \jb@make@artperiod@howcited   % multiple part end
              }{%
                  \jbhowcitednormalpart%
                  \jbhowcitedcomparepart%
              }%
          }{% NORMAL=TRUE, COMPARE=TRUE, multiple=false
%              \jb@typeout{Using howcited=normal AND howcited=compare}%
              \jbhowcitednormalpart%
              \jbhowcitedcomparepart%
          }%
      }{%
          % NORMAL=TRUE, compare=false
          \ifthenelse{\boolean{jb@howcited@multiple}}{%
              % NORMAL=TRUE, compare=false, MULTIPLE=TRUE
              % howcited=normal AND howcited=multiple
%              \jb@typeout{Using howcited=normal AND howcited=multiple}%
              \ifthenelse{\equal{\jb@@mult@switch}{1}}{% multiple part start
                 \jb@make@howcited
                 \jb@make@comment@howcited
                 \jb@make@artperiod@howcited   % multiple part end
              }{%
                 \jbhowcitednormalpart%
              }%
          }{%   NORMAL=TRUE, compare=false, multiple=false
%              \jb@typeout{Using ONLY howcited=normal}
              \jbhowcitednormalpart%
          }%
      }%
  }{%
  %   normal=false
      \ifthenelse{\boolean{jb@howcited@compare}%
      }{% normal=false, COMPARE=TRUE
          \ifthenelse{\boolean{jb@howcited@multiple}}{%
             % normal=false, COMPARE=TRUE, MULTIPLE=TRUE
%             \jb@typeout{Using howcited=compare AND howcited=multiple}
             \ifthenelse{\equal{\jb@@mult@switch}{1}}{% multiple part start
                \jb@make@howcited
                \jb@make@comment@howcited
                \jb@make@artperiod@howcited   % multiple part end
             }{%
                \jbhowcitedcomparepart%
             }%
          }{% normal=false, COMPARE=TRUE, multiple=false
%              \jb@typeout{Using ONLY howcited=compare}
              \jbhowcitedcomparepart%
          }%
      }{% normal=false, compare=false
          \ifthenelse{\boolean{jb@howcited@multiple}}{%
              % normal=false, compare=false, MULTIPLE=TRUE
%              \jb@typeout{Using ONLY howcited=multiple}
              \jb@suppress@dot@for@howcitedtrue
              \ifthenelse{\equal{\jb@@mult@switch}{1}}{% multiple part start
                  \jb@make@howcited
                  \jb@make@comment@howcited
                  \jb@make@artperiod@howcited  % multiple part end
              }{%
                  \jb@make@all@howcited@empty
              }%
          }{% normal=false, compare=false, multiple=false, all=true
            \ifthenelse{\boolean{jb@howcited@all}}{%
               \jb@suppress@dot@for@howcitedtrue
               \jb@make@howcited
               \jb@make@comment@howcited
% we have to switch on `howcited' for articles and periodicals
               \jb@allow@howcited@art@periodtrue
               \jb@make@artperiod@howcited
            }{%
                % normal=false, compare=false, multiple=false, all=false
                % no howcited option
                \relax
            }%
          }%
      }%
  }%
  \jbaddtomakehowcited%
}%
%\newcommand*{\jb@make@howcited@all}{%
%   \jb@suppress@dot@for@howcitedtrue
%   \jb@make@howcited
%   \jb@make@comment@howcited
%% we have to switch on `howcited' for articles and periodicals
%   \jb@allow@howcited@art@periodtrue
%   \jb@make@artperiod@howcited
%}%
\newcommand*{\jb@detect@used@cite@commands}{%
  \ifthenelse{\equal{\@nameuse{b@\jb@key @C}}{cite}}{%
     \let\jb@specialcite\cite}{\relax}%
  \ifthenelse{\equal{\@nameuse{b@\jb@key @C}}{citetitle}}{%
     \let\jb@specialcite\citetitle}{\relax}%
  \ifthenelse{\equal{\@nameuse{b@\jb@key @C}}{citenotitle}}{%
     \let\jb@specialcite\jbcitenotitle}{\relax}%
}%
\newcommand*{\jb@last@label}{}
\newcommand*{\jb@last@mult@author}{}
\AtEndDocument{\let\jb@chk@multiple\@gobbletwo}
\newcommand*{\jb@chk@multiple}[2]{%
   \ifthenelse{\equal{#1}{\jb@last@mult@author}}{%
       \global\@namedef{jb@fm@\jb@last@label}{}%
       \global\@namedef{jb@fm@#2}{}%
   }{%
       \relax
   }%
   \def\jb@last@mult@author{#1}%
   \def\jb@last@label{#2}%
}%
\newcommand*\jb@chk@bibetal[2]{%
    \begingroup
    \protected@edef\x{%
        \endgroup
        \def\noexpand\jb@@chk@bibetal####1\Bibetal####2\noexpand\end{%
            \noexpand\jb@@bibetal@argcheck{####1}{####2}{#2}%
        }%
    }\x
    \protected@edef\@tempa{#1}%
    \protected@edef\@tempb{\Bibetal}%
    \expandafter\expandafter\expandafter
    \jb@@chk@bibetal\expandafter\@tempa\@tempb\end
}
\newcommand*\jb@@bibetal@argcheck[3]{%
    \ifthenelse{\equal{#2}{}}{%
%        \jb@typeout{---NO bibetal in citation |#1|#2|}%
    }{%
%        \jb@typeout{--- bibetal in citation |#1|#2|}%
        \if@filesw{%
            \let\protect\noexpand
            \immediate\write\@auxout{\string\jb@chk@multiple{#1#2}{#3}}%
        }%
        \fi
    }%
}
\newcommand*{\jb@@name}{}%
\newcommand*{\jb@last@fullname}{}%
% NEW 0.5e biblaw commands contributed by Tilman Finke
\newcommand*{\jb@biblaw@item}{\hspace{0.5em}$\triangleright$\hspace{0.5em}}
\newlength{\jb@biblaw@entry@width}
\newlength{\jb@biblaw@item@width}
\settowidth{\jb@biblaw@item@width}{\jb@biblaw@item}
\setlength{\jb@biblaw@entry@width}{\jb@biblaw@item@width}
\setlength{\jb@biblaw@entry@width}{-\jb@biblaw@entry@width}
%\addtolength{\jb@biblaw@entry@width}{\columnwidth}
% REMOVED because of problems using \typearea from the KOMA-bundle after loading jurabib
% calculation should be done inside \thebibliography, suggested by Tilman Finke
% \addtolength{\jb@biblaw@entry@width}{\textwidth}%
\newcolumntype{j}[1]{>{\bibaltformatalign\hspace{0pt}}p{#1}}
% NEW 0.5f changed item to make consecutive bibliographies possible
\newcommand*{\jb@item}{\item}%
\newcommand\jb@deactivate@babel{%
  %FIXME: \noextrasfrench or \bbl@deactivate don't work here?? just do it the low-level way:
  \let\do\@makeother\do\:\do\;\do\!\do\?\do\"\do\`\do\'\do\^%<---! solved in 0.51r (bug reported by Andreas Altenburger)
%  \do\~ % 0.51r removed, causes problems with ~ from .bst
}
\newcommand*{\bibnumberformat}[1]{\biblnfont{#1.}}%
\newcommand\jb@@test@fullname{}
\newcommand\jb@@testlast@fullname{}
\newcommand\jb@@test@au@or@ed{}
\newcommand\jb@@testlast@au@or@ed{}
\newcommand*{\jbdoitem}{%
 \ifjb@index\protected@xdef\curr@key{\jb@key}%
            \gdef\jb@authorlist{}\fi
 \ifjb@no@bib\relax\else
  \ifthenelse{\equal{\@nameuse{NOBIB@\jb@key}}{suppress}}{}{%
% NEW 0.5f changed item to make consecutive bibliographies possible
   \jb@item\hyper@jbanchorstart{\jb@key}\hyper@jbanchorend
   \ifjb@howcited
     \@ifundefined{b@\jb@key @C}{%
%        the work \jb@key isn't cited
         \renewcommand*{\bibhowcited}{%
                 \space\bibnotcited}%
         \renewcommand*{\bibcommenthowcited}{%
                 \space\bibnotcited}%
         \ifjb@allow@howcited@art@period
           \renewcommand*{\bibartperiodhowcited}{%
                    \space\bibnotcited}%
         \fi
     }{%
%      the work \jb@key is cited
       \jb@detect@used@cite@commands
       \jb@handle@superscript@ed
       \jb@make@the@howcited
% NEW 0.5f no op. cit. in howcited remark!
       \let\OpCit\@empty
     }%
   \fi
   \protected@edef\jb@tempcntc{\thebibnamereplace}%
   \stepcounter{bibnamereplace}%
   \label{jbib:\thebibnamereplace}%
   \@tempcnta=\jb@tempcntc
   \advance\@tempcnta\@ne
   \protected@edef\jb@tempcntd{\the\@tempcnta}%
   \ifthenelse{\boolean{jb@bibformat@ibidem}}{%
% 0.5e completely rewritten bibformat=ibidem
       \ifthenelse{%
          \equal{\jb@simple@pageref@by@heiko{jbib:\jb@tempcntc}}{%
            \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
       }{%
           \ifjb@debug SAME PAGE/\fi
           \ifthenelse{\equal{\jb@@test@fullname}{\jb@@testlast@fullname}}{%
                 \ifjb@debug SAME AUTHOR \fi
                 \ifthenelse{\equal{\jb@@fullname}{}}{}{%
                     \ifthenelse{%
                          \boolean{jbaltformat}%
                     }{%
                          \def\jb@@name{}%
                     }{%
                          \def\jb@@name{\bibauthormultiple}%
                     }%
                }%
           }{%
                 \ifjb@debug AUTHOR DIFFERS \fi
                 \ifthenelse{\equal{\jb@@fullname}{}}{%
                     \def\jb@@name{}%
                 }{%
                     \def\jb@@name{\jb@@fullname\bibansep}%
                 }%
           }%
       }{% DIFFERENT PAGES !!!!!
            \ifthenelse{%
                \boolean{@twoside}%
                \and
                \isodd{\jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
                \and
                \equal{%
                    \jb@simple@pageref@by@heiko{jbib:\jb@tempcntd}}{%
                    \jb@simple@pageref@by@heiko{jbib:\thebibnamereplace}}%
            }{%
                \ifjb@debug DIFF AND ODD/\fi
                \ifthenelse{%
                     \equal{\jb@@test@fullname}{\jb@@testlast@fullname}%
                }{%
                     \ifjb@debug SAME AUTHOR \fi
                     \ifthenelse{\equal{\jb@@fullname}{}}{}{%
                        \ifthenelse{%
                            \boolean{jbaltformat}%
                        }{%
                           \def\jb@@name{%
                               \jb@@fullname%
                               \space%
                               \bibfnfont{\bibcontinuedname}%
                               \bibansep%
                           }%
                        }{%
                            \def\jb@@name{\bibauthormultiple}%
                        }%
                     }%
                }{%
                    \ifjb@debug AUTHORS DIFFERS \fi
                    \ifthenelse{\equal{\jb@@fullname}{}}{%
                        \def\jb@@name{}%
                    }{%
                        \def\jb@@name{\jb@@fullname\bibansep}%
                    }%
                }%
            }{%
                \ifjb@debug DIFF AND EVEN/\fi
                \ifthenelse{%
                     \equal{\jb@@test@fullname}{\jb@@testlast@fullname}%
                }{%
                     \ifjb@debug SAME AUTHOR \fi
                     \ifthenelse{\equal{\jb@@fullname}{}}{}{%
                        \ifthenelse{%
                            \boolean{jbaltformat}%
                        }{%
                           \def\jb@@name{%
                               \jb@@fullname%
                               \space%
                               \bibfnfont{\bibcontinuedname}%
                               \bibansep%
                           }%
                        }{%
                            \def\jb@@name{\jb@@fullname\bibansep}%
                        }%
                     }%
                }{%
                    \ifjb@debug AUTHORS DIFFERS \fi
                    \ifthenelse{\equal{\jb@@fullname}{}}{%
                        \def\jb@@name{}%
                    }{%
                        \def\jb@@name{\jb@@fullname\bibansep}%
                    }%
                }%
            }%
        }%
   }{% bibformat=ibidem false
       \ifthenelse{\equal{\jb@@fullname}{}}{%
           \def\jb@@name{}%
       }{%
           \def\jb@@name{\jb@@fullname\bibansep}%
       }%
   }%
   \ifjb@babel
     \ifthenelse{\equal{\jb@@language}{\@empty}}{%
         \expandafter\jbselectlanguage\expandafter{\bbl@main@language}%
     }{%
         \language=\csname l@\jb@@language\endcsname\relax%
     }%
     \jb@check@language@start%
   \fi
   \ifjbaltformat\else
     \ifjb@numbered@bib
       \renewcommand*{\bibleftcolumn}{.36\linewidth}%
       \renewcommand*{\bibrightcolumn}{%
            \textwidth-\bibleftcolumn-5mm-\jbnumberbibwidth}%
         \begin{minipage}[t]{\jbnumberbibwidth}%
           \stepcounter{jbbibcnta}\bibnumberformat{\thejbbibcnta}%
         \end{minipage}%
     \fi
   \fi
   \ifjb@tabular
            \begin{minipage}[t]{\bibleftcolumn}%
                \renewcommand*{\bibansep}{}%
                \bibleftcolumnadjust\mbox{}%
                \jb@@name%
            \end{minipage}\ifjb@numbered@bib\hspace{5mm}\else\hspace{10mm}\fi%
            \begin{minipage}[t]{\bibrightcolumn}%
                \bibrightcolumnadjust%
%               no linebreak in right column
                \let\jblinebreak\@empty
                \jb@@fulltitle%
                \begingroup
                  \jb@check@language@end%
                  \let\hyper@jblinkstart\@gobble
                  \let\hyper@jblinkend\relax
                  \jb@bibarg@howcited%
                \endgroup
                \ifjb@dot\unskip\unskip\unskip.\fi
% NEW 0.5e
                \jb@endnote%
                \ifjb@backref~\backref{\csname br@\jb@key\endcsname}\fi
            \end{minipage}%\medskip%
   \else
       \ifjbaltformat
            \ifx\jb@@name\@empty\else\medskip\fi % add some vertical space between different authors
            \let\jblinebreak\@empty\setlength{\tabcolsep}{0pt}\mbox{}\noindent
            \begin{tabular}{p{\jb@biblaw@item@width}j{\jb@biblaw@entry@width}}
            \ifx\jb@@name\@empty\else\multicolumn{2}{p{\columnwidth}}{\jb@@name}\\\fi
            \jb@biblaw@item & \jb@@fulltitle%
                              \begingroup
                                 \jb@check@language@end%
                                 \let\hyper@jblinkstart\@gobble
                                 \let\hyper@jblinkend\relax
                                 \jb@bibarg@howcited%
                               \endgroup
                               \ifjb@dot\unskip\unskip\unskip.\fi
                               \jb@endnote%
                               \ifjb@backref
                                 ~\backref{\csname br@\jb@key\endcsname}%
                               \fi
            \end{tabular}
       \else
            \jb@@name\jb@@fulltitle%
            \begingroup
              \jb@check@language@end%
              \let\hyper@jblinkstart\@gobble
              \let\hyper@jblinkend\relax
              \jb@bibarg@howcited%
            \endgroup
            \ifjb@dot\unskip\unskip\unskip.\fi
            \jb@endnote%
            \ifjb@backref~\backref{\csname br@\jb@key\endcsname}\fi
       \fi
   \fi
% NEW 0.5e
   \gdef\jb@endnote{}%
   \ifjb@index\ifjb@index@bib\jb@index@as@alias{\jb@key}\fi\fi
%  save last author
   \protected@edef\jb@@testlast@fullname{\jb@@test@fullname}%
   \protected@edef\jb@@testlast@au@or@ed{\jb@@test@au@or@ed}%   
  }%
 \fi
 \if@filesw{\let\protect\noexpand\immediate\write\@auxout{%
  \string\bibcite{\jb@key}{\jb@tempa}%
  \ifjb@index
% NEW 0.5f No writeout to aux if \nobibliography is used
    \ifjb@no@bib\else
      ^^J\string\jb@define@alias{\curr@key}{\jb@authorlist}%
    \fi
  \fi}}%
 \fi
 \ignorespaces
}%
\newcommand*{\jbbibargs}[5]{%
  \protected@edef\jb@tempa{\jb@tempb{#1}{#4}}%
  \protected@edef\jb@tempb{\expandafter\jb@thirdofseven\jb@tempa\@empty}%
  \protected@edef\jb@tempc{\expandafter\jb@fourthofseven\jb@tempa\@empty}%
  \def\jb@bibarg@howcited{#5}%
  \ifthenelse{\equal{#2}{jureco}}{\global\jb@bibformat@ibidemfalse\global\jbaltformatfalse}{\gdef\jb@@test@fullname{#2}}%
  \ifthenelse{\equal{#3}{}}{}{\gdef\jb@@test@au@or@ed{#3}}%
  \jb@chk@bibetal{\jb@@author}{\jb@key}%
  \let\jb@first@author\@undefined
  \let\jb@first@editor\@undefined
  \setcounter{ibidem@author}{0}%
  \setcounter{multiple@author}{0}%
}%
%  % NEW 0.51v 4 args now
%  \newcommand*{\jbbibargs}[4]{%
%    \protected@edef\jb@tempa{\jb@tempb{#1}{#3}}%
%    \protected@edef\jb@tempb{\expandafter\jb@thirdofseven\jb@tempa\@empty}%
%  % NEW 0.5f revised for more arguments from .bbl
%    \protected@edef\jb@tempc{\expandafter\jb@fourthofseven\jb@tempa\@empty}%
%    \def\jb@bibarg@howcited{#4}%
%  % NEW 0.51v 4 args now, bibformat=ibidemalt
%    \ifthenelse{\equal{#2}{jureco}}{\global\jb@bibformat@ibidemfalse\global\jbaltformatfalse}{\gdef\jb@@test@fullname{#2}}%  
%    \jb@chk@bibetal{\jb@@author}{\jb@key}%
%  % added in 0.5e, suggested by Joachim Trinkwitz (jtr@uni-bonn.de),
%  % no reversed editors for authorformat=firstnotreversed, makes no sense
%    \let\jb@first@author\@undefined
%  % added in 0.5f to allow the firstnotreversed-feature optionally by removing \def\jb@firsteditor{} from \bibBTsep and \bibJTsep.
%    \let\jb@first@editor\@undefined
%  % NEW 0.5f idem feature -- forget last author at the end of the entry.
%  % No comparing with the next entry!
%  %  \def\jb@inside@author{}%
%  %  \def\jb@inside@editor{}%
%    \setcounter{ibidem@author}{0}%
%    \setcounter{multiple@author}{0}%
%  }%
% \def\@lbibitem[#1]#2{\def\jb@tempb{#1}\def\jb@key{#2}}%
\def\@lbibitem{%
  \begingroup
  \jb@deactivate@babel
  \jb@lbibitem
}
\def\jb@lbibitem[#1]#2{\gdef\jb@tempb{#1}\gdef\jb@key{#2}\endgroup}%
% special thanks to Stefan Ulrich
\newcommand*{\nobibliography}[1]{%
  \ifjb@allow@nobib
   \global\jb@no@bibtrue
%  no hyperlinks if bibliography is suppressed
   \if@filesw\immediate\write\@auxout{%
% NEW 0.51v switch off hypercite when \nobibliography is used   
         \string\global\string\jb@allow@hyper@citefalse^^J%
         \string\global\string\jb@allow@hyper@cite@nobibfalse^^J%
         \string\global\string\jb@no@bibtrue
%        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ indexing for \nobibliography too         
     }%
   \fi
  \begingroup
    \renewenvironment{thebibliography}[1]{%
     \usecounter{enumiv}%
     \renewcommand*{\item}[1][]{%
       \ifx\relax####1\relax\stepcounter\@listctr\fi
     }%
    }{\relax}%
    \bibliography{#1}%
  \endgroup
  \else
  \jb@package@warningNoLine{\jb@pkg@name}{%
    You are using the `\string\nobibliography' command\MessageBreak
    without using one of the `citefull' options.\MessageBreak
    Choose `citefull=first' or `citefull=all'.\MessageBreak
    I'm putting out the normal `\string\bibliography'%
  }%
  \bibliography{#1}%
 \fi
}%
% NEW 0.5f \jb@enote@hook introduced for compatibility with endnotes.sty
\newcommand\jb@enote@hook{}
% *******************************************************
%
%           THE CITE COMMANDS
%
%
% *******************************************************
%          \cite section
% *******************************************************
\def\cite{%
  \@ifstar{%
    \begingroup
      \jb@deactivate@babel%
      \jb@save@auxfile%
      \jb@starred@citetrue
      \@ifnextchar[{\jb@cite@no@title}{\jb@cite@no@title[]}%
  }{%
    \begingroup
      \jb@deactivate@babel%
      \jb@save@auxfile%
      \@ifnextchar[{\jb@cite}{\jb@cite[]}%
  }%
}%
% CH 0.52p missing \endgroup (double \begingroup!) while calling \jbcitenotitle
%\def\cite{%
% \begingroup
%  \jb@deactivate@babel%
%  \jb@save@auxfile%
%  \@ifstar{\jbcitenotitle}{\@ifnextchar[{\jb@cite}{\jb@cite[]}}%
%}%
\newcommand*{\jb@cite}{}%
%
\def\jb@cite{%
  \@ifnextchar[{\jb@@cite}{\jb@@cite[]}%
}
\def\jb@@cite[#1]{%
  \@ifnextchar[{\jb@@@cite[#1]}{\jb@@@cite[#1][]}%
}
\def\jb@@@cite[#1][#2]#3{%
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
 \def\jb@enote@hook{%
     \ifjb@all@full
        \jb@change@fonts@for@fullcitetrue
        \jb@fullcite@againtrue
        \jb@citefalse
     \else
        \jb@citetrue
        \jb@fullcite@againfalse
     \fi
     \jb@cite@titlefalse
     \jb@cite@no@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footfalse     % works only for non-endnotes
 \@citex[#1][#2]{#3}%
 \endgroup
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\if@filesw
     {\let\protect\noexpand\immediate\write\@auxout{%
      \string\jb@define@alias{#3}{\jb@authorlist}}}%
 \fi\fi\fi
 \futurelet\@let@token\@next@footnote
}%
% *******************************************************
%          \cite* section
% *******************************************************
%\newcommand*{\jbcitenotitle}{%
% \begingroup
%  \jb@deactivate@babel%
%  \jb@save@auxfile%
%% NEW 0.51k
%  \jb@starred@citetrue
%  \@ifnextchar[{\jb@cite@no@title}{\jb@cite@no@title[]}%
%}
\newcommand*{\jb@cite@no@title}{}%
%
\def\jb@cite@no@title{%
  \@ifnextchar[{\jb@@cite@no@title}{\jb@@cite@no@title[]}%
}
\def\jb@@cite@no@title[#1]{%
  \@ifnextchar[{\jb@@@cite@no@title[#1]}{\jb@@@cite@no@title[#1][]}%
}
\def\jb@@@cite@no@title[#1][#2]#3{%
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
 \def\jb@enote@hook{%
     \ifjb@all@full
        \jb@change@fonts@for@fullcitetrue
        \jb@fullcite@againtrue
        \jb@cite@no@titlefalse
     \else
        \jb@cite@no@titletrue
        \jb@fullcite@againfalse
     \fi
     \jb@citefalse
     \jb@cite@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footfalse % works only for non-endnotes
 \@citex[#1][#2]{#3}%
 \endgroup
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\if@filesw
    {\let\protect\noexpand\immediate\write\@auxout{%
     \string\jb@define@alias{#3}{\jb@authorlist}}}%
 \fi\fi\fi
 \futurelet\@let@token\@next@footnote
}%
% *******************************************************
%          \citetitle section
% *******************************************************
\newcommand*{\jbcitetitle}{%
 \begingroup
  \jb@deactivate@babel%
  \jb@save@auxfile%
  \@ifnextchar[{\jb@cite@title}{\jb@cite@title[]}%
}
\newcommand*{\jb@cite@title}{}%
%
\def\jb@cite@title{%
  \@ifnextchar[{\jb@@cite@title}{\jb@@cite@title[]}%
}
\def\jb@@cite@title[#1]{%
  \@ifnextchar[{\jb@@@cite@title[#1]}{\jb@@@cite@title[#1][]}%
}
\def\jb@@@cite@title[#1][#2]#3{%
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
 \def\jb@enote@hook{%
     \ifjb@all@full
        \jb@change@fonts@for@fullcitetrue
        \jb@fullcite@againtrue
        \jb@cite@titlefalse
     \else
        \jb@cite@titletrue
        \jb@fullcite@againfalse
     \fi
     \jb@citefalse
     \jb@cite@no@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footfalse % works only for non-endnotes
 \@citex[#1][#2]{#3}%
 \endgroup
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\if@filesw
    {\let\protect\noexpand\immediate\write\@auxout{%
     \string\jb@define@alias{#3}{\jb@authorlist}}}%
 \fi\fi\fi
 \futurelet\@let@token\@next@footnote
}%
% *******************************************************
%          \fullcite section
% *******************************************************
\newcommand*{\jbfullcite}{%
 \begingroup
  \jb@deactivate@babel%
  \jb@save@auxfile%
  \@ifnextchar[{\jb@fullcite}{\jb@fullcite[]}%
}
\newcommand*{\jb@fullcite}{}%
%
\def\jb@fullcite{%
  \@ifnextchar[{\jb@@fullcite}{\jb@@fullcite[]}%
}
\def\jb@@fullcite[#1]{%
  \@ifnextchar[{\jb@@@fullcite[#1]}{\jb@@@fullcite[#1][]}%
}
\def\jb@@@fullcite[#1][#2]#3{%
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
 \def\jb@enote@hook{%
     \noibidem%
     \jb@change@fonts@for@fullcitetrue
     \jb@cite@no@titlefalse
     \jb@fullcite@againtrue
     \jb@citefalse
     \jb@cite@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footfalse % works only for non-endnotes
 \@citex[#1][#2]{#3}%
 \endgroup
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\if@filesw
    {\let\protect\noexpand\immediate\write\@auxout{%
     \string\jb@define@alias{#3}{\jb@authorlist}}}%
 \fi\fi\fi
 \futurelet\@let@token\@next@footnote
}%
% *******************************************************
%
%           THE FOOT CITE COMMANDS
%
%
% *******************************************************
%          \footcite section
% *******************************************************
\newcommand*{\jbfootcite}{%
 \begingroup
  \jb@deactivate@babel%
  \jb@save@auxfile%
  \@ifstar{\jbfootcitenotitle}{%
  \@ifnextchar[{\jb@footcite}{\jb@footcite[]}}}%
\newcommand*{\jb@footcite}{}%
%
\def\jb@footcite{%
  \@ifnextchar[{\jb@@footcite}{\jb@@footcite[]}%
}
\def\jb@@footcite[#1]{%
  \@ifnextchar[{\jb@@@footcite[#1]}{\jb@@@footcite[#1][]}%
}
\def\jb@@@footcite[#1][#2]#3{%
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
 \ifjb@fn\ClassError{\jb@pkg@name}{%
  You are using `\string\footcite' inside a footnote}{%
  Sorry, that makes no sense.}\fi
 \def\jb@enote@hook{\unskip%
     \ifjb@all@full
      \jb@change@fonts@for@fullcitetrue
      \jb@fullcite@againtrue
      \jb@citefalse
     \else
      \jb@citetrue
      \jb@fullcite@againfalse
     \fi
     \jb@cite@titlefalse
     \jb@cite@no@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footnote@periodtrue
 \jb@foottrue % works only for non-endnotes
 \@citex[#1][#2]{#3}%
 \endgroup
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\if@filesw
    {\let\protect\noexpand\immediate\write\@auxout{%
     \string\jb@define@alias{#3}{\jb@authorlist}}}%
 \fi\fi\fi
 \futurelet\@let@token\@next@footnote
}%
% *******************************************************
%          \footcitetitle section
% *******************************************************
\newcommand*{\jbfootcitetitle}{%
 \begingroup
  \jb@deactivate@babel%
  \jb@save@auxfile%
  \@ifnextchar[{\jb@footcitetitle}{\jb@footcitetitle[]}%
}%
\newcommand*{\jb@footcitetitle}{}%
%
\def\jb@footcitetitle{%
  \@ifnextchar[{\jb@@footcitetitle}{\jb@@footcitetitle[]}%
}
\def\jb@@footcitetitle[#1]{%
  \@ifnextchar[{\jb@@@footcitetitle[#1]}{\jb@@@footcitetitle[#1][]}%
}
\def\jb@@@footcitetitle[#1][#2]#3{%
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
 \ifjb@fn\ClassError{\jb@pkg@name}{%
  You are using `\string\footcitetitle' inside a footnote}{%
  Sorry, that makes no sense.}\fi
 \def\jb@enote@hook{\unskip% <== added to skip spaces before endnotes
     \ifjb@all@full
       \jb@change@fonts@for@fullcitetrue
       \jb@fullcite@againtrue
       \jb@cite@titlefalse
     \else
       \jb@cite@titletrue
       \jb@fullcite@againfalse
     \fi
     \jb@citefalse
     \jb@cite@no@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footnote@periodtrue
 \jb@foottrue % works only for non-endnotes
 \@citex[#1][#2]{#3}%
 \endgroup
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\if@filesw
    {\let\protect\noexpand\immediate\write\@auxout{%
     \string\jb@define@alias{#3}{\jb@authorlist}}}%
 \fi\fi\fi
 \futurelet\@let@token\@next@footnote
}%
% *******************************************************
%          \footcite* section
% *******************************************************
\newcommand*{\jbfootcitenotitle}{%
 \begingroup
  \jb@deactivate@babel%
  \jb@save@auxfile%
% NEW 0.51k
  \jb@starred@citetrue  
  \@ifnextchar[{\jb@footcitenotitle}{\jb@footcitenotitle[]}}%
\newcommand*{\jb@footcitenotitle}{}%
%
\def\jb@footcitenotitle{%
  \@ifnextchar[{\jb@@footcitenotitle}{\jb@@footcitenotitle[]}%
}
\def\jb@@footcitenotitle[#1]{%
  \@ifnextchar[{\jb@@@footcitenotitle[#1]}{\jb@@@footcitenotitle[#1][]}%
}
\def\jb@@@footcitenotitle[#1][#2]#3{%
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
 \ifjb@fn\ClassError{\jb@pkg@name}{%
  You are using `\string\footcite*' inside a footnote}{%
  Sorry, that makes no sense.}\fi
 \def\jb@enote@hook{\unskip%
     \ifjb@all@full
      \jb@change@fonts@for@fullcitetrue
      \jb@fullcite@againtrue
      \jb@cite@no@titlefalse
     \else
      \jb@cite@no@titletrue
      \jb@fullcite@againfalse
     \fi
     \jb@citefalse
     \jb@cite@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footnote@periodtrue
 \jb@foottrue % works only for non-endnotes
 \@citex[#1][#2]{#3}%
 \endgroup
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\if@filesw
    {\let\protect\noexpand\immediate\write\@auxout{%
     \string\jb@define@alias{#3}{\jb@authorlist}}}%
 \fi\fi\fi
 \futurelet\@let@token\@next@footnote
}%
% *******************************************************
%          \footfullcite section
% *******************************************************
\newcommand*{\jbfootfullcite}{%
 \begingroup
  \jb@deactivate@babel%
  \jb@save@auxfile%
  \@ifnextchar[{\jb@footfullcite}{\jb@footfullcite[]}%
}%
\newcommand*{\jb@footfullcite}{}%
%
\def\jb@footfullcite{%
  \@ifnextchar[{\jb@@footfullcite}{\jb@@footfullcite[]}%
}
\def\jb@@footfullcite[#1]{%
  \@ifnextchar[{\jb@@@footfullcite[#1]}{\jb@@@footfullcite[#1][]}%
}
\def\jb@@@footfullcite[#1][#2]#3{%
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
 \ifjb@fn\ClassError{\jb@pkg@name}{%
  You are using `\string\footfullcite' inside a footnote}{%
  Sorry, that makes no sense.}\fi
 \def\jb@enote@hook{\unskip%
     \noibidem%
     \jb@change@fonts@for@fullcitetrue
     \jb@cite@no@titlefalse
     \jb@fullcite@againtrue
     \jb@citefalse
     \jb@cite@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footnote@periodtrue
 \jb@foottrue % works only for non-endnotes
 \@citex[#1][#2]{#3}%
 \endgroup
% NEW 0.5f `authorformat=indexed' for \nobibliography too
 \ifjb@index\ifjb@no@bib\if@filesw
    {\let\protect\noexpand\immediate\write\@auxout{%
     \string\jb@define@alias{#3}{\jb@authorlist}}}%
 \fi\fi\fi
 \futurelet\@let@token\@next@footnote
}%
% END ****************************************************************
% NEW 0.5f
\newcommand*{\citetitleonly}{%
 \begingroup
  \jb@deactivate@babel%
  \jb@save@auxfile%
  \@ifnextchar[%
   {\jb@cite@titlewithoutauthor}{\jb@cite@titlewithoutauthor[]}}%
\newcommand*{\jb@cite@titlewithoutauthor}{}%
\def\jb@cite@titlewithoutauthor[#1]{%
 \def\jb@enote@hook{%
     \ifjb@all@full
        \jb@change@fonts@for@fullcitetrue
        \jb@fullcite@againtrue
        \jb@cite@titlefalse
     \else
        \jb@cite@titletrue
        \jb@noauthorforcitetitletrue
        \jb@fullcite@againfalse
     \fi
     \jb@citefalse
     \jb@cite@no@titlefalse
     \jb@footfalse % works for endnotes too
 }%
 \jb@enote@hook
 \jb@footfalse % works only for non-endnotes
 \@ifnextchar[{\@citex[#1]}{\@citex[#1][]}%
}%
\newcommand*{\citefield}[3][]{%
  \renewcommand*{\@cite}[2]{##1##2}%
  \let\@citea\@empty\@cite{\@for\@citeb:=#3\do{%
  \@citea\def\@citea{;\penalty\@m\ }%
  \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
  \if@filesw\immediate\write\@auxout{\jb@makehowcited%
  \string\citation{\@citeb}}\fi
  \@ifundefined{b@\@citeb\@extra@b@citeb}{%
  \mbox{\reset@font{\bfseries ?}, #1}\G@refundefinedtrue\@latex@warning%
  {Citation `\@citeb' on page \thepage \space undefined}}{%
  \begingroup
% NEW 0.5e only for \jb@checked@title, otherwise \jb@@newauthorcite is undefined
   \def\jb@@newauthorcite{#3}%
   \ifjb@allow@hyper@cite\hyper@jblinkstart{\@citeb}\fi
%   \protected@edef\jb@tempa{\csname b@\@citeb\@extra@b@citeb\endcsname}%
%   \protected@edef\jb@tempb{\expandafter\jb@thirdofseven\jb@tempa\@empty}%
% NEW 0.5f revised for more arguments from .bbl
%   \protected@edef\jb@tempc{\expandafter\jb@fourthofseven\jb@tempa\@empty}%
% NEW 0.5f new command because of increasing use
   \jb@extract
   \ifthenelse{\equal{#2}{}}{???}{%
       \ifthenelse{\equal{#2}{title}}{%
           \jbtitlefont{\jb@@title}%
       }{%
            \ifthenelse{\equal{#2}{juratitle}
                        \or\equal{#2}{shorttitle}}{%
                \jbtitlefont{\jb@@shorttitle}%
            }{%
                 \ifthenelse{\equal{#2}{year}}{%
                    \ifx\jb@@year\@empty\else
                     \textup{\jbcitationyearformat{\jb@@year}}\fi
                 }{%
                       \ifthenelse{\equal{#2}{author}}{%
                           \let\biblnfont\jbauthorfont
                           \let\bibfnfont\jbauthorfnfont
                           \let\bibelnfont\jbauthorfont
                           \let\bibefnfont\jbauthorfnfont
% NEW 0.5f \jb@checked@author introduced for oxford crossrefs
                           \ifjbcross
                                \jb@checked@author%
                             \else
                                \jbauthorfont{\jb@@fullname}%
                           \fi
                       }{%
                             \ifthenelse{\equal{#2}{juraauthor}\or\equal{#2}{shortauthor}}{%
% NEW 0.5e to avoid ambiguous author ``\citefield's''
                                 \ifthenelse{\equal{\jb@@mult@switch}{1}\or\equal{\jb@@title@switch}{1}}{%
                                     \jbauthorfont{\jb@@author}%
% later in 0.5e: check for crossref's added, because outside crossref's the title is unwanted!
                                     \ifjbcross\jb@checked@title\fi%
                                 }{%
                                     \jbauthorfont{\jb@@author}%
                                 }%
                             }{%
                                  \ifthenelse{\equal{#2}{apy}}{%
                                      \apyformat{\jb@@apy}%
                                  }{%
% NEW 0.51r access to url field added, suggested by Andreas Altenburger
                                      \ifthenelse{\equal{#2}{url}}{%
                                          \jburluse{#3}%
                                      }{%
                                          #2%
                                      }%
                                  }%
                             }%
                       }%
                 }%
            }%
       }%
   }%
   \ifjb@allow@hyper@cite\hyper@jblinkend\fi
  \endgroup
%  \ifthenelse{\equal{#1}{\@empty}}{\relax}{,\space #1}%
% CH 0.52p, check for `commabeforerest' introduced
  \ifthenelse{\equal{#1}{\@empty}}{\relax}{\ifjb@comma@before@rest,\fi\space #1}%
  }}}{}}%
% NEW 0.5f emulate the most important natbib citation commands
\newcommand{\jb@nat@cite@left@sep}{}%
\newcommand{\jb@nat@cite@right@sep}{}%
\newcommand*{\citep}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@citep}{\jb@citep[]}}%
%\def\jb@citep[#1]{\@ifnextchar[{\jb@@citep[#1]}{\jb@@citep[#1][]}}%
\def\jb@citep[#1]{\@ifnextchar[{\jb@@citep[#1]}{\jb@@citep[][#1]}}%
%                                                            ^^
% CHANGED 0.52n first optional argument should print out the page
\def\jb@@citep[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{,\space\jb@@year}}%
        \renewcommand{\jb@nat@cite@left@sep}{(}\renewcommand{\jb@nat@cite@right@sep}{)}%
% to avoid double footnotes when using endnotes.sty
        \jb@footfalse
    }%
    \jb@enote@hook
    \jb@footfalse
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\citet}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@citet}{\jb@citet[]}}%
%\def\jb@citet[#1]{\@ifnextchar[{\jb@@citet[#1]}{\jb@@citet[#1][]}}%
\def\jb@citet[#1]{\@ifnextchar[{\jb@@citet[#1]}{\jb@@citet[][#1]}}%
%                                                            ^^
% CHANGED 0.52n first optional argument should print out the page
\def\jb@@citet[#1][#2]#3{%
    \def\jb@enote@hook{%
%        \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{\space(\jb@@year)}}%
% CH 0.52n removed closing brace after year
         \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{\space(\jb@@year}}%        
%        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
% CH 0.52n added closing brace after page, if given
         \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{)}%
% to avoid double footnotes when using endnotes.sty
        \jb@footfalse
    }%
    \jb@enote@hook
    \jb@footfalse
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\citealt}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@citealt}{\jb@citealt[]}}%
%\def\jb@citealt[#1]{\@ifnextchar[{\jb@@citealt[#1]}{\jb@@citealt[#1][]}}%
\def\jb@citealt[#1]{\@ifnextchar[{\jb@@citealt[#1]}{\jb@@citealt[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page  ^^
\def\jb@@citealt[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{\space\jb@@year}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
% to avoid double footnotes when using endnotes.sty
        \jb@footfalse
    }%
    \jb@enote@hook
    \jb@footfalse
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\citealp}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@citealp}{\jb@citealp[]}}%
%\def\jb@citealp[#1]{\@ifnextchar[{\jb@@citealp[#1]}{\jb@@citealp[#1][]}}%
\def\jb@citealp[#1]{\@ifnextchar[{\jb@@citealp[#1]}{\jb@@citealp[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page  ^^
\def\jb@@citealp[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{,\space\jb@@year}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
% to avoid double footnotes when using endnotes.sty
        \jb@footfalse
    }%
    \jb@enote@hook
    \jb@footfalse
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\citeauthor}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@citeauthor}{\jb@citeauthor[]}}%
%\def\jb@citeauthor[#1]{\@ifnextchar[{\jb@@citeauthor[#1]}{\jb@@citeauthor[#1][]}}%
\def\jb@citeauthor[#1]{\@ifnextchar[{\jb@@citeauthor[#1]}{\jb@@citeauthor[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page           ^^
\def\jb@@citeauthor[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
% to avoid double footnotes when using endnotes.sty
        \jb@footfalse
    }%
    \jb@enote@hook
    \jb@footfalse
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\citeyear}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@citeyear}{\jb@citeyear[]}}%
%\def\jb@citeyear[#1]{\@ifnextchar[{\jb@@citeyear[#1]}{\jb@@citeyear[#1][]}}%
\def\jb@citeyear[#1]{\@ifnextchar[{\jb@@citeyear[#1]}{\jb@@citeyear[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page     ^^
\def\jb@@citeyear[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\ifthenelse{\equal{\jb@@year}{}}{?}{\jb@@year}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
% to avoid double footnotes when using endnotes.sty
        \jb@footfalse
    }%
    \jb@enote@hook
    \jb@footfalse
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\citeyearpar}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@citeyearpar}{\jb@citeyearpar[]}}%
%\def\jb@citeyearpar[#1]{\@ifnextchar[{\jb@@citeyearpar[#1]}{\jb@@citeyearpar[#1][]}}%
\def\jb@citeyearpar[#1]{\@ifnextchar[{\jb@@citeyearpar[#1]}{\jb@@citeyearpar[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page              ^^
\def\jb@@citeyearpar[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\ifthenelse{\equal{\jb@@year}{}}{?}{(\jb@@year)}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
% to avoid double footnotes when using endnotes.sty
        \jb@footfalse
    }%
    \jb@enote@hook
    \jb@footfalse
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\footcitep}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@footcitep}{\jb@footcitep[]}}%
%\def\jb@footcitep[#1]{\@ifnextchar[{\jb@@footcitep[#1]}{\jb@@footcitep[#1][]}}%
\def\jb@footcitep[#1]{\@ifnextchar[{\jb@@footcitep[#1]}{\jb@@footcitep[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page        ^^
\def\jb@@footcitep[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{,\space\jb@@year}}%
        \renewcommand{\jb@nat@cite@left@sep}{(}\renewcommand{\jb@nat@cite@right@sep}{)}%
        \jb@footfalse % works for endnotes too
    }%
    \jb@enote@hook
    \jb@foottrue
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\footcitet}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@footcitet}{\jb@footcitet[]}}%
%\def\jb@footcitet[#1]{\@ifnextchar[{\jb@@footcitet[#1]}{\jb@@footcitet[#1][]}}%
\def\jb@footcitet[#1]{\@ifnextchar[{\jb@@footcitet[#1]}{\jb@@footcitet[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page        ^^
\def\jb@@footcitet[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{\space(\jb@@year)}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
        \jb@footfalse % works for endnotes too
    }%
    \jb@enote@hook
    \jb@foottrue
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\footcitealt}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@footcitealt}{\jb@footcitealt[]}}%
%\def\jb@footcitealt[#1]{\@ifnextchar[{\jb@@footcitealt[#1]}{\jb@@footcitealt[#1][]}}%
\def\jb@footcitealt[#1]{\@ifnextchar[{\jb@@footcitealt[#1]}{\jb@@footcitealt[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page              ^^
\def\jb@@footcitealt[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{\space\jb@@year}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
        \jb@footfalse % works for endnotes too
    }%
    \jb@enote@hook
    \jb@foottrue
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\footcitealp}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@footcitealp}{\jb@footcitealp[]}}%
%\def\jb@footcitealp[#1]{\@ifnextchar[{\jb@@footcitealp[#1]}{\jb@@footcitealp[#1][]}}%
\def\jb@footcitealp[#1]{\@ifnextchar[{\jb@@footcitealp[#1]}{\jb@@footcitealp[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page              ^^
\def\jb@@footcitealp[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}\ifthenelse{\equal{\jb@@year}{}}{}{,\space\jb@@year}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
        \jb@footfalse % works for endnotes too
    }%
    \jb@enote@hook
    \jb@foottrue
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\footciteauthor}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@footciteauthor}{\jb@footciteauthor[]}}%
%\def\jb@footciteauthor[#1]{\@ifnextchar[{\jb@@footciteauthor[#1]}{\jb@@footciteauthor[#1][]}}%
\def\jb@footciteauthor[#1]{\@ifnextchar[{\jb@@footciteauthor[#1]}{\jb@@footciteauthor[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page                       ^^
\def\jb@@footciteauthor[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\jbauthorfont{\jb@@author}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
        \jb@footfalse % works for endnotes too
    }%
    \jb@enote@hook
    \jb@foottrue
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\footciteyear}{\begingroup\jb@deactivate@babel\@ifnextchar[{\jb@footciteyear}{\jb@footciteyear[]}}%
%\def\jb@footciteyear[#1]{\@ifnextchar[{\jb@@footciteyear[#1]}{\jb@@footciteyear[#1][]}}%
\def\jb@footciteyear[#1]{\@ifnextchar[{\jb@@footciteyear[#1]}{\jb@@footciteyear[][#1]}}%
% CHANGED 0.52n first optional argument should print out the page                 ^^
\def\jb@@footciteyear[#1][#2]#3{%
    \def\jb@enote@hook{%
        \def\jb@nat@commands{\ifthenelse{\equal{\jb@@year}{}}{?}{\jb@@year}}%
        \renewcommand{\jb@nat@cite@left@sep}{}\renewcommand{\jb@nat@cite@right@sep}{}%
        \jb@footfalse % works for endnotes too
    }%
    \jb@enote@hook
    \jb@foottrue
    \jb@emulate@nat@cite[#1][#2]{#3}\endgroup
    \futurelet\@let@token\@next@footnote
}%
\newcommand*{\jb@emulate@nat@cite}{\@ifnextchar[{\jb@@emulate@nat@cite}{\jb@@emulate@nat@cite[]}}%
\def\jb@@emulate@nat@cite[#1]{\@ifnextchar[{\jb@@@emulate@nat@cite[#1]}{\jb@@@emulate@nat@cite[#1][]}}%
\def\jb@@@emulate@nat@cite[#1][#2]#3{%
% NEW 0.52p indexing feature for natbib emulatimng commands added
  \ifjb@index\ifjb@no@bib\gdef\jb@authorlist{}\fi\fi
  \ifjb@foot
    \renewcommand*{\@cite}[2]{\unskip\footnote{##1##2.}}%
  \else
    \renewcommand*{\@cite}[2]{##1##2}%
  \fi
  \let\@citea\@empty
  \@cite{%
    \@for\@citeb:=#3\do{%
        \@citea\def\@citea{;\penalty\@m\ }%
        \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
        \if@filesw
            \immediate\write\@auxout{%
                \jb@makehowcited\string\citation{\@citeb}}%
        \fi
        \@ifundefined{b@\@citeb\@extra@b@citeb}{%
          \mbox{\reset@font{\bfseries ?}, #1}%
          \G@refundefinedtrue
          \@latex@warning{Citation `\@citeb' on page \thepage \space undefined}%
        }{%
          \begingroup
% NEW 0.52p indexing too ...
           \jb@index@as@alias{\@citeb}%
           \ifjb@allow@hyper@cite\hyper@jblinkstart{\@citeb}\fi
           \jb@extract%
           \jb@nat@cite@left@sep%
% NEW 0.51r second opt. arg introduced
           \ifthenelse{\equal{#1}{\@empty}}{}{#1\space}%
           \jb@nat@commands%
          \endgroup
          \ifthenelse{\equal{#2}{\@empty}}{}{,\space%
             \ifjb@formatted@pages\jbprformat{#2}\else#2\fi}%
          \jb@nat@cite@right@sep%
          \ifjb@allow@hyper@cite\hyper@jblinkend\fi
% NEW 0.52p still indexing ...
          \ifjb@index\ifjb@no@bib\if@filesw
          {\let\protect\noexpand\immediate\write\@auxout{%
              \string\jb@define@alias{#3}{\jb@authorlist}}}%
          \fi\fi\fi
        }%
    }%
  }{}%
}%
\newcommand*{\jb@makehowcited}{%
\ifjb@howcited
 \ifjbcross\else
% NEW 0.51c new switch for suppressing howcited while using \nobibliography,
% `jb@allow@hyper@cite' is used by the new option `hypercite=false'
  \ifjb@allow@hyper@cite@nobib
%   no need to write out if \nobibliography is used.
   \ifjb@cite\string\jbrealcitation{cite}{\@citeb}^^J\fi
   \ifjb@cite@title\string\jbrealcitation{citetitle}{\@citeb}^^J\fi
   \ifjb@cite@no@title\string\jbrealcitation{citenotitle}{\@citeb}^^J\fi
  \fi
 \fi
\fi
}%
\newcommand*{\jb@changefontsforfullcite}{%
  \ifjb@reverse@names@in@citation
      \let\bibnf\bibrnf
      \let\bibenf\bibrenf
  \fi
  \let\bibansep\jbhowsepbeforetitle
  \let\bibbtasep\jbbtasep
  \let\bibbfsasep\jbbfsasep
  \let\bibbstasep\jbbstasep
  \let\bibbtesep\jbbtesep
  \let\bibbfsesep\jbbfsesep
  \let\bibbstesep\jbbstesep
  \let\jblinebreak\@empty
  \ifjb@change@fonts@for@fullcite
  \let\biblnfont\jbauthorfont%
  \let\bibfnfont\jbauthorfnfont%
  \let\bibelnfont\jbauthorfont%
  \let\bibefnfont\jbauthorfnfont%
  \let\bibtfont\jbtitlefont%
  \let\bibbtfont\jbbtitlefont%
  \let\bibapifont\jbapifont%
    \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{%
    \ifjb@dynamic@author@fonts
      \let\jbauthorfont\jbactualauthorfont
      \let\biblnfont\jbactualauthorfont
      \let\bibfnfont\jbactualauthorfnfont
%      \let\bibelnfont\jbactualauthorfont
%      \let\bibefnfont\jbactualauthorfnfont
    \fi
    }{%
    \ifjb@dynamic@author@fonts
      \ifjb@see
      \let\biblnfont\jbactualauthorfont
      \else
      \let\jbcoauthorfont\jbactualauthorfont
      \let\jbauthorfont\jbauthorfontifcoauthor
      \fi
    \fi
    }%
  \fi
}%
\newcommand*{\jb@test@last@author@ibidem}{%
   \ifjb@see
     \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{}{%
       \jb@formatted@co@author%
%      if 2nd opt. arg (via option `see') is given, switch to lower case ibid.
%      thanks to Alexander Wisspeintner (wisspein@informatik.tu-muenchen.de)
       \let\IbidemName\IbidemMidName
     }%
   \fi
   \ifthenelse{\equal{\jb@@newcoauthorcite}{\jb@@lastcoauthorcite}\or\boolean{jb@see}}{%
%                                                                 ^^^^^^^^^^^^^^^^^^^
% NEW 0.5e: if `see' is active, allow immediately following ibidem for different `coauthors'
% Example: \footcite[][see]{inbook-minimal}
%          \footcite{inbook-minimal}        <=== ibid. for humanities (if `see' is active), NOT for lawyers!
%          \footcite{inbook-minimal}        <=== ibid. for both!
     \let\jb@@newcoauthorcite\@empty
     \@ifundefined{ibidem}{\@namedef{ibidem}{}}{\relax}%
     \ifjb@debug
       \textcolor[named]{WildStrawberry}{%
       \ifjb@debug@br[\fi\ifthenelse{\thejb@cites@in@footnote<2}{\IbidemName}{\IbidemMidName}\ifjb@debug@br]\fi}%
     \else
%       \IbidemName
% NEW 0.52k+l lowercase ibidem for inline citations or \cite's inside the same footnote. (reported by Matthias Damm)
       \ifthenelse{\thejb@cites@in@footnote<2}{\IbidemName}{\IbidemMidName}%
% NEW 0.51 Ibidem/Idem-bugfix. Bug reported by Sönke Schaal (<s.schaal@freenet.de>)
% When using German and `ibidem' and `idem' are used together, it appears `A.a.O.Ders.'
% because of ``hardcoded'' gender macros for German in dejbbib.ldf. In all other languages 
% the gender macros were linked to \idem[mid]name, which was \@empty'ed here in this 
% macro. Now they are disabled all in the same way, by using:
       \jb@switchidemofflocallytrue
% NEW 0.52i while we suppressing output of startpages for ibidem citations now, 
% we have to switch off the mechanism to suppress formatted pages after startpages
       \jbnoformatafterstartpagefalse       
     \fi
% NEW 0.5f if the pages are also the same, suppress them!
     \ifthenelse{\equal{\jb@@newpagecite}{\jb@@lastpagecite}}{\let\jb@@newpagecite\@empty}{}%
% CHANGED 0.51h kerning routine removed
%     \ifjb@ssed@kerning@wanted
%          \renewcommand*{\jb@kern@before@sepi}{}%
%          \renewcommand*{\jb@kern@before@sepii}{}%
%          \renewcommand*{\jb@kern@before@sepiii}{}%
%          \renewcommand*{\jb@kern@after@sepi}{ }%
%          \renewcommand*{\jb@kern@after@sepii}{ }%
%          \renewcommand*{\jb@kern@after@sepiii}{ }%
%     \fi
     \let\jb@extraspace\@empty
%     \jb@footnote@period@ibidemfalse
% NEW 0.5e humanities stuff
     \let\jbapifont\@empty% <== remove single quotes after ibid.
     \let\jbbtfont\@empty % <== remove single quotes after ibid.
     \ifjb@ibidem@with@name
       \let\jb@@fullname\@empty
       \let\IbidemName\@empty
       \let\jbatsep\@empty
       \jb@second@extra@spacefalse
     \fi
     \let\jb@use@fullcite\@empty
     \let\jb@@author\@empty
     \let\jb@aftertitleedition\@empty
     \let\jb@checked@edition\@empty
     \let\jbhowsepbeforetitle\@empty
     \let\jb@@title\@empty
% NEW 0.5e bug removed for ibidem'ed citations, wrong error message about missing shorttitle
% (although given), submitted by Andreas K. Foerster (<AKFoerster@nikocity.de>)
% changed \@empty to \relax
     \let\jb@@shorttitle\relax
% NEW 0.5e for use with jchicago.bst
     \let\jb@formatted@year\@empty
% NEW 0.5e idem feature
% REMOVED 0.5f See => Ibidem/Idem-bugfix some lines above
%     \let\idemname\@empty
% NEW 0.5e op.cit. feature
     \let\OpCit\relax
     \ifjb@see\else\let\jb@@newcoauthorcite\@empty\fi
     \ifthenelse{%
                 \equal{\jb@@newpagecite}{\jb@@lastpagecite}%
                 \or
                 \equal{\jb@@newpagecite}{}%
     }{%
                 \global\jb@footnote@periodfalse
     }{}%
% NEW 0.5f make sure it is empty (prophylaxe)
     %\let\jb@makeidem\@empty
   }{\relax}%
}%
% NEW 0.5f gender check for idem (necessary only for german users, I think)
\newcommand*{\jb@idem@gender@checked}{%
  \ifjb@noauthorforcitetitle\else
% NEW 0.5f Ibidem/Idem-bugfix
   \ifjb@switchidemofflocally\else
    \ifthenelse{%
        \not\equal{\jb@@gender}{}%
        \and
        \boolean{jblookforgender}%
    }{%
        \ifthenelse{\equal{\jb@@gender}{sm}}{%
           \@ifundefined{jb@morethanonecite}{\idemSmname}{\idemsmname}%
        }{%
            \ifthenelse{\equal{\jb@@gender}{pm}}{%
                \@ifundefined{jb@morethanonecite}{\idemPmname}{\idempmname}%
            }{%
                \ifthenelse{\equal{\jb@@gender}{sf}}{%
                     \@ifundefined{jb@morethanonecite}{\idemSfname}{\idemsfname}%
                }{%
                    \ifthenelse{\equal{\jb@@gender}{pf}}{%
                        \@ifundefined{jb@morethanonecite}{\idemPfname}{\idempfname}%
                    }{%
                        \ifthenelse{\equal{\jb@@gender}{sn}}{%
                            \@ifundefined{jb@morethanonecite}{\idemSnname}{\idemsnname}%
                        }{%
                            \ifthenelse{\equal{\jb@@gender}{pn}}{%
                                \@ifundefined{jb@morethanonecite}{\idemPnname}{\idempnname}%
                            }{%
                                \@ifundefined{jb@morethanonecite}{\idemSmname}{\idemsmname}%
                            }%
                        }%
                    }%
                }%
            }%
        }%
    }{%
% NEW 0.5f
       \ifthenelse{\equal{\bbl@main@language}{english}\and\boolean{jboxford}}{%
           \edfont{\idemname}%
       }{%
           \ifjbcross\edfont{\idemmidname}\else\edfont{\idemname}\fi
       }%
%       \idemname%
    }%
   \fi
  \fi
}
\newcommand*{\jb@do@idem}{%
  \@ifundefined{idem}{\@namedef{idem}{}}{\relax}%
  \ifjb@same@fullauthor
% NEW 0.5f warning about ambiguous citations inserted, if:
    \ifthenelse{%
        \equal{\jb@@mult@switch}{1}%                                    1. author wrote multiple works,
        \and\equal{\jb@@shorttitle}{}%                                   2. shorttitle is empty,
        \and\equal{\@nameuse{citefull@\jb@@newauthorcite}}{citefull}%   3. not the very first citation, and
        \and\boolean{jb@no@title@replace}%                              4. replacing shorttitle by title not possible
    }{%
          \@ifundefined{ETFII@\jb@@newauthorcite}{%        The same warning is placed somewhere else,
            \global\@namedef{ETFII@\jb@@newauthorcite}{}%  but we don't want to disturb the user with warnings.
            \jb@package@warningNoLine{\jb@pkg@name}{%
             *** `\jb@@newauthorcite' ***\on@line\MessageBreak
             is an ambiguous citation! Because you are using\MessageBreak
             `titleformat=noreplace', the title field can't\MessageBreak
             be used to replace the missing shorttitle}%
          }{\relax}%
    }{}%
    \ifjb@debug
      \textcolor[named]{WildStrawberry}{%
          \ifjb@debug@br[\fi
            \jb@idem@gender@checked%
          \ifjb@debug@br]\fi
      }%
    \else
        \jb@idem@gender@checked%
    \fi
    \let\jb@@fullname\@empty
    \let\jb@@author\@empty
%    \let\IbidemName\@empty
%    \let\IbidemMidName\@empty
    \ifthenelse{%
           \equal{\jb@@newpagecite}{\jb@@lastpagecite}%
           \TE@or % normal \or causes problems
           \equal{\jb@@newpagecite}{}%
    }{%
           \ifjb@opcit\else
           \@ifundefined{jb@morethanonecite}{%
             \ifjbidemabbrvwithperiod
% we don't suppress the period, if there are multiple works are cited and the title is printed.
                \ifthenelse{\equal{\jb@@mult@switch}{1}\TE@or\equal{\jb@@title@switch}{1}}{}{%
                   \global\jb@footnote@periodfalse
                }%
             \fi
           }{\global\jb@footnote@periodtrue}%
           \fi
    }{}%
  \fi
}
\newcommand*{\jb@test@last@author@idem}{%
   \ifjb@see
%  for humanities
     \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{}{%
       \jb@formatted@co@author%
       \let\idemname\idemmidname
       \let\jb@@newcoauthorcite\@empty
     }%
     \jb@do@idem
   \else
%  for lawyers
     \ifjb@coauthor@last
         \jb@do@idem
         \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{}{%
           \jbhowsepcoauthorlast%
           \jb@formatted@co@author%
           \let\idemname\idemmidname
           \let\jb@@newcoauthorcite\@empty
         }%
     \else
         \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{}{%
           \jb@formatted@co@author%
           \jbhowsepcoauthorfirst%
           \let\idemname\idemmidname
           \let\jb@@newcoauthorcite\@empty
         }%
         \jb@do@idem
     \fi
   \fi
}%
\newcommand*{\jb@makeibidem}{%
  \ifthenelse{\equal{\jb@@author}{empty}}{%
    \jb@all@titlestrue
    \let\jbhowsepcoauthorlast\@empty
    \ifjb@see\else
       \let\jb@@newcoauthorcite\@empty
    \fi
  \@ifundefined{MISS@##3}{%
    \global\@namedef{MISS@##3}{}%
    \jb@package@warningNoLine{\jb@pkg@name}{%
    The author of `\jb@@newauthorcite'\MessageBreak
    is missing, I assume you know what %
    you are doing}%
    }{\relax}%
  }{\relax}%
  \ifthenelse{\boolean{jb@ibidem}}{%
    \protected@edef\jb@tempcnt{\thejbbibcnt}%
    \stepcounter{jbbibcnt}%
%   labels only for cites in footnotes !
    \ifjb@fn
      \begingroup
        \jb@restore@auxfile
        \label{ibidem:\thejbbibcnt}%
      \endgroup
    \fi
    \ifthenelse{\equal{\jb@@newauthorcite}{\jb@@lastauthorcite}}{%
      \@tempcnta=\jb@tempcnt
        \ifjb@ibidem@double@pagewise
         \advance\@tempcnta\@ne
        \fi
      \protected@edef\jb@idemcnta{\the\@tempcnta}%
      \ifthenelse{\boolean{jb@ibidem@pagewise}}{%
%       true for ibidem=strict[doublepage]
        \ifthenelse{%
           \(%
%           check if on facing pages
%           switch for ibidem=strictdoublepage true?
               \boolean{jb@ibidem@double@pagewise}%
             \and
               \isodd{\jb@simple@pageref@by@heiko{ibidem:\thejbbibcnt}}
             \and
               \equal{%
                  \jb@simple@pageref@by@heiko{ibidem:\jb@idemcnta}}{%
                  \jb@simple@pageref@by@heiko{ibidem:\thejbbibcnt}}%
           \)%
           \or
%            ignoring page breaks
             \equal{%
               \jb@simple@pageref@by@heiko{ibidem:\jb@tempcnt}}{%
               \jb@simple@pageref@by@heiko{ibidem:\thejbbibcnt}}%
        }{%
%         facing pages
          \jb@test@last@author@ibidem
%         no lookat for recently cited works!?
          \jb@lookatfalse
        }{%
%         not on facing pages
          \relax
        }%
      }{%
%       ibidem not pagewise (ibidem=strict[doublepage] false)
        \jb@test@last@author@ibidem
      }% jb@ibidem@pagewise end
  }{\relax}% authors equal
  }{\relax}% jb@ibidem
}%
\newcommand*{\jb@makeidem}{%
% no citation idem's for crossref \cites in bibliography, we are building
% own idem's for bibliography
 \ifjbweareinbib\else
  \ifthenelse{\boolean{jb@idem}}{%
    \protected@edef\jb@idemcnta{\theidemcnt}%
    \stepcounter{idemcnt}%
    \ifjb@fn
      \begingroup
        \jb@restore@auxfile
        \label{idem:\theidemcnt}%
      \endgroup
    \fi
    \ifjb@same@fullauthor
      \@tempcnta=\jb@idemcnta
        \ifjb@idem@double@pagewise
            \advance\@tempcnta\@ne
        \fi
      \protected@edef\jb@idemcntb{\the\@tempcnta}%
      \ifthenelse{\boolean{jb@idem@pagewise}}{%
           \ifthenelse{%
                  \boolean{jb@idem@double@pagewise}%
                \and
                  \isodd{\jb@simple@pageref@by@heiko{idem:\theidemcnt}}%
                \and
                  \equal{%
                     \jb@simple@pageref@by@heiko{idem:\jb@idemcntb}}{%
                     \jb@simple@pageref@by@heiko{idem:\theidemcnt}}%
           }{%
               \jb@test@last@author@idem
           }{%
               \ifthenelse{%
                    \equal{\jb@simple@pageref@by@heiko{idem:\jb@idemcnta}}{%
                           \jb@simple@pageref@by@heiko{idem:\theidemcnt}}%
               }{%
                    \jb@test@last@author@idem
               }{}%
           }%
      }{%
           \jb@test@last@author@idem
      }%
    \fi
  }{}%
 \fi
}%
% NEW 0.5f, check for ##3
\newcommand{\jb@make@ibidem@name@title}{%
   \jb@relaxforemptyauthor
   \ifthenelse{\equal{\jb@@shorttitle}{}}{%
      \ifjb@no@title@replace\else
         \jbhowsepbeforetitle\jbtitlefont{\jb@@title}%
      \fi%
   }{%
      \jbhowsepbeforetitle\jbtitlefont{\jb@@shorttitle}%
% NEW 0.5f: switch for howcited=compare, we have to know, if the shorttitle was used.
      \@ifundefined{TITLE@##3}{\global\@namedef{TITLE@##3}{used}}{}%
   }%
  \ifjb@author@year\ifjb@yearaftertitle\jb@formatted@year\fi\fi
% to think about ...
%  \ifthenelse{\equal{\jb@@fullname}{\@empty}}{}{%
%       \jbatsep\ifjb@third@extra@space\space\fi}%
}%
\newcommand*{\jb@makecheckednameibidem}{%
 \ifjb@fullcite@again\else
  \ifjb@ibidem@with@name
% NEW 0.5e/0.52d: no adding of pageranges for ibidem=name|nametitle!
   \jb@allow@adding@of@pagerangefalse
   \ifthenelse{\equal{\jb@@author}{empty}}{%
    \jb@second@extra@spacefalse}{\relax}%
   \ifjb@debug@br[\fi
   \jb@formatted@co@author@in%
   \ifjb@ibidem@with@short@name
    \ifthenelse{\equal{\jb@@author}{empty}}{%
      \jbauthorfont{\jb@@fullname}%
    }{%
      \jbauthorfont{\jb@@author}%
    }%
   \else
     \jb@@fullname%
   \fi
% NEW 0.5e author-year support
   \ifjb@author@year\ifjb@yearafterauthor\jb@formatted@year\fi\fi
   \ifthenelse{\equal{\jb@@mult@switch}{1}}{%
    \@ifundefined{MULT@##3}{%
      \global\@namedef{MULT@##3}{}%
      \ifjb@ibidem@with@name@and@title\else
       \ifjb@ibidem@with@name@and@title@auto\else
        \jb@package@warningNoLine{\jb@pkg@name}{%
        The author of `\jb@@newauthorcite'\MessageBreak
        is cited with more than one work, %
        I'm switching\MessageBreak to %
        `ibidem=name&title&auto' to avoid %
        ambiguous citations}%
% NEW 0.5f ????????????
        \global\jb@ibidem@with@name@and@title@autotrue
      \fi\fi
    }{\relax}%
   }{\relax}%
% to think about ...
%   \ifjb@ibidem@with@name
%    \ifjb@ibidem@with@name@and@title
%      \jbhowsepbeforetitle%
%    \else
%       \ifthenelse{\equal{\jb@@fullname}{\@empty}}{%
%           \unskip}{\jbhowsepbeforetitleibidemname}%
%    \fi
%   \else
%     \jbhowsepbeforetitle%
%   \fi
%   \ifthenelse{\equal{\jb@@fullname}{\@empty}}{}{%
%    \ifjb@ibidem@with@name@and@title\else\space\fi}%
   \ifjb@ibidem@with@name@and@title
        \jb@make@ibidem@name@title%
% |> NEW 0.5f
   \else
      \ifjb@ibidem@with@name@and@title@auto
         \ifjb@same@author@different@work% WECHSEL!%
              \jb@make@ibidem@name@title%
         \fi
      \fi
% NEW 0.5f >|
   \fi
% to think about ...
%   \ifthenelse{\equal{\jb@@fullname}{\@empty}}{%
     \ifthenelse{\equal{\jb@@title}{}}{%
       \ifthenelse{\equal{\jb@@shorttitle}{}}{%
            \IbidemName%
        }{,\space\IbidemMidName}%
     }{,\space\IbidemMidName}%
%   }{%
%     \IbidemMidName%
%   }%
% NEW 0.5f period problem ...
   \ifthenelse{%
        \equal{\jb@@newpagecite}{\jb@@lastpagecite}%
        \TE@or % normal \or causes problems
        \equal{\jb@@newpagecite}{}%
   }{%
        \ifjb@opcit\else
           \global\jb@footnote@periodfalse
        \fi
   }{}%
%   \jb@footnote@period@ibidemfalse
   \jb@relaxcommandsforfullcite
   \ifjb@debug@br]\fi
  \fi
 \fi
}%
\newcommand*{\jb@dofullcite}{%
 \ifjb@debug
   \textcolor[named]{Red}{%
   \ifjb@debug@br[\fi
    \jb@formatted@co@author@in\jb@use@fullcite%
   \ifjb@debug@br]\fi}%
 \else
   \jb@formatted@co@author@in\jb@use@fullcite%
 \fi%
 \jb@relaxcommandsforfullcite
 \let\jb@extraspace\@empty
% CHECK WHY!
% \global\jb@fullcite@againfalse %%!!!
 \jb@allow@lookat@for@fullcitefalse
}%
\newcommand*{\jb@makeagainfullcite}{%
 \ifjb@fullcite@again
   \jb@allow@adding@of@pagerangefalse
   \ifthenelse{%
    \equal{\@nameuse{\jb@@newauthorcite}}{allnextshort}}{%
      \relax
   }{%
    \jb@dofullcite%
   }%
 \else
  \ifthenelse{%
    \equal{\@nameuse{\jb@@newauthorcite}}{allnextfull}}{%
    \jb@dofullcite%
  }{%
    \relax
  }%
 \fi
}%
\newcommand*{\jb@relaxforemptyauthor}{%
  \ifthenelse{\equal{\jb@@author}{empty}}{%
    \let\jb@@author\@empty
    \let\jbhowsepbeforetitle\relax
    \let\jb@extraspace\@empty
    }{\relax}%
}%
\newcommand*{\jb@warningfootciteusage}{%
  \ifjb@cite@no@title
   \ifthenelse{%
        \equal{\jb@@mult@switch}{1}%
        \and
% NEW 0.5f superfluous warning about ambiguous citation while using `authorformat=year'
% bug reported by Anneke Emse (<emse@uni-koeln.de>)
        \not\boolean{jb@author@year}%
   }{%
       \jb@package@warning{\jb@pkg@name}{%
       *** `\jb@@newauthorcite' ***\MessageBreak
       is an ambiguous citation! Beware of\MessageBreak
       using \string\[foot]cite*}%
   }{\relax}%
  \fi
}%
\newcommand*{\jb@checktitlefields}{%
% NEW 0.5f wrong warning about ambiguous citation for the second citation
% was given, if `titleformat=all', `titleformat=noreplace' and
% `citefull=first' were active, \jb@alltitlestrue switches to \jb@@arg=1
% and produces the wrong message!
% Later in 0.5f: Think about it!!!!!!!!!!!!!!
%    \and\not\boolean{jb@all@titles}%
% NEW 0.5f Have thought about it, new command introduced (\jb@@mult@switch)
 \ifthenelse{\equal{\jb@@mult@switch}{1}}{%
% NEW 0.52o No warning about ambiguous citations if `authorformat=year' is used
   \ifthenelse{\equal{\jb@@shorttitle}{}\and\not\boolean{jb@author@year}}{%
     \ifthenelse{\equal{\jb@@title}{}}{%
       \let\jb@extraspace\@empty
       \@ifundefined{ETF@\jb@@newauthorcite}{%
         \global\@namedef{ETF@\jb@@newauthorcite}{}%
         \jb@package@warning{\jb@pkg@name}{%
           *** `\jb@@newauthorcite' ***\MessageBreak
           is an ambiguous citation! The `shorttitle'\MessageBreak
           can't be used. I tried to substitute with\MessageBreak
           `title' field - without success, please check the\MessageBreak
           citation}{\relax}%
       }{\relax}%
     }{%
% NEW 0.5e special warning if titleformat=noreplace is used and shorttitle is empty
       \ifthenelse{%
          \equal{\@nameuse{citefull@\jb@@newauthorcite}}{citefull}%
            \or
          \boolean{jbcross}%
       }{%
          \ifjbweareinbib\else
           \ifjb@no@title@replace
            \@ifundefined{ETFII@\jb@@newauthorcite}{%
              \global\@namedef{ETFII@\jb@@newauthorcite}{}%
              \jb@package@warningNoLine{\jb@pkg@name}{%
               *** `\jb@@newauthorcite' ***\on@line\MessageBreak
               is an ambiguous citation! Because you are using\MessageBreak
               `titleformat=noreplace', the title field can't\MessageBreak
               be used to replace the missing shorttitle}%
            }{\relax}%
         \fi\fi
       }{\relax}%
     }%
   }{\relax}%
 }{%
% NEW 0.5 Warnings improved because of new command (\jb@@mult@switch)
     \@ifundefined{jb@fm@\@citeb}{}{%
         \ifthenelse{\equal{\jb@@mult@switch}{0}%
                     \and\not\boolean{jbweareinbib}%
                     \and\boolean{jb@no@title@replace}%
         }{%
              \@ifundefined{ETFII@\jb@@newauthorcite}{%
                \global\@namedef{ETFII@\jb@@newauthorcite}{}%
                \jb@package@warningNoLine{\jb@pkg@name}{%
                 *** `\jb@@newauthorcite' ***\on@line\MessageBreak
                 is an ambiguous citation! Because you are using\MessageBreak
                 `titleformat=noreplace', the title field can't\MessageBreak
                 be used to replace the missing shorttitle}%
              }{\relax}%
         }{\relax}%
     }%
 }%
}%
% NEW 0.5f new command (\jb@@title@switch) introduced to make a difference between multiple
% author switch and `titleformat=all' and bibetal switch, produces wrong warning
% messages about (non-existent) multiple citations
\newcommand*{\jb@maketitlewishestrue}{%
  \ifjb@all@titles\def\jb@@title@switch{1}\fi
  \ifjb@cite@title\def\jb@@title@switch{1}\fi
  \ifjb@cite@no@title\def\jb@@title@switch{0}\fi
}%
\newcommand*{\jb@makecoauthorlastwithtitle}{%
 \ifjb@noauthorforcitetitle\else
  \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{%
   \jb@make@author@emph%
   \jb@formatted@author%
   \jb@checked@edition%
  }{%
   \jb@formatted@author%
   \ifjb@ssed@after@author\jb@checked@edition\fi
   \jb@make@coauthor@emph%
   \jbhowsepcoauthorlast%
   \jb@formatted@co@author%
   \ifjb@ssed@after@author\else\jb@checked@edition\fi
  }%
 \fi
 \ifthenelse{%
    \equal{\@nameuse{\jb@@newauthorcite}}{allnextnotitle}}{%
 }{%
    \jb@checked@title%
 }%
}%
\newcommand*{\jb@makecoauthorfirstwithtitle}{%
 \ifjb@noauthorforcitetitle\else
  \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{%
   \jb@make@author@emph%
   \jb@formatted@author%
   \jb@checked@edition%
  }{%
   \jb@make@coauthor@emph%
   \jb@formatted@co@author%
   \jbhowsepcoauthorfirst%
   \jb@formatted@author%
   \jb@checked@edition%
  }%
 \fi
 \ifthenelse{%
    \equal{\@nameuse{\jb@@newauthorcite}}{allnextnotitle}}{%
 }{%
    \jb@checked@title%
 }%
}%
\newcommand*{\jb@makecoauthorlastwithouttitle}{%
 \ifjb@noauthorforcitetitle\else
  \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{%
   \jb@make@author@emph%
   \jb@formatted@author%
   \jb@checked@edition%
  }{%
   \jb@formatted@author%
   \ifjb@ssed@after@author\jb@checked@edition\fi
   \jb@make@coauthor@emph%
   \jbhowsepcoauthorlast%
   \jb@formatted@co@author%
   \ifjb@ssed@after@author\else\jb@checked@edition\fi
  }%
 \fi
}%
\newcommand*{\jb@makecoauthorfirstwithouttitle}{%
 \ifjb@noauthorforcitetitle\else
  \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{%
   \jb@make@author@emph%
   \jb@formatted@author%
   \jb@checked@edition%
  }{%
   \jb@make@coauthor@emph%
   \jb@formatted@co@author%
   \jbhowsepcoauthorfirst%
   \jb@formatted@author%
   \jb@checked@edition%
  }%
 \fi
}%
\newcommand*{\jb@makecheckedcite}{%
 \ifthenelse{%
   \equal{\jb@@mult@switch}{1}%
   \or\equal{\jb@@title@switch}{1}%
% NEW 0.5f superfluous warning about ambiguous citation while using `authorformat=year'
% ambiguity is avoided by the year and the generated extra.label!
% bug reported by Anneke Emse (<emse@uni-koeln.de>)
% CHANGED 0.51k small modification, because of problems with combination of `authorformat=year'
% and `titleformat=all'
   \and\not\boolean{jb@starred@cite}%
 }{%
   \ifjb@coauthor@last
     \jb@makecoauthorlastwithtitle
   \else
     \jb@makecoauthorfirstwithtitle
   \fi
 }{%
   \ifjb@coauthor@last
     \jb@makecoauthorlastwithouttitle
   \else
     \jb@makecoauthorfirstwithouttitle
   \fi
 }%
% NEW 0.51r fallback to url, if url given and neither shortauthor or shorttitle are given
% CH 0.52p removed, because of problems of detecting non-given url
%   \ifthenelse{\equal{\jb@@shorttitle}{}\and\equal{\jb@@author}{}%
%     \and\not\equal{\jburluse{\jb@@newauthorcite}}{}}{\jburluse{\jb@@newauthorcite}}{}%
 \jb@aftertitleedition%
 \ifjb@yearaftertitle\jbyear\fi
}%
\newcommand*{\jb@ssed@size}{\tiny}%
\newlength{\jb@length@i}  \settowidth{\jb@length@i}  {\jb@ssed@size 1}%
\newlength{\jb@length@ii} \settowidth{\jb@length@ii} {\jb@ssed@size 11}%
\newlength{\jb@length@iii}\settowidth{\jb@length@iii}{\jb@ssed@size 111}%
\newcommand*{\jb@kern@before@sepi}  {\hspace{-\jb@length@i}}%
\newcommand*{\jb@kern@after@sepi}   {\hspace{\jb@length@i}}%
\newcommand*{\jb@kern@before@sepii} {\hspace{-\jb@length@ii}}%
\newcommand*{\jb@kern@after@sepii}  {\hspace{\jb@length@ii}}%
\newcommand*{\jb@kern@before@sepiii}{\hspace{-\jb@length@iii}}%
\newcommand*{\jb@kern@after@sepiii} {\hspace{\jb@length@iii}}%
\newcommand*{\jb@kern@sep}{}%
% NEW 0.5e
\newcommand*{\jb@extract@starting@page}[1]{%
    \protected@edef\sp@tempa{#1}%
    \expandafter\jb@@extract@starting@page\sp@tempa-\end%
}
\newcommand\jb@@start@page@switch{0}%
\newcommand*{\jb@@extract@starting@page}{}% make sure it's undefined
\def\jb@@extract@starting@page#1-#2\end{%
   \def\jb@@start@page{#1}%
}%
%% NEW 0.5e
%% The following code for testing pageranges was completely
%% contributed by Stefan Ulrich, very special thanks!
\def\sndecmd{}%
% NEW 0.51a Robusted
\DeclareRobustCommand*{\nopage}{}
\newcommand*{\pageadd}[1]{{\space{}#1}}
\newcommand*{\jbprformat}[1]{%
% Hack: Das Argument von \nopage bleibt durch
% den \ifx-Test im Input-Stream stehen
% NEW 0.51a \ifx changed to \if, \nopage can be used in pages-field now
    \if\nopage#1\else
        \jb@parse@page{#1}%
    \fi
}%
% NEW 0.51o added to adapt the separation of \formatpages automatically
\newcommand{\jbpagesnamesep}{\,}\newcommand{\bibpagesnamesep}{\,}%
\newcommand*{\jb@parse@page}[1]{%
  \ifthenelse{\equal{\jbpagename}{}\and\equal{\jbpagesname}{}}{\def\jbpagesnamesep{}}{}%
  \ifthenelse{\equal{\bibpagename}{}\and\equal{\bibpagesname}{}}{\def\bibpagesnamesep{}}{}%
    \jb@if@contains@ff{#1}{%
        \ifjbweareinbib
            \bibpagesname\bibpagesnamesep#1%
        \else
            \jbpagesname\jbpagesnamesep#1%
        \fi
    }{%
        \jb@if@contains@f{#1}{%
            \ifjbweareinbib
                \bibpagesname\bibpagesnamesep#1%
            \else
                \jbpagesname\jbpagesnamesep#1%
            \fi
        }{%
            \jb@if@contains@endash{#1}{%
                \ifjbweareinbib
                    \bibpagesname\bibpagesnamesep#1%
                \else
                    \jbpagesname\jbpagesnamesep#1%
                \fi
            }{%
                \jb@if@contains@multiple{#1}{%
                    \ifjbweareinbib
                        \bibpagesname\bibpagesnamesep#1%
                    \else
                        \jbpagesname\jbpagesnamesep#1%
                    \fi
                }{%
% 0.51u: Here we have single pages!                
                    \ifjbweareinbib
                        \bibpagename\bibpagesnamesep#1%
                    \else
                        \jbpagename\jbpagesnamesep#1%
                    \fi
                }%
            }%
        }%
    }%
}%
\newcommand*{\jb@if@contains@multiple}[1]{%
    \protected@edef\@tempa{#1}%
% die folgende \expandafter-Orgie ist nötig, um vor dem
% Aufruf von \jb@@if@contains@multiple erst \space, dann
% \@tempa zu expandieren:
    \expandafter\expandafter\expandafter\jb@@if@contains@multiple
    \expandafter\@tempa\space\@nil
}
\newcommand*{\jb@if@contains@endash}[1]{%
    \protected@edef\@tempa{#1}%
    \expandafter\jb@@if@contains@endash\@tempa--\@nil}%
\newcommand*{\jb@if@contains@ff}[1]{%
    \protected@edef\@tempa{#1}%
    \expandafter\jb@@if@contains@ff\@tempa ff\@nil}%
\newcommand*{\jb@if@contains@f}[1]{%
    \protected@edef\@tempa{#1}%
    \expandafter\jb@@if@contains@f\@tempa f\@nil}%
\newcommand*{\jb@@if@contains@multiple}{}
\def\jb@@if@contains@multiple#1 #2\@nil{%
% \jb@typeout{args of multiple: |#1|#2|}%
    \ifx\\#2\\% is #2 empty?
% \jb@typeout{no and}%
        \expandafter\@secondoftwo
    \else
% \jb@typeout{and found}%
        \expandafter\@firstoftwo
    \fi
}%
\newcommand*{\jb@@if@contains@endash}{}
\def\jb@@if@contains@endash#1--#2\@nil{%
% \jb@typeout{args of endash: |#1|#2|}%
    \ifx\\#2\\% is #2 empty?
% \jb@typeout{no --}%
        \expandafter\@secondoftwo
    \else
% \jb@typeout{-- found}%
        \expandafter\@firstoftwo
    \fi
}%
\newcommand*{\jb@@if@contains@f}{}
\def\jb@@if@contains@f#1f#2\@nil{%
% \jb@typeout{args of f: |#1|#2|}%
    \ifx\\#2\\% is #2 empty?
% \jb@typeout{no f}%
        \expandafter\@secondoftwo
    \else
% \jb@typeout{f found}%
        \expandafter\@firstoftwo
    \fi
}%
\newcommand*{\jb@@if@contains@ff}{}
\def\jb@@if@contains@ff#1ff#2\@nil{%
% \jb@typeout{args of ff: |#1|#2|}%
    \ifx\\#2\\% is #2 empty?
% \jb@typeout{no ff}%
        \let\sndecmd\@secondoftwo
% \ecmd changed to \sndecmd, \ecmd already used, causes errors
    \else
        \def\@tempa{ff}%
        \def\@tempb{#2}%
        \ifx\@tempa\@tempb
% \jb@typeout{ff found}%
            \let\sndecmd\@firstoftwo
        \else
% \jb@typeout{no ff}%
            \let\sndecmd\@secondoftwo
        \fi
    \fi
    \sndecmd
}%
\newcommand*{\jbpagesformat}[1]{#1}%
\newcommand*{\jbafterstartpagesep}{,}%
% NEW 0.51o now five args, one new optional for configurable separation before startpage 
\newcommand*{\formatpages}{\@ifnextchar[{\jb@formatpages}{\jb@formatpages[]}}%
\def\jb@formatpages[#1]{\@ifnextchar[{\jb@@formatpages[#1]}{\jb@@formatpages[#1][]}}%
\def\jb@@formatpages[#1][#2]#3#4#5{%
  \def\jb@afterstartpagesep{#1}%
  \def\jb@beforestartpagesep{#2}%
  \def\jb@start@page@for@types{#3}%
  \def\jb@normalpageldelim{#4}%
  \def\jb@normalpagerdelim{#5}%
  \ifthenelse{\equal{#1}{}\and\equal{#2}{}%
% startpage will be recognized only, when at least one opt. arg is used
  }{%
    \renewcommand*{\jbpagesformat}[1]{%
        \jb@normalpageldelim##1\jb@normalpagerdelim}%
  }{\jb@start@pagetrue}%
}%
% NEW 0.5f: emulate the old command \formatarticlepages
% NEW 0.51o five args
\newcommand*{\formatarticlepages}[3][]{\formatpages[#1]{article}{#2}{#3}}%
% CHANGED 0.51h
\newcommand*{\jb@do@ssed@kerning}{%
  \ifjb@ssed@after@author\else
    \ifthenelse{\equal{\jb@@edition}{}}{}{%
      \ifthenelse{\jb@@edition>9}{%
          \ifthenelse{\jb@@edition>99}{%
            \ifjb@comma@before@rest\,\,\,\,\,\,\else\kern\jbedwidth\fi
          }{%
            \ifjb@comma@before@rest\,\,\,\,\else\kern\jbedwidth\fi
          }%
      }{%
        \ifjb@comma@before@rest\,\,\else\kern\jbedwidth\fi
      }%
    }%
  \fi
}%
\newcommand\herename{}
\newcommand*{\jbfirstcitepageranges}{\jb@allow@adding@of@pagerange@for@first@citetrue}
% CH 0.52m rewritten, output of pageranges for explicit fullcites too, output of 
%          herename requires not-empty pages=field now.
\newcommand*{\jb@add@something@before@page}{%
   \ifthenelse{%
        \boolean{jb@allow@adding@of@pagerange@for@first@cite}%
        \and
        \not\equal{\jb@@pages}{}%
        \and
        \(
            \boolean{jb@first@cite}%
            \or
            \boolean{jb@fullcite@again}%
        \)
   }{%
        \herename%
   }{}%
}%
\newcommand*{\jb@before@page@sep}{%
    \unskip\jb@kern@sep\space%
    \ifjb@ssed@recent@kerned
       \jb@do@ssed@kerning%
    \fi
% NEW 0.52f    
    \jb@add@something@before@page%    
}%
\newcommand*{\jb@formatted@start@page}{%
   \ifthenelse{%
     \not\equal{\jb@@start@page}{}%
     \and
     \boolean{jb@allow@adding@of@pagerange}%
     \and
     \(%
% NEW 0.5f, \formatpages for all types possible
        \boolean{jb@start@page}%
        \and
        \equal{\jb@start@page@for@types@arg}{1}%
     \)%
% NEW 0.52i, no startpage for ibidem 
     \and\not\boolean{jb@switchidemofflocally}%     
   }{%
% NEW 0.51o for configurable separation before startpage   
     \ifthenelse{\equal{\jb@beforestartpagesep}{}}{}{%
        \renewcommand*{\jbbeforestartpagesep}{\jb@beforestartpagesep}}%
     \renewcommand*{\jbafterstartpagesep}{\jb@afterstartpagesep}%
     \renewcommand*{\jbpagesformat}[1]{%
            \jb@normalpageldelim##1\jb@normalpagerdelim}%
     \jb@allow@adding@of@pagerangefalse % avoid additional pagerange
% NEW 0.51o for configurable separation before startpage
     \jbbeforestartpagesep%
     \ifjb@formatted@pages
         \jbprformat{\jb@@start@page}%
     \else
         \jb@@start@page%
     \fi
     \ifthenelse{\equal{\jb@@newpagecite}{}}{}{%
        \let\jb@before@page@sep\@empty % remove commabeforerest
        \jbafterstartpagesep%
     }%
   }{}%
}
\newcommand*{\jb@@formatted@pages}{%
  \ifthenelse{\equal{\jb@@pages}{}}{%
      \ifthenelse{\equal{\jb@@newpagecite}{}}{}{%
         \jb@before@page@sep%
         \jbpagesformat{\jb@@newpagecite}%
      }%
  }{%
      \jb@formatted@start@page%
      \ifjb@always@pageranges
% NEW 0.52l changed feature: `pages=always' gives the full pagerange from bib file only for long 
        \ifjb@first@cite
            \ifjb@allow@adding@of@pagerange
              \ifjb@formatted@pages
                 \jb@before@page@sep%
                 \jbprformat{\jb@@pages}%
              \else
                 \jb@before@page@sep%
                 \jb@@pages%
              \fi
            \fi
        \fi
        \ifthenelse{\equal{\jb@@newpagecite}{}}{}{%
           \jb@before@page@sep%
           \jbpagesformat{\jb@@newpagecite}%
        }%
      \else
         \ifjb@tested@pageranges
            \ifthenelse{\equal{\jb@@newpagecite}{}}{%
                \ifjb@allow@adding@of@pagerange
                  \ifthenelse{\not\equal{\diffpageibidemname}{\samepageibidemname}%
                              \TE@or
                              \not\equal{\diffpageibidemmidname}{\samepageibidemmidname}%
                  }{%
                     \jb@package@warning{\jb@pkg@name}{%
                     You have redefined one ore more ibidem macros\MessageBreak
                     while using `pages=test'. Please note it is\MessageBreak
                     possible that you did not get the desired\MessageBreak
                     results}%
                  }{}%
                  \ifjb@formatted@pages
                     \jb@before@page@sep%
                     \jbprformat{\jb@@pages}%
                  \else
                     \jb@before@page@sep%
                     \jb@@pages%
                  \fi
                \fi
            }{%
               \jb@before@page@sep%
               \jbpagesformat{\jb@@newpagecite}%
            }%
         \else
             \ifthenelse{\equal{\jb@@newpagecite}{}}{}{%
                \jb@before@page@sep%
                \jbpagesformat{\jb@@newpagecite}%
             }%
         \fi
      \fi
  }%
}%
\newcommand*{\jb@checked@kerning}{%
% CHANGED 0.51h kerning routine removed
% \ifjb@ibidem@with@name
    \jb@@formatted@pages\unskip%
% \else
%   \ifthenelse{%
%       \boolean{jb@ssed@kerning@wanted}% kerning ON?
%       \and
%       \(\(%
%             \boolean{jb@ssed@sw}%
%             \and%
%             \equal{\jb@@edition@switch}{1}%
%         \)%
%         \or%
%             \boolean{jb@ssed@all}%
%         \or%
%         \(%
%             \boolean{jb@ssed@commented}%
%             \and%
%             \equal{\jb@@type}{commented}%
%       \)\)%
%    }{%
%         \ifthenelse{\equal{\jb@@edition}{}}{%
%             \jb@kern@sep\space%
%         }{%
%             \ifthenelse{\jb@@edition>9}{%
%                 \ifthenelse{\jb@@edition>99}{%
%                    \jb@kern@before@sepiii%
%                    \jb@kern@sep%
%                    \jb@kern@after@sepiii %
%                 }{%
%                    \jb@kern@before@sepii%
%                    \jb@kern@sep%
%                    \jb@kern@after@sepii %
%                 }%
%             }{%
%                 \jb@kern@before@sepi%
%                 \jb@kern@sep%
%                 \jb@kern@after@sepi %
%             }%
%         }%
%         \ifthenelse{\equal{\jb@@newcoauthorcite}{\@empty}}{%
%             \ifjb@comma@before@rest\else\space\fi\jb@@formatted@pages%
%         }{%
%             \ifthenelse{\equal{\jbhowsepcoauthorfirst}{~in }}{%
%                \jb@@formatted@pages}{ \jb@@formatted@pages}%
%         }%
%  }{%
%      \jb@@formatted@pages\unskip%
%  }%
% \fi
}%
\newcommand*{\jb@makecheckedpages}{%
 \ifthenelse{\equal{\jb@@newpagecite}{\@empty}}{%
%   \ifjb@footnote@period@ibidem
    \ifjb@suppress@dot@for@howcited\else
     \ifjbcross\else
      \ifjb@allow@dot@for@lookat
% CHANGED 0.51h kerning routine removed      
%       \ifjb@ssed@kerning@wanted
%        \renewcommand*{\jb@kern@sep}{}%
%        \renewcommand*{\jb@kern@after@sepi}{}%
%        \renewcommand*{\jb@kern@after@sepii}{}%
%        \renewcommand*{\jb@kern@after@sepiii}{}%
%        \jb@checked@kerning%
%%        \ifjb@comma@before@rest.\else\unskip.\fi
%       \else
% NEW 0.5e \unskip and much more added
          \ifthenelse{\boolean{jb@comma@before@rest}}{%
             \ifthenelse{%
                   \(
                     \not\equal{\jb@@pages}{}%
                     \and
                     \(
                         \boolean{jb@always@pageranges}%
                         \or
                         \boolean{jb@tested@pageranges}%
                     \)
                   \)
                   \or
% NEW 0.5e added for comma also before starting page, bug reported by Rebekka Rieger (uzsr2x@uni-bonn.de)
                   \(
                       \not\equal{\jb@@start@page}{}%
                       \and
                       \boolean{jb@allow@adding@of@pagerange}%
                       \and
                       \boolean{jb@start@page}%
                       \and
                       \equal{\jb@@type}{article}%
                   \)
             }{%
               \renewcommand*{\jb@kern@sep}{,}%
             }{%
               \renewcommand*{\jb@kern@sep}{}%
             }%
             \jb@checked@kerning%
% NEW 0.5f no dot for the first cite if multiple keys are given
% NEW 0.5fb8 removed
%             \ifjb@footnote@period\unskip%
%                \@ifundefined{jb@morethanonecite}{}{.}%
%             \fi
%            \ifjb@footnote@period\unskip.\fi
          }{%
             \renewcommand*{\jb@kern@sep}{}%
             \jb@checked@kerning%
% NEW 0.5f no dot for the first cite if multiple keys are given
% NEW 0.5fb8 removed
%             \ifjb@footnote@period\unskip%
%                \@ifundefined{jb@morethanonecite}{}{.}%
%             \fi
%            \ifjb@footnote@period\unskip.\fi
          }%
% CHANGED 0.51h kerning routine removed
%       \fi
      \fi
     \fi
    \fi
%   \fi
 }{%
  \ifjb@period
      \ifjb@comma@before@rest
        \renewcommand*{\jb@kern@sep}{,}%
        \jb@checked@kerning%
      \else
        \renewcommand*{\jb@kern@sep}{}%
        \jb@checked@kerning%
      \fi
  \else
      \ifjb@comma@before@rest
        \renewcommand*{\jb@kern@sep}{,}%
        \jb@checked@kerning%
% NEW 0.5fb8 removed
%        \ifjb@footnote@period\unskip.\fi
      \else
        \renewcommand*{\jb@kern@sep}{}%
        \jb@checked@kerning%
% NEW 0.5fb8 removed
%        \ifjb@footnote@period\unskip.\fi
      \fi
  \fi
 }%
}%
% NEW 0.5e
% code for new option values `citefull=chapter|section'
% contributed by Stefan Ulrich. Very special thanks.
\newcommand*{\jb@list}{}
% NEW 0.5e own list for opcit resetting.
\newcommand*{\jb@opcit@list}{}
\newcommand*{\jb@elt}{}
\let\jb@elt\relax
\newtoks\jb@temptoks
\newcommand*{\jb@@append}[2]{%
%   take care that list doesn't start with empty elem
    \ifthenelse{\equal{#2}{}}{%
        \protected@xdef#2{#1}%
    }{%
        \jb@temptoks=\expandafter{#2}%
        \protected@xdef#2{\the\jb@temptoks,#1}%
    }%
}%
\newcommand*{\jb@append}[2]{%
%    \jb@typeout{add elem |#1| to list |#2|?}%
    \jb@if@elem{#1}{#2}{%
%        \jb@typeout{ --- yes, not adding}%
    }{%
%        \jb@typeout{ --- no, added}%
        \jb@@append{#1}{#2}%
    }%
}%
\newcommand*{\jb@list@tempa}{}
\newcommand*{\jb@list@tempb}{}
\newcommand*{\jb@test@cmd}{}
\newcommand*{\jb@if@elem}[2]{%
%    \jb@typeout{testing if |#1| is elem of |#2|}%
    \protected@edef\jb@list@tempa{#1}%
    \let\jb@test@cmd\@secondoftwo
    \@for\jb@list@tempb:=#2\do{%
        \ifx\jb@list@tempa\jb@list@tempb
             \let\jb@test@cmd\@firstoftwo
        \fi
    }%
    \jb@test@cmd
}%
\newcommand*{\jb@undefineall}[2]{%
 \ifthenelse{\equal{#2}{opcit}}{%
    \ifthenelse{\equal{\jb@reset@opcit@for}{chapter}}{%
% CHANGED 0.5f removing of this check, because of problems
% when using characters for chapter numbering. e.g. using \appendix
%       \ifthenelse{\thechapter>1}{%
           \@ifundefined{resetopcit\thechapter}{%
                \global\@namedef{resetopcit\thechapter}{}%
                \jb@typeout{Package jurabib Info: Resetting `#2'
                     for Chapter \thechapter}%
                \@for\jb@list@tempa:=#1\do{%
                    \expandafter\gdef\csname\jb@list@tempa\endcsname{}%
                }%
           }{\relax}%
%       }{}%
    }{%
%       \ifthenelse{\thesection>1}{%
           \@ifundefined{resetcf\thesection}{%
                \global\@namedef{resetcf\thesection}{}%
                \jb@typeout{Package jurabib Info: Resetting `#2'
                     for Section \thesection}%
                \@for\jb@list@tempa:=#1\do{%
                    \expandafter\gdef\csname\jb@list@tempa\endcsname{}%
                }%
           }{\relax}%
%       }{}%
    }%
 }{%
    \ifthenelse{\equal{\jb@resetfor}{chapter}}{%
%       \ifthenelse{\thechapter>1}{%
           \@ifundefined{resetcitefull\thechapter}{%
                \global\@namedef{resetcitefull\thechapter}{}%
                \jb@typeout{Package jurabib Info: Resetting `#2'
                     for Chapter \thechapter}%
                \@for\jb@list@tempa:=#1\do{%
                    \expandafter\gdef\csname\jb@list@tempa\endcsname{}%
                }%
           }{\relax}%
%       }{}%
    }{%
%       \ifthenelse{\thesection>1}{%
           \@ifundefined{resetcitefull\thesection}{%
                \global\@namedef{resetcitefull\thesection}{}%
                \jb@typeout{Package jurabib Info: Resetting `#2'
                     for Section \thesection}%
                \@for\jb@list@tempa:=#1\do{%
                    \expandafter\gdef\csname\jb@list@tempa\endcsname{}%
                }%
           }{\relax}%
%       }{}%
    }%
 }%
% REMOVED 0.5f caused problems with citations, which are first citations and containing crossref's
%  \@for\jb@list@tempa:=#1\do{%
%    \expandafter\gdef\csname\jb@list@tempa\endcsname{}%
% }%
}%
\newcommand*{\jb@showelems}[1]{%
%    \jb@typeout{show elems of list #1:}%
 \@for\jb@list@tempa:=#1\do{%
   \jb@typeout{\jb@list@tempa:
     \expandafter\meaning\csname\jb@list@tempa\endcsname}%
 }%
}%
\newcommand*{\jb@firstcitefull}{%
% NEW 0.5e reset citefull=first for each chapter/section
 \@ifundefined{jb@resetfor}{}{%
   \ifthenelse{%
     \(
        \equal{\jb@resetfor}{chapter}%
        \or
        \equal{\jb@resetfor}{section}%
     \)
     \and\value{citefull}=0%
%     \and\not\value{\jb@resetfor}=1%
   }{%
% THE RESET
     \jb@undefineall{\jb@list}{citefull=first}%
   }{}%
 }%
%  \ifjbweareinbib\else
%   \ifjb@firstcite@full
%    \ifjb@all@full\else
%     \ifjb@no@lookat@for@bib\else
  \ifthenelse{%
              \not\boolean{jbweareinbib}%
              \and%
              \boolean{jb@firstcite@full}%
              \and%
              \equal{\jb@@cite@fullfirst@switch}{1}%
              \and\not\boolean{jb@all@full}%
              \and\not\boolean{jb@no@lookat@for@bib}%
  }{%
     \ifthenelse{\equal{\@nameuse{citefull@\jb@@newauthorcite}}{citefull}}{%
       \let\jb@extraspace\@empty %!!!
       \@ifundefined{jb@morethanonecite}{%
         \jb@makecheckednameibidem%
       }{\relax}%
       \ifjb@ibidem@with@name@and@title\else
         \@ifundefined{ibidem}{\let\jb@extraspace\space}{}%
       \fi
     }{% the first cite
       \jb@first@citetrue
% CHANGED 0.52d check for type
       \ifthenelse{\not\equal{\jb@start@page@for@types@arg}{1}}{%
         \jb@allow@adding@of@pagerangefalse
       }{}%
       \global\@namedef{citefull@\jb@@newauthorcite}{citefull}%
% NEW 0.5f simply define all detectors of already cited crossrefs.
% If a collection is cited first and if this collection is crossref'ed later by an essay entry,
% it should appear a short form of the citation, not the full citation!
       \global\@namedef{NORMCR@\jb@@newauthorcite}{}%
       \global\@namedef{ARTCR@\jb@@newauthorcite}{}%
       \global\@namedef{INCCR@\jb@@newauthorcite}{}%
% NEW 0.5e for citefull=chapter|section
       \jb@append{citefull@\jb@@newauthorcite}{\jb@list}%
       \jbonlyforfirstcitefullbegin%
       \let\jb@extraspace\@empty
       \ifjb@lookat
        \ifjb@allow@lookat@for@fullcite
         \begingroup
          \jb@restore@auxfile
% NEW 0.5e avoid multiple labels for citefull=chapter
          \label{look@\@citeb:\jb@reset@look@label@for}%
% NEW 0.5f correct links for hyperref
          \hyper@jbanchorstart{look@\@citeb:\jb@reset@look@label@for}\hyper@jbanchorend%
         \endgroup
         \@namedef{look@\jb@@newauthorcite}{firsttime}%
        \fi
       \fi
       \ifjb@debug
         \textcolor[named]{Blue}{%
          \ifjb@debug@br[\fi
            \jb@formatted@co@author@in\jb@use@fullcite%
          \ifjb@debug@br]\fi}%
       \else
         \jb@formatted@co@author@in\jb@use@fullcite%
       \fi
       \jbonlyforfirstcitefullend%
       \let\jb@makeagainfullcite\@empty
% To think about: allow opcit for resetted `citefull=first' citations?
       \let\OpCit\@empty % ??????
       \jb@relaxcommandsforfullcite
     }%
%     \fi
%    \fi
%   \fi
%  \fi
  }{%
     \jb@allow@lookat@for@fullcitefalse
  }%
}%
\newcommand*{\jb@ssed@format}{%
  \ifthenelse{\equal{\jb@@edition}{}}{}{%
   \textsuperscript{\jb@ssed@size\jb@@edition}}}%
\newcommand*{\jb@ssed@notitle@format}{%
  \ifthenelse{\equal{\jb@@edition}{}}{}{%
   \textsuperscript{\jb@ssed@size\jb@@edition}%
% CHANGED 0.51h kerning routine removed
%   \ifjb@ssed@kerning@wanted
%    \ifthenelse{\equal{\jb@@newcoauthorcite}{}}{}{%
%      \ifthenelse{\equal{\jbhowsepcoauthorlast}{--}}{}{%
%      \ifthenelse{\equal{\jbhowsepcoauthorfirst}{~in }}{}{%
%         \hspace{-.2em}%
%         }%
%      }%
%      \ifjb@coauthor@last
%          \setlength{\jb@length@i}{0pt}%
%          \setlength{\jb@length@ii}{0pt}%
%          \setlength{\jb@length@iii}{0pt}%
%      \fi
%   }%
%   \fi
  }%
}%
\newcommand{\jb@@samework@edition@differs}{}%
\newlength{\jbedwidth}
\newcommand*{\jb@make@superscript@edition}{%
 \ifthenelse{\equal{\jb@@edition}{\@empty}}{}{%
 \ifjb@ssed@all
  \renewcommand*{\jb@checked@edition}{%
    \ifthenelse{\equal{\jb@@mult@switch}{1}\TE@or\equal{\jb@@title@switch}{1}}{%
        \ifthenelse{%
%            \equal{\jb@@type}{commented}%
%            \and
            \equal{\jb@@samework@edition@differs}{1}%
        }{%
            \let\jb@checked@title\@empty
            \jb@ssed@format%
            \settowidth{\jbedwidth}{\jb@ssed@format}%
            \ifjb@ssed@kerning@wanted\ifjb@ssed@after@author\else
                \kern-\jbedwidth\jb@ssed@recent@kernedtrue\fi
            \fi
        }{%
            \renewcommand*{\jb@aftertitleedition}{\jb@ssed@format}%
        }%
    }{%
        \jb@ssed@notitle@format%
    }%
 }%
 \else
   \ifjb@ssed@commented
    \renewcommand*{\jb@checked@edition}{%
      \ifthenelse{\equal{\jb@@type}{commented}}{%
          \ifthenelse{\equal{\jb@@mult@switch}{1}\TE@or\equal{\jb@@title@switch}{1}}{%
              \ifthenelse{%
                  \equal{\jb@@samework@edition@differs}{1}%
              }{%
                  \let\jb@checked@title\@empty
                  \jb@ssed@format%
                  \settowidth{\jbedwidth}{\jb@ssed@format}%
                  \ifjb@ssed@kerning@wanted\ifjb@ssed@after@author\else
                    \kern-\jbedwidth\jb@ssed@recent@kernedtrue\fi
                  \fi
              }{%
                  \renewcommand*{\jb@aftertitleedition}{\jb@ssed@format}%
              }%
          }{%
              \jb@ssed@notitle@format%
          }%
      }{}%
    }%
   \else
     \ifjb@ssed@sw
       \ifthenelse{\equal{\jb@@edition@switch}{1}}{%
            \renewcommand*{\jb@checked@edition}{%
               \ifthenelse{\equal{\jb@@mult@switch}{1}\TE@or\equal{\jb@@title@switch}{1}}{%
                    \ifthenelse{%
% UNSURE: for the switch value, should multiple value given too to build a short form?
%                        \boolean{jb@ssed@mult@works}%
%                        \and
%                        \equal{\jb@@type}{commented}%
%                        \and
                        \equal{\jb@@samework@edition@differs}{1}%
                    }{%
                        \let\jb@checked@title\@empty
                        \jb@ssed@format%
                        \settowidth{\jbedwidth}{\jb@ssed@format}%
                        \ifjb@ssed@kerning@wanted\ifjb@ssed@after@author\else
                            \kern-\jbedwidth\jb@ssed@recent@kernedtrue\fi
                        \fi
                    }{%
                        \renewcommand*{\jb@aftertitleedition}{\jb@ssed@format}%
                    }%
               }{%
                    \jb@ssed@notitle@format%
               }%
            }%
       }{}%
     \else
       \ifjb@ssed@mult@works
           \renewcommand\jb@checked@edition{%
               \ifthenelse{%
                   \boolean{jb@ssed@mult@works}%
                   \and
%                   \equal{\jb@@type}{commented}%
%                   \and
                   \equal{\jb@@samework@edition@differs}{1}%
               }{%
                   \let\jb@checked@title\@empty
                   \jb@ssed@format%
                   \settowidth{\jbedwidth}{\jb@ssed@format}%
                   \ifjb@ssed@kerning@wanted\ifjb@ssed@after@author\else
                       \kern-\jbedwidth\jb@ssed@recent@kernedtrue\fi
                   \fi
               }{}%
           }%
       \fi
     \fi
   \fi
 \fi
 }%
}%
% NEW 0.51l macros for detecting commentaries with same author 
% and same title, but different editions, contributed by Stefan Ulrich
\newtoks\jb@ta\newtoks\jb@tb
\newcommand\jbauthorinfo{%
  \begingroup\@sanitize % needed to deactivate \" etc.
  \jb@deactivate@babel
  \catcode`\ =10        % but treat spaces as usual (gobble between arguments)
  \jb@define@verbatim@
}
\newcommand\jb@define@verbatim@[2]{%
  \def\jb@curr@key{#2}\def\jb@list{}\jb@do@authorinfo#1\jb@end\endgroup}
\newcommand\jb@curr@cite{}
\newcommand\jb@last@cite{}
\newcommand\jb@citeasedn[1]{\global\@namedef{jb@#1}{}}
\newcommand\jb@check@edn[1]{%
  \@ifundefined{jb@#1}{%
%        \typeout{work differs}%
        \def\jb@@samework@edition@differs{0}%
  }{%
%        \typeout{only EDN differs}%
        \def\jb@@samework@edition@differs{1}%
  }%
}
\def\jb@do@authorinfo#1#2\jb@end{%
  \ifthenelse{\equal{#2}{}}{%
%    \typeout{at end of list: |#1|}%
    \jb@ta=\expandafter{\jb@list}%
    \jb@tb=\expandafter{#1}%
    \@ifundefined{\the\jb@ta\the\jb@tb}{%
%        \typeout{this is new:^^J|\the\jb@ta\the\jb@tb|}%
    }{%
%        \typeout{this is not new:^^J|\the\jb@ta\the\jb@tb|}%
%        \typeout{saving1: |\expandafter\meaning\csname\the\jb@ta\the\jb@tb\endcsname|}%
%        \typeout{saving2: |\meaning\jb@curr@key|}%
        \protected@write\@auxout{}{%
            % save previous label, and current label:
            \string\csname\space jb@citeasedn\string\endcsname{\@nameuse{\the\jb@ta\the\jb@tb}}^^J%
            \string\csname\space jb@citeasedn\string\endcsname{\jb@curr@key}%
        }%
    }%
%    \typeout{===remembering: \jb@curr@key}%
    \expandafter\global\expandafter\@namedef\expandafter{\the\jb@ta\the\jb@tb\expandafter}\expandafter{\jb@curr@key}%
  }{%
%    \typeout{list item: |#1|}%
    \jb@ta=\expandafter{\jb@list}%
    \jb@tb=\expandafter{#1}%
    \protected@edef\jb@list{\the\jb@ta\the\jb@tb}%
%    \typeout{list: \meaning\jb@list}%
    \jb@do@authorinfo#2\jb@end
  }%
}
%  \def\jb@do@authorinfo#1#2\jb@end{%
%    \jb@ta=\expandafter{\jb@list}%
%    \jb@tb=\expandafter{#1}%
%   % \protected@edef\@tempa{#1}%
%   % \protected@edef\@tempa{\expandafter\strip@prefix\meaning\@tempa}%
%   % \jb@tb=\expandafter{\@tempa}%
%    \ifthenelse{\equal{#2}{}}{%
%   %    \typeout{at end of list: |#1|}%
%      \@ifundefined{\the\jb@ta\the\jb@tb}{%
%   %        \typeout{this is new:^^J|\the\jb@ta\the\jb@tb|}%
%      }{%
%   %        \typeout{this is not new:^^J|\the\jb@ta\the\jb@tb|}%
%   %        \typeout{saving1: |\expandafter\meaning\csname\the\jb@ta\the\jb@tb\endcsname|}%
%   %        \typeout{saving2: |\meaning\jb@curr@key|}%
%          \protected@write\@auxout{}{%
%              % save previous label, and current label:
%              \string\csname\space jb@citeasedn\string\endcsname{\@nameuse{\the\jb@ta\the\jb@tb}}^^J%
%              \string\csname\space jb@citeasedn\string\endcsname{\jb@curr@key}%
%          }%
%      }%
%   %    \typeout{===remembering: \jb@curr@key}%
%      \expandafter\global\expandafter\@namedef\expandafter{\the\jb@ta\the\jb@tb\expandafter}\expandafter{\jb@curr@key}%
%    }{%
%   %    \typeout{list item: |#1|}%
%      \jb@ta=\expandafter{\jb@list}%
%      \jb@tb=\expandafter{#1}%
%      \protected@edef\jb@list{\the\jb@ta\the\jb@tb}%
%   %    \typeout{list: \meaning\jb@list}%
%      \jb@do@authorinfo#2\jb@end  }%
%  }
\newcommand\jb@@last@@author{}
\newcommand\jb@@new@@author{}
\newcommand\jb@@last@@title{}
\newcommand\jb@@new@@title{}
\newcommand\jb@@last@fullname@author{}
\newcommand\jb@@new@fullname@author{}
\newcommand{\jb@do@ibidem@name@title@test}{%
       \def\jb@@new@fullname@author{INTT@\jb@@fullname}% INTT= ibidem name & title test
       \ifthenelse{\equal{\jb@@last@fullname@author}{\jb@@new@fullname@author}%
% full names are the same, but it's not the same work
                   \and\not\equal{\jb@@newauthorcite}{\jb@@lastauthorcite}%
       }{%
           \jb@same@author@different@worktrue
       }{%
           \jb@same@author@different@workfalse
       }%
       \global\let\jb@@last@fullname@author\jb@@new@fullname@author
}%
\newcommand*{\jb@do@if@multiple@bibetal}{\def\jb@@title@switch{1}}
\newcommand*{\jb@make@opcit}{%
% NEW 0.5e op.cit. feature
% NEW 0.5f no opcit in bibliography
            \ifjbweareinbib\else
% NEW 0.5f no opcit inside crossref's, confusing the reader, because he is not able
% to see, what is meant by the opcit at the end of a citation with crossref
% (the main citation or the crossref?). And we are going around problems with lookat.
             \ifjbcross\else
              \ifjb@opcit
                \@ifundefined{jb@reset@opcit@for}{}{%
                   \ifthenelse{%
                      \not\equal{\jb@reset@opcit@for}{}%
                      \and\value{opcit}=0%
% causes error: `Extra \or'.
%                    \(
%                        \equal{\jb@reset@opcit@for}{chapter}%
%                        \or
%                       \equal{\jb@reset@opcit@for}{section}%
%                     \)
%                    \and\value{opcit}=0%
                   }{%
                      \jb@undefineall{\jb@opcit@list}{opcit}%
                   }{}%
                }%
% debugging
%               \jb@showelems{\jb@opcit@list}%
                \ifthenelse{\equal{\@nameuse{opcit@\jb@@newauthorcite}}{cited}}{%
                    \jb@@opcittrue
%% INSERT A WARNING ABOUT AMBIGUOUS CITATIONS!!!!!!!!!!!!
% NEW 0.5f no switching to `authorformat=year' for `opcit'
%                    \let\jb@@shorttitle\relax
%                    \let\jbhowsepbeforetitle\@empty
                }{%
                    \global\@namedef{opcit@\jb@@newauthorcite}{cited}%
% NEW 0.5f opcit hyperlinked to first citation
                    \hyper@jbanchorstart{opcit.\jb@@newauthorcite.\jb@reset@opcit@label@for}%
                    \hyper@jbanchorend%
                    \jb@append{opcit@\@citeb}{\jb@opcit@list}%
                    \jb@@opcitfalse
                }%
              \fi
             \fi
            \fi
}%
% NEW 0.52f command to allow pageranges for first cites and specific types
\newcommand*{\jb@make@pageranges@for@first@cite}{%
 \ifthenelse{\equal{\@nameuse{citefull@\@citeb}}{citefull}%
             \and\not\boolean{jb@allow@adding@of@pagerange@for@first@cite}%
 }{%
         \let\jbPAGES\@gobble
         \let\jbpages\@gobble
         \let\jbPages\@gobble
         \let\jbartPages\@gobble
 }{%
    \ifthenelse{\(\equal{\jb@@type}{article}\or\equal{\jb@@type}{periodical}%
%                 \or\equal{\jb@@type}{incollection}%
                \)%
                \and\boolean{jb@allow@adding@of@pagerange@for@first@cite}%
      }{% do nothing
      }{%
          \let\jbPAGES\@gobble
          \let\jbpages\@gobble
          \let\jbPages\@gobble
          \let\jbartPages\@gobble
      }%
 }%
}
\def\@citex[#1][#2]#3{%
% NEW 0.52l we have to count the citations inside a footnote for lowercase ibidem
  \stepcounter{jb@cites@in@footnote}% \thejb@cites@in@footnote
  \ifjb@ssed@mult@works\jb@check@edn{#3}\fi
% NEW 0.5f added for compatibility with endnotes.sty
  \ifjb@foot
    \renewcommand*{\@cite}[2]{\unskip\footnote{##1##2\ifthenelse{\boolean{jb@footnote@period}}{\unskip.}{}}}%
  \else
    \renewcommand*{\@cite}[2]{%
      \ifjb@fn\else\ifjbweareinbib\else\jb@open\fi\fi
        ##1##2%
      \ifjb@fn\else\ifjbweareinbib\else\jb@close\fi\fi
    }%
  \fi
  \ifjb@natbib@opt@arg@order
    \def\jb@@newcoauthorcite{#1}%
    \ifx\relax#2\relax
        \def\jb@@newpagecite{#2}%
    \else
        \ifjb@formatted@pages
            \def\jb@@newpagecite{\jbprformat{#2}}%
        \else
            \def\jb@@newpagecite{#2}%
        \fi
    \fi
  \else
    \ifx\relax#1\relax
        \def\jb@@newpagecite{#1}%
    \else
        \ifjb@formatted@pages
            \def\jb@@newpagecite{\jbprformat{#1}}%
        \else
            \def\jb@@newpagecite{#1}%
        \fi
    \fi
    \def\jb@@newcoauthorcite{#2}%
  \fi
  \ifjb@no@nested@crossrefs
% perhaps \bibcrossrefcite is redef'd, so let's save it
    \let\origcrossref\jbcrossrefchecked
% disable crossreferencing in full citations by default
    \renewcommand*{\jbcrossrefchecked}[2][]{}%
% save crossref editor separation
    \let\origbibces\bibces
    \renewcommand*{\bibces}{}%
  \fi
  \let\@citea\@empty%
  \@cite{%
    \@for\@citeb:=#3\do{%
       \@citea%
       \def\@citea{;\penalty\@m\ %
          \@ifundefined{jb@morethanonecite}{%
             \global\@namedef{jb@morethanonecite}{}}{}%
          \ifthenelse{\equal{\jb@@newpagecite}{\@empty}}{\relax}{%
            \jb@package@warning{\jb@pkg@name}{%
               I assume you know what you're doing %
               using `\jb@@newpagecite'\MessageBreak
               on a citation with more than one\MessageBreak
               author}{\relax}%
          }%
       }%
% NEW 0.5f now we are checking inside \@for
       \@ifundefined{b@\@citeb}{}{%
           \protected@edef\@tempa{\csname b@\@citeb\endcsname}%
           \protected@edef\jb@@new@@author{\expandafter\jb@fifthofseven\@tempa\@empty}%
       }%
       \ifthenelse{\equal{\jb@@last@@author}{\jb@@new@@author}\and\not\equal{\jb@@new@@author}{}}{%
           \jb@same@fullauthortrue
       }{%
           \jb@same@fullauthorfalse
       }%
       \global\let\jb@@last@@author\jb@@new@@author
% NEW 0.5f This has to be tested outside definition of \@citea!
       \@ifundefined{jb@morethanonecite}{\relax}{%
           \let\jb@@newcoauthorcite\@empty
% NEW 0.5f for repeated authors in multiple citations
           \let\idemname\idemmidname
       }%
       \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
       \if@filesw
         \immediate\write
            \@auxout{%
               \jb@makehowcited\string\citation{\@citeb}%
            }%
       \fi
% b@\@citeb\@extra@b@citeb instead of b@\@citeb %
% for chapterbib compatibility
       \@ifundefined{b@\@citeb\@extra@b@citeb}{%
          \mbox{\reset@font{\bfseries ?}, #1}%
          \G@refundefinedtrue
          \@latex@warning{%
            Citation `\@citeb' on page \thepage \space undefined
          }%
       }{%
          \begingroup
% CH 0.52f position of \jb@extract changed
            \jb@extract%
            \ifjb@always@pageranges\else\ifjb@tested@pageranges
               \ifthenelse{\equal{\jb@@newpagecite}{}}{}{\jb@make@pageranges@for@first@cite}%
               \else\jb@make@pageranges@for@first@cite\fi\fi
% NEw 0.5e \@citeb instead of #3 (we are inside \@for!)
            \def\jb@@newauthorcite{\@citeb}%
% NEW 0.5f new position of \jb@make@opcit to jump to the beginning of the opcit source citation
            \jb@make@opcit%
            \jb@index@as@alias{\@citeb}%
            \jb@changefontsforfullcite
            \ifjb@allow@hyper@cite\hyper@jblinkstart{\@citeb}\fi
            \jb@extract% 
            \jb@do@ibidem@name@title@test%
% NEW 0.5e For crossref's: avoid lonely \jbhowsepbeforetitle at the beginning
% of an bib entry, if no author (and no key!) is given
            \ifthenelse{%
                \equal{\jb@@fullname}{\@empty}%
                \and
                \equal{\jb@@author}{\@empty}%
            }{%
                \let\jbhowsepbeforetitle\@empty
            }{}%
% do some things ONLY in citations, use \addto
            \jbonlyforcitations%
%   check if we should print out the title for a special publication type <=== To TEST !!!!!!!!!!!
            \jb@cite@title@for@type@hook%
% NEW 0.52n check for types and citefull=first            
            \jb@cite@full@first@fortype@hook%
% NEW 0.52n check for work which should have always title            
            \jb@cite@title@for@work@hook%
% NEW 0.5f check for which type we should print out the starting page
            \jb@start@page@for@type@hook%
% NEW 0.5e check for which type we should give a starting page
%           \jb@format@startpages@for@types@hook%
            \jb@make@superscript@edition%
%   check if different works with <name>~\Bibetal exists
% NEw 0.5e \@citeb instead of #3 (we are inside \@for!)
            \@ifundefined{jb@fm@\@citeb}{}{%
              \ifthenelse{\equal{\jb@@mult@switch}{0}}{%
                \@ifundefined{jb@fmmess@\@citeb}{% only one message per entry
                \global\@namedef{jb@fmmess@\@citeb}{}%
                \jb@package@warning{\jb@pkg@name}{%
                  Multiple use of `et. al.' for the author(s)\MessageBreak
                  of `#3' \MessageBreak
                  detected, printing the title to\MessageBreak
                  avoid ambiguity}}{}}{\relax}%
                \jb@do@if@multiple@bibetal% the things to do if true
            }%
% NEW 0.5f position changed
%            \jb@checked@etal%
            \ifjb@babel
                \ifthenelse{%
                    \equal{\jb@@language}{\bbl@main@language}%
                }{%
% language is equal with the main language, nothing to do
                }{%
                    \ifthenelse{%
                        \equal{\jb@@language}{\@empty}%
                    }{%
% if no language is given, use the main language
                        \expandafter\jbselectlanguage%
                        \expandafter{\bbl@main@language}%
                    }{%
% if a language is given, use it
                        \language=\csname l@\jb@@language\endcsname\relax%
                    }%
                }%
                \jb@check@language@start%
            \fi
            \jb@checktitlefields
            \@ifundefined{jb@morethanonecite}{\jb@makeibidem}{\relax}%
% NEW 0.5f idem is allowed for citations with multiple keys (ibidem NOT, makes no sense)
            \jb@makeidem
            \jb@firstcitefull
% NEW 0.5f position changed to detect for first (full) citation in et al. macro
            \jb@checked@etal
            \jb@makeagainfullcite%
            \jb@relaxforemptyauthor
            \jb@warningfootciteusage
            \jb@maketitlewishestrue
            \jb@cite@no@title@for@type@hook%
% NEW 0.5f special opcit command, makes it configurable
% NEW 0.5f position changed for better hyperlinks to the opcit source citation.
%            \jb@make@opcit%
            \ifjb@debug
            \textcolor[named]{Dandelion}{%
              \ifjb@debug@br[\fi\jb@makecheckedcite\ifjb@debug@br]\fi}%
            \else
              \jb@makecheckedcite%
            \fi
% NEW 0.5e op.cit. feature
% NEW 0.5f rewritten
            \OpCit%
            \ifjb@lookat
             \ifjb@firstcite@full
              \ifjb@allow@lookat@for@fullcite
               \ifjb@all@full\else
                \ifjb@fn\else
                 \ifjb@endnotes\else
                   \ClassError{\jb@pkg@name}{%
                      Do not use package option `lookat' %
                      without\MessageBreak using footnotes %
                     (at least for the initial\MessageBreak
                     citations)%
                   }{%
                     I don't know what to use for referencing %
                     when you aren't using\MessageBreak
                     footnotes at least for the initial %
                     citations. If you can't \MessageBreak
                     believe it, type `r' and check your %
                     citations. You will see\MessageBreak
                     the labels of the chapter or sections.%
                   }%
                 \fi
                \fi
                \ifthenelse{%
                    \equal{\@nameuse{look@\@citeb}}{firsttime}%
                }{%
                    \relax
                }{%
% "Don't place the \ref and \vref within the scope of
% \hyper@natlinkstart ... \hyper@natlinkend--that can
% cause nested hyperlinks."            - Eitan Gurari
% So we are closing the hyperlink and the group here ...
                  \unskip\space\lookatprefix%
                    \ifjb@allow@hyper@cite\hyper@jblinkend\fi
                  \endgroup
%                  \unskip\space%
%                  \ifjb@allow@hyper@cite\hyper@jblinkstart{look@\@citeb:\jb@reset@look@label@for}\fi
%                  \lookatprefix%
%                  \ifjb@allow@hyper@cite\hyper@jblinkend\fi
                  \ifjb@vario
                     \vref{look@\@citeb:\jb@reset@look@label@for}%
                  \else
                     \ref{look@\@citeb:\jb@reset@look@label@for}%
                  \fi
%                  \ifjb@allow@hyper@cite\hyper@jblinkstart{look@\@citeb:\jb@reset@look@label@for}\fi
%                  \lookatsuffix%
%                  \ifjb@allow@hyper@cite\hyper@jblinkend\fi
                  \begingroup
                    \ifjb@allow@hyper@cite\hyper@jblinkstart{\@citeb}\fi
                        \lookatsuffix%
%                        \protected@edef\jb@tempa{\csname b@\@citeb\@extra@b@citeb\endcsname}%
%                        \protected@edef\jb@tempb{\expandafter\jb@thirdofseven\jb@tempa\@empty}%
%                        \protected@edef\jb@tempc{\expandafter\jb@fourthofseven\jb@tempa\@empty}%
% NEW 0.5f new command because of increasing use
                        \jb@extract
                }%
               \fi % allfull end
              \fi % allow@lookat@for@fullcite end
             \fi % jb@firstcite@full end
            \fi % jb@lookat end
            \ifjb@natbib@opt@arg@order
              \jb@checkperiod{#2}%
           \else
              \jb@checkperiod{#1}%
           \fi
           \jb@extract@starting@page{\jb@@pages}%
% NEW 0.52b no extra `p' after startpage
           \ifjb@formatted@pages
             \ifthenelse{%
                \boolean{jbnoformatafterstartpage}%
                \and\not\equal{\jb@@start@page}{}%
% Added 0.52c looking for correct type
                \and\equal{\jb@start@page@for@types@arg}{1}%
             }{%
                \ifjb@natbib@opt@arg@order
                    \def\jb@@newpagecite{#2}%
                \else
                    \def\jb@@newpagecite{#1}%
                \fi
             }{}%
           \fi
           \jb@makecheckedpages
           \jb@check@language@end%
           \ifjb@allow@hyper@cite\hyper@jblinkend\fi
          \endgroup
% NEW 0.5e analoguous to the defintions at the beginning of
% \@citex, otherwise subsequent page(ranges) won't be detected!
          \ifjb@natbib@opt@arg@order
            \gdef\jb@@lastcoauthorcite{#1}%
            \ifx\relax#2\relax
                \gdef\jb@@lastpagecite{#2}%
            \else
                \ifjb@formatted@pages
                    \gdef\jb@@lastpagecite{\jbprformat{#2}}%
                \else
                    \gdef\jb@@lastpagecite{#2}%
                \fi
            \fi
          \else
            \ifx\relax#1\relax
                \gdef\jb@@lastpagecite{#1}%
            \else
                \ifjb@formatted@pages
                    \gdef\jb@@lastpagecite{\jbprformat{#1}}%
                \else
                    \gdef\jb@@lastpagecite{#1}%
                \fi
            \fi
            \gdef\jb@@lastcoauthorcite{#2}%
          \fi
% NEW 0.5e: save last author only outside the bibliography, otherwise we run into
% problems if using bibliography at the beginning of the document _and_ using
% options `ibidem' and `howcited'
          \ifjbweareinbib\else\gdef\jb@@lastauthorcite{#3}\fi
          \global\let\jb@morethanonecite\@undefined
% relax the flag for ibidem'ing
          \let\ibidem\@undefined
          \ifjb@no@nested@crossrefs
% restore \bibcrosrefcite
            \global\let\jbcrossrefchecked\origcrossref
          \fi
% allow parentheses/brackets only for text citations
          \ifjb@fn
            \let\jb@close\@empty
            \let\jb@open\@empty
          \fi
% needed for resetting citefull=first each chapter or section
          \stepcounter{citefull}%
          \stepcounter{opcit}%
% NEW 0.5e page(ranges) not only for full cites, but, please, no doubles
          \jb@allow@adding@of@pagerangetrue
       }%
     }%
% to make sure that the fullcite mechanism is disabled -- otherwise,
% if \nextciteshort{} is used, the `true' is
% transferred to the next cite -- mysterious.
% NEW 0.5e Position changed
     \global\jb@fullcite@againfalse
% NEW 0.5f switch back for next cite
     \jb@noauthorforcitetitlefalse
  }{}%
%  \global\jb@fnfalse% \global removed, caused errors,
%   when `lookat' is used and works are only cited as crossref's
%   and at first as a non-footnote citation in bibliography
% NEW 0.5e Position changed and test added, if we have a multiple citation like \cite{<key1,<key2>}
  \ifjb@fn\else\jb@fnfalse\fi
% NEW 0.51h first trial for reworked kerning routine
  \jb@ssed@recent@kernedfalse
}%
\AtBeginDocument{%
   \let\citetitle\jbcitetitle
   \let\fullcite\jbfullcite
   \let\footfullcite\jbfootfullcite
   \let\footcite\jbfootcite
   \let\footcitetitle\jbfootcitetitle
}%
\InputIfFileExists{jurabib.cfg}{%
   \jb@typeout{Package jurabib Info: *** Local config file `jurabib.cfg' used ***^^J}}{%
   \jb@typeout{Package jurabib Info: *** No local config file found ***^^J}%
}%
% As long as hyperref.sty and/or url.sty are not modified approppriately, but no hyperlinks :-(
%\renewcommand\url{\begingroup\Url}%
%
%</package>
%<*jurabst|jurecobst|jurunsrt>
ENTRY{
  address
  author
  booktitle
  chapter
  edition
  editor
  howpublished
  institution
  isbn
  issn
  journal
  key
  language
  month
  note
  number
  organization
  pages
  publisher
  school
  series
  title
  type
  volume
  year
%%
  url
  urldate
  volumetitle
  dissyear
  howcited
  juratitle
  juraauthor
  shorttitle           
  shortauthor          
  ssedition            
  titleaddon           
  booktitleaddon       
  editortype           
  sortkey              
  annote               
  gender
  translator
  flanguage
  oyear
  oaddress
  opublisher
  updated
  totalpages
  founder
  }
  { repeat-authors repeat-titles }
  { label dummy.label extra.label sort.label current-authors 
%    current-titles % removed again because of limited string size
  }

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

INTEGERS { colon.after  period.dash }

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

STRINGS { s t u v w x }

FUNCTION {output.nonnull}
{ 's :=
  output.state after.block =
    { write$ }
    { output.state before.all =
      {  write$ }
      {  output.state colon.after =
         { "" * write$ }
         { output.state period.dash =
           { ", " *  write$ }
           { output.state mid.sentence =
             { " " * write$ }
             { write$ }
           if$
           }
        if$
         }
      if$
       }
     if$
     after.block '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 {not}
{   { #0 }
  { #1 }
  if$
}

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

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

FUNCTION {is.num}
{ chr.to.int$
  duplicate$ "0" chr.to.int$ < not
  swap$ "9" chr.to.int$ > not and
}

FUNCTION {extract.num}
{ duplicate$ 't :=
  "" 's :=
  { t empty$ not }
  { t #1 #1 substring$
  t #2 global.max$ substring$ 't :=
  duplicate$ is.num
    { s swap$ * 's := }
    { pop$ "" 't := }
  if$
  }
  while$
  s empty$
  'skip$
  { pop$ s }
  if$
}

FUNCTION {convert.edition.superscript}
{ edition extract.num "l" change.case$ 's :=
  s "first" = s "1" = or s "erste" = or
    { "1" 't := }
    { s "second" = s "2" = or s "zweite" = or
        { "2" 't := }
        { s "third" = s "3" = or s "dritte" = or
            { "3" 't := }
            { s "fourth" = s "4" = or s "vierte" = or
                { "4" 't := }
                { s "fifth" = s "5" = or s "fuenfte" = or
                    { "5" 't := }
                    { s "sixth" = s "6" = or s "sechste" = or
                        { "6" 't := }
                        { s "seventh" = s "7" = or s "siebte" = or s "siebente" = or
                            { "7" 't := }
                            { s "eighth" = s "8" = or s "achte" = or
                                { "8" 't := }
                                { s "nineth" = s "9" = or s "neunte" = or
                                      { "9" 't := }
                                      {  s #1 #1 substring$ is.num
                                           { s "" * 't := }
                                           { edition 't := }
                                         if$
                                      }
                                  if$
                                }
                              if$
                            }
                          if$
                        }
                      if$
                    }
                  if$
                }
              if$
            }
          if$
        }
      if$
    }
  if$
  t
}

FUNCTION {n.dashify}
{ 't :=
  ""
  { t empty$ not }
      { t #1 #1 substring$ "-" =
          { t #1 #2 substring$ "--" = not
               { "--" * t #2 global.max$ substring$ 't := }
               {   { t #1 #1 substring$ "-" = }
                   { "-" * t #2 global.max$ substring$ 't :=  }
                  while$
               }
            if$
          }
          { t #1 #1 substring$ * t #2 global.max$ substring$ 't := }
    if$
  }
  while$
}

FUNCTION {output.bibitem.fst}
{ newline$
  "\bibitem[{" write$
  shortauthor empty$
    { juraauthor empty$
       { author empty$
          { editor empty$
              { organization empty$
                   { "empty" write$ }
% 0.5e key removed from label generating mechanism, bug reported by Padraig de Brun
%                   { key empty$
%                       { "empty" write$ }
%                       { key write$ }
%                     if$
%                   }
                   { organization write$ }
                if$
              }
              { label write$ }
            if$
          }
          { label write$ }
         if$
       }
       { juraauthor write$ }
     if$
    }
    { shortauthor write$ }
  if$
  "}%" write$
  sortkey empty$
         'skip$
         { newline$ "% SORTKEY: [" sortkey * "]" * write$ }
  if$
  newline$
  shorttitle empty$
   { juratitle empty$
       { journal empty$
           { "         {}%" write$ }
%<*jurabst|jurunsrt>
           { year empty$
%</jurabst|jurunsrt>
%<*jurecobst>
           { "         {" journal * "}%" * write$ }
%</jurecobst>
%<*jurabst|jurunsrt>
                { "         {" journal * "}%" * write$ }
%                { "         {" journal * " " * year * "}%" * write$ }
% NEW 0.52p markup introduced
                { "         {" journal * " \jbsy {" * year * "}}%" * write$ }
             if$
           }
%</jurabst|jurunsrt>
         if$
       }
       { "         {" juratitle * "}%" * write$ }
     if$
    }
    { "         {" shorttitle * "}%" * write$ }
  if$
  newline$
  repeat-authors
    { "         {{1}" write$ }
    { "         {{0}" write$ }
  if$
  howcited empty$
    { "{}" write$ }
    { "{" howcited * "}" * write$ }
  if$
  type$ empty$
    { "{}" write$ }
    { "{" type$ * "}" * write$ }
  if$
%  year empty$
%    { "{}" write$ }
%    %{ "{" year * "}" * write$ }
%    { "{" year * "\el{" * extra.label * "}}" * write$ }
%  if$
  year empty$
    { "{}" write$ }
    { "{" year * write$
      extra.label "" =
          'skip$
          { "\el {" write$ extra.label write$ "}" write$ }
      if$
      "}" write$
    }
  if$
  edition empty$
    { "{}" write$ }
    { "{" convert.edition.superscript extract.num * "}" * write$ }
  if$
  ssedition empty$
    { "{}" write$ }
    { "{" ssedition * "}" * write$ }
  if$
  language empty$
    { "{}" write$ }
    { "{" language * "}" * write$ }
  if$
  pages empty$
    { "{}%" write$ }
    { "{" write$ pages n.dashify write$ "}%" write$ }
  if$
}

FUNCTION {output.bibitem.snd}
{ newline$
%<*jurecobst>
  publisher empty$
    { address empty$
           { "          {" write$ }
           { "          {" write$ address write$ }
      if$
    }
    { address empty$
           { "          {" write$ }
           { "          {" write$ address write$ "\bpubaddr {} " write$ publisher write$ }
      if$
    }
  if$
%</jurecobst>
%<*jurabst|jurunsrt>
  publisher empty$
    { address empty$
         { year empty$
               { "          {" write$ }
               { "          {" write$
                            year write$
                            extra.label "" =
                              'skip$
                              { "\el {" write$ extra.label write$ "}" write$ }
                            if$
               }
           if$
         }
         { year empty$
               { "          {" write$ address write$ }
               { "          {" write$ address write$ "\bibbdsep {} " write$
                            year write$
                            extra.label "" =
                              'skip$
                              { "\el {" write$ extra.label write$ "}" write$ }
                            if$
               }
           if$
         }
      if$
    }
    { address empty$
        { year empty$
              { "          {" write$ publisher write$ }
              { "          {" write$ publisher write$ "\bibbdsep {} " write$
                           year write$
                           extra.label "" =
                             'skip$
                             { "\el {" write$ extra.label write$ "}" write$ }
                           if$
              }
          if$
        }
        { year empty$
              { "          {" write$ address write$ "\bpubaddr {} " write$ publisher write$ }
              { "          {" write$ address write$ "\bpubaddr {} " write$ publisher write$ "\bibbdsep {} " write$
                           year write$
                           extra.label "" =
                             'skip$
                             { "\el {" write$ extra.label write$ "}" write$ }
                           if$
              }
          if$
        }
      if$
    }
  if$
%</jurabst|jurunsrt>
  "}}%" write$ newline$
  "         {" write$
  title empty$
    { "{}%" write$ newline$ }
    { "{" title * "}%" * write$ newline$ }
  if$
  gender empty$
    { "          {}" write$ }
    { "          {" gender * "}" * write$ }
  if$
% % NEW 0.51h
% removed again in 0.51k
%   repeat-authors
%     { repeat-titles
%          { "{1}" write$ }
%          { "{0}" write$ }
%       if$  
%     }
%     { "{0}" write$ }
%   if$
  "{}{}{}{}{}{}{}}%" write$ newline$
  "        ]{" write$
  cite$ write$
  "}" write$
  url empty$
    'skip$
    { newline$ " \jburldef {" write$ cite$ write$ "}{" write$ url write$ "}%" write$ }
  if$
  newline$
  " \jbbibargs {" write$
  ""
  before.all 'output.state :=
}

FUNCTION {output.bibitem}
{ output.bibitem.fst
  output.bibitem.snd
}

% NEW 0.5e
FUNCTION {format.note}
{ note empty$
      'skip$
      { output.state before.all =
          {" \jbnote {}{" * note * "} " * }
          {" \jbnote {1}{" * note * "} " * }
       if$
      }
  if$
}

% NEW 0.5e
FUNCTION {format.endnote}
{ note empty$
      { "" }
      { "  \jbendnote {" note * "}" * }
  if$
}

% NEW 0.5e
FUNCTION {fin.entry.endnote}
{ " \jbdoitem" * write$
  annote missing$
    { " \bibAnnoteFile {" cite$ * "}" * write$ newline$ }
    { " \bibAnnote {" annote * "}" * write$ newline$ }
  if$
}

FUNCTION {format.juradiss.book}
{ dissyear empty$
  { "" }
  { type empty$
     { school empty$
         { "No university in " cite$ * warning$
           " (\alsothesisname {} \jurthesisname\bibbdsep {} " dissyear * ")" * }
         { " (\alsothesisname {} \jurthesisname, " school * "\bibbdsep {} " dissyear * ")" * * }
       if$
     }
     { school empty$
         { "No university in " cite$ * warning$
           " (\alsothesisname {} " type * ", " * "\bibbdsep {} " dissyear * ")" * * }
         { " (\alsothesisname {} " type * ", " * school * "\bibbdsep {} " dissyear * ")" * * }
       if$
     }
   if$
  }
  if$
}

FUNCTION {format.thesis}
{ year empty$
      { school empty$
              { "No universtiy in " cite$ * warning$ }
              { "There's a university, but no year in " cite$ * warning$ }
        if$
        ""
      }
      { type empty$
%<*jurecobst>
            { school empty$
                    { "No university in " cite$ * warning$ 
                        type$ "mastersthesis" =
                           { "\apyformat {\mastersthesisname}" * }
                           { type$ "jurthesis" =
                                 { "\apyformat {\jurthesisname}" * }
                                 { "\apyformat {\phdthesisname}" * }
                             if$
                           }
                        if$
                    }
                    { type$ "mastersthesis" =
                           { "\mastersthesisname, \apyformat {" school * "}" * }
                           { type$ "jurthesis" =
                                 { "\jurthesisname, \apyformat {" school * "}" * }
                                 { "\phdthesisname, \apyformat {" school * "}" * }
                             if$
                           }
                      if$
                    }
              if$
            }
%</jurecobst>
%<*jurabst|jurunsrt>
            { school empty$
                    { "No university in " cite$ * warning$ 
                        type$ "mastersthesis" =
                           { "\apyformat {\mastersthesisname\bibbdsep {} " year * "}" * }
                           { type$ "jurthesis" =
                                 { "\apyformat {\jurthesisname\bibbdsep {} " year * "}" * }
                                 { "\apyformat {\phdthesisname\bibbdsep {} " year * "}" * }
                             if$
                           }
                        if$
                    }
                    {  type$ "mastersthesis" =
                           { "\mastersthesisname, \apyformat {" school * "\bibbdsep {} " year * * "}" * }                    
                           { type$ "jurthesis" =
                                 { "\jurthesisname, \apyformat {" school * "\bibbdsep {} " year * * "}" * }
                                 { "\phdthesisname, \apyformat {" school * "\bibbdsep {} " year * * "}" * }
                             if$
                           }
                       if$
                    }
              if$
            }
%</jurabst|jurunsrt>
%<*jurecobst>
            { school empty$
                    { "No university in " cite$ * warning$ type }
                    { type " \apyformat {" * school * "}" * }
              if$
            }
%</jurecobst>
%<*jurabst|jurunsrt>
            { school empty$
                    { "No university in " cite$ * warning$ type "\bibbdsep {} \apyformat {" * year * "}" * }
                    { type " \apyformat {" * school * "\bibbdsep {} " year * * "}" * }
              if$
            }
%</jurabst|jurunsrt>
       if$
  }
  if$
}

FUNCTION {set.comma.pages.check}
{ year empty$
  'skip$
  { pages empty$
    { url empty$
      'skip$
      { ", " * }
      if$
    }
    { ", " * }
    if$
  }
  if$
}

FUNCTION {set.period.dash}
{ output.state before.all =
  'skip$
  { period.dash  'output.state := }
  if$
}

FUNCTION {set.period.dash.check}
{ empty$
  'skip$
  'set.period.dash
  if$
}

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

FUNCTION {part.of.sentence}
{ output.state before.all =
   'skip$
   { mid.sentence 'output.state := }
  if$
}

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

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

% This function replaces the string on top of the stack with its final
% non-right-brace character.

FUNCTION {get.final.nonrightbrace.char}
{   { duplicate$
    #-1 #1 substring$
    duplicate$
    "}" =
  }
  { pop$
    #-2 global.max$ substring$
  }
  while$
  swap$ pop$
}

% somewhat analogous to the add.period$ built-in function, this function looks
% at the string on top of the stack, and if its last character is a period,
% question mark, or exclamation mark, it appends nothing (the closing brace),
% else it appends the \bibatsep macro

FUNCTION {check.punct.instead.of.add.period}
{ duplicate$
  get.final.nonrightbrace.char
  duplicate$ "." = swap$
  duplicate$ "!" = swap$
  "?" = or or
  { "} " * }
  { "}\bibatsep\ " * }
  if$
}

%FUNCTION {check.punct.textedition} % NEW 0.5e
%{ duplicate$
%  get.final.nonrightbrace.char
%  duplicate$ "." = swap$
%  duplicate$ "," = swap$
%  "?" = or or
%  { "}" * }
%  { "\jbaensep}" * }
%  if$
%}

FUNCTION {check.punct.instead.of.add.period.art}
{ duplicate$
  get.final.nonrightbrace.char
  duplicate$ "." = swap$
  duplicate$ "!" = swap$
  "?" = or or
  { "} " * }
  { volume empty$
    { pages empty$
      { "}\ajtsep\ " * }
      { crossref missing$
        { month empty$
          { "}\ajtsep\ " * }
          { "}\ajtsep " * }
          if$
        }
        { "}\ajtsep " * }
        if$
      }
      if$
    }
    { "}\ajtsep\ " * }
    if$
  }
  if$
}

FUNCTION {emphasize}
{ duplicate$ empty$
       { pop$ "" }
       { "\bibtfont {" swap$ check.punct.instead.of.add.period * }
  if$
}

FUNCTION {journaltitlemarkup}
{ duplicate$ empty$
      { pop$ "" }
      { "\bibJTsep \bibjtfont {" swap$ check.punct.instead.of.add.period.art * }
  if$
}

FUNCTION {incollbooktitlemarkup}
{ duplicate$ empty$
      { pop$ "" }
      { "\bibbtfont {" swap$ check.punct.instead.of.add.period * }
  if$
}

INTEGERS { nameptr namesleft numnames }

FUNCTION { lastnamemarkup }
{ duplicate$ empty$
    { pop$ "" }
    { "\bibnf {" swap$ * "}" * }
  if$
}

FUNCTION { editorlastnamemarkup }
 { duplicate$ empty$
  { pop$ "" }
  { author empty$
       { "\biblenf {" swap$ * "}" * } % lonely editor(s)!
       { "\bibenf {" swap$ * "}" * }
   if$
  }
  if$
}

FUNCTION { othermarkup }
 { duplicate$ empty$
    { pop$ " {}" }
       { " {" swap$ * "}" * }
  if$
}

FUNCTION {article.in.journal}
{ duplicate$ empty$
  { pop$ "" }
  { author missing$
    { title missing$
        'skip$
        { journaltitlemarkup "" swap$ * }
      if$
    }
    { journaltitlemarkup "" swap$ * }
    if$
   }
  if$
}

FUNCTION {format.names} % NEW v0.5
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
  { namesleft #0 > }
  { s nameptr "{ll}" format.name$ 't := t lastnamemarkup 't :=
    s nameptr "{ff}" format.name$ othermarkup 'u :=
    s nameptr "{f.}" format.name$ othermarkup 'v :=
    s nameptr "{vv}" format.name$ othermarkup 'w :=
    s nameptr "{jj}" format.name$ othermarkup 'x :=
    t u * v * w * x * 't :=
     nameptr #1 >
      { namesleft #1 >
          { numnames #3 >
                { "" * }
                { numnames #3 <
                     { "\Bibbtasep " * t * }      % between (exactly) two authors
                     { "\Bibbfsasep " * t * }     % between first and second author (if more than two)
                  if$
                }
            if$
          }
          { t "\bibnf {others} {} {} {} {}" =
            t "\bibnf {others} {} {} {} {} \edfont {\editorsname}" = or
            numnames #3 > or
               { "\bibIMfont {\Bibetal}" * }
               { numnames #3 <
                   { "\Bibbtasep " * t * }  % between (exactly) two authors
                   { "\Bibbstasep " * t * } % between second and third author
                 if$
               }
            if$
          }
        if$
      }
     't
    if$
    nameptr #1 + 'nameptr :=
    namesleft #1 -  'namesleft :=
  }
  while$
}

FUNCTION {format.editor.names} % NEW v0.5
{ 's :=
  #1 'nameptr :=
  s num.names$ 'numnames :=
  numnames 'namesleft :=
  { namesleft #0 > }
  { s nameptr "{ll}" format.name$ 't := t editorlastnamemarkup 't :=
    s nameptr "{ff}" format.name$ othermarkup 'u :=
    s nameptr "{f.}" format.name$ othermarkup 'v :=
    s nameptr "{vv}" format.name$ othermarkup 'w :=
    s nameptr "{jj}" format.name$ othermarkup 'x :=
    t u * v * w * x * 't :=
     nameptr #1 >
      { namesleft #1 >
          { numnames #3 >
                { "" * }
                { numnames #3 <
                     { "\Bibbtesep " * t * }      % between (exactly) two editors
                     { "\Bibbfsesep " * t * }     % between first and second editor (if more than two)
                  if$
                }
            if$
          }
          { t "\bibenf {others} {} {} {} {}" =
            t "\biblenf {others} {} {} {} {}" = or
            t "\bibenf {others} {} {} {} {} \edfont {\editorsname}" = or
            t "\biblenf {others} {} {} {} {} \edfont {\editorsname}" = or
            numnames #3 > or
               { "\bibIMfont {\Bibetal}" * }
               { numnames #3 <
                   { "\Bibbtesep " * t * }  % between (exactly) two editors
                   { "\Bibbstesep " * t * } % between second and third editor
                 if$
               }
            if$
          }
        if$
      }
     't
    if$
    nameptr #1 + 'nameptr :=
    namesleft #1 -  'namesleft :=
  }
  while$
}

FUNCTION {format.name.sig}
{ '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 * }
            {  t "others" =
                { " et al." * }
                { "" * t * }
              if$
            }
          if$
        }
        't
      if$
    nameptr #1 + 'nameptr :=
    namesleft #1 -  'namesleft :=
  }
  while$
}

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

FUNCTION {format.authors}
{ author empty$
  { "" }
  { author format.names }
  if$
}

FUNCTION {format.founders}
{ founder empty$
   'skip$
   { author empty$
         'skip$
         { " in: " * }
     if$
     founder format.names "\foundername" * *
     editor empty$
        'skip$
        { author empty$
             { "\afterfoundersep {}" * }
             'skip$
          if$
        }
     if$
   }
  if$
}

FUNCTION {format.editors}
{ editor empty$
   { "" }
   { author empty$
        {  editor format.editor.names
           editortype empty$
              { editor num.names$ #1 >
                  { "\fsted {\editorsname}" * }
                  { "\fsted {\editorname}" * }
                if$
              }
              { "\fsted {(" editortype * ")}" * * }
           if$
        }
        {  founder empty$
               { "\bibfnfont {;} " * }
               { type$ "commented" =
                   { "\afterfoundersep {}" * }
                   { "\bibfnfont {;} " * }
                 if$
               }
           if$
           editor format.editor.names *
           editortype empty$
              { editor num.names$ #1 >
                  { " \edfont {\editorsname}" * }
                  { " \edfont {\editorname}" * }
                if$
              }
              { " \edfont {(" editortype * ")}" * * }
           if$
        }
    if$
   }
  if$
}

FUNCTION {format.snd.editors}
{ editor empty$
   { "" * }
   { author empty$
        { editortype empty$
             { editor num.names$ #1 >
                 { "\snded {\sndeditorsname}" * }
                 { "\snded {\sndeditorname}" * }
               if$
             }
             { "\snded {(" editortype * ")}" * * }
          if$
        }
        'skip$
    if$
   }
  if$
}

%<*jurabst|jurunsrt>
%  FUNCTION { set.after.author.sep }
%  { author missing$
%       { editor missing$
%            { organization missing$
%                   { "} {empty} {" }
%                   { "} {" author format.name.sig * "} {" * }
%              if$
%            }
%            { "} {" editor format.ed.name.sig * "} {" * }
%        if$
%       }
%       { "} {" author format.name.sig * "} {" * }
%    if$  
%    author empty$
%        { format.snd.editors }
%        'skip$
%    if$
%    "" *
%  }
FUNCTION { set.after.author.sep }
{ author missing$
     { editor missing$
          { organization missing$
                 { "} {empty} {} {" }
                 { "} {" author format.name.sig * "} {au} {" * }
            if$
          }
          { "} {" editor format.name.sig * "} {ed} {" * }
      if$
     }
     { "} {" author format.name.sig * "} {au} {" * }
  if$
  author empty$
      { format.snd.editors }
      'skip$
  if$
  "" *
}
%</jurabst|jurunsrt>

%<*jurecobst>
FUNCTION { set.after.author.sep }
{ author empty$ editor empty$ and
      { "}{jureco} {} {" "" * }
      { year empty$
         'skip$
          { year missing$
             { "\bibYear {}" * }
             { "\bibYear {" * year * extra.label * "}" * }
            if$
          }
        if$
        "}{jureco} {} {" "" *
      }
  if$
}
%</jurecobst>

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

FUNCTION { format.howcited }
{ "} {\bibhowcited}" format.endnote * }

% CH 0.51q macros for testing commentaries, reworked, bug reported by Tilman Finke
% check for editor and edition added
FUNCTION { format.howcited.comment }
{ edition empty$
     { "} {\bibcommenthowcited}" format.endnote * }
     { "} {\bibcommenthowcited}" format.endnote * *
       author empty$ editor empty$ not and
         { " \jbauthorinfo {" editor format.names.info " " title * * * "}{" cite$ "}" * * * }
         { author empty$ shortauthor empty$ not and
               { " \jbauthorinfo {" shortauthor format.names.info " " title * * * "}{" cite$ "}" * * * }
               { " \jbauthorinfo {" author format.names.info " " title * * * "}{" cite$ "}" * * * }
           if$
         }
       if$
     }
  if$
}

FUNCTION { format.howcited.artperiod }
{ "} {\bibartperiodhowcited}" format.endnote * }


FUNCTION {format.ed.incoll}
{ editor empty$
   { "" }
   { editor format.editor.names
     editortype empty$
        { editor num.names$ #1 >
            { " \edfont {\editorsname}" * }
            { " \edfont {\editorname}" * }
          if$
        }
        { " \edfont {(" editortype * ")}" * * }
     if$
   }
  if$
}

FUNCTION {format.proceed.organization}
{  organization empty$
    { "" }
    { organization " \organizationname {}" * }
   if$
}

% NEW 0.5e titleaddon
FUNCTION {format.titleaddon}
{ title empty$
  { "" }
  { titleaddon empty$
       { "" }
       { titleaddon "\bibatsep\ " * }
    if$
  }
  if$
}


FUNCTION {format.title}
{ title empty$
      { "" }
      { "\bibtfont {" title check.punct.instead.of.add.period * format.titleaddon * }
  if$
}

FUNCTION {format.artperiodincoll.title}
{ title empty$
      { "" }
      { "\bibapifont {" title check.punct.instead.of.add.period *  format.titleaddon * }
  if$
}

FUNCTION {format.volumetitle}
{ volumetitle empty$
  { "" }
  { volume empty$
      { "There's a volumetitle but no volume in " cite$ * warning$ volumetitle ", " * }
      { volumetitle ", " * }
    if$
  }
 if$
}

FUNCTION {add.extra.label}
{ extra.label "" =
    'skip$
    { "\bibel {" extra.label * "}" * * }
  if$
}

FUNCTION {format.date}
{ year empty$
  { month empty$
       { "" }
       { "There's a month but no year in " cite$ * warning$  month  }
    if$
  }
  { month empty$
       { edition empty$
            'skip$
            { "\jbssedbd {" convert.edition.superscript extract.num * "}" * * }
         if$
         year
         add.extra.label
       }
       { month " " * 
         edition empty$
            'skip$
            { "\jbssedbd {" convert.edition.superscript extract.num * "}" * * }
         if$       
         year *
         add.extra.label
       }
    if$
  }
  if$
}

FUNCTION {format.date.old}
{ year empty$
  { month empty$
    { "" }
    { "There's a month but no year in " cite$ * warning$  month  }
    if$
  }
  { month empty$
    'year
    { month " " * year * }
    if$
  }
  if$
}

FUNCTION {format.update}
{ updated missing$ not
     { "\updatesep {} \updatename {} " * updated * }
     'skip$   
  if$ 
}

FUNCTION {oaddress.opublisher.oyear.format}
{ type$ "book" = type$ "inbook" = type$ "incollection" = or or
     { oyear empty$
            { opublisher empty$
                 { oaddress empty$
                     'skip$
                     { oaddress "\osep {} " * * }
                   if$
                 }
                 { oaddress empty$
                     { opublisher "\osep {} " * * }
                     { oaddress "\bpubaddr {} " * opublisher "\osep {} " * * * }
                   if$
                 }
              if$
            }
            { year empty$
                 { "oyear without year in " cite$ * warning$ }
                 'skip$
              if$
              opublisher empty$
                 { oaddress empty$
                     { oyear * "\osep {} \reprintname {}, " * }
                     { oaddress "\bibbdsep {} " * oyear "\osep {} " * * * }
                   if$
                 }
                 { oaddress empty$
                     { opublisher * "\bibbdsep {} " * oyear "\osep {} " * * }
                     { oaddress "\bpubaddr {} " * opublisher "\bibbdsep {} " * * oyear "\osep {} " * * * }
                   if$
                 }
              if$
            }
       if$
     }
     'skip$
  if$
}

FUNCTION {make.translators}
{ before.all 'output.state :=
  translator empty$
    { flanguage empty$
        { "" }
        { "\translator {}{" flanguage "l" change.case$ * "}" *
% NEW 0.52e
          type$ "incollection" = not 
          type$ "article" = not 
          and
            { "{1} " * }
            { type$ "incollection" =
                { booktitle empty$
                    { "{} " * }
                    { "{1} " * }
                  if$
                }
                { type$ "article" =
                    { "{1}" * }
                    { series empty$
                        { "{} " * }
                        { "{1} " * }
                      if$
                    }
                  if$
                }
              if$
            }
          if$  
        }
      if$
    }
    { "\translator {" translator * "}" *
      flanguage empty$
        { "{}" * }
        { "{" * flanguage "l" change.case$ * "}" * }
      if$
% NEW 0.52e
      type$ "incollection" = not 
      type$ "article" = not 
      and
        { "{1} " * }
        {
          type$ "incollection" =
            { booktitle empty$
                { "{} " * }
                { "{1} " * }
              if$
            }
            { type$ "article" =
                { "{1} " * }
                { series empty$
                    { "{} " * }
                    { "{1} " * }
                  if$
                }
              if$
            }
          if$
        }
      if$
    }
  if$
  before.all 'output.state :=
}

%<*jurecobst>
FUNCTION {format.address.publisher.year}
{  publisher empty$
     { address empty$
         { institution empty$
             { "" }
             { " \apyformat {" oaddress.opublisher.oyear.format * institution "}" * }
           if$
         }
         { institution empty$
             { " \apyformat {" oaddress.opublisher.oyear.format * address "}" * }
             { " \apyformat {" oaddress.opublisher.oyear.format * address "\bpubaddr {} " * institution "}" * * }
           if$
         }
       if$
     }
     { address empty$
         { institution empty$
             { "There's only a publisher (no address) in " cite$ * warning$
               " \apyformat {" oaddress.opublisher.oyear.format * publisher "}" * }
             { " \apyformat {" oaddress.opublisher.oyear.format * publisher ", " * institution "}" * * }
           if$
         }
         { institution empty$
             { " \apyformat {" oaddress.opublisher.oyear.format * address "\bpubaddr {} " * publisher "}" * * }
             { " \apyformat {" oaddress.opublisher.oyear.format * address "\bpubaddr {} " * publisher ", " * institution "}" * * * }
           if$
         }
       if$
     }
  if$
}
%</jurecobst>

%<*jurabst|jurunsrt>
FUNCTION{checked.inst}
{ institution empty$
    { " \apyformat {" *
        oaddress.opublisher.oyear.format
    }
    'skip$
  if$
}

FUNCTION {format.address.publisher.year}
{  publisher empty$
     { address empty$
         { year empty$
             { "Neither address nor year in " cite$ * warning$ "" }
             { "No address in " cite$ * warning$
               institution empty$
                 { " \apyformat {" oaddress.opublisher.oyear.format format.date * "}" * }
%                 { "" * format.date "}" * }
% CH 0.52p if institution field is used outside specification, it should be printed out properly too.
                 { " \apyformat {" institution * "\bibbdsep {} "  * format.date "}" * * }
               if$
             }
           if$
         }
        { year empty$ % NEW 0.5e bug removed, no \bibbdsep without year
            { checked.inst address "}" * }
            { checked.inst address "\bibbdsep {} " format.date * "}" * * }
          if$
        }
       if$
     }
     { address empty$
          { year empty$
                { "There's only a publisher (no address, no year) in " cite$ * warning$ publisher }
                { checked.inst publisher "\bibbdsep {} " * format.date "}" * * }
            if$
          }
          { year empty$
                { checked.inst address * "\bpubaddr {} " publisher "}" * * }%
                { checked.inst address * "\bpubaddr {} " publisher "\bibbdsep {} " * format.date "}" * * * }
            if$
          }
       if$
     }
  if$
}
%</jurabst|jurunsrt>

FUNCTION {format.howpublished.address.year}
{ howpublished empty$
     { address empty$
%<*jurecobst>
          { "No address in " cite$ * warning$ }
%</jurecobst>
%<*jurabst|jurunsrt>
          { year empty$
               { "Neither address nor year in " cite$ * warning$ "" }
               { "No address in " cite$ * warning$ year }
            if$
          }
%</jurabst|jurunsrt>
%<*jurecobst>
          { " \apyformat {" oaddress.opublisher.oyear.format address * "}" * }
%</jurecobst>
%<*jurabst|jurunsrt>
          { " \apyformat {" oaddress.opublisher.oyear.format address * "\bibbdsep {} " * format.date "}" * * }
%</jurabst|jurunsrt>
       if$
     }
     { address empty$
%<*jurecobst>
          { "There's only a howpublished (no address) in " cite$ * warning$ " \apyformat {" oaddress.opublisher.oyear.format howpublished * "}" * }
%</jurecobst>
%<*jurabst|jurunsrt>
          { year empty$
               { "There's only a howpublished (no address, no year) in " cite$ * warning$ howpublished }
               { " \apyformat {" oaddress.opublisher.oyear.format howpublished * "\bibbdsep {} " * format.date "}" * * }
            if$
          }
%</jurabst|jurunsrt>
%<*jurecobst>
          { " \apyformat {" oaddress.opublisher.oyear.format address * "\bpubaddr {} " * howpublished "}" * * }
%</jurecobst>
%<*jurabst|jurunsrt>
          { year empty$
               { " \apyformat {" oaddress.opublisher.oyear.format address * "\bpubaddr {} " * howpublished "}" * * }
               { " \apyformat {" oaddress.opublisher.oyear.format address * "\bpubaddr {} " * howpublished * "\bibbdsep {} " * format.date "}" * * }
            if$
          }
%</jurabst|jurunsrt>
       if$
     }
  if$
}

FUNCTION {tie.or.space.connect}
{ duplicate$ text.length$ #4 <
     { "~" }
     { " " }
  if$
  swap$ * *
}

FUNCTION {bibvol.tie.or.space.connect}
{ duplicate$ text.length$ #4 <
     { "~" }
     { "{} " }
  if$
  swap$ * *
}

FUNCTION {format.btitle}{ title emphasize format.titleaddon * }

FUNCTION {format.btitle.vol}
{ number empty$
   { series empty$
        { volume empty$
             { title emphasize format.titleaddon * }
             { 
% 0.52 Markup for volume introduced
% 0.52e Markup for volume improved, separation after title is now part of markup,
%       but we can only use one separation globally :-(
               title emphasize format.titleaddon * " \volumeformat {" volume * "} " * *
%               title emphasize format.titleaddon * " \volumeformat {" volume * "}, " * *
%               title emphasize format.titleaddon * " \Volumename" *
%               volume bibvol.tie.or.space.connect ", " * 
             }
          if$
        }
        { volume empty$
             { title emphasize format.titleaddon *  }
% CHANGED v0.51b, reported by Tilman Finke, if series given, series appeared before title; 
% I think this was mixed up by me. Simply mixed up again.
%             { series emphasize format.titleaddon * "\Volumename" *
%               volume bibvol.tie.or.space.connect ": " * title "\bibatsep\ " * * }
             { 
% 0.52 Markup for volume introduced                                                                                           
% 0.52e Markup for volume improved, separation after title is now part of markup, 
%       but we can only use one separation globally :-(
               title emphasize format.titleaddon * "\volumeformat {" volume * "} " * * series "\bibatsep\ " * *              
%               title emphasize format.titleaddon * "\volumeformat {" volume * "}: " * * series "\bibatsep\ " * *              
%               title emphasize format.titleaddon * "\Volumename" *
%               volume bibvol.tie.or.space.connect ": " * series "\bibatsep\ " * * 
             }
               
          if$
        }
     if$
   }
   { title emphasize format.titleaddon * }
  if$
}

FUNCTION {format.btitle.vol.inbook}
{ number empty$
   { series empty$
       { volume empty$
           { "\bibapifont {" title check.punct.instead.of.add.period * format.titleaddon * }
           { "\bibapifont {" title check.punct.instead.of.add.period * format.titleaddon *
% 0.52 Markup for volume introduced
% 0.52e Markup for volume improved, separation after title is now part of markup, 
%       but we can only use one separation globally :-(
             " \volumeformat {" volume * "} " * *
%             " \volumeformat {" volume * "}, " * *
%             " \Volumename" * volume bibvol.tie.or.space.connect ", " * 
           }
         if$
       }
       { volume empty$
           { "\bibapifont {" title check.punct.instead.of.add.period * format.titleaddon * }
           { series emphasize 
% 0.52 Markup for volume introduced           
% 0.52e Markup for volume improved, separation after title is now part of markup, 
%       but we can only use one separation globally :-(
             "\volumeformat {" volume * "} " * *
%             "\volumeformat {" volume * "}: " * *
%             "\Volumename" * volume bibvol.tie.or.space.connect ": " *
             "\bibapifont {" title check.punct.instead.of.add.period * format.titleaddon * * }
         if$
       }
     if$
   }
   { "\bibapifont {" title check.punct.instead.of.add.period * format.titleaddon * }
  if$
}

FUNCTION {format.url}
{ url empty$
  { "" }
  { 
% NEW 0.51r remove space, if no author and no title is given
   author empty$ title empty$ and
        'skip$
        { " " * }
    if$
    urldate empty$
% CH 0.51r leading whitespace before \jburluse removed
        {"\jburluse {" cite$ * "}" * }
%        {"\jburluse {" cite$ * "}~-- \urldatecomment " * urldate * }
        {"\jburluse {" cite$ * "}\bibbudcsep {}\urldatecomment " * urldate * }
    if$
  }
  if$
}

FUNCTION {format.naked.url}
{ url empty$
  { "" }
  { urldate empty$
    { title empty$
         'skip$
         { title emphasize * }
      if$
      "\jburluse {" cite$ * "}" *
    }
    { title empty$
         'skip$
         { title emphasize * }
      if$
%      "\jburluse {" cite$ * "}~-- \urldatecomment " * urldate *
      "\jburluse {" cite$ * "}\bibbudcsep {}\urldatecomment " * urldate *
    }
  if$
  }
  if$
}

FUNCTION {format.series.number}
{ volume empty$
  { number empty$
     { series empty$
          { "" }
          { " \numberandseries {}{" series * "}" * }
       if$
     }
     { series empty$
         { " \numberandseries {" number * "}{}" * "There's a number but no series in " cite$ * warning$ }
         { " \numberandseries {" number * "}{" * series "}" * * }
       if$
     }
    if$
   }
   { series empty$
      { "" }
      { type$ "proceedings" =
          { " \numberandseries {}{" series * "}" * } % { " (" series * ")" * }
          { "" }
        if$
      }
     if$
   }
  if$
}

FUNCTION {first.ed} { "\firstedname" }
FUNCTION {second.ed}{ "\secondedname" }
FUNCTION {third.ed} { "\thirdedname" }
FUNCTION {fourth.ed}{ "\fourthedname" }
FUNCTION {fifth.ed} { "\fifthedname" }
FUNCTION {th.ed}    { "\thedname" }

FUNCTION {convert.edition}
{ edition extract.num "l" change.case$ 's :=
  s "first" = s "1" = or
  { first.ed 't := }
  { s "second" = s "2" = or
    { second.ed 't := }
    { s "third" = s "3" = or
      { third.ed 't := }
      { s "fourth" = s "4" = or
        { fourth.ed 't := }
        { s "fifth" = s "5" = or
          { fifth.ed 't := }
          { s #1 #1 substring$ is.num
            { s th.ed * 't := }
            { edition 't := }
            if$
          }
          if$
        }
        if$
      }
      if$
    }
    if$
  }
  if$
  t
}

FUNCTION {format.edition}
{ 
%  textedition empty$
%    { 
      edition empty$
         { "" }
         { "\jbedition {" * convert.edition "~\editionname {}\jbaensep} " * }% dot or not ???????
      if$
%    }
%    { "\jbedition {" textedition check.punct.textedition * }% dot or not ???????
%  if$
}

FUNCTION { format.isbn.issn }
{ isbn empty$
   { issn empty$
      { "" }
      { "\jbissn {" issn n.dashify tie.or.space.connect "}" * }
     if$
   }
   { "\jbisbn {" isbn n.dashify tie.or.space.connect "}" * }
  if$
}

FUNCTION { format.isbn.issn.old }
{ isbn empty$
   { issn empty$
      { "" }
      { ", \protect\mbox {ISSN}" issn n.dashify tie.or.space.connect }
     if$
   }
   { ", \protect\mbox {ISBN}" isbn n.dashify tie.or.space.connect }
  if$
}

INTEGERS { multiresult }

FUNCTION {multi.page.check}
{ 't :=
  #0 'multiresult :=
  { multiresult not
    t empty$ not
    and
  }
  { t #1 #1 substring$
    duplicate$ "-" =
    swap$ duplicate$ "," =
    swap$ "+" =
    or or
  { #1 'multiresult := }
  { t #2 global.max$ substring$ 't := }
    if$
  }
  while$
  multiresult
}

FUNCTION {format.pages}
{ pages empty$
  { "" }
  {
% NEW 0.5f now done by \jbprformat
%    pages multi.page.check
%       {
         " \jbPages{" pages n.dashify * "}" *
%       }
%       { " \jbPage{" pages * "}" * }
%    if$
  }
  if$
}

FUNCTION {multi.pagerange.check}
{ 't :=
  #0 'multiresult :=
  { multiresult not
    t empty$ not
    and
  }
  { t #1 #1 substring$
    duplicate$ "-" =
    swap$ duplicate$ "b" =
    swap$ "/" = or or
  { #1 'multiresult := }
  { t #2 global.max$ substring$ 't := }
    if$
  }
  while$
  multiresult
}

FUNCTION {check.missing.pages}
{ pages empty$
    { "Empty pages in " cite$ * warning$ }
    { pages multi.pagerange.check
        { "" * }
        { "There's only a starting page, no pagerange in " cite$ * warning$ }
      if$
    }
  if$
}

FUNCTION {format.pages.book}
{ pages empty$
  { "" }
  { " \jbpages {" pages " \bibtotalpagesname}" *}
  if$
}

FUNCTION {format.totalpages}
{ totalpages empty$
  { "" }
  {
   ", " totalpages "~\bibtotalpagesname" * *
  }
  if$
}

FUNCTION {format.vol.year.num.pages}
{ volume empty$
        { "" }
        { " \artvolumeformat {" volume * "}" * }
  if$
%<*jurabst|jurunsrt>
  month empty$
       'skip$
       { "\ " month * * }
  if$
  year empty$
      { "There's a volume but no year in " cite$ * warning$ }
% NEW 0.52i add.extra.label added      
      { " \artyearformat {" year * "}" * * add.extra.label }
  if$
%</jurabst|jurunsrt>
%<*jurecobst>
  number empty$
        'skip$
        { 
% REMOVED 0.52p, doubled comma, if number and volume are given, while
% \artnumberformat prints out a comma by itself (reported by Kai Kramer)
%            volume empty$
%                  { "" * }
%                  { ", " * }
%            if$
          "\artnumberformat {" number * "}" * *
        }
  if$
%</jurecobst>
%<*jurabst|jurunsrt>
  number empty$
        'skip$
        { "\artnumberformat {" number * "}" * * }
  if$
%</jurabst|jurunsrt>
  pages empty$
       'skip$
       { duplicate$ empty$
                   { pop$ format.pages }
                   { "" format.pages * * }
         if$
       }
  if$
}

FUNCTION {format.vol.bracedyear.num.pages}
{ volume empty$
        { "" }
        { " \pervolumeformat {" volume * "}" * }
  if$
%  volume "\bibvolumecomment\ " * field.or.null
%<*jurabst|jurunsrt>
  year empty$
      { "There's a volume but no year in " cite$ * warning$ }
      { " \peryearformat {" year * "}" * * }
  if$
  month empty$
       'skip$
       { ", " month * * }
  if$
%</jurabst|jurunsrt>
%<*jurecobst>
  number empty$
        'skip$
        { volume empty$
                { "" * }
                { ", " * }
          if$
          "\pernumberformat {" number * "}" * *
    }
  if$
%</jurecobst>
%<*jurabst|jurunsrt>
  number empty$
        'skip$
        { ", \pernumberformat {" number * "}" * * }
  if$
%</jurabst|jurunsrt>
  pages empty$
       'skip$
       { duplicate$ empty$
                   { pop$ format.pages }
                   { "" format.pages * * }
         if$
       }
  if$
}

FUNCTION {format.vol.bracedyear.num.pages.orig}
{ volume "\bibvolumecomment\ " * field.or.null
  year empty$
      { "There's a volume but no year in " cite$ * warning$ }
      { " \peryearformat {" year * "}" * * }
  if$
  month empty$
    'skip$
    { ", " month * * }
  if$
  number empty$
    'skip$
    { ", Nr.~" number * *
%        volume empty$
%          { "There's a number but no volume in " cite$ * warning$ }
%          'skip$
%        if$
    }
  if$
  pages empty$
    'skip$
    { duplicate$ empty$
      { pop$ format.pages }
      { "" format.pages * * }
    if$
    }
  if$
}

FUNCTION {format.chapter.pages}
{ chapter empty$
  'format.pages
    { type empty$
      { "\unskip.\,-- \bibchapterlongname" }
      { "\unskip.\,-- " type * }
    if$
    chapter tie.or.space.connect
    pages empty$
      'skip$
      { format.pages * }
    if$
    }
  if$
}

% NEW 0.5e booktitleaddon
FUNCTION {format.booktitleaddon}
{ booktitle empty$
  { "" }
  { booktitleaddon empty$
       { "" }
       { booktitleaddon }
    if$
  }
  if$
}

FUNCTION {format.incoll.editor.booktitle}
{ booktitle empty$
  { "" }
  { editor empty$
    { volume empty$
        { "\incolledformat {}{}{" booktitle incollbooktitlemarkup format.booktitleaddon * * "}{}" *
          booktitleaddon empty$
            { "{} " * }
            { "{1} " * }
          if$
        }
        { "\incolledformat {}{}{" booktitle incollbooktitlemarkup format.booktitleaddon * * "}{" * volume * "}" *
            booktitleaddon empty$
              { "{} " * }
              { "{1} " * }
            if$
        }
      if$
    }
    { volume empty$
         { "\incolledformat {"
            editor empty$
               { "" }
               { editor format.editor.names "}" * *
                    editor num.names$ #1 >
                         { "{\edfont {\editorsname}}{" * }
                         { editortype empty$
                               { "{\edfont {\editorname}}{" * }
                               { "{\edfont {(" * editortype * ")}}{" * }
                           if$
                         }
                    if$
               }
            if$
            booktitle incollbooktitlemarkup * format.booktitleaddon * "}{}" *
            booktitleaddon empty$
              { "{} " * }
              { "{1} " * }
            if$
         }
         { "\incolledformat {" *
            editor empty$
               { "" }
               { editor format.editor.names "}" * *
                    editor num.names$ #1 >
                         { "{\edfont {\editorsname}}{" * }
                         { editortype empty$
                               { "{\edfont {\editorname}}{" * }
                               { "{\edfont {(" * editortype * ")}}{" * }
                           if$
                         }
                    if$
               }
            if$
            booktitle incollbooktitlemarkup * format.booktitleaddon * "}{" volume * "}" *
            booktitleaddon empty$
              { "{} " * }
              { "{1} " * }
            if$
         }
      if$
    }
    if$
  }
  if$
}

FUNCTION {format.tr.number.jur}
{ type empty$
   { number empty$
     { " -- \technicalreportname {} " }
     { "~(" number * ").\,-- \technicalreportname {} " * }
     if$
   }
   { number empty$
     { " -- " type  * }
     { "~(" number * ").\,-- " type * " " * * }
     if$
   }
  if$
}

FUNCTION {format.article.crossref.bracedyear}
{ key empty$
    { journal empty$
        { "Need key or journal for " cite$ * " to crossref " * crossref * warning$ "" }
        { "\bibJTsep\bibjtfont {" journal * check.punct.instead.of.add.period.art *  }
      if$
      volume empty$
        { "No volume in " cite$ * warning$ }
% 0.52 Markup added
        { " \pervolumeformat {" volume * "} " *  }
%        { " " volume * " " *  }
      if$
%<*jurabst|jurunsrt>
      year empty$
        { "No year in " cite$ * warning$ }
        { "\peryearformat {" year * "}" * * }
      if$
%</jurabst|jurunsrt>
      pages empty$
        'skip$
        { duplicate$ empty$
            { pop$ format.pages }
            { format.pages * }
          if$
        }
      if$
    }
    { "" key * }
  if$
  "\ \protect\jbcrossrefchecked {" * crossref * "}\unskip" *
}

FUNCTION {format.article.crossref}
{ key empty$
    { journal empty$
        { "Need key or journal for " cite$ * " to crossref " * crossref * warning$ "" }
        { "\bibJTsep\bibjtfont {" journal * check.punct.instead.of.add.period.art *  }
      if$
    }
    { "" key * }
  if$
  year empty$
      'skip$
%      { "\ " year * * }
%                    ^ added in 0.5e
      { year * }      
  if$
  " \protect\jbcrossrefchecked {" crossref * "}" *
}

FUNCTION {format.book.crossref}
{ editor empty$
  editor field.or.null author field.or.null =
  or
  { key empty$
    { series empty$
      { "Need editor, key, or series for " cite$ * " to crossref " * crossref * warning$ "" * }
      { "" * }
      if$
    }
    { key * }
    if$
  }
  { "" * }
  if$
  volume empty$
  { "Empty volume in " cite$ * "'s crossref of " * crossref * warning$ ""
    " \protect\jbcrossrefchecked {" * crossref * "}\unskip" * }
  { " \protect\jbcrossrefchecked[" * volume * "]{" * crossref "}\unskip" * }
  if$
}

FUNCTION {format.incoll.inproc.crossref}
{
% 0.5f removed, seems to be senseless
%  editor empty$
%    editor field.or.null author field.or.null = or
%      { key empty$
%         { booktitle empty$
%              { "Need editor, key, or booktitle for " cite$ * " to crossref " * crossref * warning$ "" }
%              { " \bibbtfont {" booktitle check.punct.instead.of.add.period * }
%           if$
%         }
%         { "" }
%        if$
%      }
%      { "" }
% if$
 " \protect\jbincollcrossref {" * crossref * "}" *
% check added, if editor for the crossref'd work is given, switch introduced for that problem.
  editor empty$
    { "{}" * }
    { "{1}" * }
  if$
 format.pages % *<== 0.5f removed too.
}

FUNCTION { format.editors.organization }
{ organization empty$
    'skip$
    { type$ "misc" =
        { organization }
        { author empty$
            { editor empty$
                { " " organization * " \organizationname {}" * }
                { "; " organization * " \organizationname {}" * }
              if$
            }
            { "; " organization * " \organizationname {}" * }
          if$
        }
      if$
    }
  if$
}

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.artperiodincoll.title "title" output.check
  crossref missing$
      { journal article.in.journal output.nonnull
        new.sentence
        format.vol.year.num.pages output
      }
      { format.article.crossref output.nonnull }
  if$
  format.url output
  format.note
  format.isbn.issn output
  format.howcited.artperiod output
  check.missing.pages
  fin.entry.endnote
}

FUNCTION {commented}
{ output.bibitem
  author empty$
    { editor empty$
        { format.founders }
        { format.founders format.editors "editor" output.check }
      if$
    }
    { editor empty$
        { format.authors format.founders output.nonnull }
        { format.authors format.founders format.editors output.nonnull }
      if$
    }
  if$
  set.after.author.sep output
  crossref missing$
    { format.btitle.vol "title" output.check }
    { format.btitle "title" output.check }
  if$
  format.volumetitle output
  format.edition output
  format.address.publisher.year "publisher" output.check
  format.update
  new.sentence
  crossref missing$
    { format.series.number output }
    { format.book.crossref output.nonnull }
  if$
  format.url output
  format.pages output
  format.note
  format.howcited.comment output
  fin.entry.endnote
}

FUNCTION {periodical}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.artperiodincoll.title "title" output.check
  crossref missing$
    { journal article.in.journal output.nonnull
      new.sentence
      format.vol.bracedyear.num.pages output
    }
    { new.sentence format.article.crossref.bracedyear output.nonnull }
  if$
  format.url output
  format.note
  format.isbn.issn output
  format.howcited.artperiod output
  fin.entry.endnote
}

FUNCTION {book}
{ output.bibitem
  author empty$
    { editor empty$
        { "" "author and editor" output.check }
        { format.editors output.nonnull }
      if$
    }
    { editor empty$
        { format.authors output.nonnull }
        { format.authors "\jbtiafed {" format.editors * "}" * output.nonnull }
      if$
    }
  if$
  set.after.author.sep output
  crossref missing$
    { format.btitle.vol "title" output.check }
    { format.btitle "title" output.check }
  if$
  author empty$ not editor empty$ not and 
      { "\jbedafti {\edbyname {} " editor * "," * * "} " * }
      'skip$
  if$
  make.translators output
  format.volumetitle output
  format.edition output
  format.address.publisher.year "publisher" output.check
  new.sentence
  format.juradiss.book output
  crossref missing$
    { format.series.number output }
    { format.book.crossref output.nonnull }
  if$
  format.url output
  format.pages output
% NEW 0.52e  
  format.totalpages output  
%
  format.note
  format.isbn.issn output
  format.howcited output
  fin.entry.endnote
}

FUNCTION {inbook}
{ output.bibitem
  author empty$
    { format.editors "author and editor" output.check }
    { editor empty$
        { format.authors output.nonnull }
        { format.authors format.editors output.nonnull }
      if$
    }
  if$
  set.after.author.sep output
  crossref missing$
  { chapter empty$
      { "There's no chapter in " cite$ * warning$ "" * }
      { type empty$
          { "\Bibchaptername{}" }
          { type }
        if$
        chapter tie.or.space.connect " In " * *
      }
    if$
    format.btitle.vol.inbook "title" output.check
%
  make.translators output
%
    format.volumetitle output
    format.edition output
    format.address.publisher.year "publisher" output.check
    new.sentence
    format.series.number output
    format.url output
    format.pages "pages" output.check
    format.note
    format.isbn.issn output
  }
  { chapter empty$
      { "There's no chapter in " cite$ * warning$ "" *
        format.btitle.vol.inbook "title" output.check
      }
      { type empty$
        { "\Bibchaptername{}" }
        { type }
      if$
        chapter tie.or.space.connect "" * *
      }
    if$
    format.volumetitle output
    format.book.crossref output.nonnull
    format.url output
    format.pages "pages" output.check
    format.note
  }
  if$
  part.of.sentence
  format.howcited output
  fin.entry.endnote
}

FUNCTION {incollection}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.artperiodincoll.title "title" output.check
%
  make.translators output
%
  crossref missing$
    { format.incoll.editor.booktitle "booktitle" output.check
      format.volumetitle output
      format.edition output
      format.address.publisher.year "publisher" output.check
      new.sentence
      format.series.number output
      format.url output
      format.isbn.issn output
      part.of.sentence
      format.chapter.pages output
      format.note
    }
    { format.volumetitle output
      format.incoll.inproc.crossref output.nonnull
      format.url output
      format.note
    }
  if$
  format.howcited output
  check.missing.pages
  fin.entry.endnote
}

FUNCTION {inproceedings}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
% NEW 0.5f changed, suggested by Olaf Meltzer (olaf.meltzer@freenet.de),
%          because of dependent character of that publication type
%  format.title "title" output.check
  format.artperiodincoll.title "title" output.check
  crossref missing$
  { format.incoll.editor.booktitle "booktitle" output.check
    address empty$
      { organization new.sentence.checka
        organization output
        part.of.sentence
        format.address.publisher.year output
      }
      { format.address.publisher.year "publisher" output.check }
    if$
    new.sentence
    series empty$
      'skip$
      { format.series.number output }
    if$
    format.url output
    format.note
    format.isbn.issn output
    part.of.sentence
    format.pages output
  }
  { format.incoll.inproc.crossref output.nonnull
    format.url output
    format.note
  }
  if$
  format.howcited output
  fin.entry.endnote
}

FUNCTION {conference}{inproceedings}

FUNCTION {manual}
{ output.bibitem
  author empty$
    { organization empty$
        'skip$
        { organization output.nonnull
          address output
        }
      if$
    }
    { format.authors output.nonnull }
  if$
  set.after.author.sep output
  format.btitle "title" output.check
  format.edition output
  author empty$
    { organization empty$
        { address output part.of.sentence }
        'skip$
      if$
    }
    { address "\bpubaddr {} " *  organization * output
      part.of.sentence
    }
  if$
  format.date output
  pages set.period.dash.check
  format.pages.book output
  format.url output
  format.note
  format.howcited output
  fin.entry.endnote
}

FUNCTION {mastersthesis}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.btitle "title" output.check
  format.thesis output
  set.comma.pages.check
  pages new.sentence.checka
  format.pages output
  format.url output
  format.note
  format.howcited output
  fin.entry.endnote
}

FUNCTION {phdthesis}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.btitle "title" output.check
  format.thesis output
  set.comma.pages.check
  pages new.sentence.checka
  format.pages output
  format.url output
  format.note
  format.howcited output
  fin.entry.endnote
}

FUNCTION {jurthesis}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.btitle "title" output.check
  format.thesis output
  set.comma.pages.check
  pages new.sentence.checka
  format.pages output
  format.url output
  format.note
  format.howcited output
  fin.entry.endnote
}

FUNCTION {booklet}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.title "title" output.check
  format.howpublished.address.year output
  format.note
  format.url output
  format.howcited output
  fin.entry.endnote
}

FUNCTION {misc}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.title output
  format.howpublished.address.year output
  format.note
  format.url output
  format.howcited output
  fin.entry.endnote
}

FUNCTION {proceedings}
{ output.bibitem
  editor empty$
  { organization empty$
     'skip$
     { "\biblnfont {" organization * " \organizationname}" * output }
    if$
  }
  { format.editors output.nonnull }
  if$
  set.after.author.sep output
  format.btitle "title" output.check
  new.sentence
  editor empty$
    'skip$
    {  format.proceed.organization output }
  if$
  new.sentence
  format.series.number output.nonnull
  volume empty$
    { "" output.nonnull }
% 0.52 Markup added
    { "\volumeformat {" volume * "} " * "volume" output.check }
%    { "\Volumename" volume bibvol.tie.or.space.connect "volume" output.check }
  if$
  format.address.publisher.year "publisher" output.check
  pages set.period.dash.check
  format.pages.book output
  format.url output
  format.note
  format.isbn.issn output
  format.howcited output
  fin.entry.endnote
}

FUNCTION {techreport}
{ output.bibitem
  author empty$
    { format.editors "author and editor" output.check }
    { editor empty$
        { format.authors output.nonnull }
        { format.authors format.editors output.nonnull }
      if$
    }
  if$
  set.after.author.sep output
  format.title "title" output.check
  institution new.sentence.checka
% REMOVED 0.2p
%    institution empty$
%      'skip$
%      { " \apyformat {" institution * ", " * output.nonnull }
%    if$
  format.address.publisher.year output
  number new.sentence.checka
  format.tr.number.jur "number" output.check
  pages set.period.dash.check
  format.pages.book output
  format.url output
  format.note
  format.isbn.issn output
  format.howcited output
  fin.entry.endnote
}

FUNCTION {www}
{ output.bibitem
  format.authors "author" output.check
  set.after.author.sep output
  format.naked.url output
  format.howcited output
  fin.entry.endnote
}

FUNCTION {lexicon}
{ output.bibitem
  set.after.author.sep output
  crossref missing$
    { format.btitle.vol "title" output.check }
    { format.btitle "title" output.check }
  if$
  author empty$
      { editor empty$
            'skip$
            { "\edbyname{} " * editor format.editor.names "," * *  }
        if$
      }
      { "\byname{} " author format.names * "," * * }
  if$
  make.translators output
  format.volumetitle output
  format.edition output
  format.address.publisher.year "publisher" output.check
  new.sentence
  format.juradiss.book output
  crossref missing$
    { format.series.number output }
    { format.book.crossref output.nonnull }
  if$
  format.url output
  format.pages output
  format.totalpages output
  format.note
  format.isbn.issn output
  format.howcited output
  fin.entry.endnote
}

FUNCTION {unpublished}{misc}

FUNCTION {default.type}{misc}

MACRO {jan} {"\janname\ "}
MACRO {feb} {"\febname\ "}
MACRO {mar} {"\marname\ "}
MACRO {apr} {"\aprname\ "}
MACRO {may} {"\mayname\ "}
MACRO {jun} {"\junname\ "}
MACRO {jul} {"\julname\ "}
MACRO {aug} {"\augname\ "}
MACRO {sep} {"\sepname\ "}
MACRO {oct} {"\octname\ "}
MACRO {nov} {"\novname\ "}
MACRO {dec} {"\decname\ "}

READ

FUNCTION {sortify}{ purify$ "l" change.case$ }

INTEGERS { len }

FUNCTION {chop.word}
{ 's :=
  'len :=
  s #1 len substring$ =
  { s len #1 + global.max$ substring$ }
  's
  if$
}

FUNCTION {format.lab.names}
{ 's :=                                  % for two: (Jones/de~Bruijn)
   s #1 "{vv~}{ll}" format.name$         % for three: (Jones/de~Bruijn/Smith)
   s num.names$ duplicate$               % for more: (Jones et\,al.)
   #2 <
   'pop$                                 % for just one person
   { duplicate$ duplicate$
     #3 >
%     ^--- here we can determine the appearence of `et\,al.' for the _label_
     swap$ s swap$ "{ff }{vv }{ll}{ jj}" format.name$ "others" =
     or
     { pop$ "\Bibetal" * }              % for 4 or more, or last is `others'
     { #2 =
       {  "\jbbtasep " * s #2 "{vv~}{ll}" format.name$ * } % for (exactly) two
       { "\jbbfsasep " * s #2 "{vv~}{ll}" format.name$ *   % for three
         "\jbbstasep " * s #3 "{vv~}{ll}" format.name$ *
       }
       if$
     }
     if$
   }
   if$
% reintroduced in 0.51r
   year missing$
      'skip$
      { "\jbdy {" year * "}" * * }% dummy year to prevent from `1993a' and `2001b' for works by the same author
   if$
}

FUNCTION {format.editor.lab.names}
{ 's :=                                  % for two: (Jones/de~Bruijn)
  s #1 "{vv~}{ll}" format.name$         % for three: (Jones/de~Bruijn/Smith)
  s num.names$ duplicate$               % for more: (Jones et\,al.)
  #2 <
  'pop$                                 % for just one person
  { duplicate$ duplicate$
    #3 >
%    ^--- here we can determine the appearence of `et\,al.' for the _label_
    swap$ s swap$ "{ff }{vv }{ll}{ jj}" format.name$ "others" =
    or
    { pop$ "\Bibetal" * }              % for 4 or more, or last is `others'
    { #2 =
      {  "\jbbtesep " * s #2 "{vv~}{ll}" format.name$ * } % for (exactly) two
      { "\jbbfsesep " * s #2 "{vv~}{ll}" format.name$ *   % for three
        "\jbbstesep " * s #3 "{vv~}{ll}" format.name$ *
      }
      if$
    }
    if$
  }
  if$
% reintroduced in 0.51r
  year missing$
      'skip$
     { "\jbdy {" year * "}" * * }% dummy year to prevent from `1993a' and `2001b' for works by the same author
  if$
}

FUNCTION {author.key.label}
{ author empty$
  { key empty$
    { cite$ #1 #3 substring$ }
      'key
    if$
  }
  { author format.lab.names }
  if$
}

FUNCTION {author.editor.key.label}
{ author empty$
  { editor empty$
    { key empty$
      { cite$ #1 #3 substring$ }
        'key
      if$
    }
    { editor format.editor.lab.names }
    if$
  }
  { author format.lab.names }
  if$
}

FUNCTION {editor.key.label}
{ editor empty$
  { key empty$
    { cite$ #1 #3 substring$ }
      'key
    if$
  }
  { editor format.editor.lab.names }
  if$
}

FUNCTION {calc.label}
{ type$ "book" = type$ "inbook" = or type$ "incollection" = or type$ "commented" = or type$ "lexicon" = or
  'author.editor.key.label
  { type$ "proceedings" =
    'editor.key.label
    'author.key.label
    if$
  }
  if$
  'label :=
}

FUNCTION {calc.dummy.label}
{ type$ "book" = type$ "inbook" = or type$ "incollection" = or type$ "commented" = or
  'author.editor.key.label
  { type$ "proceedings" =
    'editor.key.label
    'author.key.label
    if$
  }
  if$
  'dummy.label :=
}

FUNCTION {sort.format.names}
{ 's :=
  #1 'nameptr :=
  ""
  s num.names$ 'numnames :=
  numnames 'namesleft :=
  { namesleft #0 > }
  { nameptr #1 >
  { "   " * }
  'skip$
    if$
    s nameptr "{ll{ }}{  ff{ }}{ vv{ }}{  jj{ }}" format.name$ 't :=
    nameptr numnames = t "\bibnf {others} {} {} {} {}" = and
  { "\Bibetal" * }
  { t sortify * }
    if$
    nameptr #1 + 'nameptr :=
    namesleft #1 - 'namesleft :=
  }
  while$
}

FUNCTION {sort.format.title}
{ 't :=
  "A " #2
  "An " #3
    "Der " #4
    "Die " #4
      "Das " #4
      "Ein " #4
        "Eine " #5
          "The " #4 t chop.word
         chop.word
       chop.word
       chop.word
     chop.word
     chop.word
  chop.word
  chop.word
  sortify
  #1 global.max$ substring$
}

FUNCTION {author.sort}
{ author empty$
  { key empty$
  {
%%    "to sort, need author or key in " cite$ * warning$
    ""
  }
  { key sortify }
    if$
  }
  { author sort.format.names }
  if$
}

FUNCTION {author.editor.sort}
{ author empty$
  { editor empty$
  { key empty$
    {
%%        "to sort, need author, editor, or key in " cite$ * warning$
      ""
    }
    { key sortify }
    if$
  }
  { editor sort.format.names }
    if$
  }
  { author sort.format.names }
  if$
}

FUNCTION {editor.sort}
{ editor empty$
  { key empty$
    { "to sort, need editor or key in " cite$ * warning$ "" }
    { key sortify }
    if$
  }
  { editor sort.format.names }
  if$
}

FUNCTION {presort}
{ calc.label
  calc.dummy.label
%<*jurabst|jurecobst&!jurunsrt>
  sortkey empty$
     { type$ "book" =
         type$ "incollection" =    or
           type$ "inbook" =        or
              type$ "commented" =  or
            'author.editor.sort
            { type$ "proceedings" =
                'editor.sort
                'author.sort
              if$
            }
        if$
     }
     { 
       sortkey 
% REMOVED 0.52n, sortkey should be used as is!
%       sort.format.names 
     }
  if$
  "    "
  *
  year field.or.null sortify
  *
  "    "
  *
  title field.or.null
  sort.format.title
  *
  #1 entry.max$ substring$
  'sort.key$ :=
%</jurabst|jurecobst&!jurunsrt>  
}

ITERATE {presort}

%% FUNCTION {before.sort} { "BEFORE SORT:" top$ }
%% EXECUTE {before.sort}
%% FUNCTION {print.sort.keys} {sort.key$ top$}
%% ITERATE {print.sort.keys}

%<*jurabst|jurecobst&!jurunsrt>
SORT
%</jurabst|jurecobst&!jurunsrt>

%% FUNCTION {after.sort} {"AFTER SORT:" top$}
%% EXECUTE {after.sort}
%% ITERATE {print.sort.keys}

%  <*jurecobst>
STRINGS { last.dummy.label next.extra }

INTEGERS { last.extra.num number.label }

FUNCTION {forward.pass}
{ last.dummy.label dummy.label =
    { last.extra.num #1 + 'last.extra.num :=
      last.extra.num int.to.chr$ 'extra.label :=
    }
    { "a" chr.to.int$ 'last.extra.num :=
      "" 'extra.label :=
      dummy.label 'last.dummy.label :=
    }
  if$
  number.label #1 + 'number.label :=
}

FUNCTION {reverse.pass}
{ next.extra "b" =
    { "a" 'extra.label := }
    'skip$
  if$
  extra.label 'next.extra :=
  extra.label
  duplicate$ empty$
    'skip$
    { "" swap$ * }
  if$
  'extra.label :=
  dummy.label extra.label * 'dummy.label :=
}

ITERATE {forward.pass}

REVERSE {reverse.pass}
% </jurecobst>

FUNCTION {set.current.authors}
{ author empty$
  { editor empty$
    { organization empty$
      { cite$ 'current-authors := }
      { organization 'current-authors := }
      if$
    }
    { editor format.names #1 entry.max$ substring$ 'current-authors := }
%%           ^^^^^^^^^^^^ NOT format.editor.names, otherwise \jb@@arg is always = 0!!!
    if$
  }
  { author format.names #1 entry.max$ substring$ 'current-authors := }
  if$
}

%FUNCTION {set.current.titles}
%{ title empty$
%      'skip$
%      { title 'current-titles := }
%  if$
%}

STRINGS { previous-authors 
%          previous-titles 
        }

FUNCTION {initialize.previous.authors} { "" 'previous-authors := }

% FUNCTION {initialize.previous.titles} { "" 'previous-titles := }

FUNCTION {mark.repeat.authors}
{ current-authors previous-authors =
  { #1 'repeat-authors := }
  'skip$
  if$
  current-authors 'previous-authors :=
}

%FUNCTION {mark.repeat.titles}
%{ current-titles previous-titles =
%  { #1 'repeat-titles := }
%  'skip$
%  if$
%  current-titles 'previous-titles :=
%}

ITERATE {set.current.authors}
% ITERATE {set.current.titles}

EXECUTE {initialize.previous.authors}
% EXECUTE {initialize.previous.titles}

ITERATE {mark.repeat.authors}
% ITERATE {mark.repeat.titles}

EXECUTE {initialize.previous.authors}
% EXECUTE {initialize.previous.titles}

REVERSE {mark.repeat.authors}
% REVERSE {mark.repeat.titles}

FUNCTION {begin.bib}
{ preamble$ empty$
    'skip$
    { preamble$ write$ newline$ }
  if$
  "%" write$ newline$
%<*jurecobst>
  "% This bibliography was produced by using jureco.bst" write$ newline$
%</jurecobst>
%<*jurabst|jurunsrt>
  "% This bibliography was produced by using jurabib.bst" write$ newline$
%</jurabst|jurunsrt>
  "%" write$ newline$
  "\begin{thebibliography}{}" write$ newline$
}

EXECUTE {begin.bib}

EXECUTE {init.state.consts}

ITERATE {call.type$}

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

EXECUTE {end.bib}
%</jurabst|jurecobst|jurunsrt>
%<*german>
\ProvidesFile{dejbbib.ldf}[jurabib German language definitions]
\def\bibsgerman{%
    \def\etalname{\unskip\nobreakspace{}et\,al.}%
    \def\etalnamenodot{\unskip\nobreakspace{}et\,al}%
    \def\bibandname{und}%
    \def\textandname{\bibandname}%
    \def\commaname{,}%
    \def\bibeandname{und}%
    \def\texteandname{\bibeandname}%
    \def\commaename{,}%
    \def\inname{\ifjboxford in:\else\ifjbchicago in\else In\fi\fi}%
    \def\incollinname{\ifjboxford in:\else\ifjbchicago in\else In\fi\fi}%
    \def\ofseriesname{der Reihe}%
    \def\volumeofname{von}%
    \def\inseriesname{in}%
    \def\editorname{(Hrsg.)}%
    \def\editorsname{(Hrsg.)}%
    \def\sndeditorname{(Hrsg.)}%
    \def\sndeditorsname{(Hrsg.)}%
    \def\edbyname{hrsg. v.}%
    \def\Edbyname{Hrsg. v.}%
    \def\byname{v.}%
    \def\volname{Bd.}%
    \def\volumename{Band}%
    \def\Volumename{Band}%
    \def\numbername{Nummer}%
    \def\editionname{Auf\/lage}%
    \def\bibchaptername{Kap.}%
    \def\Bibchaptername{Kap.}%
    \def\bibchapterlongname{Kapitel}%
    \def\jbpagename{S.}%
    \def\jbpagesname{S.}%
    \def\bibpagename{S.}%
    \def\bibpagesname{S.}%
    \def\bibtotalpagesname{Seiten}%
    \def\jbpagenamenodot{}%
    \def\mastersthesisname{Diplomarbeit}%
    \def\phdthesisname{Dissertation}%
    \def\jurthesisname{Jur. Diss.}%
    \def\alsothesisname{zugl.}%
    \def\technicalreportname{Technischer Bericht}%
    \def\organizationname{\unskip, \textup{Veranst.}}%
    \def\janname{Januar}%
    \def\febname{Februar}%
    \def\marname{M{\"a}rz}%
    \def\aprname{April}%
    \def\mayname{Mai}%
    \def\junname{Juni}%
    \def\julname{Juli}%
    \def\augname{August}%
    \def\sepname{September}%
    \def\octname{Oktober}%
    \def\novname{November}%
    \def\decname{Dezember}%
    \def\firstedname{1.}%
    \def\secondedname{2.}%
    \def\thirdedname{3.}%
    \def\fourthedname{4.}%
    \def\fifthedname{5.}%
    \def\thedname{.}%
    \def\urldatecomment{Zugriff am }%
    \def\howcitedprefix{(zitiert: }%
    \def\howcitedsuffix{)}%
    \def\lookatprefix{(Anm.~}%
    \def\lookatsuffix{)}%
    \def\ibidemname{A.\,a.\,O\kern-1.2pt.}%
    \def\ibidemmidname{a.\,a.\,O\kern-1.2pt.}%
    \def\idemname{Ders.}%
    \def\idemmidname{ders.}%
    \def\ajtsep{}%
    \def\bibcontinuedname{(Forts.)}%
    \def\idemSmname{Ders.}\def\idemsmname{ders.}%
    \def\idemPmname{Dies.}\def\idempmname{dies.}%
    \def\idemSfname{Dies.}\def\idemsfname{dies.}%
    \def\idemPfname{Dies.}\def\idempfname{dies.}%
    \def\idemSnname{Dass.}\def\idemsnname{dass.}%
    \def\idemPnname{Dies.}\def\idempnname{dies.}%
    \def\idemSmedbyname{Demselben}\def\idemsmedbyname{demselben}%
    \def\idemPmedbyname{Denselben}\def\idempmedbyname{denselben}%
    \def\idemSfedbyname{Derselben}\def\idemsfedbyname{derselben}%
    \def\idemPfedbyname{Denselben}\def\idempfedbyname{denselben}%
    \def\idemSnedbyname{Demselben}\def\idemsnedbyname{demselben}%
    \def\idemPnedbyname{Denselben}\def\idempnedbyname{denselben}%    
    \jbidemabbrvwithperiodtrue
    \def\bibidemSmname{Derselbe}\def\bibidemsmname{derselbe}%
    \def\bibidemPmname{Dieselben}\def\bibidempmname{dieselben}%
    \def\bibidemSfname{Dieselbe}\def\bibidemsfname{dieselbe}%
    \def\bibidemPfname{Dieselben}\def\bibidempfname{dieselben}%
    \def\bibidemSnname{Dasselbe}\def\bibidemsnname{dasselbe}%
    \def\bibidemPnname{Dieselben}\def\bibidempnname{dieselben}%
    \def\trans{\ifjbweareinbib"ubers.\else\ifjboxford"ubers.\else\ifjbchicago"ubers.\else"Ubers.\fi\fi\fi}%
    \def\transfrom{aus dem}%
    \def\Transfrom{Aus dem}%
    \def\transby{von}%
    \def\fromgerman{Deutschen}%
    \def\fromenglish{Englischen}%
    \def\fromfrench{Franz{\"o}sischen}%
    \def\fromdutch{Holl{\"a}ndischen}%
    \def\fromspanish{Spanischen}%
    \def\fromitalian{Italienischen}%
    \def\fromnorsk{Norwegischen}%
    \def\Reprint{Nachdruck}%
    \def\reprint{Nachdruck}%
    \def\updatesep{,}%
    \def\updatename{Stand:}%   
    \def\herename{hier:~}%     
    \def\foundername{\space\edfont{(Begr.)}}%
    \def\afterfoundersep{\slash}%
    \def\jbmakeindexactual{=}%
    \addtoalllanguages%
}%
%</german>
%<*english>
\ProvidesFile{enjbbib.ldf}[jurabib English language definitions]
\def\bibsenglish{%
    \def\etalname{\unskip\nobreakspace{}et\,al.}%
    \def\etalnamenodot{\unskip\nobreakspace{}et\,al}%
    \def\bibandname{and}%
    \def\textandname{\bibandname}%
    \def\commaname{,}%
    \def\bibeandname{and}%
    \def\texteandname{\bibeandname}%
    \def\commaename{,}%
    \def\inname{\ifjboxford in:\else\ifjbchicago in\else In\fi\fi}%
    \def\incollinname{\ifjboxford in:\else\ifjbchicago in\else In\fi\fi}%
    \def\ofseriesname{of}%
    \def\volumeofname{of}%
    \def\inseriesname{in}%
    \def\editorname{\unskip,\space{}editor}%
    \def\editorsname{\unskip,\space{}editors}%
    \def\sndeditorname{editor}%
    \def\sndeditorsname{editors}%
    \def\edbyname{edited by}%
    \def\Edbyname{Edited by}%
    \def\byname{by}%    
    \def\volname{vol.}%    
    \def\volumename{volume}%
    \def\Volumename{Volume}%
    \def\numbername{number}%
    \def\editionname{edition}%
    \def\bibchaptername{chap.}%
    \def\Bibchaptername{Chap.}%
    \def\bibchapterlongname{chapter}%
    \def\jbpagename{p.}%
    \def\jbpagesname{pp.}%
    \def\bibpagename{p.}%
    \def\bibpagesname{pp.}%
    \def\bibtotalpagesname{pages}%
    \def\jbpagenamenodot{p}%
    \def\alsothesisname{also}%
    \def\phdthesisname{Ph.\,D thesis}%
    \def\mastersthesisname{Master's thesis}%
    \def\jurthesisname{diss. jur.}%
    \def\technicalreportname{Technical report}%
    \def\organizationname{\textup{(Org.)}}%
    \def\janname{January}%
    \def\febname{February}%
    \def\marname{March}%
    \def\aprname{April}%
    \def\mayname{May}%
    \def\junname{June}%
    \def\julname{July}%
    \def\augname{August}%
    \def\sepname{September}%
    \def\octname{October}%
    \def\novname{November}%
    \def\decname{December}%
    \def\firstedname{1st}%
    \def\secondedname{2nd}%
    \def\thirdedname{3rd}%
    \def\fourthedname{4th}%
    \def\fifthedname{5th}%
    \def\thedname{th}%
    \def\urldatecomment{visited on }%
    \def\howcitedprefix{(cited: }%
    \def\howcitedsuffix{)}%
    \def\lookatprefix{(as in n.~}%
    \def\lookatsuffix{)}%
    \def\ibidemname{Ibid.}%
    \def\ibidemmidname{ibid.}%
    \def\idemname{Idem}%
    \def\idemmidname{idem}%
    \def\ajtsep{}%
    \def\bibcontinuedname{(cont.)}%
    \def\idemSmname{\idemname}\def\idemsmname{\idemmidname}\def\idemPmname{\idemname}
    \def\idempmname{\idemmidname}\def\idemSfname{\idemname}\def\idemsfname{\idemmidname}%
    \def\idemPfname{\idemname}\def\idempfname{\idemmidname}\def\idemSnname{\idemname}%
    \def\idemsnname{\idemmidname}\def\idemPnname{\idemname}\def\idempnname{\idemmidname}%
    \def\idemSmedbyname{\idemname}\def\idemsmedbyname{\idemmidname}\def\idemPmedbyname{\idemname}%
    \def\idempmedbyname{\idemmidname}\def\idemSfedbyname{\idemname}\def\idemsfedbyname{\idemmidname}%
    \def\idemPfedbyname{\idemname}\def\idempfedbyname{\idemmidname}\def\idemSnedbyname{\idemname}%
    \def\idemsnedbyname{\idemmidname}\def\idemPnedbyname{\idemname}\def\idempnedbyname{\idemmidname}%    
    \def\bibidemSmname{\idemname}\def\bibidemsmname{\idemmidname}\def\bibidemPmname{\idemname}%
    \def\bibidempmname{\idemmidname}\def\bibidemSfname{\idemname}\def\bibidemsfname{\idemmidname}%
    \def\bibidemPfname{\idemname}\def\bibidempfname{\idemmidname}\def\bibidemSnname{\idemname}%
    \def\bibidemsnname{\idemmidname}\def\bibidemPnname{\idemname}\def\bibidempnname{\idemmidname}%
    \def\trans{\ifjbweareinbib trans.\else\ifjboxford trans.\else\ifjbchicago trans.\else Trans.\fi\fi\fi}%
    \def\transfrom{from the}%
    \def\Transfrom{From the}%
    \def\transby{by}%
    \def\fromgerman{German}%
    \def\fromenglish{English}%
    \def\fromfrench{French}%
    \def\fromdutch{Dutch}%
    \def\fromspanish{Spanish}%
    \def\fromitalian{Italian}%
    \def\fromnorsk{Norwegian}%
    \def\Reprint{Reprint}%
    \def\reprint{reprint}%
    \def\updatesep{,}%
    \def\updatename{last update:}%
    \def\herename{here:~}%
    \def\foundername{\space\edfont{(TO DO)}}%
    \def\afterfoundersep{\slash}%
    \addtoalllanguages%
}%
%</english>
%<*dutch>
\ProvidesFile{dujbbib.ldf}[jurabib Dutch language definitions]
\def\bibsdutch{%
    \def\etalname{\unskip\nobreakspace{}et\,al.}%
    \def\etalnamenodot{\unskip\nobreakspace{}et\,al}%
    \def\bibandname{en}%
    \def\textandname{\bibandname}%
    \def\commaname{,}%
    \def\bibeandname{en}%
    \def\texteandname{\bibeandname}%
    \def\commaename{,}%
    \def\inname{in}%
    \def\incollinname{\ifjbchicago in\else in:\fi}%
    \def\ofseriesname{van}%
    \def\volumeofname{van}%
    \def\inseriesname{in}%
    \def\editorname{(red.)}%
    \def\editorsname{(red.)}%
    \def\sndeditorname{(red.)}%
    \def\sndeditorsname{(red.)}%
    \def\edbyname{onder redactie van}%
    \def\Edbyname{Onder redactie van}%
    \def\byname{van}%
    \def\volname{deel}%
    \def\volumename{deel}%
    \def\Volumename{deel}%
    \def\numbername{nr.}%
    \def\editionname{druk}%
    \def\bibchaptername{H.}%
    \def\Bibchaptername{H.}%
    \def\bibchapterlongname{Hoofdstuk}%
    \def\jbpagename{blz.}%
    \def\jbpagesname{blz.}%
    \def\bibpagename{blz.}%
    \def\bibpagesname{blz.}%
    \def\bibtotalpagesname{pages}% TODO
    \def\jbpagenamenodot{}%
    \def\mastersthesisname{Scriptie}%
    \def\phdthesisname{Proefschrift}%
    \def\jurthesisname{diss. jur.}% ???
    \def\alsothesisname{ook}%
    \def\technicalreportname{Technisch rapport}%
    \def\organizationname{\unskip, \textup{Oorspr.}}%
    \def\janname{januari}%
    \def\febname{februari}%
    \def\marname{maart}%
    \def\aprname{april}%
    \def\mayname{mei}%
    \def\junname{juni}%
    \def\julname{juli}%
    \def\augname{augustus}%
    \def\sepname{september}%
    \def\octname{oktober}%
    \def\novname{november}%
    \def\decname{december}%
    \def\firstedname{eerste}%
    \def\secondedname{tweede}%
    \def\thirdedname{derde}%
    \def\fourthedname{3\textsuperscript{e}}%
    \def\fifthedname{4\textsuperscript{e}}%
    \def\thedname{\textsuperscript{e}}%
    \def\urldatecomment{bezocht op }%
    \def\howcitedprefix{(geciteerd: }%
    \def\howcitedsuffix{)}%
    \def\lookatprefix{(zie voetnoot~}%
    \def\lookatsuffix{)}%
    \def\ibidemname{Ibid.}%
    \def\ibidemmidname{ibid.}%
    \def\idemname{Idem}%
    \def\idemmidname{idem}%
    \def\ajtsep{}%
    \def\bibcontinuedname{(cont.)}%
    \def\idemSmname{\idemname}\def\idemsmname{\idemmidname}\def\idemPmname{\idemname}
    \def\idempmname{\idemmidname}\def\idemSfname{\idemname}\def\idemsfname{\idemmidname}%
    \def\idemPfname{\idemname}\def\idempfname{\idemmidname}\def\idemSnname{\idemname}%
    \def\idemsnname{\idemmidname}\def\idemPnname{\idemname}\def\idempnname{\idemmidname}%
    \def\idemSmedbyname{\idemname}\def\idemsmedbyname{\idemmidname}\def\idemPmedbyname{\idemname}%
    \def\idempmedbyname{\idemmidname}\def\idemSfedbyname{\idemname}\def\idemsfedbyname{\idemmidname}%
    \def\idemPfedbyname{\idemname}\def\idempfedbyname{\idemmidname}\def\idemSnedbyname{\idemname}%
    \def\idemsnedbyname{\idemmidname}\def\idemPnedbyname{\idemname}\def\idempnedbyname{\idemmidname}%    
    \def\bibidemSmname{\idemname}\def\bibidemsmname{\idemmidname}\def\bibidemPmname{\idemname}%
    \def\bibidempmname{\idemmidname}\def\bibidemSfname{\idemname}\def\bibidemsfname{\idemmidname}%
    \def\bibidemPfname{\idemname}\def\bibidempfname{\idemmidname}\def\bibidemSnname{\idemname}%
    \def\bibidemsnname{\idemmidname}\def\bibidemPnname{\idemname}\def\bibidempnname{\idemmidname}%
    \def\trans{\ifjbweareinbib trans.\else\ifjboxford trans.\else\ifjbchicago trans.\else Trans.\fi\fi\fi}%
    \def\transfrom{vanuit het}%
    \def\Transfrom{Vanuit het}%
    \def\transby{door}%
    \def\fromgerman{Duits}%
    \def\fromenglish{Engels}%
    \def\fromfrench{Frans}%
    \def\fromdutch{Nederlands}%
    \def\fromspanish{TO DO}%
    \def\fromitalian{TO DO}%
    \def\fromnorsk{TO DO}%    
    \def\Reprint{Herdruk}%
    \def\reprint{herdruk}%
    \def\updatesep{,}%
    \def\updatename{Stand:}%
    \def\herename{TO DO}%
    \def\foundername{\space\edfont{(TO DO)}}% Founder of a series
    \def\afterfoundersep{\slash}%
    \addtoalllanguages%
}%
%</dutch>
%<*french>
\ProvidesFile{frjbbib.ldf}[jurabib French language definitions]
\def\bibsfrench{%
    \def\etalname{\unskip\nobreakspace{}\texit{et\,al.}}%
    \def\etalnamenodot{\unskip\nobreakspace{}\texit{et\,al}}%
    \def\bibandname{et}%
    \def\textandname{\bibandname}%
    \def\commaname{,}%
    \def\bibeandname{et}%
    \def\texteandname{\bibeandname}%
    \def\commaename{,}%
    \def\inname{\ifjboxford dans :\else dans\fi}%
    \def\incollinname{\ifjboxford dans :\else dans\fi}%
    \def\ofseriesname{,}%
    \def\volumeofname{de}%
    \def\inseriesname{dans}%
    \def\editorname{(\'ed.)}%
    \def\editorsname{(\'ed.)}%
    \def\sndeditorname{(\'ed.)}%
    \def\sndeditorsname{(\'ed.)}%
    \def\edbyname{publi\'e par}%
    \def\Edbyname{Publi\'e par}%
    \def\byname{par}%    
    \def\volname{vol.}%
    \def\volumename{volume}%
    \def\Volumename{Volume}%
    \def\numbername{n$^\circ$~}%
    \def\editionname{\'edition}%
    \def\bibchaptername{chap.}%
    \def\Bibchaptername{Chap.}%
    \def\bibchapterlongname{chapitre}%
    \def\jbpagename{p.}%
    \def\jbpagesname{p.}%
    \def\bibpagename{p.}%
    \def\bibpagesname{p.}%
    \def\bibtotalpagesname{pages}% TODO    
    \def\jbpagenamenodot{p}%
    \def\alsothesisname{tir\'e de :}%
    \def\mastersthesisname{DEA}%
    \def\phdthesisname{Th\`ese de doctorat}%
    \def\jurthesisname{Th\`ese de droit}%
    \def\technicalreportname{Rapport technique}%
    \def\organizationname{}%
    \def\janname{janvier}%
    \def\febname{f\'evrier}%
    \def\marname{mars}%
    \def\aprname{avril}%
    \def\mayname{mai}%
    \def\junname{juin}%
    \def\julname{juillet}%
    \def\augname{ao\^ut}%
    \def\sepname{septembre}%
    \def\octname{octobre}%
    \def\novname{novembre}%
    \def\decname{d\'ecembre}%
    \def\firstedname{1\textsuperscript{er}}%
    \def\secondedname{2\textsuperscript{e}}%
    \def\thirdedname{3\textsuperscript{e}}%
    \def\fourthedname{4\textsuperscript{e}}%
    \def\fifthedname{5\textsuperscript{e}}%
    \def\thedname{\textsuperscript{e}}%
    \def\urldatecomment{visit\'e le }%
    \def\howcitedprefix{(cit\'e dans : }%
    \def\howcitedsuffix{)}%
    \def\lookatprefix{(cf. n$^\circ$~}%
    \def\lookatsuffix{)}%
    \def\ibidemname{\textit{Ibid.}}%
    \def\ibidemmidname{\textit{ibid.}}%
    \def\idemname{\textit{Idem}}%
    \def\idemmidname{\textit{idem}}%
    \def\ajtsep{,}%
    \def\bibcontinuedname{(cont.)}%
    \def\idemSmname{\idemname}\def\idemsmname{\idemmidname}\def\idemPmname{\idemname}
    \def\idempmname{\idemmidname}\def\idemSfname{\idemname}\def\idemsfname{\idemmidname}%
    \def\idemPfname{\idemname}\def\idempfname{\idemmidname}\def\idemSnname{\idemname}%
    \def\idemsnname{\idemmidname}\def\idemPnname{\idemname}\def\idempnname{\idemmidname}%
    \def\idemSmedbyname{\idemname}\def\idemsmedbyname{\idemmidname}\def\idemPmedbyname{\idemname}%
    \def\idempmedbyname{\idemmidname}\def\idemSfedbyname{\idemname}\def\idemsfedbyname{\idemmidname}%
    \def\idemPfedbyname{\idemname}\def\idempfedbyname{\idemmidname}\def\idemSnedbyname{\idemname}%
    \def\idemsnedbyname{\idemmidname}\def\idemPnedbyname{\idemname}\def\idempnedbyname{\idemmidname}%    
    \def\bibidemSmname{\idemname}\def\bibidemsmname{\idemmidname}\def\bibidemPmname{\idemname}%
    \def\bibidempmname{\idemmidname}\def\bibidemSfname{\idemname}\def\bibidemsfname{\idemmidname}%
    \def\bibidemPfname{\idemname}\def\bibidempfname{\idemmidname}\def\bibidemSnname{\idemname}%
    \def\bibidemsnname{\idemmidname}\def\bibidemPnname{\idemname}\def\bibidempnname{\idemmidname}%
    \def\trans{\ifjbweareinbib traduit\else\ifjboxford traduit\else\ifjbchicago traduit\else Traduit\fi\fi\fi}%
    \def\transfrom{\unskip\unskip\space}%
    \def\Transfrom{\unskip\unskip\space}%
    \def\transby{par}%
    \def\fromgerman{de l'allemand}%
    \def\fromenglish{de l'anglais}%
    \def\fromfrench{du français}%
    \def\fromdutch{du n\'eerlandais}%
    \def\fromspanish{de l'espagnol}%
    \def\fromitalian{de l'italien}%
    \def\fromnorsk{du norv\'egien}%
    \def\Reprint{R\'e\'edition}%
    \def\reprint{r\'e\'edition}%
    \def\updatesep{,}%
    \def\updatename{derni\`ere mise \`a jour:}%
    \def\herename{TO DO}%
    \def\foundername{\space\edfont{(TO DO)}}% Founder of a series
    \def\afterfoundersep{\slash}%
    \addtoalllanguages%
}%
%</french>
%<*spanish>
\ProvidesFile{spjbbib.ldf}[jurabib Spanish language definitions]
\def\bibsspanish{%
    \def\etalname{\textit{\unskip\nobreakspace{}et\,al.}}%
    \def\etalnamenodot{\textit{\unskip\nobreakspace{}et\,al}}%
    \def\bibandname{y}%
    \def\textandname{\bibandname}%
    \def\commaname{,}%
    \def\bibeandname{y}%
    \def\texteandname{\bibeandname}%
    \def\commaename{,}%
    \def\inname{\ifjboxford en:\else\ifjbchicago en\else En\fi\fi}%
    \def\incollinname{\ifjboxford en:\else\ifjbchicago en\else En\fi\fi}%
    \def\ofseriesname{de la colecci\'on}%
    \def\volumeofname{de}%
    \def\inseriesname{en}%
    \def\editorname{\unskip,\space{}director}%
    \def\editorsname{\unskip,\space{}directores}%
    \def\sndeditorname{director}%
    \def\sndeditorsname{directores}%
    \def\edbyname{dirigido por}%
    \def\Edbyname{Dirigido por}%
%    \def\editorname{(ed.)}%
%    \def\editorsname{(eds.)}%
%    \def\sndeditorname{(ed.)}%
%    \def\sndeditorsname{(eds.)}%
%    \def\edbyname{editado por}%
%    \def\Edbyname{Editado por}%
    \def\byname{por}%
    \def\volname{vol.}%    
    \def\volumename{volumen}%
    \def\Volumename{Volumen}%
    \def\numbername{n\'umero}%    
    \def\editionname{ed\/ici\'on}%
    \def\bibchaptername{cap.}%
    \def\Bibchaptername{Cap.}%
    \def\bibchapterlongname{Cap\'itulo}%
    \def\jbpagename{p\'ag.}%
    \def\jbpagesname{p\'ags.}%
    \def\jbpagenamenodot{p\'ag}%
    \def\bibpagename{p\'ag.}%
    \def\bibpagesname{p\'ags.}%
%    \def\jbpagename{p.}%
%    \def\jbpagesname{pp.}%
%    \def\jbpagenamenodot{p}%
%    \def\bibpagename{p.}%
%    \def\bibpagesname{pp.}%
    \def\bibtotalpagesname{p\'aginas}%
%    \def\bibtotalpagesname{pages}%
    \def\mastersthesisname{Proyecto Fin de Carrera}%
%    \def\mastersthesisname{Tesis de Licenciatura}%
    \def\phdthesisname{Tesis Doctoral}%
    \def\jurthesisname{Tesis Doctoral}%
%    \def\jurthesisname{diss. jur.}%
    \def\alsothesisname{tambi\'en como}%    
    \def\technicalreportname{Informe t\'ecnico}%
    \def\organizationname{Organizaci\'on}%
    \def\janname{enero}%
    \def\febname{febrero}%
    \def\marname{marzo}%
    \def\aprname{abril}%
    \def\mayname{mayo}%
    \def\junname{junio}%
    \def\julname{julio}%
    \def\augname{agosto}%
    \def\sepname{septiembre}%
    \def\octname{octubre}%
    \def\novname{noviembre}%
    \def\decname{diciembre}%
    \def\firstedname{1.\textsuperscript{a}}%
    \def\secondedname{2.\textsuperscript{a}}%
    \def\thirdedname{3.\textsuperscript{a}}%
    \def\fourthedname{4.\textsuperscript{a}}%
    \def\fifthedname{5.\textsuperscript{a}}%
    \def\thedname{.\textsuperscript{a}}%
    \def\urldatecomment{visitado el }%
%    \def\howcitedprefix{(citado como: }%
    \def\howcitedprefix{(citado en: }%
    \def\howcitedsuffix{)}%
    \def\lookatprefix{(v\'ease nota~}%
    \def\lookatsuffix{)}%
    \def\ibidemname{Ibíd.}%
    \def\ibidemmidname{ibíd.}%
    \def\idemname{Ídem}%
    \def\idemmidname{ídem}%
%    \def\ibidemname{Ibid.}%
%    \def\ibidemmidname{ibid.}%
%    \def\idemname{Idem}%
%    \def\idemmidname{idem}%
    \def\ajtsep{,}%
    \def\bibcontinuedname{(cont.)}%
    \def\idemSmname{\idemname}\def\idemsmname{\idemmidname}\def\idemPmname{\idemname}
    \def\idempmname{\idemmidname}\def\idemSfname{\idemname}\def\idemsfname{\idemmidname}%
    \def\idemPfname{\idemname}\def\idempfname{\idemmidname}\def\idemSnname{\idemname}%
    \def\idemsnname{\idemmidname}\def\idemPnname{\idemname}\def\idempnname{\idemmidname}%
    \def\idemSmedbyname{\idemname}\def\idemsmedbyname{\idemmidname}\def\idemPmedbyname{\idemname}%
    \def\idempmedbyname{\idemmidname}\def\idemSfedbyname{\idemname}\def\idemsfedbyname{\idemmidname}%
    \def\idemPfedbyname{\idemname}\def\idempfedbyname{\idemmidname}\def\idemSnedbyname{\idemname}%
    \def\idemsnedbyname{\idemmidname}\def\idemPnedbyname{\idemname}\def\idempnedbyname{\idemmidname}%    
    \def\bibidemSmname{\idemname}\def\bibidemsmname{\idemmidname}\def\bibidemPmname{\idemname}%
    \def\bibidempmname{\idemmidname}\def\bibidemSfname{\idemname}\def\bibidemsfname{\idemmidname}%
    \def\bibidemPfname{\idemname}\def\bibidempfname{\idemmidname}\def\bibidemSnname{\idemname}%
    \def\bibidemsnname{\idemmidname}\def\bibidemPnname{\idemname}\def\bibidempnname{\idemmidname}%
    \def\trans{\ifjbweareinbib trad.\else\ifjboxford trad.\else\ifjbchicago trad.\else Trad.\fi\fi\fi}%
    \def\transfrom{del}%
    \def\Transfrom{Del}%
    \def\transby{por}%
    \def\fromgerman{alem\'an}%
    \def\fromenglish{ingl\'es}%
    \def\fromfrench{franc\'es}%
    \def\fromdutch{holand\'es}%
    \def\fromspanish{espa\~nol}%
    \def\fromitalian{italiano}%
    \def\fromnorsk{noruego}%
    \def\Reprint{Reimpresi\'on}%
    \def\reprint{reimpresi\'on}%
    \def\updatesep{,}%
    \def\updatename{\'ultima actualizaci\'on:}%
    \def\herename{aqu\'i:~}%
    \def\foundername{\space\edfont{(orig.)}}%
    \def\afterfoundersep{\slash}%
    \addtoalllanguages%
}%
%</spanish>
%<*italian>
\ProvidesFile{itjbbib.ldf}[jurabib Italian language definitions]
\def\bibsitalian{%
    \def\etalname{\unskip\nobreakspace{}et\,al.}%
    \def\etalnamenodot{\unskip\nobreakspace{}et\,al}%
    \def\bibandname{e}%
    \def\textandname{\bibandname}%
    \def\commaname{,}%
    \def\bibeandname{e}%
    \def\texteandname{\bibeandname}%
    \def\commaename{,}%
    \def\inname{\ifjboxford in:\else\ifjbchicago in\else In\fi\fi}%
    \def\incollinname{\ifjboxford in:\else\ifjbchicago in\else In\fi\fi}%
    \def\ofseriesname{della collana}%
    \def\volumeofname{de}%
    \def\inseriesname{in}%
    \def\editorname{(ed.)}%
    \def\editorsname{(eds.)}%
    \def\sndeditorname{(ed.)}%
    \def\sndeditorsname{(eds.)}%
    \def\edbyname{a cura di}%
    \def\Edbyname{A cura di}%
    \def\byname{di}%
    \def\volname{vol.}%
    \def\volumename{volume}%
    \def\Volumename{Volume}%
    \def\numbername{numero}%
    \def\editionname{ed\/izione}%
    \def\bibchaptername{cap.}%
    \def\Bibchaptername{Cap.}%
    \def\bibchapterlongname{Capitolo}%
    \def\jbpagename{p.}%
    \def\jbpagesname{pp.}%
    \def\bibpagename{p.}%
    \def\bibpagesname{pp.}% 
    \def\bibtotalpagesname{pages}% TODO    
    \def\jbpagenamenodot{p}%
    \def\mastersthesisname{Tesi di Laurea}%
    \def\phdthesisname{Tesi di dottorato}%
    \def\jurthesisname{diss. jur.}%
    \def\alsothesisname{anche}%
    \def\technicalreportname{Rapporto tecnico}%
    \def\organizationname{Organizzazione}%
    \def\janname{gennaio}%
    \def\febname{febbraio}%
    \def\marname{marzo}%
    \def\aprname{aprile}%
    \def\mayname{maggio}%
    \def\junname{giugno}%
    \def\julname{luglio}%
    \def\augname{agosto}%
    \def\sepname{settembre}%
    \def\octname{ottobre}%
    \def\novname{novembre}%
    \def\decname{dicembre}%
    \def\firstedname{1\textsuperscript{a}}%
    \def\secondedname{2\textsuperscript{a}}%
    \def\thirdedname{3\textsuperscript{a}}%
    \def\fourthedname{4\textsuperscript{a}}%
    \def\fifthedname{5\textsuperscript{a}}%
    \def\thedname{\textsuperscript{a}}%
    \def\urldatecomment{accesso a }%
    \def\howcitedprefix{(citato da: }%
    \def\howcitedsuffix{)}%
    \def\lookatprefix{(vedi nota~}%
    \def\lookatsuffix{)}%
    \def\ibidemname{Ibid.}%
    \def\ibidemmidname{ibid.}%
    \def\idemname{Idem}%
    \def\idemmidname{idem}%
    \def\ajtsep{,}%
    \def\bibcontinuedname{(cont.)}%
    \def\idemSmname{\idemname}\def\idemsmname{\idemmidname}\def\idemPmname{\idemname}
    \def\idempmname{\idemmidname}\def\idemSfname{\idemname}\def\idemsfname{\idemmidname}%
    \def\idemPfname{\idemname}\def\idempfname{\idemmidname}\def\idemSnname{\idemname}%
    \def\idemsnname{\idemmidname}\def\idemPnname{\idemname}\def\idempnname{\idemmidname}%
    \def\idemSmedbyname{\idemname}\def\idemsmedbyname{\idemmidname}\def\idemPmedbyname{\idemname}%
    \def\idempmedbyname{\idemmidname}\def\idemSfedbyname{\idemname}\def\idemsfedbyname{\idemmidname}%
    \def\idemPfedbyname{\idemname}\def\idempfedbyname{\idemmidname}\def\idemSnedbyname{\idemname}%
    \def\idemsnedbyname{\idemmidname}\def\idemPnedbyname{\idemname}\def\idempnedbyname{\idemmidname}%    
    \def\bibidemSmname{\idemname}\def\bibidemsmname{\idemmidname}\def\bibidemPmname{\idemname}%
    \def\bibidempmname{\idemmidname}\def\bibidemSfname{\idemname}\def\bibidemsfname{\idemmidname}%
    \def\bibidemPfname{\idemname}\def\bibidempfname{\idemmidname}\def\bibidemSnname{\idemname}%
    \def\bibidemsnname{\idemmidname}\def\bibidemPnname{\idemname}\def\bibidempnname{\idemmidname}%
    \def\trans{\ifjbweareinbib trad.\else\ifjboxford trad.\else\ifjbchicago trad.\else Trad.\fi\fi\fi}%
    \def\transfrom{dal}%
    \def\Transfrom{Dal}%
    \def\transby{da}%
    \def\fromgerman{tedesco}%
    \def\fromenglish{inglese}%
    \def\fromfrench{francese}%
    \def\fromdutch{olandese}%
    \def\fromspanish{spangolo}%
    \def\fromspanish{spagnolo}%
    \def\fromitalian{italiano}%
    \def\fromnorsk{norvegese}%    
    \def\Reprint{Ristampa}%
    \def\reprint{ristampa}%
    \def\updatesep{,}%
    \def\updatename{ultimo aggiornamento:}%
    \def\herename{TO DO}%
    \def\foundername{\space\edfont{(TO DO)}}% Founder of a series
    \def\afterfoundersep{\slash}%
    \addtoalllanguages%
}%
%</italian>
%<*norsk>
\ProvidesFile{itjbbib.ldf}[jurabib Norsk language definitions]
\def\bibsnorsk{%
    \def\etalname{\unskip\nobreakspace{}m.fl.}%
    \def\etalnamenodot{\unskip\nobreakspace{}m.fl}%
% At least at the Faculty of Law, University of Oslo, one is allowed to use 
% eihter et. al or ``m.fl'' or ``m.fl.''
    \def\bibandname{og}%
    \def\textandname{\bibandname}%
    \def\commaname{,}%
    \def\bibeandname{og}%
    \def\texteandname{\bibeandname}%
    \def\commaename{,}%
    \def\inname{\ifjboxford i:\else\ifjbchicago i\else I\fi\fi}%
    \def\incollinname{\ifjboxford i:\else\ifjbchicago i\else I\fi\fi}%
    \def\ofseriesname{of}%
    \def\volumeofname{of}%
    \def\inseriesname{i}%
%  I'm not sure about these.  In what context are \ofseriesname and \volumeofname used? 
    \def\editorname{\unskip,\space{}redaktør}%
    \def\editorsname{\unskip,\space{}redaktører}%
% editor causes some problems.  ''editor(s)'' -> ''redaktør(er)'' % Otherwise, 
% if the abbrev. ''ed'' or variation thereof, it should be ''red.''  
    \def\sndeditorname{redaktør}%
    \def\sndeditorsname{redaktører}%
% The same applies here, I guess.
    \def\edbyname{redigert av}%
    \def\Edbyname{Redigert av}%
    \def\byname{av}%
    \def\volname{bd.}%
    \def\volumename{bind}%
    \def\Volumename{Bind}%
% Is this meant as a reference to a ''two-book'' book?   If so, ''bd'', 
% ''bind'', ''Bind''.  However, if it refers to the number-of-years a 
% publication is issued in total, it should be ''årg.'', ''årgang'' and 
% ''Årgang''. 
    \def\numbername{nummer}%
    \def\editionname{utgave}%
    \def\bibchaptername{kap.}%
    \def\Bibchaptername{Kap.}%
    \def\bibchapterlongname{kapittel}%
    \def\jbpagename{s.}%
    \def\jbpagesname{sider}%
    \def\bibpagename{s.}%
    \def\bibpagesname{s.}%
    \def\bibtotalpagesname{sider}%
    \def\jbpagenamenodot{s}%
    \def\alsothesisname{også}%
    \def\phdthesisname{Doktorgradsavhandling}%
    \def\mastersthesisname{Hovedoppgave}%
    \def\jurthesisname{diss. jur.}%
    \def\technicalreportname{Teknisk rapport}%
    \def\organizationname{\textup{(Org.)}}%
    \def\janname{januar}%
    \def\febname{februar}%
    \def\marname{mars}% 
    \def\aprname{april}%
    \def\mayname{mai}%
    \def\junname{juni}%
    \def\julname{juli}%
    \def\augname{august}%
    \def\sepname{september}%
    \def\octname{oktober}%
    \def\novname{november}%
    \def\decname{desember}%
    \def\firstedname{1.}%
    \def\secondedname{2.}%
    \def\thirdedname{3.}%
    \def\fourthedname{4.}%
    \def\fifthedname{5.}%
    \def\thedname{.}%
    \def\urldatecomment{sjekket: }%
    \def\howcitedprefix{henv: }%
    \def\howcitedsuffix{)}%
    \def\lookatprefix{((Se note~}%
    \def\lookatsuffix{)}%
    \def\ibidemname{Ibid.}%
    \def\ibidemmidname{ibid.}%
    \def\idemname{Idem}%
    \def\idemmidname{idem}%
    \def\ajtsep{}%
    \def\bibcontinuedname{(forts.)}%
    \def\idemSmname{\idemname}\def\idemsmname{\idemmidname}\def\idemPmname{\idemname}
    \def\idempmname{\idemmidname}\def\idemSfname{\idemname}\def\idemsfname{\idemmidname}%
    \def\idemPfname{\idemname}\def\idempfname{\idemmidname}\def\idemSnname{\idemname}%
    \def\idemsnname{\idemmidname}\def\idemPnname{\idemname}\def\idempnname{\idemmidname}%
    \def\idemSmedbyname{\idemname}\def\idemsmedbyname{\idemmidname}\def\idemPmedbyname{\idemname}%
    \def\idempmedbyname{\idemmidname}\def\idemSfedbyname{\idemname}\def\idemsfedbyname{\idemmidname}%
    \def\idemPfedbyname{\idemname}\def\idempfedbyname{\idemmidname}\def\idemSnedbyname{\idemname}%
    \def\idemsnedbyname{\idemmidname}\def\idemPnedbyname{\idemname}\def\idempnedbyname{\idemmidname}%    
    \def\bibidemSmname{\idemname}\def\bibidemsmname{\idemmidname}\def\bibidemPmname{\idemname}%
    \def\bibidempmname{\idemmidname}\def\bibidemSfname{\idemname}\def\bibidemsfname{\idemmidname}%
    \def\bibidemPfname{\idemname}\def\bibidempfname{\idemmidname}\def\bibidemSnname{\idemname}%
    \def\bibidemsnname{\idemmidname}\def\bibidemPnname{\idemname}\def\bibidempnname{\idemmidname}%
    \def\trans{\ifjbweareinbib oversatt\else\ifjboxford oversatt\else\ifjbchicago oversatt\else Oversatt\fi\fi\fi}%
    \def\transfrom{fra}%
    \def\Transfrom{Fra}%
    \def\transby{av}%
    \def\fromgerman{tysk}%
    \def\fromenglish{engelsk}%
    \def\fromfrench{fransk}%
    \def\fromdutch{nederlandsk}%
    \def\fromspanish{spansk}%
    \def\fromitalian{italiensk}%
    \def\fromnorsk{norsk}%
    \def\Reprint{Opptrykk}%
    \def\reprint{opptrykk}%
    \def\updatesep{,}%
    \def\updatename{oppdatert senest:}%
    \def\herename{på}%
    \def\foundername{\space\edfont{(TO DO)}}% Founder of a series
    \def\afterfoundersep{\slash}%
    \addtoalllanguages%
}%
%</norsk>
%<*test|testbt>
\documentclass[12pt]{book}
\usepackage[latin1]{inputenc}
\usepackage[%
 authorformat=smallcaps,%
 %authorformat=italic,%
 %authorformat=dynamic,%
 %authorformat=citationreversed,%
 %authorformat=allreversed,%
 %authorformat=firstnotreversed,%
 %authorformat=reducedifibidem,%
 %authorformat=and,%
 %authorformat=year,%
 %authorformat=indexed,%
 %authorformat=abbrv,%
 %coauthorformat=italic,%
 %coauthorformat=normal,%
 %colastsep=divis,%
 %cofirstsep=in,%
 %cofirstsep=comma,%
 %titleformat=italic,%
 %titleformat=all,%
 %titleformat=commasep,%
 titleformat=colonsep,%
 %titleformat=noreplace,%
 commabeforerest=true,%
 %howcited=all,%
 %howcited=normal,%
 %howcited=compare,%
 %howcited=multiple,%
 %ibidem=strict,%
 %ibidem=strictdoublepage,%
 %ibidem=nostrict,%
 %ibidem=name,%
 %ibidem=name&title,%
 %ibidem=name&title&auto,%
 %citefull=first,%
 %citefull=chapter,%
 %citefull=section,%
 %citefull=all,%
 %bibformat=tabular,%
 %bibformat=nohang,%
 %bibformat=numbered,%
 %bibformat=ibidem,%
 %bibformat=ibidemalt,%
 %bibformat=compress,%
 %bibformat=raggedright,%
 %crossref=long,%
 %crossref=short,%
 %crossref=dynamic,%
 %superscriptedition=all,%
 %superscriptedition=switch,%
 %superscriptedition=commented,%
 %superscriptedition=bib,%
 %pages=always,%
 %pages=test,%
 %pages=format,%
 %see=true,%
 %lookat=true,%
 %human=true,%
 %oxford=true,%
 %chicago=true,%
 %edby=true,%
 %endnote=true,%
 %biblikecite=true,%
 %idem=strict,%
 %idem=strictdoublepage,%
 %idem=nostrict,%
 %opcit=true,%
 %opcit=chapter,%
 %opcit=section,%
 %annote=true,%
 %citetoend=true,%
 %hypercite=false% 
]{jurabib}
%</test|testbt>
%<*testbt>
\usepackage{bibtopic}
%</testbt>
%
%<*test|testbt>
%%
\begin{document}
%</test|testbt>
%
%<*test>
\bibliography{jbtest}
%</test>
%
%<*test|testbt>
\bibliographystyle{jurabib}
%</test|testbt>
%
%<*testbt>
\chapter*{Literature}
\begin{btSect}{book}
\section*{Monographs}
\btPrintCited
\end{btSect}
\begin{btSect}{comment}
\section*{Commentaries}
\btPrintCited
\end{btSect}
%</testbt>
%
%<*test|testbt>
This is a test\footcite[Rn.~357]{medicus}\footcite[Rn.~78]{broxbgb}\footcite[Rn.~168]{broxbgb}
\newpage
\footcite[Rn.~170]{broxbgb}%
\footcite[Rn.~473]{broxbgb}%
\footcite[Rn.~709]{musielak}%
\footcite[\S~167, Rn.~38][Leptien]{soergel}%
\footcite[\S~15, III, 1]{koehler}%
\footfullcite[Rn. 186]{broxbgb}%
\footcite[\S~147, Rn.~2][Brox]{erm}%
\footcite[Rn.~493]{broxbgb}%
\footcite[Rn.~372]{broxbgb}%
\footcite[Rn.~944]{medicus}%
\footcite[Rn.~949]{huebner}%
\footcite[\S~167, Rn.~27][Brox]{erm}%
\footfullcite{jbtesturl}
\nocite{*}
\end{document}
%</test|testbt>
%
%<*testcb>
\documentclass[12pt]{report}
\usepackage{german}
\usepackage[%
    authorformat=smallcaps,%
    commabeforerest,%
    titleformat=colonsep,%
    bibformat={tabular,ibidem},%
    pages=format,%
]{jurabib}
\usepackage[duplicate]{chapterbib}
\usepackage{remreset}
\renewcommand*{\StartFinalBibs}{%
    \renewcommand*{\refname}{\chaptername\space\thechapter}%
}%
\makeatletter
\@removefromreset{footnote}{chapter}
\renewcommand*{\bib@heading}{%
    \section*{\refname\@mkboth{\refname}{\refname}}%
}%
\makeatother
\begin{document}
\tableofcontents
\include{cb1}
\include{cb2}
\chapter*{Literature}\addcontentsline{toc}{chapter}{Literature}
\bibliographystyle{jurabib}
\bibliography{jbtest}
\end{document}
%</testcb>
%<*testcb1>
\chapter{One}

    That's a very small example document to illustrate the usage of \textsf{jurabib}
    \footcite[34]{broxschr} together with \textsf{chapterbib}.\footcite[34]{broxbgb}

\bibliographystyle{jurabib}
\bibliography{jbtest}
%</testcb1>
%
%<*testcb2>
\chapter{Two}

    That's a very small example document to illustrate the usage of \textsf{jurabib}
    \footcite[34]{broxschr} together with \textsf{chapterbib}.\footcite[34]{palandt}

\bibliographystyle{jurabib}
\bibliography{jbtest}
%</testcb2>
%
%<*testbib|book>
@BOOK{broxbgb,
  author      = {Hans Brox},
  title       = {Allgemeiner Teil des B{\"u}rgerlichen Gesetzbuches},
  shorttitle  = {BGB~AT},
  year        = 1996,
  language    = {german},
  address     = {Kln, Berlin, Bonn, M{\"u}nchen},
  edition     = 20,
  annote      = {This is a senseless test for testing the annote field.\par If
                 you are reading this text now, note that you can switch
                 off the output of this field by removing the \texttt{annote} option
                 \begin{itemize}\item You are able to use lists inside the annote field\end{itemize}}
}
@BOOK{broxschr,
  author      = {Hans Brox},
  title       = {Besonderes Schuldrecht},
  shorttitle  = {SchR~BT},
  year        = 1995,
  language    = {german},
  address     = {M{\"u}nchen},
  edition     = 20
}
@BOOK{canaris,
  author      = {Claus Wilhelm Cannabis},
  title       = {Die Vertrauenshaftung im deutschen Privatrecht},
  shorttitle  = {Vertrauenshaftung},
  year        = 1971,
  language    = {german},
  address     = {M{\"u}nchen}
}
@BOOK{ennenipp,
  author      = {Ludwig Enneccerus and Hans Carl Nipperdey},
  title       = {Allgemeiner Teil des B{\"u}rgerlichen Rechts},
  year        = 1960,
  volume      = {1},
  language    = {german},
  volumetitle = {zweiter Halbband},
  address     = {T{\"u}bingen},
  edition     = 15
}
@BOOK{huebner,
  author      = {Heinz H{\"u}bner},
  title       = {Allgemeiner Teil des B{\"u}rgerlichen Gesetzbuches},
  shorttitle  = {BGB~AT},
  year        = 1996,
  language    = {german},
  address     = {Berlin, New York},
  edition     = 2
}
@BOOK{koehler,
  author      = {Helmut K{\"o}hler},
  title       = {BGB Allgemeiner Teil},
  shorttitle  = {BGB~AT},
  language    = {german},
  year        = 1996,
  address     = {M{\"u}nchen},
  edition     = 23
}
@BOOK{medicus,
  author      = {Dieter Medicus},
  title       = {Allgemeiner Teil des BGB},
  shorttitle  = {BGB~AT},
  year        = 1995,
  howcited    = 1,
  address     = {M{\"u}nchen},
  edition     = {6}
}
@BOOK{musielak,
  author      = {Hans-Joachim Musielak},
  title       = {Grundkurs BGB},
  shorttitle  = {BGB~GK},
  language    = {german},
  year        = 1994,
  address     = {M{\"u}nchen}
}
@BOOK{alexy,
  author      = {Alexy, Robert},
  title       = {Theorie der Grundrechte},
  year        = 1985,
  address     = {Baden-Baden},
  school      = {G{\"o}ttingen},
  dissyear    = 1984
}
%</testbib|book>
%<*testbib>
@ARTICLE{broxja,
  author      = {Hans Brox},
  gender      = {sm},
  title       = {Die Anfechtung bei der Stellvertretung},
  journal     = {JA},
  language    = {german},
  year        = 1980,
  address     = {M{\"u}nchen}
}
@ARTICLE{eujenfrank,
  author      = {Heiko Eujen and Rainer Frank},
  gender      = {pm},
  title       = {Anfechtung der Bevollm{\"a}chtigung nach Abschluß des
                 Vertretergesch{\"a}ftes\,?},
  language    = {german},
  journal     = {JZ},
  year        = 1973
}
@ARTICLE{proelss,
  author      = {J{\"u}rgen Pr{\"o}lss},
  gender      = {sm},
  title       = {Vertretung ohne Vertretungsmacht\,?},
  journal     = {JuS},
  language    = {german},
  year        = 1985
}
@PERIODICAL{oellers,
  author      = {Bernd Oellers},
  gender      = {sm},
  title       = {Doppelwirkung im Recht\,?},
  journal     = {AcP},
  language    = {german},
  year        = 1969,
  volume      = 169
}
%</testbib>
%<*testbib|comment>
@COMMENTED{erm,
  author      = {Walther Erman},
  gender      = {sm},
  title       = {Handkommentar zum B{\"u}rgerlichen Gesetzbuch},
  address     = {M{\"u}nster},
  language    = {german},
  year        = 1993,
  volume      = 1,
  edition     = {9}
}
@COMMENTED{mueko,
  title       = {Kommentar zum B{\"u}rgerlichen Gesetzbuch},
  shortauthor = {M{\"u}Ko},
  address     = {M{\"u}nchen},
  language    = {german},
  year        = 1994,
  volume      = 2,
  volumetitle = {-- Schuldrecht -- Allgemeiner Teil},
  edition     = {3}
}
@COMMENTED{palandt,
  author      = {Otto Palandt},
  gender      = {sm},
  title       = {Kommentar zum B{\"u}rgerlichen Gesetzbuch},
  address     = {M{\"u}nchen},
  language    = {german},
  year        = 1996,
  edition     = {6}
}
@COMMENTED{soergel,
  author      = {Hans Theodor Soergel},
  gender      = {sm},
  title       = {Kommentar zum B{\"u}rgerlichen Gesetzbuch},
  address     = {Stuttgart, Berlin, K{\"o}ln, Mainz},
  year        = 1987,
  howcited    = 1,
  edition     = 12,
  volume      = 1,
  language    = {german}
}
%</testbib|comment>
%<*testbib|other>
@INCOLLECTION{incollection-full,
  author      = {Daniel D. Lincoll},
  gender      = {sm},
  title       = {Semigroups of Recurrences},
  editor      = {David J. Lipcoll and D. H. Lawrie and A. H. Sameh},
  booktitle   = {High Speed Computer and Algorithm Organization},
  publisher   = {Academic Press},
  year        = 1977,
  number      = 23,
  series      = {Fast Computers},
  type        = {Part},
  chapter     = 3,
  pages       = {179--183},
  address     = {New York},
  edition     = {Third},
  month       = sep,
  language    = {english},
  note        = {This is a full INCOLLECTION entry}
}
@INCOLLECTION{incollection-crossref,
  author      = {Daniel D. Lincoll},
  gender      = {sm},
  title       = {Semigroups of Recurrences},
  pages       = {179--183},
  language    = {english},
  note        = {This is a cross-referencing INCOLLECTION entry},
  crossref    = {whole-collection}
}
@BOOK{whole-collection,
  title       = {High Speed Computer and Algorithm Organization},
  editor      = {David J. Lipcoll and D. H. Lawrie and A. H. Sameh},
  gender      = {sm},
  publisher   = {Academic Press},
  year        = 1977,
  series      = {Fast Computers},
  address     = {New York},
  edition     = {Third},
  month       = sep,
  language    = {english},
  note        = {This is a cross-referenced BOOK (collection) entry},
  booktitle   = {High Speed Computer and Algorithm Organization},
  number      = 23
}
@MASTERSTHESIS{alexymthesis,
  author      = {Alexy, Robert},
  gender      = {sm},
  title       = {Theorie der Grundrechte},
  year        = 1984,
  school      = {G{\"o}ttingen}
}
@PHDTHESIS{alexyphdthesisi,
  author      = {Alexy, Robert},
  gender      = {sm},
  title       = {Theorie der Grundrechte},
  year        = 1984,
  school      = {G{\"o}ttingen}
}
@PHDTHESIS{alexyphdthesisii,
  author      = {Alexy, Robert},
  gender      = {sm},
  title       = {Theorie der Grundrechte},
  year        = 1984,
  type        = {Habil.},
  school      = {G{\"o}ttingen}
}
@JURTHESIS{alexyjurthesisi,
  author      = {Alexy, Robert},
  gender      = {sm},
  title       = {Theorie der Grundrechte},
  year        = 1984,
  school      = {G{\"o}ttingen}
}
@JURTHESIS{alexyjurthesis,
  author      = {Alexy, Robert},
  gender      = {sm},
  title       = {Theorie der Grundrechte},
  year        = 1984,
  type        = {Habil.},
  school      = {G{\"o}ttingen}
}
@WWW{jbtesturl,
  author      = {Jens Berger},
  gender      = {sm},
  title       = {Home of jurabib},
  url         = {http://userpage.fu-berlin.de/~jberger/docs/english/jbendoc.html},
  urldate     = {2002/07/29}
}
%</testbib|other>
%<*config>
\ProvidesFile{jurabib.cfg}[jurabib local configuration file]
\jurabibsetup{%
 %authorformat=smallcaps,%
 %authorformat=italic,%
 %authorformat=dynamic,%
 %authorformat=citationreversed,%
 %authorformat=allreversed,%
 %authorformat=firstnotreversed,%
 %authorformat=reducedifibidem,%
 %authorformat=and,%
 %authorformat=year,%
 %authorformat=indexed,%
 %authorformat=abbrv,%
 %coauthorformat=italic,%
 %coauthorformat=normal,%
 %colastsep=divis,%
 %cofirstsep=in,%
 %cofirstsep=comma,%
 %titleformat=italic,%
 %titleformat=all,%
 %titleformat=commasep,%
 %titleformat=colonsep,%
 %titleformat=noreplace,%
 %commabeforerest=true,%
 %howcited=all,%
 %howcited=normal,%
 %howcited=compare,%
 %howcited=multiple,%
 %ibidem=strict,%
 %ibidem=strictdoublepage,%
 %ibidem=nostrict,%
 %ibidem=name,%
 %ibidem=name&title,%
 %ibidem=name&title&auto,%
 %citefull=first,%
 %citefull=chapter,%
 %citefull=section,%
 %citefull=all,%
 %bibformat=tabular,%
 %bibformat=nohang,%
 %bibformat=numbered,%
 %bibformat=ibidem,%
 %bibformat=ibidemalt,%
 %bibformat=compress,%
 %bibformat=raggedright,%
 %crossref=long,%
 %crossref=short,%
 %crossref=dynamic,%
 %superscriptedition=all,%
 %superscriptedition=switch,%
 %superscriptedition=commented,%
 %superscriptedition=bib,%
 %pages=always,%
 %pages=test,%
 %pages=format,%
 %see=true,%
 %lookat=true,%
 %human=true,%
 %oxford=true,%
 %chicago=true,%
 %edby=true,%
 %endnote=true,%
 %biblikecite=true,%
 %idem=strict,%
 %idem=strictdoublepage,%
 %idem=nostrict,%
 %opcit=true,%
 %opcit=chapter,%
 %opcit=section,%
 %annote=true,%
 %citetoend=true,%
 %hypercite=false%
}
%</config>
%<*jbtesthutex>
\documentclass[12pt,a4paper,german,english]{article}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage[%
     titleformat=italic,%
     titleformat=all,%
     titleformat=noreplace,%
     titleformat=commasep,%
     commabeforerest,%
     ibidem=strict,%
     citefull=first,%
     lookat,%
     oxford,%
     pages=format,%
]{jurabib}

\begin{document}
\footcite[23--67]{bergmeier80}%
\footcite[23--67]{helm72}%
\footcite[23--67]{helm82}%
\footcite[23--67]{helm82a}%
\footcite[23--67]{helm97}%
\footcite[23--67]{LunWalThis99}%
\footcite[23--67]{bergmeier80}%
\footcite[23--67]{Thiselton99}%
\footcite[23--67]{LunWalThis99}%
\footcite[23--67]{Lundin99}%
\footcite[23--67]{Lundin99}%
\footcite[67f]{Lundin99}%
\footcite[23--67]{Kraft74}%
\footcite[23--67]{Oberman88}%

\footcite[67ff]{bergmeier80}%
\footcite[67]{helm72}%
\footcite[67]{helm82}%
\footcite[67]{helm82a}%
\footcite[67]{helm97}%
\footcite[67]{bergmeier80}%
\footcite[67]{Thiselton99}%
\footcite[67]{LunWalThis99}%
\footcite[67]{Lundin99}%
\footcite[67]{Kraft74}%
\footcite[67]{Oberman88}%
\footnote{In ``\citefield{title}{Thiselton99}'' Thiselton said~\dots}

This is a very simple test document to illustrate some of the
capabilities of \textsf{jurabib} in the humanities.
If someone can contribute a better one, please e-mail me:
\texttt{jb@jurabib.org}.


\bibliographystyle{jurabib}
%%\bibliographystyle{jhuman}
\bibliography{jbtesthu}

\end{document}
%</jbtesthutex>
%<*jbtesthubib>
@BOOK{bergmeier80,
  author      = {Bergmeier, Roland},
  gender      = {sm},
  title       = {Glaube als Gabe nach Johannes: Religions- und
                Theologiegeschichtliche Studien zum pr{\"a}destinatianischen
                Dualismus im vierten Evangelium},
  publisher   = {W. Kohlhammer},
  year        = 1980,
  volume      = 112,
  series      = {Beitr{\"a}ge zur Wissenschaft vom Alten und Neuen Testament},
  address     = {Stuttgart etc.},
  keywords    = {Predestinatie; Johannes; Gnostiek; Qumran; Dualisme},
  language    = {german},
  shorttitle  = {Glaube als Gabe},
  annote      = {This is a senseless test for testing the annote field.\par If
                 you are reading this text now, note that you can switch
                 off the output of this field by removing the \texttt{annote} option
                 \begin{itemize}\item You are able to use lists inside the annote field\end{itemize}}
}
@ARTICLE{helm72,
  author      = {Helm, Paul},
  gender      = {sm},
  title       = {Revealed Propositions and Timeless Truths},
  journal     = {Religious Studies},
  year        = 1972,
  volume      = 8,
  pages       = {127--136},
  comment     = {Nog eens kopieren}
}
@BOOK{helm82,
  author      = {Helm, Paul},
  gender      = {sm},
  title       = {Divine Revelation: The Basic Issues},
  year        = 1982,
  address     = {London},
  annote      = {Verdediging van propositionele visie op Openbaring},
  language    = {english},
  shorttitle  = {Divine Revelation}
}
@INCOLLECTION{helm82a,
  author      = {Helm, Paul},
  gender      = {sm},
  title       = {The Role of Logic in Biblical Interpretation},
  editor      = {E. Radmacher and R. Preus},
  booktitle   = {Hermeneutics, Inerrancy, \& the Bible},
  year        = 1982,
  pages       = {841--858},
  address     = {Grand Rapids},
  language    = {english},
  shorttitle  = {Role of Logic}
}
@BOOK{helm97,
  author      = {Helm, Paul},
  gender      = {sm},
  title       = {Faith and Understanding},
  year        = 1997,
  series      = {Reason and Religion},
  address     = {Edinburgh},
  publisher   = {Edinburgh University Press},
  language    = {english}
}
@INCOLLECTION{Thiselton99,
  author      = {Thiselton, Anthony C.},
  gender      = {sm},
  title       = {Communicative Action and Promise in
                 Interdisciplinary, Biblical, and Theological Hermeneutics},
  booktitle   = {The Promise of Hermeneutics},
  pages       = {133--240},
  crossref    = {LunWalThis99},
  shorttitle  = {Communicative Action}
}
@BOOK{LunWalThis99,
  editor      = {Lundin, Roger and Walhout, Clarence and Thiselton, Anthony C.},
  gender      = {pm},
  year        = 1999,
  title       = {The Promise of Hermeneutics},
  publisher   = {Eerdmans},
  address     = {Grand Rapids},
  shorttitle  = {Promise}
}
@INCOLLECTION{Lundin99,
  author      = {Lundin, Roger},
  gender      = {sm},
  title       = {Interpreting Orphans: Hermeneutics in the Cartesian
                 Tradition},
  booktitle   = {The Promise of Hermeneutics},
  pages       = {1--64},
  crossref    = {LunWalThis99},
  shorttitle  = {Interpreting Orphans}
}
@Book{Oberman88,
  author      = {Oberman, Heiko Augustinus},
  gender      = {sm},
  title       = {De erfenis van Calvijn: grootheid en grenzen: drie
                 lezingen},
  publisher   = {Kok},
  year        = 1988,
  address     = {Kampen},
  annote      = {zie liter},
  series      = {Kuyper-voordrachten},
  language    = {dutch}
}
@Book{Kraft74,
  editor      = {Kraft, Robert A. and Attridge, Harold and Spittler, Russell and Timbie, Janet},
  gender      = {pm},
  title       = {The Testament of Job According to the SV Text},
  publisher   = {Society of Biblical Literature \& Scholars' Press},
  year        = 1937,
  volume      = 4,
  series      = {Texts and Translations 5: Pseudepigrapha Series},
  address     = {Missoula, Montana},
}
%</jbtesthubib>
%<*jblongcfg>
%% This is a example configuration file to use for exam homeworks,
%% dissertations and the like for german law students, contributed
%% by Tilman Finke (Tilman.Finke@web.de) If you want to use it,
%% rename it to `jurabib.cfg'.
%% If you want to share your personal configuration file (e.g. if it
%% reflects the requests of your university), please send it to
%% jb@jurabib.org
\jurabibsetup{authorformat=dynamic,
              superscriptedition=all,
              titleformat=all,
              titleformat=commasep,
              titleformat=noreplace,
              colastsep=divis,
              howcited=compare,
              commabeforerest,
              bibformat=ibidemalt,
              bibformat=compress,
              pages=always}
\renewcommand*{\bibjtsep}{in: }
\renewcommand*{\bibatsep}{,}
\renewcommand*{\bibbdsep}{}
\renewcommand*{\jbaensep}{,}
\jbdotafterbibentry
\formatpages[ ]{article}{(}{)}
%</jblongcfg>
\endinput
%   \fi
% \def\GlossaryPrologue{\section*{"Anderungsverzeichnis}
%                   \markboth{"Anderungsverzeichnis}{"Anderungsverzeichnis}
%                   \addcontentsline{toc}{section}{"Anderungsverzeichnis}}
%    \Finale
%\endinput
