From e02235dda0e68d2131b9cf111af5448fa125ad58 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 29 Jan 2017 22:32:58 +0000
Subject: koma-script (29jan17)

git-svn-id: svn://tug.org/texlive/trunk@43084 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/koma-script/scrartcl.cls  | 290 +++++++++++++--------
 1 file changed, 187 insertions(+), 103 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/koma-script/scrartcl.cls')

diff --git a/Master/texmf-dist/tex/latex/koma-script/scrartcl.cls b/Master/texmf-dist/tex/latex/koma-script/scrartcl.cls
index 6f85fa9d918..2c148569bf9 100644
--- a/Master/texmf-dist/tex/latex/koma-script/scrartcl.cls
+++ b/Master/texmf-dist/tex/latex/koma-script/scrartcl.cls
@@ -81,7 +81,7 @@
 %% find a complete unmodified copy of LaTeX2e at
 %% <http://www.ctan.org/pub/tex-archive/macros/latex/base/>.
 %% 
-%%% From File: $Id: scrkernel-version.dtx 2461 2016-05-19 07:17:15Z kohm $
+%%% From File: $Id: scrkernel-version.dtx 2491 2016-07-29 08:03:57Z kohm $
 \begingroup
   \catcode`\@11\relax
   \ifx\KOMAScriptVersion\undefined
@@ -103,7 +103,7 @@
       \fi
     }
   \fi
-  \@CheckKOMAScriptVersion{2016/06/14 v3.21 KOMA-Script}%
+  \@CheckKOMAScriptVersion{2017/01/03 v3.22 KOMA-Script}%
 \endgroup
 \providecommand*{\scr@clsextension}{\@clsextension}
 \AtBeginDocument{%
@@ -118,21 +118,21 @@
 \newcommand*{\KOMAClassFileName}{\KOMAClassName.\@clsextension}
 \edef\KOMAClassFileName{\KOMAClassFileName}
 \ProvidesClass{\KOMAClassName}[%
-  2016/06/14 v3.21 KOMA-Script
+  2017/01/03 v3.22 KOMA-Script
   document class (\ClassName)%
 ]
-%%% From File: $Id: scrkernel-basics.dtx 2467 2016-05-27 18:35:47Z kohm $
+%%% From File: $Id: scrkernel-basics.dtx 2490 2016-07-29 06:29:45Z kohm $
 \RequirePackage{scrkbase}[\KOMAScriptVersion]
-%%% From File: $Id: tocbasic.dtx 2477 2016-06-12 09:52:43Z kohm $
+%%% From File: $Id: tocbasic.dtx 2499 2016-09-06 07:00:45Z kohm $
 \RequirePackage{tocbasic}[%
-  2016/06/14 v3.21 KOMA-Script
+  2017/01/03 v3.22 KOMA-Script
 ]
 \addtotoclist{toc}
 \addtotoclist[float]{lof}
 \addtotoclist[float]{lot}
-%%% From File: $Id: scrkernel-tocstyle.dtx 2475 2016-06-09 07:51:01Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 2559 2016-12-02 08:03:11Z kohm $
 %%%            (run: prepare)
-%%% From File: $Id: scrkernel-sections.dtx 2477 2016-06-12 09:52:43Z kohm $
+%%% From File: $Id: scrkernel-sections.dtx 2565 2016-12-21 17:25:47Z kohm $
 %%%            (run: prepare)
 \newcommand*{\scr@dotchangeatdocument}[1]{%
   \ClassError{\KOMAClassName}{%
@@ -184,7 +184,7 @@
 \newcommand*{\size@paragraph}{}
 \newcommand*{\size@subparagraph}{}
 \newcommand*{\sectfont}{\normalcolor\@gr@gsffamily\bfseries}
-%%% From File: $Id: scrkernel-compatibility.dtx 2461 2016-05-19 07:17:15Z kohm $
+%%% From File: $Id: scrkernel-compatibility.dtx 2491 2016-07-29 08:03:57Z kohm $
 \newif\if@scr@emulatestandardclasses
 \let\scr@emulatestandardclassestrue\relax
 \let\scr@emulatestandardclassesfalse\relax
@@ -310,7 +310,8 @@
 \@namedef{scr@v@3.19a}{15}
 \@namedef{scr@v@3.20}{15}
 \@namedef{scr@v@3.21}{15}
-\@namedef{scr@v@last}{15}
+\@namedef{scr@v@3.22}{16}
+\@namedef{scr@v@last}{16}
 \newcommand*{\scr@v@is@lt}[1]{%
   \scr@compatibility<\@nameuse{scr@v@#1}
 }
@@ -350,7 +351,7 @@
   \if@egregdoesnotlikesansseriftitles\else\sffamily\fi
 }
 %%% From File: $Id: scrkernel-language.dtx 2429 2016-04-12 12:10:19Z kohm $
-%%% From File: $Id: scrkernel-fonts.dtx 2428 2016-04-12 10:31:07Z kohm $
+%%% From File: $Id: scrkernel-fonts.dtx 2501 2016-09-28 05:55:32Z kohm $
 \newcommand*\@ptsize{%
   11%
 }
@@ -435,7 +436,7 @@
 \BeforePackage{tex4ht}{%
   \let\scr@defineobsoletefonts\thr@@
 }
-%%% From File: $Id: scrkernel-typearea.dtx 2464 2016-05-27 17:14:11Z kohm $
+%%% From File: $Id: scrkernel-typearea.dtx 2494 2016-08-04 07:23:47Z kohm $
 \newcommand*{\@BCOR}{\expandafter\@@BCOR\CurrentOption BCORBCOR\@@BCOR}
 \newcommand*{\@@BCOR}{}
 \def\@@BCOR #1BCOR#2BCOR#3\@@BCOR{%
@@ -744,9 +745,9 @@
 \KOMA@ifkey{abstract}{@abstrt}
 \KOMA@DeclareStandardOption{abstracton}{abstract=true}
 \KOMA@DeclareStandardOption{abstractoff}{abstract=false}
-%%% From File: $Id: scrkernel-tocstyle.dtx 2475 2016-06-09 07:51:01Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 2559 2016-12-02 08:03:11Z kohm $
 %%%            (run: option)
-%%% From File: $Id: scrkernel-sections.dtx 2477 2016-06-12 09:52:43Z kohm $
+%%% From File: $Id: scrkernel-sections.dtx 2565 2016-12-21 17:25:47Z kohm $
 %%%            (run: option)
 \KOMA@key{numbers}{%
   \KOMA@set@ncmdkey{numbers}{@tempa}{%
@@ -976,7 +977,7 @@
 \KOMA@DeclareDeprecatedOption{cleardoubleempty}{cleardoublepage=empty}
 \KOMA@DeclareDeprecatedOption{cleardoubleplain}{cleardoublepage=plain}
 \KOMA@DeclareDeprecatedOption{cleardoublestandard}{cleardoublepage=current}
-%%% From File: $Id: scrkernel-floats.dtx 2468 2016-05-31 11:27:28Z kohm $
+%%% From File: $Id: scrkernel-floats.dtx 2498 2016-09-01 19:44:10Z kohm $
 \newif\if@captionabove\@captionabovefalse
 \newif\if@tablecaptionabove\@tablecaptionabovefalse
 \newif\if@figurecaptionabove\@figurecaptionabovefalse
@@ -1110,7 +1111,7 @@
 \DeclareOption{origlongtable}{\@komalongtablefalse}
 \KOMA@DeclareDeprecatedOption{onelinecaption}{captions=oneline}
 \KOMA@DeclareDeprecatedOption{noonelinecaption}{captions=nooneline}
-%%% From File: $Id: scrkernel-footnotes.dtx 2180 2015-08-24 09:28:16Z kohm $
+%%% From File: $Id: scrkernel-footnotes.dtx 2571 2017-01-03 13:04:47Z kohm $
 \KOMA@key{footnotes}{%
   \ifx\@footnotemark\scr@saved@footnotemark
   \else
@@ -1650,8 +1651,8 @@
 \KOMA@kav@add{.\KOMAClassFileName}{index}{notoc}
 \KOMA@kav@add{.\KOMAClassFileName}{index}{standardlevel}
 \KOMA@DeclareDeprecatedOption{idxtotoc}{index=totoc}
-%%% From File: $Id: scrkernel-listsandtabulars.dtx 2318 2016-01-29 11:40:15Z kohm $
-%%% From File: $Id: scrkernel-sections.dtx 2477 2016-06-12 09:52:43Z kohm $
+%%% From File: $Id: scrkernel-listsandtabulars.dtx 2503 2016-10-21 08:54:46Z kohm $
+%%% From File: $Id: scrkernel-sections.dtx 2565 2016-12-21 17:25:47Z kohm $
 %%%            (run: execoption)
 \KOMAExecuteOptions{numbers=autoendperiod}
 %%% From File: $Id: scrkernel-miscellaneous.dtx 2463 2016-05-19 07:27:47Z kohm $
@@ -1660,8 +1661,8 @@
   headings=big%
 }
 \KOMAProcessOptions\relax
-%%% From File: $Id: scrkernel-compatibility.dtx 2461 2016-05-19 07:17:15Z kohm $
-%%% From File: $Id: scrkernel-fonts.dtx 2428 2016-04-12 10:31:07Z kohm $
+%%% From File: $Id: scrkernel-compatibility.dtx 2491 2016-07-29 08:03:57Z kohm $
+%%% From File: $Id: scrkernel-fonts.dtx 2501 2016-09-28 05:55:32Z kohm $
 \newcommand*\scr@setlength[4]{%
   \expandafter\ifnum\scr@v@is@lt{3.12}\relax
     \setlength{#1}{#2 \@plus#3 \@minus#4}%
@@ -2068,15 +2069,15 @@
     \ClassError{\KOMAClassName}{undefined old font command `\string#1'}{%
       You should note that since 1994 LaTeX2e provides a new font selection
       scheme\MessageBreak
