Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

123 lines (105 sloc) 3.743 kb
\ProvidesPackage{kslayout}
\let\kscolor=\relax
\let\ksdebugcolor=\relax
\let\kstextsc=\textsc
\let\ksLARGE=\LARGE
\DeclareOption{color}{\def\kscolor{\color{blue}}}
\DeclareOption{rm}{\let\kstextsc=\textnormal}
\DeclareOption{huge}{\let\ksLARGE=\Huge}
\DeclareOption{nopictures}{\AtEndOfPackage{\let\ChapterInclude\@gobble}}
\ProcessOptions
% running headline
% compatibility with older KOMA-script versions:
\@ifundefined{setkomafont}
{\renewcommand*{\headfont}{\small\normalfont\normalcolor}}
{\setkomafont{pagehead}{\normalfont\normalcolor}}
\RequirePackage{titlesec}
% Chapter and Section titles
%\titleformat{\chapter}[display]
% {\Huge}
% {\fontsize{70}{70pt}\selectfont\thechapter}
% {-4ex}
% {\filleft\textsc}
% [\vspace{8ex}%
% \titlerule]
% THIS ONE WORKS FINE FOR A4/11pt:
%\titleformat{\chapter}[block]
% {\vspace{4ex}\Huge}
% {\fontsize{70}{70pt}\selectfont\thechapter}
% {0.2cm}
% {\hfill\placechapter}
% [\vspace{1ex}\titlerule
% \vspace{8ex}\titlerule]
\def\ResetChapterIncludeHook{\global\let\ChapterIncludeHook\empty}
\ResetChapterIncludeHook
\def\ChapterInclude%
{\g@addto@macro\ChapterIncludeHook}
\def\settchapterspacing#1{\gdef\tchapterspacing{#1}}
\def\setbchapterspacing#1{\gdef\bchapterspacing{#1}}
\def\resetchapterspacing{%
\settchapterspacing{\RON{}}%
\setbchapterspacing{\RON{}}}
\def\RON#1{\leaders\hrule\hskip#1\linewidth}%
\def\ROFF#1{\leaders\hrule\@height0pt\hskip#1\linewidth}%
\resetchapterspacing
\def\startchapterdebug{\gdef\ksdebugcolor{\color{red}}}
\def\stopchapterdebug{\global\let\ksdebugcolor\relax}
\titleformat{\chapter}[block]
{\vspace{1ex}\LARGE}
{\fontsize{50}{50pt}\selectfont\kscolor\thechapter}
{0cm}
{\hfill%\vphantom{\rule{0pt}{55pt}}% for rigid
\Huge\placechapter}
[\ChapterIncludeHook\ResetChapterIncludeHook
\vspace{1ex}% originally 1ex
\parskip\z@
{\ksdebugcolor
\titleline{\tchapterspacing\leaders\hrule\@height0pt\hfill\kern\z@}}%
% \vspace{12ex}%
% {\ksdebugcolor
% \titleline{\bchapterspacing\leaders\hrule\@height0pt\hfill\kern\z@}}%
\resetchapterspacing]%\titlerule]% originally 8ex
\def\setAppxTitleFormat{%
\titleformat{\chapter}[block]
{\vspace{.1ex}\large}
{\fontsize{30}{30pt}\selectfont\kscolor\thechapter}
{0cm}
{\hfill%\vphantom{\rule{0pt}{55pt}}% for rigid
\Huge\placechapter}
[\ChapterIncludeHook\ResetChapterIncludeHook
\vspace{.1ex}% originally 1ex
\parskip\z@
{\ksdebugcolor
\titleline{\tchapterspacing\leaders\hrule\@height0pt\hfill\kern\z@}}%
% \vspace{12ex}%
% {\ksdebugcolor
% \titleline{\bchapterspacing\leaders\hrule\@height0pt\hfill\kern\z@}}%
\resetchapterspacing]%\titlerule]% originally 8ex
}
% To disable indentation after the chapter, we have to
% add a titlespacing* command such as:
%\titlespacing*{\chapter}{0pt}{10ex}{50ex}% for rigid
\titlespacing*{\chapter}{0pt}{12ex}{4ex}% for non-rigid
\titleformat{\section}[block]
{\vspace{1.5ex plus 1.5ex minus 0.5ex}\Large\normalfont}% was 2ex
{\Large\normalfont\kscolor\thesection}
{1em}
{\placesection\thesection}
\titleformat{\subsection}[block]
{\vspace{1ex plus 1ex minus 0.5ex}\large\normalfont}% was 1ex
{\large\normalfont\kscolor\thesubsection}
{1em}
{\placesection\thesubsection}
\newcommand*{\placesection}[2]{%
\begingroup
\setbox0=\hbox{\Large\normalfont\kscolor #1}%
\dimen0=\linewidth
\advance\dimen0 by -\wd0
\advance\dimen0 by -1em%
\def\next{\parbox[t]}%
\expandafter\expandafter\expandafter
\endgroup
\expandafter\next\expandafter{\the\dimen0}{\raggedright #2}}
\newcommand*{\placechapter}[1]{{\ksLARGE\smash{\parbox[b]{0.72\linewidth}{\flushright\kstextsc{#1}}}}}
% subsections do not appear in the table of contents
\setcounter{tocdepth}{1}
Jump to Line
Something went wrong with that request. Please try again.