summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/titlesec/titleps.sty
blob: bc75ccdb675c2e62cbe361e6bd16a0b6f93b0e00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
% +--------------------------------------------------+
% | Typeset titlesec.tex to get the documentation.   |
% +--------------------------------------------------+
%
% Copyright (c) 1998-2011 by Javier Bezos.
% All Rights Reserved.
%
% This file is part of the titlesec distribution release 2.9.2
% -----------------------------------------------------------
%
% It may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2003/12/01 or later.
% 
% This work has the LPPL maintenance status "maintained".
% 
% The Current Maintainer of this work is Javier Bezos.
%
% Release
% ~~~~~~~

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{titleps}[2011/11/17 v1.0 Page styles]

% This package is mainly a wrapper for the pagestyle macros provided
% by titlesec, so that they can be used without it.  Functionality is
% almost similar, but top pagemarks (which require 2 marks, before
% and after the title) do not work directly and therefore they are
% not available (yet).

\newif\ifttl@ps
\newif\ifttl@toclabel
\ttl@toclabeltrue

\def\ttl@calcneg#1#2{%
  {\setlength\@tempskipa{#2}%
   #1{-\@tempskipa}}}

\DeclareRobustCommand\ttl@naerror[1]{%
  \PackageError{titleps}%
    {#1\space only available in titlesec.\MessageBreak
     Consider using it instead of titleps}%
    {titleps provides a subset of the macros\MessageBreak
     for pagestyles defined in titlesec.}}

\DeclareOption{psfloats}{\let\ttl@replace\@empty} % a flag

\DeclareOption{outermarks}{\ttl@naerror{outermarks}}
\DeclareOption{topmarks}{\ttl@naerror{topmarks}}
\DeclareOption{botmarks}{%
  \def\ttl@titlemarks{\bottitlemarks}}
\DeclareOption{innermarks}{%
  \def\ttl@titlemarks{\innertitlemarks}}

\ExecuteOptions{innermarks}

\ProcessOptions

\let\newpagestyle\@empty
\let\renewpagestyle\@empty
\let\widenhead\@empty

\input ttlps.def

% Raise error if the following are used.

\def\ttl@setifthe#1{%
  \expandafter\protected@edef\csname ifthe#1\endcsname{%
    \ttl@naerror{\string\ifthe#1}}}

\ttl@setifthe{part}
\ttl@setifthe{chapter}
\ttl@setifthe{section}
\ttl@setifthe{subsection}
\ttl@setifthe{subsubsection}
\ttl@setifthe{paragraph}
\ttl@setifthe{subparagraph}

\renewcommand\toptitlemarks{\ttl@naerror{\string\toptitlemarks}}
\renewcommand\nexttoptitlemarks{\ttl@naerror{\string\nexttoptitlemarks}}
\renewcommand\outertitlemarks{\ttl@naerror{\string\outertitlemarks}}

\endinput