diff options
author | Karl Berry <karl@freefriends.org> | 2014-05-23 22:47:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-05-23 22:47:21 +0000 |
commit | 6ec5ec5e1d552890b2f701d9631a33b30f7c36d4 (patch) | |
tree | bfb58e82f1d7e8587cd1ae6ac0c8e8029921323f /Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B | |
parent | 2e586806d075a39c66a113e8c03157f5aa74d553 (diff) |
koma-script-examples (23may14)
git-svn-id: svn://tug.org/texlive/trunk@34241 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B')
3 files changed, 74 insertions, 52 deletions
diff --git a/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/result/chapterthumbexample.pdf b/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/result/chapterthumbexample.pdf Binary files differindex fb5efb16a45..e0bf54f74e0 100644 --- a/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/result/chapterthumbexample.pdf +++ b/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/result/chapterthumbexample.pdf diff --git a/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumb.sty b/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumb.sty index 5c0d057f926..849f9dbdc00 100644 --- a/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumb.sty +++ b/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumb.sty @@ -16,58 +16,79 @@ % This work consists of this file only. %----------------------------------------------------------------------- \ProvidesPackage{chapterthumb}% - [2011/09/23 v0.2 unsupported LaTeX package] + [2014/01/15 v0.3 unsupported LaTeX package] \ProcessOptions\relax -\RequirePackage{graphics,color} -\RequirePackageWithOptions{scrpage2} -\newcommand*{\putchapterthumb}{% - \begingroup - \makebox[0pt][l]{% - \hspace{-\oddsidemargin}\hspace{-1in}% - \hspace{-\@oddheadshift}% - \hspace{\paperwidth}% - \parbox[t][0pt][t]{0pt}{% - \vspace{-\topmargin}% - \vspace{-1in}% - \vspace{-\headheight}% - \vspace{\dp\strutbox}% - \vspace{\firstchapterthumbskip}% - \setlength{\@tempdima}{\paperheight}% - \addtolength{\@tempdima}{-\chapterthumbwidth}% - \addtolength{\@tempdima}{1pt}% - \setlength{\@tempdimb}{\chapterthumbskip}% - \divide\@tempdima by\@tempdimb - \@tempcnta=\@tempdima - \advance\@tempcnta by 1 - \@tempcntb=\value{chapter}% - \advance\@tempcntb by -1 - \divide\@tempcntb by \@tempcnta - \multiply\@tempcntb by -\@tempcnta - \advance\@tempcntb by \value{chapter}% - \advance\@tempcntb by -1 - \setlength{\@tempdima}{\chapterthumbskip}% - \vspace{\@tempcntb\@tempdima}% - \makebox[0pt][r]{% - \rotatebox{90}{% - \colorbox{\chapterthumbboxcolor}{% - \parbox[t][\chapterthumbheight][c]% - {\chapterthumbwidth}{% - \centering - \color{\chapterthumbcolor}% - \chapterthumbfont{\chapterthumbformat}}}}}% - }% - }% - \endgroup -} -\newcommand*{\firstchapterthumbskip}{0pt} +\RequirePackage{graphicx,color} +\RequirePackage{scrlayer} +\newcommand*{\firstchapterthumbskip}{.05\paperheight} +\newcommand*{\lastchapterthumbskip}{\firstchapterthumbskip} \newcommand*{\chapterthumbheight}{2em} -\newcommand*{\chapterthumbwidth}{.2\paperheight}% -\newcommand*{\chapterthumbskip}{.1\paperheight}% -\newcommand*{\chapterthumbboxcolor}{black}% +\newcommand*{\chapterthumbwidth}{.2\paperheight} +\newcommand*{\chapterthumbskip}{.1\paperheight} +\newcommand*{\chapterthumbboxcolor}{black} \newcommand*{\chapterthumbcolor}{white} \newcommand*{\chapterthumbformat}{\@chapapp~\thechapter} -\newcommand*{\chapterthumbfont}{\normalfont\Large\sffamily} -\newcommand*{\scr@fnt@chapterthumb}{\chapterthumbfont} +\newkomafont{chapterthumb}{\normalfont\Large\sffamily} +\newcommand*{\chapterthumbbox}{% + \if@mainmatter + \ifnum\value{chapter}>\z@ + \ifnum \value{chapterthumb}<\z@ + \else + \begingroup + \edef\reserved@a{\chapterthumbformat}% + \ifx\reserved@a\lastthechapter\else + \stepcounter{chapterthumb}% + \global\let\lastthechapter\reserved@a + \fi + \@tempcnta=\numexpr + \dimexpr + \paperheight + -\firstchapterthumbskip + -\chapterthumbwidth + -\lastchapterthumbskip + \relax / \dimexpr + \chapterthumbskip + \relax + +1 + \relax + \ifnum \value{chapterthumb}<\@tempcnta + \else + \setcounter{chapterthumb}{0}% + \fi + \vspace*{% + \dimexpr + \firstchapterthumbskip + + ( \chapterthumbskip ) + * \value{chapterthumb}% + - \baselineskip + \relax + }\par + \hfill + \makebox[0pt][r]{% + \rotatebox[origin=tl]{90}{% + \setlength{\fboxsep}{0pt}% + \colorbox{\chapterthumbboxcolor}{% + \parbox[c][\chapterthumbheight][c]% + {\chapterthumbwidth}{% + \centering + \color{\chapterthumbcolor}% + \usekomafont{chapterthumb}{% + \chapterthumbformat + }}}}}% + \endgroup + \fi + \fi + \fi +} +\newcounter{chapterthumb} +\setcounter{chapterthumb}{10000} +\newcommand*{\lastthechapter}{\relax} +\DeclareNewLayer[% + background,% + oddpage,% + rightmargin,% + contents=\chapterthumbbox +]{chapterthumb} \endinput %%% Local Variables: %%% mode: latex diff --git a/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumbexample.tex b/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumbexample.tex index f59303858b7..1f7ecbda9db 100644 --- a/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumbexample.tex +++ b/Master/texmf-dist/doc/latex/koma-script-examples/Anhang-B/source/chapterthumbexample.tex @@ -18,14 +18,15 @@ \documentclass{scrbook} \usepackage[ngerman]{babel} \usepackage{chapterthumb} +\usepackage{scrlayer-scrpage} \pagestyle{scrheadings} -\lohead[\putchapterthumb]{\putchapterthumb} +\AddLayersToPageStyle{@everystyle@}{chapterthumb} \addtokomafont{chapterthumb}{\bfseries} \begin{document} \chapter{Am Anfang beginnt es}\dots -\chapter{Weiter}\dots -\chapter{Und weiter}\dots -\chapter{Und noch weiter}\dots +\chapter{weiter}\dots +\chapter{und weiter}\dots +\chapter{und noch weiter}\dots \chapter{Und immer weiter}\dots \chapter{Geht die Reise}\dots \chapter{Hinaus}\dots |