diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/koma-script/scrjura.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/koma-script/scrjura.sty | 298 |
1 files changed, 245 insertions, 53 deletions
diff --git a/Master/texmf-dist/tex/latex/koma-script/scrjura.sty b/Master/texmf-dist/tex/latex/koma-script/scrjura.sty index 269e191ecf3..4d686e1e5fb 100644 --- a/Master/texmf-dist/tex/latex/koma-script/scrjura.sty +++ b/Master/texmf-dist/tex/latex/koma-script/scrjura.sty @@ -14,10 +14,10 @@ %% --------------------------------------------------------------- %% %% This work may be distributed and/or modified under the conditions of -%% the LaTeX Project Public License, version 1.3b of the license. +%% 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.3b or later is part of all distributions of LaTeX +%% 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". @@ -41,10 +41,9 @@ %%% From File: scrjura.dtx \NeedsTeXFormat{LaTeX2e}[1995/06/01] \ProvidesPackage{scrjura} - [2008/01/23 v0.4b alpha + [2009/03/24 v0.5a beta (package)% ] - \@ifpackageloaded{hyperref}{% \PackageError{scrjura}{Package hyperref already loaded}{% If you want to use package scrjura with package hyperref, you have to @@ -54,26 +53,91 @@ hyperref\MessageBreak behind the loading of package scrjura.}% } +\RequirePackage{scrkbase} \DeclareOption{contract}{% \g@addto@macro\document\contract% } -\newif\if@juratotoc -\DeclareOption{juratotoc}{\@juratotoctrue} +\KOMA@ifkey{juratotoc}{@juratotoc} \newcommand*{\Paragraphmark}[1]{} -\DeclareOption{markright}{% - \renewcommand*{\Paragraphmark}[1]{\markright{#1}}% -} -\DeclareOption{markboth}{% - \renewcommand*{\Paragraphmark}[1]{\markboth{#1}{#1}}% -} -\DeclareOption{parcitename}{% - \AtEndOfPackage{\renewcommand*{\parciteformat}[1]{\parname~#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}% + \ifcase\number\@tempa + \endgroup + \let\Paragraphmark\@gobble + \or + \endgroup + \renewcommand*{\Paragraphmark}[1]{\markright{##1}}% + \or + \endgroup + \renewcommand*{\Paragraphmark}[1]{\markboth{##1}{##1}}% + \or + \endgroup + \renewcommand*{\Paragraphmark}[1]{% + \ifx\@mkboth\@gobbletwo\else\markright{##1}\fi}% + \or + \endgroup + \renewcommand*{\Paragraphmark}[1]{\@mkboth{##1}{##1}}% + \else + \endgroup + \fi } -\DeclareOption{sentencecitename}{% - \AtEndOfPackage{\renewcommand*{\sentenceciteformat}[1]{\sentencename~#1}}% +\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},% + {sentencelong}{10},{longsentence}{10},{SentenceL}{10},% + {sentenceshort}{20},{shortsentence}{20},{SentenceS}{20},% + {sentencenumeric}{30},{numericsentence}{30},{SentenceN}{30},% + {long}{11},% + {short}{22},% + {numeric}{33}% + }{#1}% + \@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}% + \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}% + \fi + \endgroup } -\ProcessOptions\relax -\RequirePackage{keyval} +\KOMA@DeclareDeprecatedOption[scrjura]{parcitename}{ref=parlong} +\KOMA@DeclareDeprecatedOption[scrjura]{sentencecitename}{ref=sentencelong} +\KOMAProcessOptions\relax \newcommand*{\contract}{% \renewcommand*{\contract}{% \contract@nest@error{contract}% @@ -93,7 +157,9 @@ \let\cl@SubParagraph\@empty \newcounter{contractParagraph} \renewcommand*{\thecontractParagraph}{% - {\S~\arabic{contractParagraph}}} + {\contract@Paragraphformat{\arabic{contractParagraph}}}} +\DeclareRobustCommand*{\contract@Paragraphformat}[1]{\paragraphformat{#1}} +\newcommand*{\paragraphformat}[1]{\S~#1} \newcounter{contractSubParagraph} \@addtoreset{SubParagraph}{Paragraph} \renewcommand*{\thecontractSubParagraph}{% @@ -311,9 +377,36 @@ \setcounter{sentence}{0}\refstepcounter{sentence}% \fi } -\newcommand*{\refParagraph}[1]{% - \expandafter\ifx\csname r@#1\endcsname\relax - \ref{#1}% +\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*{\refParagraph}{% + \@ifstar {\ref@Paragraph*}{\ref@Paragraph{}} +} +\newcommand*{\ref@Paragraph}[2]{% + \expandafter\ifx\csname r@#2\endcsname\relax + \ref#1{#2}% \else \begingroup \expandafter\expandafter\expandafter\expandafter @@ -322,24 +415,36 @@ \expandafter\expandafter\expandafter\@tempb \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter\@gobble\csname r@#1\endcsname}% + \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}% \def\@tempc##1##2\@nil{##1}% \let\jura@separator\@gobble \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc - \csname r@#1\endcsname\noexpand\@nil}% + \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@#1\endcsname{{\@tempa}\@tempb}% + \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}% \let\protect\@@protect - \ref{#1}% + \ref#1{#2}% \endgroup \fi } -\newcommand*{\refPar}[1]{% - \expandafter\ifx\csname r@#1\endcsname\relax - \ref{#1}% +\newcommand*{\refParagraphN}{% + \@ifstar {\ref@ParagraphN*}{\ref@ParagraphN{}} +} +\newcommand*{\ref@ParagraphN}[2]{% + \begingroup + \let\paragraphformat\relax + \ref@Paragraph{#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 @@ -348,30 +453,63 @@ \expandafter\expandafter\expandafter\@tempb \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter\@gobble\csname r@#1\endcsname}% + \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}% \def\@tempc##1##2\@nil{##1}% \let\jura@separator\@gobble \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc - \csname r@#1\endcsname\noexpand\@nil}% + \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 `#1' on page \thepage \space + \@latex@warning{Reference `#2' on page \thepage \space with undefined par number}% }\noexpand\@nil}% \let\@@protect\protect \let\protect\noexpand - \expandafter\edef\csname r@#1\endcsname{{\@tempa}\@tempb}% + \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}% \let\protect\@@protect - \ref{#1}% + \ref#1{#2}% \endgroup \fi } -\newcommand*{\refSentence}[1]{% - \expandafter\ifx\csname r@#1\endcsname\relax - \ref{#1}% +\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 @@ -380,27 +518,43 @@ \expandafter\expandafter\expandafter\@tempb \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter{% - \expandafter\expandafter\expandafter\@gobble\csname r@#1\endcsname}% + \expandafter\expandafter\expandafter\@gobble\csname r@#2\endcsname}% \def\@tempc##1##2\@nil{##1}% \let\jura@separator\@gobble \protected@edef\@tempa{\expandafter\expandafter\expandafter\@tempc - \csname r@#1\endcsname\noexpand\@nil}% + \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 `#1' on page \thepage \space + \@latex@warning{Reference `#2' on page \thepage \space with undefined sentence number}% }\noexpand\@nil}% \let\@@protect\protect \let\protect\noexpand - \expandafter\edef\csname r@#1\endcsname{{\@tempa}\@tempb}% + \expandafter\edef\csname r@#2\endcsname{{\@tempa}\@tempb}% \let\protect\@@protect - \ref{#1}% + \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}} @@ -412,21 +566,59 @@ \ensuremath{^{\mbox{\fontsize\sf@size\z@\selectfont\thesentence}}}% } \DeclareRobustCommand*{\par@cite}[1]{\parciteformat{#1}} -\newcommand*{\parciteformat}[1]{\@Roman{\numexpr #1\relax}} +\newcommand*{\parciteformat}[1]{% + \ifcase \parcite@format + \parlongformat{#1}% + \or + \parshortformat{#1}% + \or + \parnumericformat{#1}% + \fi +} \DeclareRobustCommand*{\sentence@cite}[1]{\sentenceciteformat{#1}} -\newcommand*{\sentenceciteformat}[1]{\@arabic{\numexpr #1\relax}} +\newcommand*{\sentenceciteformat}[1]{% + \ifcase \sentencecite@format + \sentencelongformat{#1}% + \or + \sentenceshortformat{#1}% + \or + \sentencenumericformat{#1}% + \fi +} +\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{% - \@ifundefined{captionsgerman}{}{% - \addto\captionsgerman{\def\parname{Absatz}}% - \addto\captionsgerman{\def\sentencename{Satz}}% - \ifnum \l@german=\language\selectlanguage{german}\fi - }% - \@ifundefined{captionsngerman}{}{% - \addto\captionsngerman{\def\parname{Absatz}}% - \addto\captionsngerman{\def\sentencename{Satz}}% - \ifnum \l@ngerman=\language\selectlanguage{ngerman}\fi + \providecaptionname{german}\parname{Absatz}% + \providecaptionname{german}\parshortname{Abs.}% + \providecaptionname{german}\sentencename{Satz}% + \providecaptionname{german}\sentenceshortname{S.}% + \providecaptionname{ngerman}\parname{Absatz}% + \providecaptionname{ngerman}\parshortname{Abs.}% + \providecaptionname{ngerman}\sentencename{Satz}% + \providecaptionname{ngerman}\sentenceshortname{S.}% +} +\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]{% + \PackageErrorNoLine{scrjura}{% + current language not supported% + }{% + Currently scrjura only supports languages ``german'' and + ``ngerman''.\MessageBreak + It seems, that you are using another language (maybe + \languagename).\MessageBreak + Because of this you have to define \string#1\space by + yourself!\MessageBreak + It would be nice if you'll send your definitions to the author.% }% + \textbf{??}% } \newcommand*{\newmaxpar}[3]{% \begingroup |