-      called NFSS2 with several new, combinable font commands. New
+      called NFSS2 with several new, combinable font commands.
       KOMA-Script\MessageBreak
-      classes have defined the old font commands like `\string#1'
+      classes had defined the old font commands like `\string#1'
       only for compatibility\MessageBreak
       with old LaTeX 2.09 document styles of Script 2.0. Nevertheless,
       these\MessageBreak
-      commands are deprecated and undocumented at least since
-      2003. Since 2013\MessageBreak
-      KOMA-Script classes warn abouts soon removement of these deprecated
+      commands are deprecated and undocumented at least since 2003. Since
+      2013\MessageBreak
+      KOMA-Script classes warned about soon removement of these deprecated
       commands.\MessageBreak
       Now, after two decades of LaTeX2e and NFSS2, these commands will not
       work any\MessageBreak
@@ -2106,11 +2107,11 @@
       You should note, that since 1994 LaTeX2e provides a\MessageBreak
       new font selection scheme called NFSS2 with several\MessageBreak
       new, combinable font commands. New KOMA-Script classes\MessageBreak
-      have defined the old font commands like `\string#1' only for\MessageBreak
+      defined the old font commands like `\string#1' only for\MessageBreak
       compatibility with LaTeX 2.09 document styles of\MessageBreak
       Script 2.0. These commands are deprecated and\MessageBreak
       undocumented at least since 2003. Since 2013,\MessageBreak
