summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/titlesec/wrap.tss
blob: f95f03dd2aae9e06bb64c005b2f5c7b8ce57383f (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
% +--------------------------------------------------+
% | 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.1
% -----------------------------------------------------------
%
% 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.

\ProvidesFile{wrap.tss}[2011/08/28]

\gdef\ttlh@wrap#1#2#3#4#5#6#7#8{%
  \global\@noskipsectrue
  \gdef\ttl@makeline##1{##1}%
  \ttl@changecentercr
  \begingroup
    #1\ifhmode\ttl@hmode@error\fi
    \titlewidth\z@
    \def\\{\@ifstar{\@ifnextchar[{\ttl@bs}{\newline}}%
                   {\@ifnextchar[{\ttl@bs}{\newline}}}%
    \def\ttl@bs[##1]{\newline}%
    \let\@centercr\\%
    \advance\rightskip 1\leftskip plus 1fil
    \leftskip=\z@
    \parindent\z@
    \let\iftitlemeasuring\@firstoftwo
    \global\setbox\ttl@box\vtop{\setlength\hsize{#6}%
      \color@begingroup
      \ifttl@label{#2}\ttl@calc\hspace{#3}\fi
      #4{#8}\kern\z@\strut
      \@@par
      \color@endgroup}%
    \let\iftitlemeasuring\@secondoftwo
    \ttl@boxprocess
    \global\titlewidth\titlewidth
    \global\titlewidthfirst\titlewidthfirst
    \global\titlewidthlast\titlewidthlast
  \endgroup
  \edef\ttl@maxdimen{\the\titlewidth}%
  #1\ifhmode\ttl@hmode@error\fi
  \global\setbox\ttl@box\vtop{\setlength\hsize{\ttl@maxdimen}%
    \color@begingroup
    \ifttl@label{#2}\ttl@calc\hspace{#3}\fi#4{#8}\kern\z@\strut
    \@@par
    \color@endgroup}%
  \advance\@tempskipa1.5\baselineskip
  \advance\@tempskipa\ht\ttl@box
  \advance\@tempskipa\dp\ttl@box
  \advance\@tempskipa-\pagegoal
  \advance\@tempskipa\pagestretch
  \@tempskipb\pagegoal
  \pagegoal-\@tempskipa
  \ifdim\bottomtitlespace<\z@\else
    \def\@textbottom{\vskip\z@\@plus.0001fil}%
  \fi
  \penalty9999
  \pagegoal\@tempskipb
  \@tempdima\ht\ttl@box \advance\@tempdima\dp\ttl@box
  \@tempdimb\@tempdima
  \divide\@tempdima\baselineskip \count@\@tempdima
  \advance\count@
    \ifdim\@tempdimb<\the\count@.5\baselineskip\@ne\else\tw@\fi
  \dp\ttl@box=\z@
  \xdef\@svsechd##1##2{%
    \noexpand\llap{\box\ttl@box##2}%
    \setbox\z@\hbox{\hskip\ttl@maxdimen\relax##2}%
    \global\hangindent\wd\z@
    \global\hangafter-\the\count@\relax}}
	
\endinput