Gliederungs-Nr in den Rand geht nicht unter KOMA v3.17.2062 Thema ist als GELÖST markiert

Klassen und Pakete zur einfachen Umsetzung individueller Vorstellungen


MGommes

Gliederungs-Nr in den Rand geht nicht unter KOMA v3.17.2062

Beitrag von MGommes »

Folgendes Beispiel (siehe auch http://komascript.de/node/27)
funktioniert mit MiKTeX noch einwandfrei, aber nicht mehr mit Texlive und KOMA-Script v3.17.2062. Bei der neuen KOMA-Version wird nur noch die
Überschrift Ebene 0 ausgerückt, alle anderen nicht mehr.
% Gliederungsnummern in den Rand geht nicht mehr unter KOMA-Script v3.17.2062 
\documentclass[fontsize=12pt,ngerman,BCOR=12mm]{scrreprt} 
\usepackage[automark,headsepline]{scrlayer-scrpage} 
\usepackage[T1]{fontenc}
\usepackage{lmodern,babel,selinput,microtype,blindtext} 
\SelectInputMappings{adieresis={ä},germandbls={ß},Euro={€}}
\pagestyle{scrheadings} 
\title{Gliederungsnummern in den Rand ausrücken} 
\author{komascript.de/node/27}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Move numbers of section headings left into the margin
%    http://komascript.de/node/27
% Re-define \chapterformat only if it is defined and not
% \relax without making it \relax if it is not defined:
\begingroup
\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname chapterformat\endcsname\relax\else
  \renewcommand*{\chapterformat}{%
    \llap{%
      % Following line is the original definition
      \chapappifchapterprefix{\ }\thechapter\autodot\enskip
    }%
  }
\fi
% Re-define \othersectionlevelsformat
\renewcommand*{\othersectionlevelsformat}[1]{%
  \llap{%
    % Following line is the original definition
    \csname the#1\endcsname\autodot\enskip
  }%
}
% End of redefining format makros
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document} 
\maketitle 
\Blinddocument 
\end{document}

esdd
Forum-Meister
Forum-Meister
Beiträge: 2561
Registriert: So 7. Feb 2010, 16:36

Beitrag von esdd »

Du weist zwar extra auf ein Beispiel von 2004 (!) von der KOMA-Script Webseite hin, hast aber Dir aber nicht die Änderungen in der neuen Version angeschaut??

Ab Version 3.17 wird \othersectionlevelsformat nur noch genutzt, wenn \sectionformat etc. vorhanden sind. Damit das Beispiel wieder das gewünschte Ergebnis liefert, kannst Du version=3.16 als Klassenoption setzen oder \sectionformat etc. absichtlich auf \relax setzen oder \sectionformat etc. entsprechend umdefinieren:
\documentclass[fontsize=12pt,ngerman,BCOR=12mm]{scrreprt} 
\usepackage[automark,headsepline]{scrlayer-scrpage} 
\usepackage[T1]{fontenc} 
\usepackage{lmodern}
\usepackage{babel}
\usepackage{microtype}
\usepackage{selinput}
\SelectInputMappings{adieresis={ä},germandbls={ß},Euro={€}} 
\title{Gliederungsnummern in den Rand ausrücken} 
\author{komascript.de/node/27} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
% Move numbers of section headings left into the margin 
%    http://komascript.de/node/27 
% Re-define \chapterformat only if it is defined and not 
% \relax without making it \relax if it is not defined: 
\begingroup 
\expandafter\expandafter\expandafter\endgroup 
\expandafter\ifx\csname chapterformat\endcsname\relax\else 
   \renewcommand*{\chapterformat}{% 
     \llap{% 
       % Following line is the original definition 
       \chapappifchapterprefix{\ }\thechapter\autodot\IfUsePrefixLine{}{\enskip}% 
     }% 
   } 
\fi
% Redefine \sectionformat etc.
\renewcommand*{\sectionformat}{\llap{\thesection\autodot\enskip}}
\renewcommand*{\subsectionformat}{\llap{\thesubsection\autodot\enskip}}
\renewcommand*{\subsubsectionformat}{\llap{\thesubsubsection\autodot\enskip}}
% End of redefining format makros 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
\usepackage{blindtext}
\begin{document} 
\maketitle 
\Blinddocument 
\end{document}
Gruß
Elke

esdd
Forum-Meister
Forum-Meister
Beiträge: 2561
Registriert: So 7. Feb 2010, 16:36

Beitrag von esdd »

In der Zwischenzeit hat Markus Kohm das Beispiel auf seiner Webseite unter http://komascript.de/node/27 so aktualisiert, dass es sowohl mit der neuen Version (3.17) als auch mit älteren Versionen das gewünschte Ergebnis liefert.

MGommes

Beitrag von MGommes »

OK, wenn man in dem Code auf http://komascript.de/node/27
die Klammern am Ende korrigiert und in \chapappifchaperprefix
noch ein t einfügt (\chapappifchapterprefix), dann funktioniert es
auch.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  Move numbers of section headings left into the margin
%
% Re-define \chapterformat only if it is defined and not \relax without making it \relax if it is not defined:
\ifundefinedorrelax{chapterformat}{}{%
  \renewcommand*{\chapterformat}{\makebox[0pt][r]{\chapappifchapterprefix{\ }\thechapter\autodot\enskip}}%
}
% Note that this redefinition of \chapterformat will break options chapterprefix and appendixprefix!
% Re-define \sectionformat:
\providecommand*{\sectionformat}{}
\renewcommand*{\sectionformat}{\makebox[0pt][r]{\thesection\autodot\enskip}}
% Re-define \subsectionformat:
\providecommand*{\subsectionformat}{}
\renewcommand*{\subsectionformat}{\makebox[0pt][r]{\thesubsection\autodot\enskip}}
% Re-define \subsubsectionformat:
\providecommand*{\subsubsectionformat}{}
\renewcommand*{\subsubsectionformat}{\makebox[0pt][r]{\thesubsubsection\autodot\enskip}}
% Don't redefine \paragraphformat or \subparagraphformat because by default they are in-text headings.
% Re-define \othersectionlevelsformat (for KOMA-Script < 3.17:
\renewcommand*{\othersectionlevelsformat}[1]{%
  \makebox[0pt][r]{%
    % Following line is the original definition
    \csname the#1\endcsname\autodot\enskip
  }%
}
%
%  End of redefining format makros
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Antworten