-      KOMA-Script classes warn about soon removement of\MessageBreak
+      KOMA-Script classes warned about soon removement of\MessageBreak
       these deprecated commands. Now, after two decades of\MessageBreak
       LaTeX2e, NFSS2, and KOMA-Script these commands will\MessageBreak
       not work any longer. If loading a package results in\MessageBreak
@@ -2140,7 +2141,7 @@
         January\or February\or March\or April\or May\or June\or
         July\or August\or September\or October\or November\or December\fi
         \space\number\day, \number\year}%
-%%% From File: $Id: scrkernel-typearea.dtx 2464 2016-05-27 17:14:11Z kohm $
+%%% From File: $Id: scrkernel-typearea.dtx 2494 2016-08-04 07:23:47Z kohm $
 \let\@BCOR                =\relax
 \let\@@BCOR               =\relax
 \let\@DIV                 =\relax
@@ -2653,10 +2654,10 @@
   \fi
 }
 \newcommand*\abstractname{Abstract}
-%%% From File: $Id: scrkernel-tocstyle.dtx 2475 2016-06-09 07:51:01Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 2559 2016-12-02 08:03:11Z kohm $
 %%%            (run: body)
 \let\numberline\scr@numberline
-%%% From File: $Id: scrkernel-tocstyle.dtx 2475 2016-06-09 07:51:01Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 2559 2016-12-02 08:03:11Z kohm $
 %%%            (run: class,style,part)
 \CloneTOCEntryStyle{tocline}{part}
 \TOCEntryStyleStartInitCode{part}{%
@@ -2670,7 +2671,7 @@
   \expandafter\providecommand\expandafter*%
   \csname scr@tso@#1@beforeskip\endcsname{2.25em \@plus\p@}%
 }
