%%
%% This is file `scrjura.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% scrjura.dtx  (with options: `package')
%% scrlogo.dtx  (with options: `logo')
%% 
%% Copyright (c) 2007-2013
%% Markus Kohm and any individual authors listed elsewhere in this file.
%% 
%% This file was generated from file(s) of the KOMA-Script bundle.
%% ---------------------------------------------------------------
%% 
%% This work may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License, version 1.3c of the license.
%% The latest version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later and of this work.
%% 
%% This work has the LPPL maintenance status "author-maintained".
%% 
%% The Current Maintainer and author of this work is Markus Kohm.
%% 
%% This file may only be distributed together with the files
%% `scrlogo.dtx' and `scrjura.dtx'. You may however distribute the files
%% `scrlogo.dtx' and `scrjura.dtx' without this file.
%% See also `scrjura.dtx' for additional information.
%% 
%% If this file is a beta version, you are not allowed to distribute it.
%% 
%% Currently there is only a short german manual at `scrjura.dtx', that
%% should also be found as `scrjura.pdf'.
%% 
%% The KOMA-Script bundle (but maybe not this file) was based upon the
%% LaTeX2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
%% standard classes created by The LaTeX3 Project 1994-1996.
%% 
%%% From File: $Id: scrjura.dtx 1849 2014-11-25 07:56:28Z kohm $
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{scrjura}
                [2014/11/22 v0.9 KOMA-Script for jurists
                (package)%
                ]
\@ifpackageloaded{hyperref}{%
  \PackageError{scrjura}{Package hyperref already loaded}{%
    If you want to use package scrjura with package hyperref, you have to
    use\MessageBreak
    package scrjura before package hyperref.\MessageBreak
    To solve the problem, you just should move the loading of package
    hyperref\MessageBreak
    behind the loading of package scrjura.}%
}
\RequirePackage{scrkbase}[2013/03/26]
\RequirePackage{tocbasic}
\DeclareOption{contract}{%
  \g@addto@macro\document\contract%
}
\newcounter{juratoclevel}\setcounter{juratoclevel}{\@M}
\KOMA@key{juratotoc}[true]{%
  \begingroup
    \KOMA@set@ifkey{juratoclevel}{@tempswa}{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \if@tempswa
        \setcounter{juratoclevel}{2}%
      \else
        \setcounter{juratoclevel}{\@M}%
      \fi
    \else
      \setcounter{juratoclevel}{#1}%
      \FamilyKeyStateProcessed
    \fi
  \endgroup
}
\providecommand*{\toclevel@cpar}{\arabic{juratoclevel}}
\newcommand*{\cpar@numberwidth}{2em}
\newcommand*{\cpar@indent}{1.5em}
\KOMA@key{juratocnumberwidth}{%
  \begingroup\setlength{\@tempdima}{#1}\endgroup
  \renewcommand*{\cpar@numberwidth}{#1}%
  \FamilyKeyStateProcessed
}
\KOMA@key{juratocindent}{%
  \begingroup\setlength{\@tempdima}{#1}\endgroup
  \renewcommand*{\cpar@indent}{#1}%
  \FamilyKeyStateProcessed
}
\KOMA@ifkey{juratitlepagebreak}{@juratitlepagebreak}
\newif\ifparnumber
\KOMA@key{parnumber}[true]{%
  \ifstr{#1}{auto}{\AutoPar\FamilyKeyStateProcessed}{%
    \ifstr{#1}{manual}{\ManualPar\FamilyKeyStateProcessed}{%
      \KOMA@set@ifkey{parnumber}{parnumber}{#1}%
    }%
  }%
}
\newcommand*{\Clausemark}[1]{}
\KOMA@key{paragraphmark}{%
  \begingroup
    \KOMA@set@ncmdkey{paragraphmark}{@tempa}{%
      {false}{0},{off}{0},{no}{0},%
      {forceright}{1},%
      {forceboth}{2},%
      {right}{3},%
      {both}{4}%
    }{#1}%
  \ifx\FamilyKeyState\FamilyKeyStateProcessed
    \ifcase\number\@tempa
      \endgroup
      \let\Clausemark\@gobble
    \or
      \endgroup
      \renewcommand*{\Clausemark}[1]{%
        \markright{\csname MakeMarkcase\endcsname{##1}}}%
    \or
      \endgroup
      \renewcommand*{\Clausemark}[1]{%
        \markboth{\csname MakeMarkcase\endcsname{##1}}%
                 {\csname MakeMarkcase\endcsname{##1}}}%
    \or
      \endgroup
      \renewcommand*{\Clausemark}[1]{%
        \ifx
          \@mkboth\@gobbletwo
        \else
          \markright{\csname MakeMarkcase\endcsname{##1}}%
        \fi}%
    \or
      \endgroup
      \renewcommand*{\Clausemark}[1]{%
        \@mkboth{\csname MakeMarkcase\endcsname{##1}}%
                {\csname MakeMarkcase\endcsname{##1}}}%
    \else
      \endgroup
    \fi
  \else
    \endgroup
  \fi
}
\KOMA@DeclareDeprecatedOption[scrjura]{markright}{paragraphmark=forceright}
\KOMA@DeclareDeprecatedOption[scrjura]{markboth}{paragraphmark=forceboth}
\newcommand*{\parcite@format}{0}
\newcommand*{\sentencecite@format}{0}
\KOMA@key{ref}{%
  \begingroup
    \KOMA@set@ncmdkey{ref}{@tempa}{%
      {parlong}{1},{longpar}{1},{ParL}{1},%
      {parshort}{2},{shortpar}{2},{ParS}{2},%
      {parnumeric}{3},{numericpar}{3},{ParN}{3},%
      {paroff}{4},{nopar}{4},%
      {sentencelong}{10},{longsentence}{10},{SentenceL}{10},%
      {sentenceshort}{20},{shortsentence}{20},{SentenceS}{20},%
      {sentencenumeric}{30},{numericsentence}{30},{SentenceN}{30},%
      {sentenceoff}{40},{nosentence}{40},%
      {long}{11},%
      {short}{22},%
      {numeric}{33},%
      {paragraphonly}{44},{onlyparagraph}{44},%
      {ParagraphOnly}{44},{OnlyParagraph}{44}%
    }{#1}%
    \ifx\FamilyKeyState\FamilyKeyStateProcessed
      \@tempcnta=\@tempa\relax
      \@tempcntb=\z@
      \@whilenum \@tempcnta>9 \do{%
        \advance\@tempcnta -10\relax
        \advance\@tempcntb \@ne\relax
      }%
      \ifcase \@tempcnta
      \or
        \aftergroup\def\aftergroup\parcite@format
        \aftergroup{\aftergroup0\aftergroup}%
      \or
        \aftergroup\def\aftergroup\parcite@format
        \aftergroup{\aftergroup1\aftergroup}%
      \or
        \aftergroup\def\aftergroup\parcite@format
        \aftergroup{\aftergroup2\aftergroup}%
      \or
        \aftergroup\def\aftergroup\parcite@format
        \aftergroup{\aftergroup-\aftergroup1\aftergroup}%
      \fi
      \ifcase \@tempcntb
      \or
        \aftergroup\def\aftergroup\sentencecite@format
        \aftergroup{\aftergroup0\aftergroup}%
      \or
        \aftergroup\def\aftergroup\sentencecite@format
        \aftergroup{\aftergroup1\aftergroup}%
      \or
        \aftergroup\def\aftergroup\sentencecite@format
        \aftergroup{\aftergroup2\aftergroup}%
      \or
        \aftergroup\def\aftergroup\sentencecite@format
        \aftergroup{\aftergroup-\aftergroup1\aftergroup}%
      \fi
    \fi
  \endgroup
}
\KOMA@DeclareDeprecatedOption[scrjura]{parcitename}{ref=parlong}
\KOMA@DeclareDeprecatedOption[scrjura]{sentencecitename}{ref=sentencelong}
\KOMAProcessOptions\relax
\providecommand*{\DeprecatedParagraph}{%
  \PackageError{scrjura}{modification of old document needed}{%
    It seem that this document was made for scrjura up to version
    0.7a.\MessageBreak
    Since scrjura version 0.9 \string\Paragraph, \string\SubParagraph, and all
    depending\MessageBreak
    commands, options, and counters have been renamed.\MessageBreak
    You should replace the terms `Paragraph' and `paragraph` by `Clause`
    and\MessageBreak
    `clause` if they are part of the name of a scrjura feature, otherwise
    this\MessageBreak
    document may produce severall additional error messages and maybe the
    wrong\MessageBreak
    result. Sorry for the inconvenience.%
  }%
  \ParagraphCompatibilityHacks
}
\newcommand*{\ParagraphCompatibilityHacks}{%
  \PackageWarning{scrjura}{compatibility hacks for `\string\Paragraph'
    executed.\MessageBreak
    There is no support for documents using these hacks!\MessageBreak
    There is no warranty for real compatibility!\MessageBreak
    Even if the LaTeX run of the document doesn't report\MessageBreak
    any error, the result may be completely wrong.\MessageBreak
    Therefore it is recommended to solve the problem,\MessageBreak
    instead of trying to work around using the\MessageBreak
    compatibility hacks%
  }%
  \gdef\Paragraph{\Clause}%
  \gdef\SubParagraph{\SubClause}%
  \gdef\c@Paragraph{\c@Clause}%
  \gdef\cl@Paragraph{\cl@Clause}%
  \gdef\c@SubParagraph{\c@SubClause}%
  \gdef\cl@SubParagraph{\cl@SubClause}%
  \gdef\theParagraph{\theClause}%
  \gdef\theSubParagraph{\theSubClause}%
  \gdef\refParagraph{\refClause}%
  \gdef\refParagraphN{\refClauseN}%
  \aliaskomafont{Paragraph}{Clause}%
  \scr@ifundefinedorrelax{Paragraphmark}{}{%
    \global\let\Clausemark\Paragraphmark
  }%
}
\providecommand*{\Paragraph}{\DeprecatedParagraph\Paragraph}
\providecommand*{\SubParagraph}{\DeprecatedParagraph\SubParagraph}
\providecommand*{\refParagraph}{\DeprecatedParagraph\refParagraph}
\providecommand*{\refParagraphN}{\DeprecatedParagraph\refParagraphN}
\newcommand*{\scrjura@env@type}{}
\newcommand*{\ellipsispar}[1][1]{%
  \begingroup
    \KOMAoptions{parnumber=manual}\parellipsis\par
    \addtocounter{par}{#1}%
    \protected@write\@auxout{}{%
      \string\newmaxpar{\scrjura@env@type}%
                       {\csname the\scrjura@env@type AbsoluteClause\endcsname}%
                       {\thepar}%
    }%
  \endgroup
  \addtocounter{par}{-1}\refstepcounter{par}%
  \ignorespaces
}
\newcommand*{\parellipsis}{%
  \scr@ifundefinedorrelax{textellipsis}{\dots}{\textellipsis}%
}
\newcommand*{\contract}{%
  \ifx\scrjura@env@type\@empty
    \let\@doendpe\scrjura@doendpe
    \let\Clause\contract@paragraph
    \let\c@Clause\c@contractClause
    \edef\cl@Clause{\cl@Clause\cl@contractClause}%
    \let\SubClause\contract@subparagraph
    \let\c@SubClause\c@contractSubClause
    \edef\cl@SubClause{\cl@SubClause\cl@contractSubClause}%
    \let\Sentence\contract@sentence
    \renewcommand*{\scrjura@env@type}{contract}%
    \aliaskomafont{Clause}{contract.Clause}%
  \else
    \PackageError{scrjura}{nested `contract` detected}{%
      You may not use a `contract' environment inside\MessageBreak
      a `\scrjura@env@type' environment or after loading\MessageBreak
      package `scrjura' with option `\scrjura@env@type'!}%
  \fi
}
\let\if@scrjura@skiphyperref\iftrue
\let\cl@Clause\@empty
\let\cl@SubClause\@empty
\newcounter{contractClause}
\renewcommand*{\thecontractClause}{%
  {\contract@Clauseformat{\arabic{contractClause}}}}
