diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/titlesec/ttlps.def')
-rw-r--r-- | Master/texmf-dist/tex/latex/titlesec/ttlps.def | 70 |
1 files changed, 53 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/titlesec/ttlps.def b/Master/texmf-dist/tex/latex/titlesec/ttlps.def index b68c4ece33c..5ac38905d79 100644 --- a/Master/texmf-dist/tex/latex/titlesec/ttlps.def +++ b/Master/texmf-dist/tex/latex/titlesec/ttlps.def @@ -2,10 +2,10 @@ % | Typeset titlesec.tex to get the documentation. | % +--------------------------------------------------+ % -% Copyright (c) 1998-2011 by Javier Bezos. +% Copyright (c) 1998-2016 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.10.0 +% This file is part of the titlesec distribution release 2.10.1 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -63,7 +63,7 @@ % right pages at all. There are some issues related to top marks which % are explained by Knuth in \textit{The \TeX book}, pp. 259f, as well % as an uncompatibility between them and \LaTeX{} floats. To overcome -% both limitations, in the \textsf{titlesec} page styles, the second +% both limitations, in the \textsf{titleps} page styles, the second % part in |\cs{firstmark}| is a \emph{fixed} top mark and the first one % the actual first mark; the right way to get the bot mark is from the % second part. Marks are stored at each section and used before and @@ -72,7 +72,7 @@ % values in the mark before the title, and the current values in the % mark after. -\ProvidesFile{ttlps.def}[2011/12/15] +\ProvidesFile{ttlps.def}[2016/03/15] % % Page Styles @@ -172,6 +172,14 @@ % \mark es emitted, which has \ttl@running as part of the markset (see % the \newtitlemark above). +\def\ttl@mb@mark{\markboth} +\def\ttl@mb@warn{% + \PackageWarningNoLine{titleps} + {Direct use of \string\markboth\space and \string\markleft\space + can lead\MessageBreak + to unpredictable results. Please, read the manual\MessageBreak + for an explanation of this warning.}} + \def\ttl@markboth#1{% \begingroup \let\protect\@unexpandable@protect @@ -182,11 +190,11 @@ \let\glossary\relax \let\ttl@c\mark \def\mark##1{\xdef\ttl@running{\expandafter\@gobble##1}}% - \markboth{}{\ttl@enccode}% + \ttl@mb@mark{}{\ttl@enccode}% \expandafter\let\csname#1mark\endcsname\@gobble \xdef\ttl@marks{\ttl@marks}% \gdef\@themark{{\ttl@marks}{\ttl@prevmarks}}% - \ttl@c{\@themark}% + \ttl@c{\@themark\let\noexpand\ttl@mb@warn\relax}% \@nameuse{ttl@tem@#1}% \if@nobreak\ifvmode\nobreak\fi\fi \endgroup} @@ -233,7 +241,7 @@ \ttl@moremarks}}} \def\ttl@setmarks@s#1{% Solo con extramarks - \PackageError{titlesec}% + \PackageError{titleps}% {You need `extramarks' for \string\settitlemarks*}% {\string\settitlemarks* requires the package option `extramarks'}} @@ -400,22 +408,22 @@ \addtolength\linewidth{#4}% \ifx#2\@empty\else \setbox\z@\hb@xt@\linewidth{% - \color@begingroup - #2% - \color@endgroup}% - \wd\z@\z@ - \ht\z@\z@ - \dp\z@\z@ - \box\z@ + \color@begingroup + #2% + \color@endgroup}% + \wd\z@\z@ + \ht\z@\z@ + \dp\z@\z@ + \box\z@ \fi \ttl@titlemarks % Must precede the format. Defines \ttl@running \def\ttl@enccode{\ttl@headinline#1{}{}{}}% which contains ttl@enccode \ttl@running \ttl@calcneg\hspace{#4}}% - + \def\ttl@makehead#1\@@{\ttl@makeboth{#1}\makeheadrule} \def\ttl@makefoot#1\@@{\ttl@makeboth{#1}\makefootrule} - + \renewcommand\widenhead{% \@ifstar{\ttl@dupltwoargsrev\ttl@widenhd}% {\@ifnextchar[{\ttl@widenhd}{\ttl@dupltwoargs\ttl@widenhd}}} @@ -439,6 +447,34 @@ \expandafter\@secondoftwo \fi} +% Another tool: + +\newcommand\setmarkboth{% + \ifx\markboth\ttl@mb@use\else + \let\ttl@mb@mark\markboth + \let\markboth\ttl@mb@use + \fi + \def\ttl@mb@new##1##2} + +% \ttl@mb@temp is a trick to allow resetting inside \setmarkboth. + +\def\ttl@mb@use#1#2{% + \let\markboth\ttl@mb@mark + \def\ttl@mb@temp{\let\markboth\ttl@mb@use}% + \ttl@mb@new{#1}{#2}% + \ttl@mb@temp + \let\ttl@mb@temp\@undefined} + +\newcommand\resetmarkboth{% + \ifx\ttl@mb@temp\@undefined + \let\markboth\ttl@mb@mark + \def\ttl@mb@mark{\markboth}% + \else + \def\ttl@mb@temp{% + \let\markboth\ttl@mb@mark + \def\ttl@mb@mark{\markboth}}% + \fi} + % =========== % EXTRA MARKS % =========== @@ -653,7 +689,7 @@ \def\ttl@replace#1#2#3#4{% \@ifundefined{ttlr@#1#2@#3#4}% {\@ifundefined{ttlr@#1#2@#3}{}% - {\@namedef{ttlr@#1#2}{\@nameuse{ttlr@#1#2@#3}}}}% + {\@namedef{ttlr@#1#2}{\@nameuse{ttlr@#1#2@#3}}}}% {\csname ttlr@xx@x#4\endcsname\@gobble {\expandafter\let\csname ttlr@#1#2\expandafter\endcsname \csname ttlr@#1#2@#3#4\endcsname}}} |