-%%% From File: $Id: scrkernel-tocstyle.dtx 2475 2016-06-09 07:51:01Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 2559 2016-12-02 08:03:11Z kohm $
 %%%            (run: class,style,section)
 \CloneTOCEntryStyle{tocline}{section}
 \TOCEntryStyleStartInitCode{section}{%
@@ -2690,17 +2691,17 @@
   \expandafter\providecommand\expandafter*%
   \csname scr@tso@#1@beforeskip\endcsname{1.0em \@plus\p@}%
 }
-%%% From File: $Id: scrkernel-tocstyle.dtx 2475 2016-06-09 07:51:01Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 2559 2016-12-02 08:03:11Z kohm $
 %%%            (run: class,style,subsection)
 \CloneTOCEntryStyle{tocline}{subsection}
 \TOCEntryStyleStartInitCode{subsection}{%
   \expandafter\providecommand%
   \csname scr@tso@#1@linefill\endcsname{\TOCLineLeaderFill\relax}%
 }
-%%% From File: $Id: scrkernel-tocstyle.dtx 2475 2016-06-09 07:51:01Z kohm $
+%%% From File: $Id: scrkernel-tocstyle.dtx 2559 2016-12-02 08:03:11Z kohm $
 %%%            (run: class,style,default)
 \CloneTOCEntryStyle{subsection}{default}