\DeclareRobustCommand*{\contract@Clauseformat}[1]{\Clauseformat{#1}}
\newcommand*{\Clauseformat}[1]{\S~#1}
\newcounter{contractSubClause}
\@addtoreset{SubClause}{Clause}
\renewcommand*{\thecontractSubClause}{%
  {\theClause\alph{contractSubClause}}}
\newcounter{contractAbsoluteClause}
\newcommand*{\DeclareNewJuraEnvironment}[1]{%
  \@ifundefined{#1}{\expandafter\let\csname #1\expandafter\endcsname
    \csname end#1\endcsname}{}%
  \@ifundefined{#1}{\let\reserved@defjuraenvironment\@defjuraenvironment}{%
    \PackageError{scrjura}{ignorring declaration of `#1'}{%
      You've tried to declare jura environment `#1', but
      environment\MessageBreak
      `#1' or command
      \expandafter\string\csname #1\endcsname\space or
      \expandafter\string\csname end#1\endcsname\MessageBreak
      already exists.\MessageBreak
      Declaration will be ignored}%
    \long\def\reserved@defjuraenvironment##1[##2]##3##4{}%
  }%
  \@ifnextchar [%]
    {\reserved@defjuraenvironment{#1}}{\reserved@defjuraenvironment{#1}[]}%
}
\@onlypreamble\DeclareNewJuraEnvironment
\DefineFamily{KOMAarg}
\DefineFamilyMember{KOMAarg}
\DefineFamilyKey{KOMAarg}{Clause}{%
  \expandafter\gdef\csname \scrjura@env@type @Clause\endcsname{#1}%
}
\DefineFamilyKey{KOMAarg}{SubClause}{%
  \expandafter\gdef\csname \scrjura@env@type @SubClause\endcsname{#1}%
}
\DefineFamilyKey{KOMAarg}{Sentence}{%
  \expandafter\gdef\csname \scrjura@env@type @Sentence\endcsname{#1}%
}
\DefineFamilyKey{KOMAarg}{ClauseNumberFormat}{%
  \expandafter\gdef\csname \scrjura@env@type @Clauseformat \endcsname
  ##1{#1{##1}}
  \expandafter\xdef\csname \scrjura@env@type @Clauseformat\endcsname{%
    \noexpand\protect\expandafter\noexpand
    \csname \scrjura@env@type @Clauseformat \endcsname
  }%
}
\newcommand{\@defjuraenvironment}{}
\long\def\@defjuraenvironment#1[#2]#3#4{%
  \newcounter{#1Clause}%
  \newcounter{#1AbsoluteClause}%
  \newcounter{#1SubClause}%
  \begingroup
    \edef\scrjura@env@type{#1}%
    \FamilyExecuteOptions[.scrjura.sty]{KOMAarg}{#2}%
  \endgroup
  \@ifundefined{#1@Clauseformat}{%
    \expandafter\DeclareRobustCommand\expandafter*%
    \csname #1@Clauseformat\endcsname[1]{\Clauseformat{##1}}%
  }{}%
  \newenvironment{#1}{%
    \par
    \ifx\scrjura@env@type\@empty
      \edef\scrjura@env@type{#1}%
      \let\@doendpe\scrjura@doendpe
      \expandafter\let\expandafter\c@Clause\csname c@#1Clause\endcsname
      \edef\cl@Clause{\cl@Clause\csname cl@#1Clause\endcsname}%
      \expandafter\let\expandafter\c@SubClause
        \csname c@#1SubClause\endcsname
      \edef\cl@SubClause{\cl@SubClause
        \csname cl@#1SubClause\endcsname}%
      \@ifundefined{#1@Clause}{%
        \let\Clause\contract@paragraph
      }{%
        \expandafter\let\expandafter\Clause
        \csname #1@Clause\endcsname
      }%
      \@ifundefined{#1@SubClause}{%
        \let\SubClause\contract@subparagraph
      }{%
        \expandafter\let\expandafter\SubClause
        \csname #1@SubClause\endcsname
      }%
      \@ifundefined{#1@Sentence}{%
        \let\Sentence\contract@sentence
      }{%
        \expandafter\let\expandafter\Sentence\csname #1@Sentence\endcsname
      }%
      \@ifundefined{\scrjura@env@type @everypar}{%
        \expandafter\let
        \csname \scrjura@env@type @everypar\endcsname
        \contract@everypar
      }{}%
      \@ifundefined{scr@fnt@#1}{%
        \@ifundefined{scr@fnt@instead@#1}{%
          \aliaskomafont{Clause}{contract.Clause}%
        }{%
          \aliaskomafont{Clause}{\csname scr@fnt@instead@#1\endcsname}%
        }%
      }{%
        \aliaskomafont{Clause}{contract.Clause}%
      }%
      #3%
    \else
      \PackageError{scrjura}{nested scrjura environments detected}{%
        You must not use a `#1' environment inside\MessageBreak
        a `\scrjura@env@type' environment or after loading\MessageBreak
        package `scrjura' with option `\scrjura@env@type'!}%
    \fi
  }{%
    #4%
    \par
  }%
}
\define@key{contract}{title}{%
  \def\contract@title{#1}%
  \ifx\contract@entry\relax\def\contract@entry{\contract@title}\fi
  \ifx\contract@head\relax\def\contract@head{\contract@title}\fi
}
\define@key{contract}{entry}{%
  \PackageWarning{scrjura}{deprecated option `entry'.\MessageBreak
    You should use option `tocentry' instead of\MessageBreak
    option `entry'%
  }%
  \def\contract@entry{#1}}
\define@key{contract}{tocentry}{\def\contract@entry{#1}}
\define@key{contract}{noentry}[]{%
  \PackageWarning{scrjura}{deprecated option `noentry'.\MessageBreak
    You should use option `notocentry' instead of\MessageBreak
    option `noentry'%
  }%
  \let\contract@entry\relax}
\define@key{contract}{notocentry}[]{\let\contract@entry\relax}
\define@key{contract}{head}{\def\contract@head{#1}}
\define@key{contract}{nohead}[]{\let\contract@head\relax}
\define@key{contract}{number}{\def\contract@number{#1}}
\newcommand*{\contract@preskip}{2\baselineskip}
\newcommand*{\contract@postskip}{\baselineskip}
\define@key{contract}{preskip}{\def\contract@preskip{#1}}
\define@key{contract}{postskip}{\def\contract@postskip{#1}}
\newif\ifcontract@dummy
\define@key{contract}{dummy}[true]{\csname contract@dummy#1\endcsname}
\newkomafont{contract.Clause}{\sffamily\bfseries\large}
\newcommand*{\contract@paragraph@font}{\usekomafont{contract.Clause}%
  \@hangfrom}
\newcounter{@AbsClause}
\newcommand*{\theH@AbsClause}{P-\arabic{@AbsClause}}
\newcommand*{\theHClause}{\theH@AbsClause}
\newcommand*{\theHSubClause}{\theH@AbsClause}
\newcommand*{\contract@paragraph}[1]{%
  \stepcounter{\scrjura@env@type AbsoluteClause}%
  \ManualPar\parnumbertrue
  \let\contract@title\relax
  \let\contract@entry\relax
  \let\contract@head\relax
  \let\contract@number\relax
  \contract@dummyfalse
  \ifx\relax#1\relax\else\setkeys{contract}{#1}\fi
  \ifcontract@dummy\else
    \par
    \@afterindentfalse
    \addvspace{\contract@preskip}%
  \fi
  \ifx\contract@number\relax
    \let\p@Clause\@empty
    \let\theClause\thecontractClause
    \refstepcounter{Clause}%
  \else
    \begingroup
      \let\@elt\@stpelt
      \cl@Clause
    \endgroup
    \protected@edef\theClause{%
      \csname \scrjura@env@type @Clauseformat\endcsname{\contract@number}%
    }%
    \protected@edef\@currentlabel{\theClause}%
  \fi
  \stepcounter{@AbsClause}%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname if@skiphyperref\endcsname\relax
  \else
    \expandafter\let\csname if@scrjura@skiphyperref\expandafter\endcsname
    \csname if@skiphyperref\endcsname
  \fi
  \if@scrjura@skiphyperref\else
    \hyper@refstepcounter{@AbsClause}%
    \typeout{absolute Nummer: \the@AbsClause^^JLabel: `\@currentHref'}%
  \fi
  \let\theSubClause\theClause
  \ifcontract@dummy\else
    \begingroup
      \if@juratitlepagebreak\else\interlinepenalty\@M\fi
      \contract@paragraph@font{\theClause
        \ifx\contract@title\relax\else\enskip\fi}%
      \contract@title
      \ifx\contract@entry\relax\else
        \addxcontentsline{toc}{cpar}[\theClause]\contract@entry
        \addxcontentsline{cpa}{cpar}[\theClause]\contract@entry
      \fi
      \ifx\contract@head\relax\else
        \expandafter\Clausemark\expandafter{%
          \expandafter\theSubClause\expandafter\enskip\contract@head}%
      \fi
      \par
    \endgroup\nobreak\vskip\contract@postskip
    \scrjura@afterheading
  \fi
}
\newcommand*{\contract@subparagraph}[1]{%
  \stepcounter{\scrjura@env@type AbsoluteClause}%
  \ManualPar\parnumbertrue
  \let\contract@title\relax
  \let\contract@entry\relax
  \let\contract@head\relax
  \let\contract@number\relax
  \contract@dummyfalse
  \ifx\relax#1\relax\else\setkeys{contract}{#1}\fi
  \ifcontract@dummy\else
    \par
    \@afterindentfalse
    \vskip\contract@preskip
  \fi
  \ifx\contract@number\relax
    \let\p@SubClause\@empty
    \let\theSubClause\thecontractSubClause
    \refstepcounter{SubClause}%
  \else
    \begingroup
      \let\@elt\@stpelt
      \cl@SubClause
    \endgroup
    \protected@edef\theSubClause{\theClause\contract@number}%
    \protected@edef\@currentlabel{\theSubClause}%
  \fi
  \stepcounter{@AbsClause}%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname if@skiphyperref\endcsname\relax
  \else
    \expandafter\let\csname if@scrjura@skiphyperref\expandafter\endcsname
    \csname if@skiphyperref\endcsname
  \fi
  \if@scrjura@skiphyperref\else
    \hyper@refstepcounter{@AbsClause}%
    \typeout{absolute Nummer: \the@AbsClause^^JLabel: `\@currentHref'}%
  \fi
  \ifcontract@dummy\else
    \begingroup
      \if@juratitlepagebreak\else\interlinepenalty\@M\fi
      \contract@paragraph@font{\theSubClause
        \ifx\contract@title\relax\else\enskip\fi}%
      \contract@title
      \ifx\contract@entry\relax\else
        \addxcontentsline{toc}{cpar}[\theSubClause]\contract@entry
        \addxcontentsline{cpa}{cpar}[\theSubClause]\contract@entry
      \fi
      \ifx\contract@head\relax\else
        \expandafter\Clausemark\expandafter{%
          \expandafter\theSubClause\expandafter\enskip\contract@head}%
      \fi
      \par
    \endgroup
    \nobreak\vskip\contract@postskip
    \scrjura@afterheading
  \fi
}
\newcommand*{\AutoPar}{%
  \expandafter\let\expandafter\scrjura@everypar
  \csname \scrjura@env@type @everypar\endcsname
}
\newcommand*{\ManualPar}{%
  \let\scrjura@everypar\relax
}
\newcommand*{\scrjura@afterheading}{%
  \@nobreaktrue
  \everypar{%
    \if@nobreak
      \@nobreakfalse
      \clubpenalty \@M
      \if@afterindent \else
        {\setbox\z@\lastbox}%
      \fi
    \else
      \clubpenalty \@clubpenalty
      \everypar{%
        \scrjura@everypar
      }%
    \fi
    \scrjura@everypar
  }%
  \AutoPar
}
\newcommand*{\scrjura@everypar}{}
\CheckCommand*\@doendpe{\@endpetrue
  \def\par{\@restorepar\everypar{}\par\@endpefalse}\everypar
  {{\setbox\z@\lastbox}\everypar{}\@endpefalse}}
\newcommand*{\scrjura@doendpe}{%
  \@endpetrue
  \def\par{%
    \@restorepar\everypar{%
      \csname scrjura@everypar\endcsname
    }%
    \par\@endpefalse
  }%
  \everypar{%
    {\setbox\z@\lastbox}\everypar{%
      \csname scrjura@everypar\endcsname
    }%
    \@endpefalse
  }%
}
\newcommand*{\l@cpar}[2]{%
  \ifnum\value{juratoclevel}>\value{tocdepth}\else
    \scr@ifundefinedorrelax{bprot@dottedtocline}{%
      \@dottedtocline
    }{%
      \bprot@dottedtocline
    }{\value{juratoclevel}}{\cpar@indent}{\cpar@numberwidth}{#1}{#2}%
  \fi
}
\DeclareRobustCommand*{\scrjura@separator}[1]{#1}
\DeclareRobustCommand*{\scrjura@usetype}[1]{\scrjura@@usetype{#1}}
\newcommand*{\scrjura@@usetype}[1]{}
\newcounter{par}
\renewcommand*{\thepar}{\arabic{par}}
\newcommand*{\theHpar}{\theH@AbsClause-\Roman{par}}
\newcommand*{\parformat}{(\thepar)}
\newkomafont{parnumber}{}
\renewcommand*\p@par{{\scrjura@usetype{\scrjura@env@type}\theSubClause\scrjura@separator{\nobreakspace}}}
\@addtoreset{par}{Clause}
\@addtoreset{par}{SubClause}
\newcommand*{\contract@everypar}{%
  \ifparnumber
    \ifx\scrjura@special@par\relax
      \ifx\scrjura@special@reset@par\relax\else
        \global\let\thepar\scrjura@special@reset@par
        \global\let\scrjura@special@reset@par\relax
      \fi
      \refstepcounter{par}%
      \refstepcounter{sentence}%
    \else
      \ifx\scrjura@special@reset@par\relax
        \global\let\scrjura@special@reset@par\thepar
      \fi
      \global\let\thepar\scrjura@special@par
      \global\let\scrjura@special@par\relax
      \setcounter{sentence}{0}\refstepcounter{sentence}%
    \fi
    \begingroup
      \protected@write\@auxout{%
        \expandafter\let\csname \scrjura@env@type @Clauseformat\endcsname
        \@firstofone
      }{%
        \string\newmaxpar{\scrjura@env@type}%
                         {\csname the\scrjura@env@type AbsoluteClause\endcsname}%
                         {\thepar}%
      }%
      \getmaxpar\@tempa{\scrjura@env@type}%
                       {\csname the\scrjura@env@type AbsoluteClause\endcsname}%
      \typeout{Stored max is \@tempa}%
      \def\reserved@a##1\@nnil{\def\@tempa{##1}}%
      \afterassignment\reserved@a\@tempcnta=0\@tempa\relax\@nnil
      \ifnum \@tempcnta>\@ne
        {\usekomafont{parnumber}{\parformat\nobreakspace}}%
      \else
        \def\reserved@a{\relax}%
        \ifx\@tempa\reserved@a
        \else
          {\usekomafont{parnumber}{\parformat\nobreakspace}}%
        \fi
      \fi
    \endgroup
  \else
    \setcounter{sentence}{-1}\refstepcounter{sentence}%
  \fi
}
\newcommand*{\thisparnumber}[1]{%
  \def\scrjura@special@par{#1}%
}
\newcommand*{\scrjura@special@par}{}
\let\scrjura@special@par\relax
\newcommand*{\scrjura@special@reset@par}{}
\let\scrjura@special@reset@par\relax
\newcommand*{\refL}{\@ifstar {\ref@L*}{\ref@L{}}}
\newcommand*{\ref@L}[2]{%
  \begingroup
    \def\parcite@format{0}%
    \let\sentencecite@format\parcite@format
    \ref#1{#2}%
  \endgroup
}
\newcommand*{\refS}{\@ifstar {\ref@S*}{\ref@S{}}}
\newcommand*{\ref@S}[2]{%
  \begingroup
    \def\parcite@format{1}%
    \let\sentencecite@format\parcite@format
    \ref#1{#2}%
  \endgroup
}
\newcommand*{\refN}{\@ifstar {\ref@N*}{\ref@N{}}}
\newcommand*{\ref@N}[2]{%
  \begingroup
    \def\parcite@format{2}%
    \let\sentencecite@format\parcite@format
    \ref#1{#2}%
  \endgroup
}
\newcommand*{\refClause}{%
  \@ifstar {\ref@Clause*}{\ref@Clause{}}
}
\newcommand*{\ref@Clause}[2]{%
  \expandafter\ifx\csname r@#2\endcsname\relax
    \ref#1{#2}%
  \else
    \begingroup
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\def
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\@tempb
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter{%
        \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
      \def\@tempc##1##2\@nil{##1}%
      \let\scrjura@separator\@gobble
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \csname r@#2\endcsname\noexpand\@nil}%
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \@tempa\@nil}%
      \let\@@protect\protect
      \let\protect\noexpand
      \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
      \let\protect\@@protect
      \ref#1{#2}%
    \endgroup
  \fi
}
\newcommand*{\refClauseN}{%
  \@ifstar {\ref@ClauseN*}{\ref@ClauseN{}}
}
\newcommand*{\ref@ClauseN}[2]{%
  \begingroup
    \let\Clauseformat\relax
    \ref@Clause{#1}{#2}%
  \endgroup
}
\newcommand*{\refPar}{%
  \@ifstar {\ref@Par*}{\ref@Par{}}
}
\newcommand*{\ref@Par}[2]{%
  \expandafter\ifx\csname r@#2\endcsname\relax
    \ref#1{#2}%
  \else
    \begingroup
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\def
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\@tempb
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter{%
        \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
      \def\@tempc##1##2\@nil{##1}%
      \let\scrjura@separator\@gobble
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \csname r@#2\endcsname\noexpand\@nil}%
      \def\@tempc##1##2##3\@nil{##2}%
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \@tempa{%
          \protect\G@refundefinedtrue
          \nfss@text{\reset@font\bfseries ??}%
          \@latex@warning{Reference `#2' on page \thepage \space
            with undefined par number}%
        }\noexpand\@nil}%
      \let\@@protect\protect
      \let\protect\noexpand
      \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
      \let\protect\@@protect
      \ref#1{#2}%
    \endgroup
  \fi
}
\newcommand*{\refParL}{%
  \@ifstar {\ref@ParX0*}{\ref@ParX0{}}
}
\newcommand*{\ref@ParX}[3]{%
  \begingroup
    \def\parcite@format{#1}%
    \let\sentencecite@format\parcite@format
    \ref@Par{#2}{#3}%
  \endgroup
}
\newcommand*{\refParS}{%
  \@ifstar {\ref@ParX1*}{\ref@ParX1{}}
}
\newcommand*{\refParN}{%
  \@ifstar {\ref@ParN2*}{\ref@ParN2{}}
}
\newcommand*{\ref@ParN}[2]{%
  \@ifnextchar [%]
    {\ref@@ParN{#1}{#2}}%
    {\ref@ParX{#1}{#2}}%
}
\newcommand*{\ref@@ParN}{}
\def\ref@@ParN#1#2[#3]#4{%
  \begingroup
    \renewcommand*{\parnumericformat}[1]{%
      \csname @#3\endcsname{\number ##1\relax}%
    }%
    \ref@ParX{#1}{#2}{#4}%
  \endgroup
}
\newcommand*{\refSentence}{%
  \@ifstar {\ref@Sentence*}{\ref@Sentence{}}
}
\newcommand*{\ref@Sentence}[2]{%
  \expandafter\ifx\csname r@#2\endcsname\relax
    \ref#1{#2}%
  \else
    \begingroup
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\def
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter\@tempb
      \expandafter\expandafter\expandafter\expandafter
      \expandafter\expandafter\expandafter{%
        \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}%
      \def\@tempc##1##2\@nil{##1}%
      \let\scrjura@separator\@gobble
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \csname r@#2\endcsname\noexpand\@nil}%
      \def\@tempc##1##2##3##4\@nil{##3}%
      \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc
        \@tempa{}{%
          \protect\G@refundefinedtrue
          \nfss@text{\reset@font\bfseries ??}%
          \@latex@warning{Reference `#2' on page \thepage \space
            with undefined sentence number}%
        }\noexpand\@nil}%
      \let\@@protect\protect
      \let\protect\noexpand
      \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}%
      \let\protect\@@protect
      \ref#1{#2}%
    \endgroup
  \fi
}
\newcommand*{\refSentenceL}{%
  \@ifstar {\ref@SentenceX0*}{\ref@SentenceX0{}}
}
\newcommand*{\ref@SentenceX}[3]{%
  \begingroup
    \def\parcite@format{#1}%
    \let\sentencecite@format\parcite@format
    \ref@Sentence{#2}{#3}%
  \endgroup
}
\newcommand*{\refSentenceS}{%
  \@ifstar {\ref@SentenceX1*}{\ref@SentenceX1{}}
}
\newcommand*{\refSentenceN}{%
  \@ifstar {\ref@SentenceX2*}{\ref@SentenceX2{}}
}
\newcounter{sentence}[par]
\renewcommand*{\thesentence}{\arabic{sentence}}
\newcommand*{\theHsentence}{\theHpar-\arabic{sentence}}
\renewcommand*{\p@sentence}{\expandafter\p@@sentence}
\newcommand*{\p@@sentence}[1]{\p@par{{\par@cite{\thepar}}%
    \scrjura@separator{\nobreakspace}}{\sentence@cite{#1}}}
\newcommand*{\contract@sentence}{%
  \refstepcounter{sentence}%
  \textsuperscript{\thesentence}\nobreak\hskip\z@
}
\DeclareRobustCommand*{\par@cite}[1]{\parciteformat{#1}}
\newcommand*{\parciteformat}[1]{%
  \ifcase \parcite@format
    \expandafter\parlongformat
  \or
    \expandafter\parshortformat
  \or
    \expandafter\parnumericformat
  \else
    \unskip\expandafter\@gobble
  \fi
  {#1}%
}
\DeclareRobustCommand*{\sentence@cite}[1]{\sentenceciteformat{#1}}
\newcommand*{\sentenceciteformat}[1]{%
  \ifcase \sentencecite@format
    \expandafter\sentencelongformat
  \or
    \expandafter\sentenceshortformat
  \or
    \expandafter\sentencenumericformat
  \else
    \unskip\expandafter\@gobble
  \fi
  {#1}%
}
\newcommand*{\parlongformat}[1]{\parname~#1}
\newcommand*{\parshortformat}[1]{\parshortname~#1}
\newcommand*{\parnumericformat}[1]{\@Roman{\number #1\relax}}
\newcommand*{\sentencelongformat}[1]{\sentencename~#1}
\newcommand*{\sentenceshortformat}[1]{\sentenceshortname~#1}
\newcommand*{\sentencenumericformat}[1]{\@arabic{\number #1\relax}.}
\newcommand*{\parname}{Paragraph}
\AtBeginDocument{%
  \providecaptionname{german,ngerman,austrian,naustrian}\parname{Absatz}%
  \providecaptionname{german,ngerman,austrian,naustrian}\parshortname{Abs.}%
  \providecaptionname{german,ngerman,austrian,naustrian}\sentencename{Satz}%
  \providecaptionname{german,ngerman,austrian,naustrian}\sentenceshortname{S.}%
  \providecaptionname{english,american,british,canadian,USenglish,UKenglish}\parname{paragraph}%
  \providecaptionname{english,american,british,canadian,USenglish,UKenglish}\parshortname{par.}%
  \providecaptionname{english,american,british,canadian,USenglish,UKenglish}\sentencename{sentence}%
  \providecaptionname{english,american,british,canadian,USenglish,UKenglish}\sentenceshortname{sent.}%
}
\providecommand*{\parname}{\scrjura@lang@error{\parname}}
\providecommand*{\parshortname}{\scrjura@lang@error{\parshortname}}
\providecommand*{\sentencename}{\scrjura@lang@error{\sentencename}}
\providecommand*{\sentenceshortname}{\scrjura@lang@error{\sentenceshortname}}
\newcommand*{\scrjura@lang@error}[1]{%
  \PackageError{scrjura}{%
    current language not supported%
  }{%
    Currently scrjura only supports languages `german', `ngerman',
    `austrian',\MessageBreak
    `naustrian', `english', `american', `british', `canadian', `USenglish',
    and\MessageBreak
    `UKenglish'.\MessageBreak
    It seems, that you are using another language (maybe `\languagename') or
    that\MessageBreak
    your language selection isn't compatible to package `babel'.\MessageBreak
    Because of this you have to define `\string#1' by yourself!\MessageBreak
    It would be nice if you'll send your definitions to the author.%
  }%
  \textbf{??}%
}
\newcommand*{\newmaxpar}[3]{%
  \begingroup
    \expandafter\let\csname #1@Clauseformat\endcsname\@firstofone
    \protected@edef\@tempa{#2}\@onelevel@sanitize\@tempa
    \expandafter\xdef\csname max@#1@\@tempa\endcsname{#3}%
  \endgroup
}
\newcommand*{\getmaxpar}[3]{%
  \begingroup
    \expandafter\let\csname #2@Clauseformat\endcsname\@firstofone
    \protected@edef\@tempa{#3}%
    \@onelevel@sanitize\@tempa
    \expandafter\ifx \csname max@#2@\@tempa\endcsname\relax
      \edef\@tempa{\endgroup\edef\noexpand#1{\expandafter\the\value{par}}}%
    \else
      \edef\@tempa{\endgroup
        \edef\noexpand#1{\csname max@#2@\@tempa\endcsname}}%
    \fi
  \@tempa
}
\AtBeginDocument{%
  \immediate\write\@mainaux{%
    \string\providecommand*{\string\newmaxpar}[3]{}
  }%
}
%%% From File: $Id: scrlogo.dtx 1380 2013-10-01 15:31:55Z mjk $
\@ifundefined{KOMAScript}{%
  \DeclareRobustCommand{\KOMAScript}{\textsf{K\kern.05em O\kern.05em%
      M\kern.05em A\kern.1em-\kern.1em Script}}}{}
\endinput
%%
%% End of file `scrjura.sty'.