-%%% From File: $Id: scrkernel-sections.dtx 2477 2016-06-12 09:52:43Z kohm $
+%%% From File: $Id: scrkernel-sections.dtx 2565 2016-12-21 17:25:47Z kohm $
 %%%            (run: body)
 \setcounter{secnumdepth}{3}
 \newcommand*{\ifnumbered}[1]{%
@@ -2924,16 +2925,16 @@
     \scr@istest#7=\@nil
   \fi
   \if@scr@tempswa
-    \setkeys{KOMAarg.section}{tocentry={#8},head={#8},#7}%
+    \setkeys{KOMAarg.section}{tocentry={#8},head={#8},reference={#8},#7}%
   \else
     \ifcase \scr@osectarg\relax
-      \setkeys{KOMAarg.section}{tocentry={#7},head={#7}}%
+      \setkeys{KOMAarg.section}{tocentry={#7},head={#7},reference={#7}}%
     \or
-      \setkeys{KOMAarg.section}{tocentry={#8},head={#7}}%
+      \setkeys{KOMAarg.section}{tocentry={#8},head={#7},reference={#8}}%
     \or
-      \setkeys{KOMAarg.section}{tocentry={#7},head={#8}}%
+      \setkeys{KOMAarg.section}{tocentry={#7},head={#8},reference={#7}}%
     \or
-      \setkeys{KOMAarg.section}{tocentry={#7},head={#7}}%
+      \setkeys{KOMAarg.section}{tocentry={#7},head={#7},reference={#7}}%
     \fi
   \fi
   \let\IfUsePrefixLine\@secondoftwo
@@ -2950,8 +2951,8 @@
       #6{\nobreak\interlinepenalty \@M
         \sectionlinesformat{#1}{\glueexpr #3\relax}\@svsec{#8}\@@par}%
     \endgroup
-    \expandafter\csname #1mark\expandafter\endcsname\expandafter{\scr@ds@head}%
-    \ifx\scr@ds@tocentry\@empty\else
+    \expandafter\csname #1mark\expandafter\endcsname\expandafter{\@currentheadentry}%
+    \ifx\@currenttocentry\@empty\else
       \scr@ifundefinedorrelax{add#1tocentry}{%
         \expandafter\global\expandafter\def
         \csname add#1tocentry\endcsname##1##2{%
@@ -2959,18 +2960,18 @@
         }%
       }{}%
       \ifnum \numexpr #2\relax>\c@secnumdepth
-        \csname add#1tocentry\endcsname{}{\scr@ds@tocentry}%
+        \csname add#1tocentry\endcsname{}{\@currenttocentry}%
       \else
         \csname add#1tocentry\endcsname{\csname the#1\endcsname}{%
-          \scr@ds@tocentry}%
+          \@currenttocentry}%
       \fi
     \fi
   \else
     \def\@svsechd{%
       #6{\nobreak\sectioncatchphraseformat{#1}{\glueexpr #3\relax}\@svsec{#8}}%
-       \expandafter\csname #1mark\expandafter\endcsname
-       \expandafter{\scr@ds@head}%
-      \ifx\scr@ds@tocentry\@empty\else
+      \expandafter\csname #1mark\expandafter\endcsname
+      \expandafter{\@currentheadentry}%
+      \ifx\@currenttocentry\@empty\else
         \scr@ifundefinedorrelax{add#1tocentry}{%
           \expandafter\global\expandafter\def
           \csname add#1tocentry\endcsname####1####2{%
@@ -2978,10 +2979,10 @@
           }%
         }{}%
         \ifnum \numexpr #2\relax>\c@secnumdepth
-          \csname add#1tocentry\endcsname{}{\scr@ds@tocentry}%
+          \csname add#1tocentry\endcsname{}{\@currenttocentry}%
         \else
           \csname add#1tocentry\endcsname{\csname the#1\endcsname}{%
-            \scr@ds@tocentry}%
+            \@currenttocentry}%
         \fi
       \fi
     }%
@@ -2991,10 +2992,30 @@
 }
 \DefineFamily{KOMAarg}
 \DefineFamilyMember[.section]{KOMAarg}
-\DefineFamilyKey[.section]{KOMAarg}{tocentry}{\def\scr@ds@tocentry{#1}}
-\DefineFamilyKey[.section]{KOMAarg}{head}{\def\scr@ds@head{#1}}
-\newcommand*\scr@ds@tocentry{}
-\newcommand*\scr@ds@head{}
+\providecommand*\@currenttocentry{}
+\providecommand*\@currentheadentry{}
+\providecommand*\@currentlabelname{}
+\FamilyStringKey[.section]{KOMAarg}{tocentry}{\@currenttocentry}
+\FamilyStringKey[.section]{KOMAarg}{head}{\@currentheadentry}
+\DefineFamilyKey[.section]{KOMAarg}{reference}{%
+  \scr@ifundefinedorrelax{NR@gettitle}{%
+    \scr@ifundefinedorrelax{GetTitleString}{%
+      \def\@currentlabelname{#1}%
+    }{%
+      \GetTitleString{#1}%
+      \let\@currentlabelname\GetTitleStringResult
+    }%
+  }{%
+    \NR@gettitle{#1}%
+  }%
+  \scr@ifundefinedorrelax{TR@gettitle}{}{%
+    \expandafter\TR@gettitle\expandafter{\@currentlabelname}%
+  }%
+  \scr@ifundefinedorrelax{ztitlerefsetup}{}{%
+    \ztitlerefsetup{title=\@currentlabelname}%
+  }%
+  \FamilyKeyStateProcessed
+}
 \newcommand*{\scr@istest}{}
 \def\scr@istest#1=#2\@nil{%
   \ifx\relax#2\relax\@scr@tempswafalse\else\@scr@tempswatrue\fi
@@ -3633,7 +3654,26 @@
     \@dottedtocline{#1}{#2}{#3}{#4}{#5}%
   \fi
 }
-\newcommand*\appendix{\par%
+\newcommand*\appendix{%
+  \ifstr{\@currenvir}{appendix}{%
+    \ClassWarning{\KOMAClassName}{%
+      You are using
+      `\string\begin{appendix}...\string\end{appendix}'.\MessageBreak
+      You should note, that `\string\appendix' is a mostly
+      globally\MessageBreak
+      working command not an enviroment with only local\MessageBreak
+      effects. Therefore `\string\end{appendix}' will neither\MessageBreak
+      switch back to normal section numbering nor finish\MessageBreak
+      every other effect of `\string\begin{appendix}'.\MessageBreak
+      Nevertheless, some effects may end with\MessageBreak
+      `\string\end{appendix}' and the document may become\MessageBreak
+      inconsistent.\MessageBreak
+      Because of this, you should remove `\string\end{appendix}'\MessageBreak
+      and replace `\string\begin{appendix}' by command\MessageBreak
+      `\string\appendix'%
+    }%
+  }{}%
+  \par%
   \setcounter{section}{0}%
   \setcounter{subsection}{0}%
   \gdef\thesection{\@Alph\c@section}%
@@ -3655,16 +3695,16 @@
     \scr@istest#2=\@nil
   \fi
   \if@scr@tempswa
-    \setkeys{KOMAarg.section}{tocentry={#3},head={#3},#2}%
+    \setkeys{KOMAarg.section}{tocentry={#3},head={#3},reference={#3},#2}%
   \else
     \ifcase \scr@osectarg\relax
-      \setkeys{KOMAarg.section}{tocentry={#2},head={#2}}%
+      \setkeys{KOMAarg.section}{tocentry={#2},head={#2},reference={#2}}%
     \or
-      \setkeys{KOMAarg.section}{tocentry={#3},head={#2}}%
+      \setkeys{KOMAarg.section}{tocentry={#3},head={#2},reference={#3}}%
     \or
-      \setkeys{KOMAarg.section}{tocentry={#2},head={#3}}%
+      \setkeys{KOMAarg.section}{tocentry={#2},head={#3},reference={#2}}%
     \or
-      \setkeys{KOMAarg.section}{tocentry={#2},head={#2}}%
+      \setkeys{KOMAarg.section}{tocentry={#2},head={#2},reference={#2}}%
     \fi
   \fi
   \ifnumbered{#1}{%
@@ -3672,12 +3712,12 @@
     \@maybeautodot\thepart%
     \expandafter\@maybeautodot\csname the#1\endcsname
     \typeout{#1 \csname the#1\endcsname.}%
-    \ifx\scr@ds@tocentry\@empty\else
+    \ifx\@currenttocentry\@empty\else
       \scr@ifundefinedorrelax{add#1tocentry}{%
         \addtocentrydefault{#1}%
       }{%
         \@nameuse{add#1tocentry}%
-      }{\csname the#1\endcsname}{\scr@ds@tocentry}%
+      }{\csname the#1\endcsname}{\@currenttocentry}%
     \fi
   }{%
     \expandafter\ifnum\scr@v@is@lt{3.18}\relax\else
@@ -3687,13 +3727,13 @@
       \endgroup
     \fi
     \typeout{#1 without number}%
-    \ifx\scr@ds@tocentry\@empty\else
+    \ifx\@currenttocentry\@empty\else
       \hy@insteadofrefstepcounter{#1}%
       \scr@ifundefinedorrelax{add#1tocentry}{%
         \addtocentrydefault{#1}%
       }{%
         \@nameuse{add#1tocentry}%
-      }{}{\scr@ds@tocentry}%
+      }{}{\@currenttocentry}%
     \fi
   }%
   \begingroup
@@ -3709,7 +3749,7 @@
     \expandafter\ifx\csname #1mark\endcsname\@gobble
       \@mkboth{}{}%
     \else
-      \csname #1mark\expandafter\endcsname\expandafter{\scr@ds@head}%
+      \csname #1mark\expandafter\endcsname\expandafter{\@currentheadentry}%
     \fi
     \par
   \endgroup
@@ -4233,7 +4273,7 @@
 \newcommand*{\indexpagestyle}{plain}
 \pagestyle{plain}
 \pagenumbering{arabic}
-%%% From File: $Id: scrkernel-floats.dtx 2468 2016-05-31 11:27:28Z kohm $
+%%% From File: $Id: scrkernel-floats.dtx 2498 2016-09-01 19:44:10Z kohm $
 \newcommand\marginline[1]{%
   \marginpar[\raggedleft{#1}]{\raggedright #1}%
 }
@@ -4657,11 +4697,29 @@
   \cap@margin
   \begingroup
     \ifonelinecaptions
-      \let\stepcounter\@gobble
-      \let\refstepcounter\@gobble
+      \def\stepcounter##1{\advance\value{##1}\@ne}%
+      \let\refstepcounter\stepcounter
       \let\label\@gobble
       \let\@footnotetext=\@gobble
       \let\hypertarget\@gobbletwo
+      \edef\@xnewline{%
+        \unexpanded{\ClassInfo{\KOMAClassName}{%
+            Workaround for not recommended usage of \string\\ or\MessageBreak
+            \string\newline in caption text
+          }%
+          \hspace*{\linewidth}\hspace{1sp}%
+        }%
+        \unexpanded\expandafter{\@xnewline}%
+      }%
+      \edef\@xcentercr{%
+        \unexpanded{\ClassInfo{\KOMAClassName}{%
+            Workaround for not recommended usage of \string\\ or\MessageBreak
+            \string\newline in caption text
+          }%
+          \hspace*{\linewidth}\hspace{1sp}%
+        }%
+        \unexpanded\expandafter{\@xcentercr}%
+      }%
       \settowidth{\@tempdima}{\scr@@makesinglelinecaption{#1}{#2}{#3}}%
       \ifdim\@tempdima>\linewidth
         \aftergroup\scr@makemultilinecaption
@@ -4905,7 +4963,7 @@
 }{%
   \end@dblfloat
 }
-%%% From File: $Id: scrkernel-footnotes.dtx 2180 2015-08-24 09:28:16Z kohm $
+%%% From File: $Id: scrkernel-footnotes.dtx 2571 2017-01-03 13:04:47Z kohm $
 \renewcommand*\footnoterule{%
   \normalsize\ftn@rule@test@values
   \kern-\dimexpr 2.6\p@+\ftn@rule@height\relax
@@ -4958,28 +5016,46 @@
   \ftn@rule@test@values
 }
 \newcommand\deffootnote[4][]{%
-  \long\def\@makefntext##1{%
-    \setlength{\@tempdimc}{#3}%
-    \def\@tempa{#1}\ifx\@tempa\@empty
-      \@setpar{\@@par
-        \@tempdima = \hsize
-        \addtolength{\@tempdima}{-#2}%
-        \parshape \@ne #2 \@tempdima}%
-    \else
-      \addtolength{\@tempdimc}{#2}%
-      \addtolength{\@tempdimc}{-#1}%
-      \@setpar{\@@par
-        \@tempdima = \hsize
-        \addtolength{\@tempdima}{-#1}%
-        \@tempdimb = \hsize
-        \addtolength{\@tempdimb}{-#2}%
-        \parshape \tw@ #1 \@tempdima #2 \@tempdimb
+  \expandafter\ifnum\scr@v@is@ge{3.22}\relax
+    \long\def\@makefntext##1{%
+      \leftskip #2
+      \l@addto@macro\@trivlist{%
+        \ifnum\@listdepth=\@ne\advance\leftmargin #2\relax\fi
       }%
-    \fi
-    \par
-    \parindent\@tempdimc\noindent
-    \ftn@font\hbox to \z@{\hss\@@makefnmark}##1%
-  }%
+      \parindent #3\noindent
+      \IfArgIsEmpty{#1}{}{%
+        \hskip \dimexpr #1-#2\relax
+      }%
+      \ftn@font\hbox to \z@{\hss\@@makefnmark}##1%
+    }%
+  \else
+    \ClassInfo{\KOMAClassName}{%
+      Using old \string\@makefntext\space due to compatibility
+      level\MessageBreak
+      less than 3.22}%
+    \long\def\@makefntext##1{%
+      \setlength{\@tempdimc}{#3}%
+      \def\@tempa{#1}\ifx\@tempa\@empty
+        \@setpar{\@@par
+          \@tempdima = \hsize
+          \addtolength{\@tempdima}{-#2}%
+          \parshape \@ne #2 \@tempdima}%
+      \else
+        \addtolength{\@tempdimc}{#2}%
+        \addtolength{\@tempdimc}{-#1}%
+        \@setpar{\@@par
+          \@tempdima = \hsize
+          \addtolength{\@tempdima}{-#1}%
+          \@tempdimb = \hsize
+          \addtolength{\@tempdimb}{-#2}%
+          \parshape \tw@ #1 \@tempdima #2 \@tempdimb
+        }%
+      \fi
+      \par
+      \parindent\@tempdimc\noindent
+      \ftn@font\hbox to \z@{\hss\@@makefnmark}##1%
+    }%
+  \fi
   \def\@@makefnmark{\hbox{\ftnm@font{#4}}}%
 }
 \newcommand*{\ftn@font}{\normalfont}
@@ -5316,7 +5392,7 @@
   \par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax
 }
 \newcommand*\indexname{Index}
-%%% From File: $Id: scrkernel-listsandtabulars.dtx 2318 2016-01-29 11:40:15Z kohm $
+%%% From File: $Id: scrkernel-listsandtabulars.dtx 2503 2016-10-21 08:54:46Z kohm $
 \if@twocolumn
   \setlength{\leftmargini}{2em}
 \else
@@ -5420,22 +5496,24 @@
 }
 \newenvironment{addmargin*}{%
   \@tempswafalse
-  \if@twoside\is@thispageodd[]\ifthispagewasodd\else\@tempswatrue\fi\fi
-  \edef\scr@addmargin@startpage{\csname tpo@\scr@tpo\endcsname}%
+  \if@twoside\is@thispageodd[]\ifthispagewasodd\else\@tempswatrue\fi
+    \edef\scr@addmargin@startpage{\csname tpo@\scr@tpo\endcsname}\fi
   \@addmargin
 }{%
-  \unskip\nobreak\ifthispageodd{}{}%
-  \expandafter\ifx\csname tpo@\scr@tpo\endcsname\scr@addmargin@startpage\else
-    \ClassWarning{\KOMAClassName}{%
-      page break inside `addmargin*' environment.\MessageBreak
-      A `addmargin*' environment starting on page
-      \scr@addmargin@startpage\MessageBreak
-      ends on page \csname tpo@\scr@tpo\endcsname.\MessageBreak
-      This will result in potential wrong margins on\MessageBreak
-      every other page.\MessageBreak
-      So maybe you should change the `addmargin*'\MessageBreak
-      environment, that ends%
-    }%
+  \if@twoside
+    \unskip\nobreak\ifthispageodd{}{}%
+    \expandafter\ifx\csname tpo@\scr@tpo\endcsname\scr@addmargin@startpage\else
+      \ClassWarning{\KOMAClassName}{%
+        page break inside `addmargin*' environment.\MessageBreak
+        A `addmargin*' environment starting on page
+        \scr@addmargin@startpage\MessageBreak
+        ends on page \csname tpo@\scr@tpo\endcsname.\MessageBreak
+        This will result in potential wrong margins on\MessageBreak
+        every other page.\MessageBreak
+        So maybe you should change the `addmargin*'\MessageBreak
+        environment, that ends%
+      }%
+    \fi
   \fi
   \advance\@listdepth\@ne
   \endlist
@@ -5454,13 +5532,19 @@
     \setlength{\listparindent}{\parindent}%
     \setlength{\itemsep}{\parskip}%
     \setlength{\itemindent}{\z@}%
+    \setlength{\@tempskipa}{\topsep}%
     \setlength{\topsep}{\z@}%
     \setlength{\parsep}{\parskip}%
+    \setlength{\@tempskipb}{\partopsep}%
     \setlength{\partopsep}{\z@}%
     \let\makelabel\@gobble
     \setlength{\labelwidth}{\z@}%
     \advance\@listdepth\m@ne
   }%
+  \expandafter\ifnum\scr@v@is@ge{3.22}%
+    \setlength{\topsep}{\@tempskipa}%
+    \setlength{\partopsep}{\@tempskipb}%
+  \fi
   \item\is@thispageodd@setlabel\nobreak\ignorespaces
 }
 \newcommand*\descfont{\@gr@gsffamily\bfseries}
-- 
cgit v1.2.3

