diff options
author | Karl Berry <karl@freefriends.org> | 2011-12-17 00:59:21 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-12-17 00:59:21 +0000 |
commit | bb697854fb4e6eca8595e8c660b3a8aaffa47b06 (patch) | |
tree | fe48672d2ddf634c75efa2c4e9d5a7ffc4b67a52 /Master/texmf-dist | |
parent | b85dc708bbe89bd54f2e998e166032f5d35a7e6a (diff) |
titlesec/titleps 1.1.0 (15dec11)
git-svn-id: svn://tug.org/texlive/trunk@24852 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
18 files changed, 1503 insertions, 786 deletions
diff --git a/Master/texmf-dist/doc/latex/titlesec/CHANGES b/Master/texmf-dist/doc/latex/titlesec/CHANGES index cc5f4e48410..ebe6031d2ab 100644 --- a/Master/texmf-dist/doc/latex/titlesec/CHANGES +++ b/Master/texmf-dist/doc/latex/titlesec/CHANGES @@ -1,244 +1,244 @@ -Titlesec changes
-
-History of v1.0
-~~~~~~~~~~~~~~~
-1998/02/25 Added nops option
-1998/02/28 Added \@mkboth stuff in \setmarks
-1998/03/01 Changed test in \ttl@secnum
-1998/03/03 Corrected some \fil... commands
-1998/03/03 Replaced the faulty \@hangfrom by new commands
-1998/03/03 Some \def replaced by \newcommand
-1998/03/04 .dtx/.ins scheme finally rejected. Useless
- for users, obtrusive for `readers' and proned
- to errors
-1998/03/04 Tidied up documentation
-1998/03/06 \wordsep renamed and documented
-1998/03/06 Added dummy asignation in \ttl@chap.
-1998/03/06 Removed \ttl@xsect and merged into \tl@sect
-1998/03/06 Added \ProvidesPackage
-
-History of v1.1
-~~~~~~~~~~~~~~~~
-1998/03/25 \chapter corrected, as well as the size options
-1998/03/26 Added compact option
-1998/03/26 Added flushleft, flushright and center options
-1998/04/08 Changed all instances of \noindent by \parindent\z@
-1998/04/14 Added \filinner, \filouter
-1998/04/14 Added drop shape
-1998/05/01 Added rightmargin shape (and margin renamed to
- leftmargin)
-1998/05/03 Added \setheadindent
-
-History of v1.2 (unreleased)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-1998/06/01 Compatibility with AMS classes
-1998/06/08 On-demand loading of shapes
-1998/06/11 Frame shape. Some \fil... command
- modified to work in the label of this
- chapter shape.
-1998/07/03 Bottomtitle option (at last...)
-1998/07/14 ...margin styles bug fixed using a method
- similar to bottomtitle.
-1998/07/29 \titleline
-
-====================
-
-History of v2.0
-~~~~~~~~~~~~~~~~
-
-1998/08/05 to
-1998/08/29 Fully reimplemented
-
-History of v2.1
-~~~~~~~~~~~~~~~~
-1999/01/05 We define in this file the three basic shapes.
- Additional ones remain defined in external files.
- Unified the shapes for sections and chapters.
-1999/01/05 \ttl@shape merged into \ttl@format@iii.
-1999/01/05 \titlerule
-1999/01/07 \ttl@defkeys splitted from \ttl@keys
-1999/01/10 Added the \part stuff, including a definition of \@openright
-1999/01/11 Removed unnecessary \ttl@numsecfalse in \ttl@sect@i.
-1999/01/14 Optimized \titlerule
-1999/01/27 Changed \titleline to correct the spacing at the
- top page and to fix a bug which changed the mode
- to horizontal, thus introducing unwanted space
- (\makebox -> \@makebox).
-1999/02/02 \ttl@secnum renamed to \ttl@write and introduced the
- \ttl@savewrite mechanism to sincronize the toc/marks
- with the title in case there is a \newpage in <after>.
-1999/02/03 wrap shape
-1999/02/03 Added a \kern\z@ for not to avoid hyphenation
- of the last word. Not strictly necessary, but
- it is more LaTeX-like.
-1999/02/05 \partmark defined (and in \setmarks, too).
-1999/02/08 \ttl@row@i simplified.
-1999/02/08 \ttl@savefn mechanism.
-1999/02/10 Removed extra \leavevmode in display
-1999/02/13 Now \titleline doesn't add the width. It's set.
-1999/02/17 The part mark is catched, even if unused.
-1999/02/17 old/newparttoc added.
-1999/02/18 Changed many TeX assignments to the LaTeX
- counterpart.
-1999/02/19 Introduced \ttl@startargs.
-
-History of v2.1.1
-~~~~~~~~~~~~~~~~~
-1999/08/04 Moved misplaced lines in \ttl@makeboth
-
-History of v2.2 (unreleased)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-1999/11/03 We load titleps if pagestyles are required, but
- some old definitions are restored.
-1999/11/06 Improved outermarks test in \ttl@sect@i. Formerly
- the section number could be printed if a page ended
- with an unnumebered section followed by a numbered one.
-1999/11/06 \ttl@startargs now adds (and passes) automatically the
- section name. Involved macros modified accordingly.
-1999/11/06 Replaced explicit part names by the parameter in
- \ttl@part@i. The same for chapter.
-1999/11/21 \ttl@try's are not given explicitly, but built by
- \ttl@setkeys. Intruduced the \ttl@key@... and
- \ttl@extra@... commands.
-1999/11/23 Minor problems with keys fixed.
-1999/12/10 Added the nobottomtitles* option and \ttl@addstretch.
-2000/01/07 First steps towards the calcwidth feature (basic code).
-2000/01/08 (Continued.) \titleline* for rules of width \titlewidth.
- Option calcwidth implemented.
-2000/01/12 Finished with changes in wrap.tss (no longer
- "experimental" :-) )
-
-History of v2.3
-~~~~~~~~~~~~~~~
-2000/01/19 All keys are grouped in a single file tttkeys. Removed
- page.tsk and deleted the corresponding code in the sty.
-2000/01/19 Classes begun.
-2000/01/19 The level numbers are stored in \ttll@ macros, and not
- passed as arguments.
-2000/01/21 Introduced the new mark scheme. It's mostly compatible
- with the old one, but a compatibility mode seems
- imposible (it was introduced in a preliminary test
- but eventually removed).
-2000/01/23 loadonly package option.
-2000/02/01 Classes finished. Many things had to be rewritten.
-2000/02/02 Made partially compatible with hyperref (dvips).
-2000/02/08 \ttl@savewrite moved from shapes to classes. But
- explicit page breaks expand it, too, to avoid wrong
- toc entries.
-2000/02/18 A new box named \ttl@box stores the title in runin
- leftmargin etc shapes, to increase reliability.
-
-(2.3.1 -- 2.3.3 No changes on this file)
-
-History of v2.3.4
-~~~~~~~~~~~~~~~~~
-2000/05/12 nonindentfirst redefine \titlespacing instead of
- \@afterindent... so that they don't interfere with
- the first entry in tocs.
-2000/05/17 The marks in \ttl@select are protected to prevent
- endless loop if the title is expanded, say, by
- \MakeUppercase.
-
-History of v2.3.5
-~~~~~~~~~~~~~~~~~
-2000/05/21 Restores missing test for secnumdepth in \ttl@mkchap,
- and instead of setting \ttl@toclevel in ttlps now is
- done in \secdef. Except inside the macros, \ttl@toclevel
- is false, so that an explicit \...mark works.
-2000/06/04 \partmark defined with \providecommand
-2000/06/14 A patch mechanism added, for small bug fixes.
-
-History of v2.4
-~~~~~~~~~~~~~~~~
-2001/01/18 Minor changes in code. Essentialy an incremental
- update.
-2001/01/22 \titleformat has a new "easy" starred variant.
-
-History of v2.5
-~~~~~~~~~~~~~~~
-2002/01/02 New macros for \ttl@assign. Now * length allow
- non integer values.
-2002/03/22 Added \ttl@calc and \ttl@calcneg to make titlesec
- calc-savvy.
- - Merged bug fixes of .new into this file.
- - Bugs in frame fixed -- gap in lines, misplaced
- label, wrong margins (sometimes),
- - \leftskip, \rightskip and \linewidth (re)set in
- margin shapes.
- - Removed obsolete flush... options.
- - indentafter and noindentafter, new names for
- indentfirst and nonindentfirst.
- - A new level (\titleclass) without its "location"
- now raises a meaningful error.
- - Bug in top-level \titleclass fixed.
-2002/03/23 Tests for undefined and unformatted sectioning levels,
- and horizontal material in <format>.
- - Missing \if@openright inside \if@twoside in
- page class added.
- - Removed extra (but inoffensive) \expandafter
- in \ttl@class@iii.
-2002/03/27 Added \titlewidthfirst and ...last
- - "Not definable" gives a more meaningful message in
- the context of the package.
-
-History of v.2.6
-~~~~~~~~~~~~~~~~
-2004/08/30 Corrected typo in margin \hsiz -> \hsize.
-2004/10/17 Added a couple of missing \noexpand's in drop.
-2004/12/01 Removed the error about the mode in block because this
- style is general purpose.
-2005/01/16 Missing braces around #2 in the last else part of
- \ttl@headinline added
- - Replaced explicit \makeatother's by a saved value as
- the macros can be used in a class/package file.
-2005/01/18 newlinetospace mechanism
- - // does not break pages; option pageatnewline to
- restore the LaTeX behaviour.
-2005/01/19 \...break in top shape.
- - Renumbered several scratch registers to follow the
- TeXbook (p. 346), with \ttl@box in a few cases. In
- wrap \titlewidthfirst and \titlewidthlast made global.
- - Float heads and foots have now a further argument for
- additional stuff (eg, to remove rules). Option is now
- psfloats while floatps enters in compatibility mode.
- - \ttl@savetitle in all classes. Option toctitles.
-2005/01/21 Changed pageatnewline to make it compatible with
- titletoc, with \ttl@changecentercr.
-2005/01/22 \...tolist in top class.
-
-History of v.2.7
-~~~~~~~~~~~~~~~~
-2007-03-27 Added the `explicit' option.
- - Added \titlepagestyle.
-2007-03-29 Fixed wrong number for chapter in log
- - Patch file named .270 instead of .new
-2007-05-09 Added <after> to leftmargin, so that you can add stuff
- at the beginning of the paragraph, eg, the sec number.
-2007-07-07 Removed the patch mechanism.
-2007-08-07 `explicit' improved.
-
-History of v.2.8
-~~~~~~~~~~~~~~~~
-2007-08-12 \titlepagestyle already used by KOMA-Script. Renamed
- to \assignpagestyle.
-
-History of v.2.9
-~~~~~~~~~~~~~~~~
-2010-05-04 Add \nobreak in \ttl@addcontentsline, to prevent the title
- going to footnotes (!) in runin style in some (rare) cases.
-2010-05-06 Option uppercase (and \ttl@case).
-2011-02-25 \iftitlemeasuring test
-2011-07-14 Fixed \assignpagestyle
-2011-07-15 Introduced the \scantokens mechanism to make sure section
- names are 'letters' and not 'others'
-2011-07-18 Removed \if@nobreak test in wrap/drop, which added a line
- to the title after another section (why?)
-
-History of v.2.9.1
-~~~~~~~~~~~~~~~~~~
-2011-08-28 Removed a spurious > in wrap.tss
-
-History of v.2.9.2
-~~~~~~~~~~~~~~~~~~
+Titlesec changes + +History of v1.0 +~~~~~~~~~~~~~~~ +1998/02/25 Added nops option +1998/02/28 Added \@mkboth stuff in \setmarks +1998/03/01 Changed test in \ttl@secnum +1998/03/03 Corrected some \fil... commands +1998/03/03 Replaced the faulty \@hangfrom by new commands +1998/03/03 Some \def replaced by \newcommand +1998/03/04 .dtx/.ins scheme finally rejected. Useless + for users, obtrusive for `readers' and proned + to errors +1998/03/04 Tidied up documentation +1998/03/06 \wordsep renamed and documented +1998/03/06 Added dummy asignation in \ttl@chap. +1998/03/06 Removed \ttl@xsect and merged into \tl@sect +1998/03/06 Added \ProvidesPackage + +History of v1.1 +~~~~~~~~~~~~~~~~ +1998/03/25 \chapter corrected, as well as the size options +1998/03/26 Added compact option +1998/03/26 Added flushleft, flushright and center options +1998/04/08 Changed all instances of \noindent by \parindent\z@ +1998/04/14 Added \filinner, \filouter +1998/04/14 Added drop shape +1998/05/01 Added rightmargin shape (and margin renamed to + leftmargin) +1998/05/03 Added \setheadindent + +History of v1.2 (unreleased) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1998/06/01 Compatibility with AMS classes +1998/06/08 On-demand loading of shapes +1998/06/11 Frame shape. Some \fil... command + modified to work in the label of this + chapter shape. +1998/07/03 Bottomtitle option (at last...) +1998/07/14 ...margin styles bug fixed using a method + similar to bottomtitle. +1998/07/29 \titleline + +==================== + +History of v2.0 +~~~~~~~~~~~~~~~~ + +1998/08/05 to +1998/08/29 Fully reimplemented + +History of v2.1 +~~~~~~~~~~~~~~~~ +1999/01/05 We define in this file the three basic shapes. + Additional ones remain defined in external files. + Unified the shapes for sections and chapters. +1999/01/05 \ttl@shape merged into \ttl@format@iii. +1999/01/05 \titlerule +1999/01/07 \ttl@defkeys splitted from \ttl@keys +1999/01/10 Added the \part stuff, including a definition of \@openright +1999/01/11 Removed unnecessary \ttl@numsecfalse in \ttl@sect@i. +1999/01/14 Optimized \titlerule +1999/01/27 Changed \titleline to correct the spacing at the + top page and to fix a bug which changed the mode + to horizontal, thus introducing unwanted space + (\makebox -> \@makebox). +1999/02/02 \ttl@secnum renamed to \ttl@write and introduced the + \ttl@savewrite mechanism to sincronize the toc/marks + with the title in case there is a \newpage in <after>. +1999/02/03 wrap shape +1999/02/03 Added a \kern\z@ for not to avoid hyphenation + of the last word. Not strictly necessary, but + it is more LaTeX-like. +1999/02/05 \partmark defined (and in \setmarks, too). +1999/02/08 \ttl@row@i simplified. +1999/02/08 \ttl@savefn mechanism. +1999/02/10 Removed extra \leavevmode in display +1999/02/13 Now \titleline doesn't add the width. It's set. +1999/02/17 The part mark is catched, even if unused. +1999/02/17 old/newparttoc added. +1999/02/18 Changed many TeX assignments to the LaTeX + counterpart. +1999/02/19 Introduced \ttl@startargs. + +History of v2.1.1 +~~~~~~~~~~~~~~~~~ +1999/08/04 Moved misplaced lines in \ttl@makeboth + +History of v2.2 (unreleased) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +1999/11/03 We load titleps if pagestyles are required, but + some old definitions are restored. +1999/11/06 Improved outermarks test in \ttl@sect@i. Formerly + the section number could be printed if a page ended + with an unnumebered section followed by a numbered one. +1999/11/06 \ttl@startargs now adds (and passes) automatically the + section name. Involved macros modified accordingly. +1999/11/06 Replaced explicit part names by the parameter in + \ttl@part@i. The same for chapter. +1999/11/21 \ttl@try's are not given explicitly, but built by + \ttl@setkeys. Intruduced the \ttl@key@... and + \ttl@extra@... commands. +1999/11/23 Minor problems with keys fixed. +1999/12/10 Added the nobottomtitles* option and \ttl@addstretch. +2000/01/07 First steps towards the calcwidth feature (basic code). +2000/01/08 (Continued.) \titleline* for rules of width \titlewidth. + Option calcwidth implemented. +2000/01/12 Finished with changes in wrap.tss (no longer + "experimental" :-) ) + +History of v2.3 +~~~~~~~~~~~~~~~ +2000/01/19 All keys are grouped in a single file tttkeys. Removed + page.tsk and deleted the corresponding code in the sty. +2000/01/19 Classes begun. +2000/01/19 The level numbers are stored in \ttll@ macros, and not + passed as arguments. +2000/01/21 Introduced the new mark scheme. It's mostly compatible + with the old one, but a compatibility mode seems + imposible (it was introduced in a preliminary test + but eventually removed). +2000/01/23 loadonly package option. +2000/02/01 Classes finished. Many things had to be rewritten. +2000/02/02 Made partially compatible with hyperref (dvips). +2000/02/08 \ttl@savewrite moved from shapes to classes. But + explicit page breaks expand it, too, to avoid wrong + toc entries. +2000/02/18 A new box named \ttl@box stores the title in runin + leftmargin etc shapes, to increase reliability. + +(2.3.1 -- 2.3.3 No changes on this file) + +History of v2.3.4 +~~~~~~~~~~~~~~~~~ +2000/05/12 nonindentfirst redefine \titlespacing instead of + \@afterindent... so that they don't interfere with + the first entry in tocs. +2000/05/17 The marks in \ttl@select are protected to prevent + endless loop if the title is expanded, say, by + \MakeUppercase. + +History of v2.3.5 +~~~~~~~~~~~~~~~~~ +2000/05/21 Restores missing test for secnumdepth in \ttl@mkchap, + and instead of setting \ttl@toclevel in ttlps now is + done in \secdef. Except inside the macros, \ttl@toclevel + is false, so that an explicit \...mark works. +2000/06/04 \partmark defined with \providecommand +2000/06/14 A patch mechanism added, for small bug fixes. + +History of v2.4 +~~~~~~~~~~~~~~~~ +2001/01/18 Minor changes in code. Essentialy an incremental + update. +2001/01/22 \titleformat has a new "easy" starred variant. + +History of v2.5 +~~~~~~~~~~~~~~~ +2002/01/02 New macros for \ttl@assign. Now * length allow + non integer values. +2002/03/22 Added \ttl@calc and \ttl@calcneg to make titlesec + calc-savvy. + - Merged bug fixes of .new into this file. + - Bugs in frame fixed -- gap in lines, misplaced + label, wrong margins (sometimes), + - \leftskip, \rightskip and \linewidth (re)set in + margin shapes. + - Removed obsolete flush... options. + - indentafter and noindentafter, new names for + indentfirst and nonindentfirst. + - A new level (\titleclass) without its "location" + now raises a meaningful error. + - Bug in top-level \titleclass fixed. +2002/03/23 Tests for undefined and unformatted sectioning levels, + and horizontal material in <format>. + - Missing \if@openright inside \if@twoside in + page class added. + - Removed extra (but inoffensive) \expandafter + in \ttl@class@iii. +2002/03/27 Added \titlewidthfirst and ...last + - "Not definable" gives a more meaningful message in + the context of the package. + +History of v.2.6 +~~~~~~~~~~~~~~~~ +2004/08/30 Corrected typo in margin \hsiz -> \hsize. +2004/10/17 Added a couple of missing \noexpand's in drop. +2004/12/01 Removed the error about the mode in block because this + style is general purpose. +2005/01/16 Missing braces around #2 in the last else part of + \ttl@headinline added + - Replaced explicit \makeatother's by a saved value as + the macros can be used in a class/package file. +2005/01/18 newlinetospace mechanism + - // does not break pages; option pageatnewline to + restore the LaTeX behaviour. +2005/01/19 \...break in top shape. + - Renumbered several scratch registers to follow the + TeXbook (p. 346), with \ttl@box in a few cases. In + wrap \titlewidthfirst and \titlewidthlast made global. + - Float heads and foots have now a further argument for + additional stuff (eg, to remove rules). Option is now + psfloats while floatps enters in compatibility mode. + - \ttl@savetitle in all classes. Option toctitles. +2005/01/21 Changed pageatnewline to make it compatible with + titletoc, with \ttl@changecentercr. +2005/01/22 \...tolist in top class. + +History of v.2.7 +~~~~~~~~~~~~~~~~ +2007-03-27 Added the `explicit' option. + - Added \titlepagestyle. +2007-03-29 Fixed wrong number for chapter in log + - Patch file named .270 instead of .new +2007-05-09 Added <after> to leftmargin, so that you can add stuff + at the beginning of the paragraph, eg, the sec number. +2007-07-07 Removed the patch mechanism. +2007-08-07 `explicit' improved. + +History of v.2.8 +~~~~~~~~~~~~~~~~ +2007-08-12 \titlepagestyle already used by KOMA-Script. Renamed + to \assignpagestyle. + +History of v.2.9 +~~~~~~~~~~~~~~~~ +2010-05-04 Add \nobreak in \ttl@addcontentsline, to prevent the title + going to footnotes (!) in runin style in some (rare) cases. +2010-05-06 Option uppercase (and \ttl@case). +2011-02-25 \iftitlemeasuring test +2011-07-14 Fixed \assignpagestyle +2011-07-15 Introduced the \scantokens mechanism to make sure section + names are 'letters' and not 'others' +2011-07-18 Removed \if@nobreak test in wrap/drop, which added a line + to the title after another section (why?) + +History of v.2.9.1 +~~~~~~~~~~~~~~~~~~ +2011-08-28 Removed a spurious > in wrap.tss + +History of v.2.9.2 +~~~~~~~~~~~~~~~~~~ 2011-11-11 Fixed a typo in ttlps.def (\MessageBreag)
\ No newline at end of file diff --git a/Master/texmf-dist/doc/latex/titlesec/README b/Master/texmf-dist/doc/latex/titlesec/README index dfb3c519d4d..cd36dc30329 100644 --- a/Master/texmf-dist/doc/latex/titlesec/README +++ b/Master/texmf-dist/doc/latex/titlesec/README @@ -1,70 +1,74 @@ -Titlesec package
-~~~~~~~~~~~~~~~~
-This package allows to change the sectioning titles. Amongst its many
-features it provides margin titles, different format in left and right
-pages, rules above and below the title, etc.
-
-Current version is 2.9.2.
-
-Titletoc package
-~~~~~~~~~~~~~~~~
-For toc entries formatting, providing the possibility of changing
-the format in the middle of a document, grouping the entries
-in a single paragraph, pretty free-forms entries, partial tocs, etc.
-
-The titletoc.sty file is not part of the titlesec package; it's
-an independent package, but it's described in titlesec.tex.
-
-Titleps
-~~~~~~~
-With this package you have access to most (but not all) of the
-features provided by titlesec for page styles.
-
-What's new (2.9)
-~~~~~~~~~~~~~~~~
-
-- Fixed \assignpagestyle, which did not work except in a
-few cases.
-- Fixed an incompatibility with hyperref (wrong appendix
-name).
-- Added \iftitlemeasuring
-- Added package option uppercase
-- Fixed a bug when reckoning the number of lines in wrap/drop.
-
-2.9.1: Fixed a typo (a spurious > in wrap.tss).
-2.9.2: Fixed another typo (\MessageBreag in ttlps.def)
-
-Installation
-~~~~~~~~~~~~
-No .ins/.dtx preinstalation is required. Move the files to a place
-where LaTeX can find them and typeset titlesec.tex. All of files in
-this directory are necessary for titlesec.sty to work, except the
-manual titlesec.tex (and this 'readme' file). The manual requires
-titlesec.sty and titletoc.sty, and hence all the .tss and .def
-files as well.
-
-Formerly there were files with extension .new (titlesec.new and
-titletoc.new) used to patch the packages, but if present should be
-removed (they will be ignored, however).
-
-Web site, manual in PDF format and info
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-More details are available on
-
- http://www.tex-tipografia.com/titlesec.html
-
-Contact
-~~~~~~~
-Please, for suggestions, bug reports, etc., go to
-
- http://www.tex-tipografia.com/contact.html
-
-Known problems
-~~~~~~~~~~
-Some language styles (for babel) add the indentation
-after a section in a so radical way that titlesec (which
-uses the internal LaTeX macros) cannot supress it again.
-For example, spanish (fixed in version 5.0) and frenchb.
-
-2011/11/17
-
+This directory holds 3 packages for sectioning titles -- when used as +such (titlesec), in headers and footers (titleps) and in tables of +contents (titletoc). They can be used separately, but you will get +most of them when used together. + +Titlesec +~~~~~~~~ +Sectioning titles, including margin and `wrap' titles, different +format in odd and even pages, rules above and below the title, +adding new sectioning levels, measuring the width of the title, etc. + +Titletoc +~~~~~~~~ +TOC entries, with the possibility of changing the format in the middle +of a document, grouping the entries in a single paragraph, pretty +free-forms entries, partial tocs, etc. It's described in titlesec.pdf +(or .tex). + +Titleps +~~~~~~~ +Page styles with working top marks, access to top, first and bot marks +in a single header/footer, rules, headers/footers for specific floats +(kinda \thispagestyle), multiple sets of marks, etc. An one-stage +mechanims is used, without intermediate \leftmark's or \rightmark's. + +What's new (2.9. 2.10) +~~~~~~~~~~~~~~~~ + +- Fixed \assignpagestyle, which did not work except in a +few cases. +- Fixed an incompatibility with hyperref (wrong appendix +name). +- Added \iftitlemeasuring +- Added package option uppercase +- Fixed a bug when reckoning the number of lines in wrap/drop. + +2.9.1: Fixed a typo (a spurious > in wrap.tss). +2.9.2: Fixed another typo (\MessageBreag in ttlps.def) +2.10.0: New features in titleps also available in titlesec + +Installation +~~~~~~~~~~~~ +No .ins/.dtx preinstalation is required. Move the files to a place +where LaTeX can find them and typeset titlesec.tex. All of files in +this directory are necessary for titlesec.sty to work, except the +manual titlesec.tex (and this 'readme' file). The manual requires +titlesec.sty and titletoc.sty, and hence all the .tss and .def +files as well. + +Formerly there were files with extension .new (titlesec.new and +titletoc.new) used to patch the packages, but if present should be +removed (they will be ignored, however). + +Web site, manual in PDF format and info +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Further details are available on + + http://www.tex-tipografia.com/titlesec.html + +Contact +~~~~~~~ +Please, for suggestions, bug reports, etc., go to +More + http://www.tex-tipografia.com/contact.html + +Known problems +~~~~~~~~~~ +Some language styles (for babel) add the indentation +after a section in a so radical way that titlesec (which +uses the internal LaTeX macros) cannot supress it again. +For example, spanish (fixed in version 5.0) and frenchb. + +2011/12/15 + diff --git a/Master/texmf-dist/doc/latex/titlesec/titleps.pdf b/Master/texmf-dist/doc/latex/titlesec/titleps.pdf Binary files differnew file mode 100644 index 00000000000..b4f8bd4f65d --- /dev/null +++ b/Master/texmf-dist/doc/latex/titlesec/titleps.pdf diff --git a/Master/texmf-dist/doc/latex/titlesec/titleps.tex b/Master/texmf-dist/doc/latex/titlesec/titleps.tex new file mode 100644 index 00000000000..5dab28b7eab --- /dev/null +++ b/Master/texmf-dist/doc/latex/titlesec/titleps.tex @@ -0,0 +1,791 @@ +% +--------------------------------------------------+ +% | Typeset this file to get the documentation. | +% +--------------------------------------------------+ +% +% Copyright (c) 1998-2011 by Javier Bezos. +% All Rights Reserved. +% +% This file is part of the titlesec distribution release 2.10.0 +% ----------------------------------------------------------- +% +% 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. + +\def\fileversion{1.1.0} +\def\docdate{2011-12-15} + +\documentclass[a4paper]{ltxguide} +\usepackage[sf,bf,compact,topmarks,calcwidth,pagestyles]{titlesec} +\usepackage{titletoc} +\def\gobble#1{} +\def\cs#1{\expandafter\gobble\string\\#1} +\makeatletter +\newenvironment{desc} + {\if@nobreak + \vskip-\lastskip + \vspace*{-2.5ex}% + \fi + \decl} + {\enddecl} +\makeatother + +\usepackage{textcomp,pslatex} +\usepackage[linktocpage]{hyperref} + +\title{Headers and footers with \textsf{titleps}\footnote{The +\textsf{titleps} package is currently at version \fileversion. +\copyright{} 2011 Javier Bezos. All Rights Reserved.}} + +\author{Javier Bezos\footnote{For bug reports, comments and +suggestions go to \href{http://www.tex-tipografia.com/contact.html}% +{\texttt{http://www.tex-tipografia.com/contact.html}}. English +is not my strong point, so contact me when you find mistakes in the +manual. Other packages by the same author: \textsf{gloss} (with +Jos\'e Luis D\'{\i}az), \textsf{enumitem, accents, tensind, esindex, +dotlessi}.}} + +\date{\docdate} + +\widenhead{2.1pc}{0pc} +\titlelabel{\thetitle.\quad} + +\renewpagestyle{plain}[\small\sffamily\slshape]{ + \footrule + \setfoot{}{\thepage}{}} + +\newpagestyle{myps}[\small\sffamily\slshape]{ + \headrule + \sethead{titlesec -- titleps}{\sectiontitle}{\thepage}} + +\pagestyle{myps} + +\newcommand{\examplesep}{% + \begin{center}% + \rule{4pt}{4pt}% + \end{center}} + +\contentsmargin{0pt} + +\titlecontents*{section}[0pt]%[1.8pc] + {} + {\thecontentslabel. } + {} + {, \thecontentspage} + [. --- ][.] + +\addtolength{\topmargin}{-3pc} +\addtolength{\textwidth}{6pc} +\addtolength{\oddsidemargin}{-2pc} +\addtolength{\textheight}{7pc} + +\raggedright +\parindent1em +\parskip0pt + +\begin{document} + +\maketitle +\tableofcontents +\section{Introduction} + +The \textsf{titleps} package provides tools for one-stage setting of +page styles (headlines and footlines). A higher-level interface is +used, where the mark mechanism is hidden and there is no need to deal +with |\leftmark|s and |\rightmark|s -- just use a command or variable +registered as a ``mark'' as the expected value will be returned, i.e., +those when the mark was emitted, either by a sectioning command or +explicitly with |\chaptermark|, |\sectionmark|, etc. A simple +example, whose meaning should be obvious, is: +\begin{verbatim} +\newpagestyle{main}{ + \sethead[\thepage][\chaptertitle][(\thesection] % even + {\thesection)}{\sectiontitle}{\thepage}} % odd +\pagestyle{main} +\end{verbatim} + +Other features are: +\begin{itemize} +\item Working top marks, compatible with floats (unlike the standard +|\topmark|, which does not work correctly in \LaTeX{}). +\item Access to top, first and botttom marks in a single headline/footline +(e.g., the first and last section numbers). +\item Marks for more than 2 sectioning levels. +\item Auto-defining of suitable |\sectionmark| and the like. +\item Simple (and not so simple) headrules and footrules. +\item Headlines and footlines for pages with floats. +\item Headlines and footlines for specific floats (a sort of +|\thispagestyle| for floats). +\item Multiple sets of marks (named here \emph{markset}s and +\textit{extra marks}). +\end{itemize} + +It can be used without \textsf{titlesec}, but you will get most of +it when used together. To load it as a separate package, use the +customary \verb|\usepackage{titleps}|, but with \textsf{titlesec} you +have to load it with: +\begin{verbatim} +\usepackage[pagestyles]{titlesec} +\end{verbatim} + +Specific tools for sectioning command marks are provided, which are +considered the main \textit{markset} (unnamed) and carry out some +internal task. However, \textsf{titleps} can be used as well for +headers with the first an last entry of a page in a dictionary or index, +for example, thank to the \textit{extra marks} described below. + +It works with standard classes and many others; however, additional +\LaTeX{} layout adjustments could be necessary in some of them (for +instance the \textsc{AMS} classes).\footnote{% +Two columns layout requires the \textsf{fix2col} package by David +Carlisle.} + +Once loaded the package, you can define your own page styles and then +activate them, but note page styles so defined cannot be used with +\verb|\thispagestyle| except if the surrounding page style has been +defined with \textsf{titleps}, too. + +%%%% empty ? plain ? + +\section{Defining Page Styles} + +\begin{desc} +|\newpagestyle{<name>}[<global-style>]{<commands>}|\\ +|\renewpagestyle{<name>}[<global-style>]{<commands>}| +\end{desc} + +Defines a new style or redefines an existing one, named |<name>|. For +convenience, spaces and end of lines are ignored, and you need not +``hide'' them with |%|.\footnote{Even if marks should be reserved +to pass information +to headers, some classes, like the AMS ones, introduce additional +code. When redefining the |plain| style of AMS classes, you must add +the following line: |\cs{global}\cs{topskip}\cs{normaltopskip}|.} + +|<global-style>| is any command to be applied to both footlines and +headlines. Fragile commands are allowed. + +In |<commands>| you can use: + + +\begin{desc} +|\sethead[<even-left>][<even-center>][<even-right>]|\\ +| {<odd-left>}{<odd-center>}{<odd-right>}|\\ +|\setfoot[<even-left>][<even-center>][<even-right>]|\\ +| {<odd-left>}{<odd-center>}{<odd-right>}| +\end{desc} + +Set the corresponding part in headlines and footlines (note the +``visual'' layout of parameters). The optional arguments are the +three or none. If no optional arguments are given the odd-page +settings applies to both even and odd pages. A couple of starred +variant (|\setfoot*|, |\sethead*|) reverses the order of the settings +for even pages (obviously, with them the optional arguments are not +allowed). If |\sethead| is not given, then the headline it is left +empty, and same for |\setfoot| and the footline. + +In the arguments of |\sethead|/|\setfoot| and because of its one-stage +mechanism, we must distinguish between two groups of commands: +\begin{itemize} +\item The first one includes those saved when the marks are emitted, +with information related to sections, and includes: +\begin{itemize} +\item |\thechapter|, |\thesection|, |\thesubsection|\dots{} +\item |\chaptertitle|, |\sectiontitle|, |\subsectiontitle|\dots{} which print the +chapter, section\dots{} title. +\item (Only \textsf{titlesec}. Not in \textsf{titleps}.) +|\ifthechapter{<true>}{<false>}|, |\ifthesection{<true>}{<false>}|, +|\ifthesubsection{<true>}{<false>}|\dots{} which expands to |<true>| +except if the corresponding title lacks of label or there is no title +yet after the superior level (for example, between |\chapter| and a +subsequent |\section|). +\item Any other command or value ``registered'' as ``mark.'' (See below.) +\end{itemize} +They are ordinary commands, with no internal marks at all, and you can +test if, for example, they are empty. + +\item The second group are those expanded on every page, and includes: +\begin{itemize} +\item |\thepage|. +\item Any other command not included in the previous items. +\end{itemize} +\end{itemize} + +\begin{desc} +|\settitlemarks{<level-name>,<sublevel-name>,<subsublevel-name>...}|\\ +|\settitlemarks*{<level-name>,<sublevel-name>,<subsublevel-name>...}| +\end{desc} +Sets which |\...title| commands are to be defined, and when the marks +are emitted; any number of levels is allowed (1, 2, 3...). For example +|\settitlemarks{chapter,section}| +means that: +\begin{itemize} +\item |\chaptertitle| and |\sectiontitle| are the allowed titles in + headlines, +\item |\sectiontitle| is reset in |\chapter|, +\item (Only \textsf{titlesec}. Not in \textsf{titleps}.) +|\ifthechapter| and |\ifthesection| are valid tests. +\item Marks are updated in |\chapter| and |\section|. +\end{itemize} +Default is |\settitlemarks{chapter,section}|, but +|\settitlemarks{section,subsection}| in \textsf{article} class. +|\settitlemarks| may be used outside |\(re)newpagestyle| to set the +default to be used in newly defined and redefined page styles -- it is +used in |\pagestyle|.\footnote{The command \texttt{\string\setmarks} is +deprecated. Now +\texttt{\string\setmarks\string{<primary>\string}\string{<secondary>\string}}is +\texttt{\string\settitlemarks\allowbreak\string{<primary>,\allowbreak<secundary>\string}}.} + +The starred version |\settitlemarks*| creates parallel extra marks +as described below. + +Note |\markboth| is a command to set the |myheadings| marks and +here does not make sense. In fact, using it can lead to unpredictable +results. Anyway, using directly the marking commands is discouraged +(see |titlesec.pdf|), but if you need them, you may write: +\begin{verbatim} +\chapter*{My Chapter} +\chaptermark{My Chapter} +\end{verbatim} + +\begin{desc} +|\headrule \footrule|\\ +|\setheadrule{<length>} \setfootrule{<length>}| +\end{desc} + +If you want a rule below the headline and above the footline. You may +also set their width directly with the commands |\setheadrule| and +|\setfootrule|. (For instance, |\setheadrule{.4pt}| which is, by the +way, the default value.) + +These commands are local to a page style, i.e., defining them directly +in the preamble will not work because the page style settings will +override them. + +\begin{desc} +|\makeheadrule \makefootrule| +\end{desc} + +These commands are used by \textsf{titleps} to typeset the rules. +If there is no rule, both commands are empty (this value is the +default). +|\setheadrule{|\emph{dim}|}| just stands for +\begin{verbatim} +\renewcommand{\makeheadrule}{\rule[-.3\baselineskip]{\linewidth}{<dim>}} +\end{verbatim} +unless if \emph{dim} is 0 pt, which empties +|\makeheadrule| (and similarly |\setfootrule|). + +You can access the total header/footer width with |\linewidth| +but the box enclosing the rule is in fact dimensionless. Hence, +you must be concerned with the rule placement only. Its +baseline is the same as that of the header/footer. That means the +material to be used as rule should be raised or lowered with +|\raisebox|, the lifting argument in |\rule| or by using sensible +coordinates in |picture|, for instance. That makes easy to +place material above \emph{and} below. For instance, +the following code creates a headline with a black bold line +above and a red rule below (the \textsf{color} package is required): +\begin{verbatim} +\renewcommand{\makeheadrule}{% + \makebox[0pt][l]{\rule[.7\baselineskip]{\linewidth}{0.8pt}}% + \color[named]{Red}% + \rule[-.3\baselineskip]{\linewidth}{0.4pt}} +\end{verbatim} + +Of course, the material to be used as rule is not restricted to actual +rules; pictures and leaders, for instance, are allowed, too. + +\section{Headline/footline width} + +\begin{desc} +|\widenhead[<even-left>][<even-right>]{<odd-left>}{<odd-right>}|\\ +|\widenhead*{<even-right/odd-left>}{<even-left/odd-right>}| +\end{desc} + +Makes the headlines/footlines lines wider. The extra width is +asymmetrically added and hence the two [four] arguments. Like +|\sethead|, the starred version reverses the setting for even +pages---for example, |\widenhead*{0pt}{6pc}| is the same as +|\widenhead[6pc][0pt]{0pt}{6pc}|. + +To be used outside |\(re)newpagestyle|. + +\begin{desc} +|nopatches| \qquad (package option) +\end{desc} + +By default, sectioning commands are patched slightly for top marks +and |\@mkboth| to work, so that page styles behave like standard +|headings|. However, if you want to be explicit, like with standard +|myheadings|, and emit premarks and, if necessary, marks by yourself, +set this package option. Remenber you have to use |\sectionmark| and +the like, and not |\markboth| or |\markright|. + +You might also prefer to patch the sectioning commands by yourself, +either with low-level definitions or with the provided +|\TitlepsPatchSection| (with a starred version which adds no premark +and intended mainly for chapters). For example: +\begin{verbatim} +\TitlepsPatchSection*{chapter} % patches \chapter +\TitlepsPatchSection{section} % patches \section +\end{verbatim} +(In standard classes |\part| emits no mark, and therefore it is not +patched by default.) + +\section{Marks} + +Marks can be retrieved in 4 ways: +\begin{description} +\item[top marks] If a page begins with text, they are the marks +belonging to the sectioning unit of that text. If a page begin with a +sectioning title, they are the marks of that title. In other words, +top marks refer to the section immediately adjacent to the +headline. +\item[first marks] The marks of the very first sectioning title. +\item[botttom marks] The marks of the very last (bottom) sectioning +title (also known as \textit{bot marks}). +\item[next top marks] A botttom mark with the values of the top mark of +the next page (only |straight| class or equivalent); by picking some +value from it and comparing it with the corresponding value from the +botttom marks you may know if a section continues in the next page. +Of course, it will not be used very often. +\end{description} +Standard \LaTeX{} provides only first and bottom marks. As you see, with +\textsf{titleps} you have two additional marks, namely, top and next +top marks. + +It should be stressed top marks are not the same as the primitive +\verb|\topmark| (which, in fact, is not used internally at all). They +are true top marks, returning the expected result when the title is at +the top of the page. Further, they are compatible with floats, which +is not true with \verb|\topmark|s. However, they fail with explicit +page breaks, but you can use \verb|\pretitlemark| as described +below. + +\begin{desc} +|outermarks innermarks topmarks botmarks| \qquad (package options) +\end{desc} + +|innermarks| is the default in \LaTeX, with bottom marks in even pages +and first marks in odd pages. More convenient is |outermarks|, with +top marks in even pages and bottom marks in odd pages; it is the more +usual system in classic scientific literature and it is described in +\textit{The \TeX{}book}, p.~259.\footnote{|outermarks| may not work +well in conjunction with explicit |\string\<section>mark| commands} Both of them are intended for two side printing; +|topmarks|/|botmarks| are intended for one side printing with top/bot +marks in every page (they can be used in two side printing as well). + +\begin{desc} +|\bottitlemarks \toptitlemarks \firsttitlemarks \nexttoptitlemarks|\\ +|\outertitlemarks \innertitlemarks| +\end{desc} + +These commands set which mark the values of the subsequent +|\thesection|, |\sectiontitle|, etc., will be taken from. +These macros are switches, and therefore subsequent commands and +variables are taken from the selected mark. The following is valid: +\begin{verbatim} +\toptitlemarks\textbf{\thesection.} \sectiontitle -- +\bottitlemarks\textbf{\thesection.} \sectiontitle +\end{verbatim} + +You can use them freely in your headers;\,% +\footnote{Not exactly: top marks must not be used in the page where a +chapter begins, except by overriding the default definition and making +it of |top| class.} just for fun, the following header shows the +section label from three of these marks: +\begin{verbatim} +\newpagestyle{funny}{ + \sethead{\toptitlemarks Top is \thesection} + {\firsttitlemarks First is \thesection} + {\bottitlemarks Bot is \thesection}} +\end{verbatim} + +In multilingual documents, the language in force is that corresponding +to the package options -- command versions does not switch the +language, but you can do it easily with the help a new title mark and +then switching the language, as explained below. + +\begin{desc} +|\newtitlemark{<command-name>}|\\ +|\newtitlemark*{<variable-name>}| +\end{desc} + +Add a command or a variable to the list of ``marks'' to be emitted at +a sectioning command. The macro must be parameterless, and the +variable is either a length, if it has the form \verb|\<name>|, or a +counter, if it has the form \verb|<name>| (i. e., a string). +For example, if you write (with \textsf{babel}): +\begin{verbatim} +\newtitlemark{\languagename} +\end{verbatim} +then a |\languagename| in the head/foot will contain the language when +the corresponding mark was emitted; unfortunately, \textsf{babel} +does not allow |\languagename| as the first argument of +|\foreignlanguage| (it enters in a infinite loop), but there is a +simple trick -- just use an intermediate command: +\begin{verbatim} +\newcommand\titlelanguage{\languagename} +\newtitlemark{\titlelanguage} +\end{verbatim} +(What is saved is the expansion of |\titlelanguage|, which is turn is +the expansion of |\languagename|. Alternatively, you can create the +intermediate command with |\let| in the header itself.) + +Marks to be emitted at other places (not sectioning commands) are +handled with extra marks and \textit{marksets} (see below). + +Commands must be robust, but not protected, or the value returned will +not be the right one. Remember there are two kinds of robust commands +-- those containing in turn robust commands and those protected with, +say, |\DeclareRobustCommand|.\footnote{Unfortunately, +\texttt{\string\DeclareRobustCommand} has a misleading name, because a +command created with \texttt{\string\newcommand} can be robust, too. +A better name would have been +\texttt{\string\DeclareProtectedCommand}.} An example of how to use +protected commands is a layout used sometimes if sections are long as +well as their titles, where the title is splitted across the left and +the right pages. Here is how this can be carried out: +\begin{verbatim} +\DeclareRobustCommand\splitheader[2]{#1 #2} +\def\contsplitheader{} + +\def\dosplitheader{% + \gdef\contsplitheader{}% + \DeclareRobustCommand\splitheader[2]{##1\gdef\contsplitheader{##2}}} + +\renewpagestyle{headings}{ + \sethead[\thepage] + [] + [\dosplitheader\sectiontitle] + {\contsplitheader} + {} + {\thepage} +} + +\pagestyle{headings} +\end{verbatim} +(Note the header also uses |\DeclareRobustCommand|.) + +\begin{desc} +|\pretitlemark{<section>}{<text>}|\\ +|\pretitlemark*{<section>}{<text>}| +\end{desc} + +Top marks require in fact two marks, one before the page break and +other after it. This is done by \textsf{titlesec}, while +\textsf{titleps} patches the sectioning commands as described above. + +However, if you need an explicit page break you can emit the mark +with |\pretitlemark|. For example: +\begin{verbatim} +\pretitlemark{section}{Performing Brahms} +\newpage +\section{Performing Brahms} +\end{verbatim} +Note the text in the premark is the title of the next section. The +counter is advanced temporarily, so that it has the right value, but +if for some reason you do not want that, just use +\verb|\pretitlemark*|. + +\begin{desc} +|\ifsamemark{<group>}{<command>}{<true>}{<false>}| +\end{desc} + +One of the disavantaged of the switching mechanism is that comparing +a command from, say, the top marks and the botttom marks is not +trivial. +This macro just makes it simpler. If you want to compare the +currect \verb|\thesection| with that in the top mark, write: +\begin{verbatim} +\ifsamemark\toptitlemarks\thesection{<true>}{<false>} +\end{verbatim} + +\section{Running heads with floats} + +\begin{desc} +|psfloats| \qquad (package option) +\end{desc} + +This package option activates the commands described in this section.% +\footnote{It redefines some internal \LaTeX{} commands and there could be +incompatibilities with other packages modifying the same commands. That's +the very reason these commands are loaded only optionally. As of +version 2.6 the syntax was extended with a new argument to allow +extra stuff in running heads/foots. This change is backward +compatible---just preserve the old name \verb|floatps|, which +is deprecated, if you want the pre-2.6 behaviour.} + +\begin{desc} +|\setfloathead*{.}{.}{.}{<extra>}[<which-floats>]|\\ +|\setfloathead[.][.][.]{.}{.}{.}{<extra>}[<which-floats>]|\\ +(Similarly |\setfloatfoot|.) +\end{desc} + +The arguments with a dot are similar to those of |\sethead|. The final +argument says the head is used when there is a float of +the specified types (default is |tp| in headers, and |bp| in footers). +For example: +\begin{verbatim} +\newpagestyle{main}{% + \sethead ... your definition + \setfoot ... your definition + \headrule + \footrule + \setfloathead{}{}{}{\setheadrule{0pt}}[p] + \setfloatfoot{}{}{}{\setfootrule{0pt}}[p]} +\end{verbatim} +removes the header/footer on float pages, including the rules. + +\begin{desc} +|\nextfloathead*{.}{.}{.}{<extra>}[<which-floats>]|\\ +|\nextfloathead[.][.][.]{.}{.}{.}{<extra>}[<which-floats>]|\\ +(Similarly |\nextfloatfoot|.) +\end{desc} + +You may force a header (respectively footer) when a certain float is +the first top one (respectively last bottom) with those commands just +before the corresponding float, where the arguments with a dot are +similar to those of |\sethead|. Those commands are used by +themselves, without putting them inside |\(re)newpagestyle|. So, to +empty the headline when a certain figure is placed at the top (because +it is a bleed, for example): +\begin{verbatim} +\nextfloathead{}{}{}{}[t] +\begin{figure} +... +\end{figure} +\end{verbatim} + +\section{Extra marks} + +Both \textsf{titlesec} and \textsf{titleps} provide tools for handling +extra marks, if you are using an $\epsilon$-\TeX{} based engine +(currently most of them) and load the \textsf{etex} package or +equivalent. The way they work are conceptually similar to the title +marks described above -- you set which commands or variables are to +get synchronized in heads and foots. To use extra marks, you have to +load them with the following package option: + +\begin{desc} +|extramarks| \qquad (package option) +\end{desc} + +Extra marks are subsidiary. If page styles are modified internally by +another package and the document does not make use of sectioning +commands, you might still need an empty title mark (like +\verb|\sectionmark{}|), as well as to synchronize the language by +hand. + +In many cases, the following “short” marks mechanism will be enough. +With it, you simply say with \verb|\setshormark| the name of a command +to be used in heads or foots, and then emit the mark at appropiated +places (short marks for variables are not available). An example +illustrates how this is carried out: +\begin{verbatim} +\newcommand\lemmatitle{} + +\setshortmark\lemmatitle + +\newcommand\lemma[1]{% + \renewcommand\lemmatitle{#1}% + \preshortmark\lemmatitle % if you want top marks + \pagebreak[2]% + \vspace{1em}% + \textbf{#1}\enspace + \shortmark\lemmatitle} + +\newpagestyle{main}{ + \sethead{}{\topshortmark\lemmatitle + --\firstshortmark\lemmatitle + --\botshortmark\lemmatitle + --\nexttopshortmark\lemmatitle}{}} + +\pagestyle{main} +\end{verbatim} + +Top marks require emitting the marks before the page break -- just use +the command \verb|\preshortmark| as shown above. Otherwise, you may +omit it. Unlike title marks and extra marks, the selector of short +marks (\verb|\topshortmark|, \verb|\firstshortmark|, +\verb|\botshortmark|, \verb|\nexttopshortmark|), is \textit{not} a +switch and must be always immediately followed by the command to be +retrieved. + +For a more general approach use the following tools. + +\begin{desc} +|\newmarkset{<markset>}| +\end{desc} + +A \textit{markset} contains a set of related commands and variables +intended to be emitted simultaneously as marks, so that their values +can be retrieved in heads/foots. A typical \textit{markset} could be a +title and its counter (and perhaps, in a multilingual document, the +active language, i.e., \verb|\languagename| in \textsf{babel}, or an +intermediate command). There +is always a special unnamed \textit{markset} for sectioning marks, which is +the main one and handled with the tools described above (with |title| +in their names). + +\begin{desc} +|\newextramark{<markset>}{<macro-name>}|\\ +|\newextramark*{<markset>}{<variable-name>}| +\end{desc} + +Add to a \textit{markset} a command or a variable to be synchronized . +They are identical to \verb|\newtitlemark| and \verb|\newtitlemark*|, +except for the additional parameter with the \textit{markset} name. + +\begin{desc} +|\botextramarks{<markset>} \topextramarks{<markset>}|\\ +|\firstextramarks{<markset>} \nexttopextramarks{<markset>}|\\ +|\outerextramarks{<markset>} \innerextramarks{<markset>}| +\end{desc} + +The \verb|extra| counterparts of the \verb|title| commands described +above, with the same behaviour. For example: +\begin{verbatim} +\newcommand{\lemmatitle}{} +\newcounter{lemma} + +\newmarkset{lemma} +\newextramark{lemma}{\lemmatitle} +\newextramark*{lemma}{lemma} % ie, the counter `lemma' + +\newcommand{\lemma}[1]{% + \renewcommand{\lemmatitle}{#1}% + \stepcounter{lemma}% + \preextramark{lemma}% + \pagebreak[2]% + \vspace{1em}% + \textbf{(\arabic{lemma}) #1}\enspace + \extramark{lemma}} + +\newpagestyle{main}{ + \sethead{} + {\topextramarks{lemma}(\arabic{lemma}) \textbf{\lemmatitle}} + {}} + +\pagestyle{main} +\end{verbatim} + +\begin{desc} +|\settitlemarks*{<level-name>,<sublevel-name>,<subsublevel-name>...}| +\end{desc} + +By default, \LaTeX{} and \textsf{titleps} use a single \textit{markset} for +all sectioning levels. This is problematic, for example, in the +\textsf{article} class, because sections does not start a new page. +Consider the following piece of code: +\begin{verbatim} +\section{A section} +\subsection{A subsection} +\end{verbatim} +On odd pages with first marks and subsection titles, the head has +no title, because \verb|\subsection| is the second mark, not the +first one. + +To overcome this limitation, you can use the starred version of +\verb|\settitlemarks|, which creates parallel \textit{marksets} (one per +level) synchonized with the main \textit{markset}. They are retrieved like +other extra marks, but they are special in that you cannot emit them +by yourself -- they are always emitted by the corresponding +sectioning mark. So, with +\begin{verbatim} +\settitlemarks*{section,subsection} +\end{verbatim} +and a page style containing +\begin{verbatim} +\firstextramarks{subsection}\subsectiontitle +\end{verbatim} +you retrieve the mark emitted by the first \verb|\subsection|, even +if preceded by a \verb|\section|. (Top marks are best retrieved from +the main \textit{markset}.) + +They are extra marks, and therefore language synchronization has to be +done by hand -- add \verb|\languagename| or an intermediate command to +the main \textit{markset} with \verb|\newtitlemark| and, if you want, +define a command. For example: +\begin{verbatim} +% use an intermediate command because we'll need \foreignlanguage +\newcommand\titlelanguage{\languagename} +\newtitlemark{\titlelanguage} + +% define a command to ease defining page styles +\newcommand{\toplang}[1]{% + {\topextramarks{section}% + \foreignlanguage{\titlelanguage}{#1}}} +\end{verbatim} + +\section{A couple of examples} + +Because of the way marks are handled, special constructions like this are +allowed: +\begin{verbatim} +\newpagestyle{main}[\small\sffamily]{ + \sethead[\textbf{\thepage}] + [\textsl{\chaptertitle}] + [[\toptitlemarks\thesection--\bottitlemarks\thesection] + {\toptitlemarks\thesection--\bottitlemarks\thesection]} + {\textsl{\sectiontitle}} + {\textbf{\thepage}}} +\end{verbatim} +As you can see, the range of sections in a page with |\thesection| is +printed in both left and right heads. Of course, this example should +be fine tuned to collapse the ranges if there is a single section in a +page (with |\ifsamemark|), but it gives a hint of how to get stunning headers. + +In this document, the following styles are used: +\begin{verbatim} +\widenhead{2.1pc}{0pc} +\renewpagestyle{plain}[\small\sffamily\slshape]{ + \footrule + \setfoot{}{\thepage}{}} +\newpagestyle{myps}[\small\sffamily\slshape]{ + \headrule + \sethead{titlesec -- titleps}{\sectiontitle}{\thepage}} +\end{verbatim} + +The following definitions provide page styles similar to +those in Lamport's \textit{The \LaTeX\ book} (with the \textsf{calc} +package): +\begin{verbatim} +\widenhead*{0pt}{\marginparsep + \marginparwidth} % symmetrically +\renewpagestyle{plain}{} +\newpagestyle{latex}[\bfseries]{ + \headrule + \sethead[\thepage][][\chaptertitle] + {\thesection\ \sectiontitle}{}{\thepage}} +\pagestyle{latex} +\end{verbatim} + +% \section{Remarks} +% +% Page styles in standard \LaTeX{} are somewhat rudimentary. For +% example |\thispagestyle| is not always correctly synchronized with +% sectioning marks, and if you set |\pagestyle{plain}| and then +% |\thispagestyle{headings}|, its behaviour is not the expected one. +% The same happens if a page style defined in \textsf{titleps} is used +% in a |\thispagestyle| in the context of a standard page style -- you +% have to define the main one as well. + +% \section{Some tips and tricks} +% +% star |\*| +% +% split heads +% +% bible + +\end{document} + diff --git a/Master/texmf-dist/doc/latex/titlesec/titlesec.pdf b/Master/texmf-dist/doc/latex/titlesec/titlesec.pdf Binary files differindex 95b0ba3f955..5c8c11e2511 100644 --- a/Master/texmf-dist/doc/latex/titlesec/titlesec.pdf +++ b/Master/texmf-dist/doc/latex/titlesec/titlesec.pdf diff --git a/Master/texmf-dist/doc/latex/titlesec/titlesec.tex b/Master/texmf-dist/doc/latex/titlesec/titlesec.tex index 29d2a6ef517..463ae8e711e 100644 --- a/Master/texmf-dist/doc/latex/titlesec/titlesec.tex +++ b/Master/texmf-dist/doc/latex/titlesec/titlesec.tex @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -20,8 +20,8 @@ % % The Current Maintainer of this work is Javier Bezos. -\def\fileversion{2.9.2} -\def\docdate{2011-11-17} +\def\fileversion{2.10.0} +\def\docdate{2011-12-15} \documentclass[a4paper]{ltxguide} \usepackage[sf,bf,compact,topmarks,calcwidth,pagestyles]{titlesec} @@ -43,10 +43,10 @@ \title{The \textsf{titlesec}, \textsf{titleps} and \textsf{titletoc} Packages\footnote{The \textsf{titlesec} package is currently at -version 2.9.2. \copyright{} 1998--2011 Javier Bezos. +version 2.10.0. \copyright{} 1998--2011 Javier Bezos. The \textsf{titletoc} package is currently at version 1.6. The \textsf{titleps} package is currently at version -1.0. \copyright{} 1999--2011 Javier Bezos. All Rights +1.1.0 \copyright{} 1999--2011 Javier Bezos. All Rights Reserved.}} \author{Javier Bezos\footnote{For bug reports, comments and @@ -55,7 +55,7 @@ suggestions go to \href{http://www.tex-tipografia.com/contact.html}% is not my strong point, so contact me when you find mistakes in the manual. Other packages by the same author: \textsf{gloss} (with Jos\'e Luis D\'{\i}az), \textsf{enumitem, accents, tensind, esindex, -dotlessi}.}} +dotlessi, babeltools}.}} \date{\docdate} @@ -113,7 +113,9 @@ contents. The goal is to provide new features unavailable in current standard \LaTeX{} but without changing the way \LaTeX{} works you may consider using \textsf{fancyhdr}, by Piet van Oostrum, \textsf{sectsty}, by Rowland McDonnell, and \textsf{tocloft}, by Peter Wilson, which you -can make pretty things with. +can make pretty things with.\footnote{Since the sectioning commands +are rewritten, their behaviour could be somewhat different +in some cases.} Some of the new features provided are: \begin{itemize} @@ -1025,370 +1027,49 @@ underlining), you can say: However, you might prefer the package option \texttt{explicit}. -\section{Page Styles} +\section{\textsf{titleps} and Page Styles} %~~~~~~~~~~~~~~~~~~~ -As a part of this package a set of commands are provided for one-step -headline and footline settings. Those page styles has been designed to work -with sectioning related information; you shouldn't use to create -headers with the first an last entry of a page in a dictionary, -for example (you could, but it is more complicated than with -\textsf{fancyhdr}). Most of these features (but not all) are also -available as a separate package named \texttt{titleps} -- see below -for further details. - -It works with standard classes and many others; however, additional -\LaTeX{} layout -adjustments could be necessary in some of them (for instance the -\textsc{AMS} classes).\footnote{% -Two columns layout requires the -\textsf{fix2col} package by David Carlisle.} For using them, -set the following package option:\footnote{The -way page styles works was reimplemented in full in release 2.3. -However, in most of cases you won't notice it at all.} -\begin{desc} -|pagestyles| -\end{desc} - -Once this has been done, you can define your own page styles -and then activate them.\footnote{Page styles so defined cannot -be used with \texttt{\string\thispagestyle} except if the surrounding -page style has been defined with \textsf{titlesec}, too.} - -\subsection{Defining Page Styles} - -\begin{desc} -|\newpagestyle{<name>}[<global-style>]{<commands>}|\\ -|\renewpagestyle{<name>}[<global-style>]{<commands>}| -\end{desc} - -Defines a new style or redefines an existing one, named |<name>|. -For convenience, end of lines are ignored, and you need not ``hide'' -them with |%|.\footnote{Even if marks should be reserved to -pass information to headers, some classes, like AMS ones, introduce additional -code. When redefining the |plain| style of AMS classes, you must add the -following line: -|\cs{global}\cs{topskip}\cs{normaltopskip}|.} - -|<global-style>| is any command to be applied to both footlines and -headlines. Fragile commands are allowed. - -In |<commands>| you can use - -\begin{desc} -|\headrule \footrule|\\ -|\setheadrule{<length>} \setfootrule{<length>}| -\end{desc} - -If you want a rule below the headline and above the footline. You may -also set their width directly with the commands |\setheadrule| and -|\setfootrule|. (For instance, |\setheadrule{.4pt}| which is, by the -way, the default value.) - -These commands are local to a page -style, i.e., defining them directly in the preamble will -not work because the page style settings will override them. - -\begin{desc} -|\makeheadrule \makefootrule| -\end{desc} - -These commands are used by \textsf{titlesec} to typeset the rules. -If there is no rule, both commands are empty (this value is the -default). -|\setheadrule{|\emph{dim}|}| just stands for -\begin{verbatim} -\renewcommand{\makeheadrule}{\rule[-.3\baselineskip]{\linewidth}{<dim>}} -\end{verbatim} -unless if \emph{dim} is 0 pt, which empties -|\makeheadrule| (and similarly |\setfootrule|). - -You can access the total head/foot width with |\linewidth| -but the box enclosing the rule is in fact dimensionless. Hence, -you must be concerned with the rule placement only. Its -baseline is the same as that of the head/foot. That means the -material to be used as rule should be raised or lowered with -|\raisebox|, the lifting argument in |\rule| or by using sensible -coordinates in |picture|, for instance. That makes easy to -place material above \emph{and} below. For instance, -the following code creates a headline with a black bold line -above and a red rule below (the \textsf{color} package is required): -\begin{verbatim} -\renewcommand{\makeheadrule}{% - \makebox[0pt][l]{\rule[.7\baselineskip]{\linewidth}{0.8pt}}% - \color[named]{Red}% - \rule[-.3\baselineskip]{\linewidth}{0.4pt}} -\end{verbatim} - -Of course, the material to be used -as rule is not restricted to actual rules; pictures and leaders, for -instance, are allowed, too. - -\begin{desc} -|\sethead[<even-left>][<even-center>][<even-right>]|\\ -| {<odd-left>}{<odd-center>}{<odd-right>}|\\ -|\setfoot[<even-left>][<even-center>][<even-right>]|\\ -| {<odd-left>}{<odd-center>}{<odd-right>}| -\end{desc} - -Set the corresponding part in heads and foots. The optional arguments -are all or none. If no optional arguments are given the odd-page -settings applies to both even and odd pages. A couple of starred -variant (|\setfoot*|, |\sethead*|) reverses the order of the settings -for even pages (obviously, with them the optional arguments are -not allowed). In the arguments of |\sethead|/|\setfoot| and because -of its one-step mechanism, we must distinguish between two groups of -commands. The first one includes those saved when the marks are sent, with -information related to sections, and includes: -\begin{itemize} -\item |\thechapter|, |\thesection|\dots{} -\item |\chaptertitle|, |\sectiontitle|\dots{} which print the -chapter, -section\dots{} title. -\item |\ifthechapter{<true>}{<false>}|, - |\ifthesection{<true>}{<false>}|\dots{} which expands to |<true>| - except if the corresponding title lacks of label or there is - no title yet after the superior level (for example, between - |\chapter| and a subsequent |\section|). -\item Any other command or value ``registered'' as ``mark.'' (See below.) -\end{itemize} -The second group are those expanded in every page, and includes: -\begin{itemize} -\item |\thepage|. -\item Any other command not included in the previous items. -\end{itemize} - -\begin{desc} -|\setmarks{<primary>}{<secondary>}| -\end{desc} -Sets which |\...title| commands are to be defined, and when the marks -are updated. For example -|\setmarks{chapter}{section}| -means that: -\begin{itemize} -\item |\chaptertitle| and |\sectiontitle| are the allowed titles in - heads, -\item |\sectiontitle| is reset in |\chapter|, -\item |\ifthechapter| and |\ifthesection| are valid tests, and -\item Marks are updated in |\chapter| and |\section|. -\end{itemize} -By default it is -|\setmarks{chapter}{section}| but |\setmarks{section}{subsection}| in -\textsf{article} class. |\setmarks| may be used outside |\(re)newpagestyle| -to set the default to be used in newly defined and redefined page styles. -Use it before |\pagestyle|. - -Note |\markboth| is a command to set the |myheadings| marks and -here does not make sense. In fact, using it can lead to unpredictable -results. Anyway, using directly the marking commands is discouraged -(see sec.~\ref{s:starred}) but if you need them, you may use them -as in: -\begin{verbatim} -\chapter*{My Chapter} -\chaptermark{My Chapter} -\end{verbatim} - -\subsection{Additional Settings} - -\begin{desc} -|\widenhead[<even-left>][<even-right>]{<odd-left>}{<odd-right>}|\\ -|\widenhead*{<even-right>/<odd-left>}{<even-left>/<odd-right>}| -\end{desc} - -Makes the head/foot lines wider. The extra width is asymmetrically -added and hence the two [four] arguments. Like |\sethead|, the -starred version reverses the setting for even pages---for example, -|\widenhead*{0pt}{6pc}| is the same as -|\widenhead[6pc][0pt]{0pt}{6pc}|. - -\subsection{Running heads with floats} - -\begin{desc} -|psfloats| \quad (Package option.) -\end{desc} - -This package option activates the commands described in this section.% -\footnote{It redefines some internal \LaTeX{} commands and there could be -incompatibilities with other packages modifying the same commands. That's -the very reason these commands are loaded only optionally. As of -version 2.6 the syntax was extended with a new argument to allow -extra stuff in running heads/foots. This change was backward -compatible---just preserve the old name \verb|floatps|, which -is deprecated, if you want the pre-2.6 behaviour.} - - -\begin{desc} -|\setfloathead*{.}{.}{.}{<extra>}[<which-floats>]|\\ -|\setfloathead[.][.][.]{.}{.}{.}{<extra>}[<which-floats>]|\\ -(Similarly |\setfloatfoot|.) -\end{desc} - -The arguments with a dot are similar to those of |\sethead|. The final -argument says the head is used when there is a float of -the specified types (default is |tp| in headers, and |bp| in footers). -For example: -\begin{verbatim} -\newpagestyle{main}{% - \sethead ... your definition - \setfoot ... your definition - \headrule - \footrule - \setfloathead{}{}{}{\setheadrule{0pt}}[p] - \setfloatfoot{}{}{}{\setfootrule{0pt}}[p]} -\end{verbatim} -removes the header/footer on float pages, including the rules. - -\begin{desc} -|\nextfloathead*{.}{.}{.}{<extra>}[<which-floats>]|\\ -|\nextfloathead[.][.][.]{.}{.}{.}{<extra>}[<which-floats>]|\\ -(Similarly |\nextfloatfoot|.) -\end{desc} - -You may force a header (respectively footer) when a certain -float is the first top one (respectively last bottom) with -those commands, where the arguments with a dot are similar to -those of |\sethead|, just before the corresponding float. -Those commands are used by themselves, without putting them -inside |\(re)newpagestyle|. - -\subsection{Marks} - -\begin{desc} -|outermarks innermarks topmarks botmarks| \quad (Package options) -\end{desc} - -|innermarks| is the default in \LaTeX, with bottom marks in even pages -and first marks in odd pages. More convenient is |outermarks|, with -top marks in even pages and bottom marks in odd pages; it is the more -usual system in classic scientific literature and it is described in -\textit{The \TeX{}book}, p.~259. Both of them are intended for two -side printing; |topmarks|/|botmarks| are intended for one side -printing with top/bot marks in every page (they can be used in two -side printing as well).% -\footnote{|outermarks| does not work well in conjunction with explicit -|\string\<section>mark| commands. The top marks mechanism fails just -after explicit page breaks.} - -\begin{desc} -|\bottitlemarks \toptitlemarks \firsttitlemarks \nexttoptitlemark|\\ -|\outertitlemarks \innertitlemarks| -\end{desc} - -One of the cooler features added to page styles is the possibility of -selecting which marks are used in subsequent macros. These commands -set which mark the values of |\thesection|, |\sectiontitle|, -etc., will be taken from. You can use freely in your headers;\,% -\footnote{Not exactly: top marks must not be used in the page where a -chapter begins, except by overriding the default definition and making -it of |top| class.} just for fun, the following header shows the -section label from three of these marks: -\begin{verbatim} -\newpagestyle{funny}{ - \sethead{Top~is~\toptitlemarks\thesection} - {First~is~\firsttitlemarks\thesection} - {Bot~is~\bottitlemarks\thesection}} -\end{verbatim} - -|\outertitlemarks| is the default value when the |outermarks| package -option is set, |\toptitlemarks| when |topmarks| is set, and so on. -|\innertitlemarks| is the default value in \LaTeX{} and in this -package if none of those option is used. A further set of marks is -provided with |\nexttoptitlemarks| which provides a bottom mark with -the values of the top mark of the next page (straight class only); by -picking some value from it and comparing with the corresponding value -of the |\bottitlemarks| you may know if a section continues in the -next page. Of course, these commands will not be used very often. - -\begin{desc} -|\newtitlemark{<macro-name>}|\\ -|\newtitlemark*{<variable-name>}| -\end{desc} - -Add a macro or a variable to the list of ``marks'' to be saved. -The macro must be parameterless, and the variable should be in \TeX{} -form (which is the same in lengths but not in counters---the latter -take the form |\c@<counter>|). - -\subsection{A couple of examples} - -Because of the way marks are handled, special constructions like this are -allowed: -\begin{verbatim} -\newpagestyle{main}[\small\sffamily]{ - \sethead [\textbf{\thepage}] - [\textsl{\chaptertitle}] - [[\toptitlemarks\thesection--\bottitlemarks\thesection] - {\toptitlemarks\thesection--\bottitlemarks\thesection]} - {\textsl{\sectiontitle}} - {\textbf{\thepage}}} -\end{verbatim} -As you can see, the range of sections in a page |\thesection| is -printed in both left and right heads. -Of course, this example should be fine tuned to collapse the -ranges if there is a single section in a page, but it gives -a hint of how to get stunning headers. - -In this document, the following styles are used: -\begin{verbatim} -\widenhead{2.1pc}{0pc} -\renewpagestyle{plain}[\small\sffamily\slshape]{ - \footrule - \setfoot{}{\thepage}{}} -\newpagestyle{myps}[\small\sffamily\slshape]{ - \headrule - \sethead{Titlesec}{\sectiontitle}{\thepage}} -\end{verbatim} - -The following definitions provide page styles similar to -those of Lamport's \LaTeX\ book (with the \textsf{calc} -package): -\begin{verbatim} -\widenhead*{0pt}{\marginparsep + \marginparwidth} % symmetrically -\renewpagestyle{plain}{} -\newpagestyle{latex}[\bfseries]{ - \headrule - \sethead[\thepage][][\chaptertitle] - {\thesection\ \sectiontitle}{}{\thepage}} -\pagestyle{latex} +The \textsf{titleps} package provides tools for one-stage setting of +page styles (headlines and footlines). A higher-level interface is +used, where the mark mechanism is hidden and there is no need to deal +with |\leftmark|s and |\rightmark|s -- just use a command or variable +registered as a ``mark'' as the expected value will be returned, i.e., +those when the mark was emitted, either by a sectioning command or +explicitly with |\chaptermark|, |\sectionmark|, etc. A simple +example, whose meaning should be obvious, is: +\begin{verbatim} +\newpagestyle{main}{ + \sethead[\thepage][\chaptertitle][(\thesection] % even + {\thesection)}{\sectiontitle}{\thepage}} % odd +\pagestyle{main} \end{verbatim} -\subsection{\textsf{titleps}} - -With this package you have access to most of the features described in -this section without having to load \textsf{titlesec}. The following -are not supported: +Other features are: \begin{itemize} -\item top marks, and related options -- only first and bottom marks -are allowed; -\item |\ifthechapter|, |\ifthesection|, |\ifthesubsection|, etc.; -\item being a new package, the deprecated option |floatps| is not -available, but only |psfloats|. +\item Working top marks, compatible with floats (unlike the standard +|\topmark|, which does not work correctly in \LaTeX{}). +\item Access to top, first and bot marks in a single headline/footline +(e.g., the first and last section numbers). +\item Marks for more than 2 sectioning levels. +\item Simple (and not so simple) headrules and footrules. +\item Headlines and footlines for pages with floats. +\item Headlines and footlines for specific floats (a sort of +|\thispagestyle| for floats). +\item Multiple sets of marks (named here \emph{markset}s and +\textit{extra marks}). \end{itemize} - -\section{Final comments} -%~~~~~~~~~~~~~~~~~~~~~ - -\begin{itemize} - -\item Only a |\footnote| command is allowed in titles, but it -will work. However, the footnote mark is not removed from -toc entries or running headings; for that use +It can be used without \textsf{titlesec}, but you will get most of +it when used together. To load it as a separate package, use the +customary \verb|\usepackage{titleps}|, but with \textsf{titlesec} you +have to load it with: \begin{verbatim} -\usepackage[stable]{footmisc} +\usepackage[pagestyles]{titlesec} \end{verbatim} -\item The page styles have been reimplemented in full in version 2.3. -Most of previous definition will work with the current code, even if -many things have changed. In particular, headers using just |\the...| -and |\...title| commands, besides |\usepage| and formatting commands -still work. Now, pagestyles should be loaded explicitly with the -|pagestyles| option, but if it is not given and the three basic -commands are used, the page styles macros are loaded with a warning. -The new code overcomes the limitations of previous releases, fixes -some bugs (the incompatibility between top marks and floats, for -example), and adds new features. -\end{itemize} +Please, read |titleps.pdf| (or typeset |titleps.tex|) for further +information. \section{Contents: The \textsf{titletoc} package} % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/Master/texmf-dist/tex/latex/titlesec/block.tss b/Master/texmf-dist/tex/latex/titlesec/block.tss index 1efb8356e25..34b2747a84f 100644 --- a/Master/texmf-dist/tex/latex/titlesec/block.tss +++ b/Master/texmf-dist/tex/latex/titlesec/block.tss @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -20,7 +20,7 @@ % % The Current Maintainer of this work is Javier Bezos. -\ProvidesFile{block.tss}[2011/11/11] +\ProvidesFile{block.tss}[2011/12/15] \gdef\ttlh@block#1#2#3#4#5#6#7#8{% \gdef\ttl@makeline##1{\ttl@calc\hspace{#6}##1\ttl@calc\hspace{#7}}% diff --git a/Master/texmf-dist/tex/latex/titlesec/drop.tss b/Master/texmf-dist/tex/latex/titlesec/drop.tss index 6d085ff4d0c..be0d638c085 100644 --- a/Master/texmf-dist/tex/latex/titlesec/drop.tss +++ b/Master/texmf-dist/tex/latex/titlesec/drop.tss @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -20,7 +20,7 @@ % % The Current Maintainer of this work is Javier Bezos. -\ProvidesFile{drop.tss}[2011/11/11] +\ProvidesFile{drop.tss}[2011/12/15] \gdef\ttlh@drop#1#2#3#4#5#6#7#8{% \global\@noskipsectrue diff --git a/Master/texmf-dist/tex/latex/titlesec/frame.tss b/Master/texmf-dist/tex/latex/titlesec/frame.tss index 273ab6be723..b386347010e 100644 --- a/Master/texmf-dist/tex/latex/titlesec/frame.tss +++ b/Master/texmf-dist/tex/latex/titlesec/frame.tss @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -20,7 +20,7 @@ % % The Current Maintainer of this work is Javier Bezos. -\ProvidesFile{frame.tss}[2011/11/11] +\ProvidesFile{frame.tss}[2011/12/15] \gdef\ttlh@frame#1#2#3#4#5#6#7#8{% \def\ttl@filleft##1{\hfill}% diff --git a/Master/texmf-dist/tex/latex/titlesec/leftmargin.tss b/Master/texmf-dist/tex/latex/titlesec/leftmargin.tss index 05776d68196..e2d17301f88 100644 --- a/Master/texmf-dist/tex/latex/titlesec/leftmargin.tss +++ b/Master/texmf-dist/tex/latex/titlesec/leftmargin.tss @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -20,7 +20,7 @@ % % The Current Maintainer of this work is Javier Bezos. -\ProvidesFile{leftmargin.tss}[2011/11/11] +\ProvidesFile{leftmargin.tss}[2011/12/15] \gdef\ttlh@leftmargin#1#2#3#4#5#6#7#8{% \global\@noskipsectrue diff --git a/Master/texmf-dist/tex/latex/titlesec/margin.tss b/Master/texmf-dist/tex/latex/titlesec/margin.tss index 73e42342c3d..4fc8cb3729b 100644 --- a/Master/texmf-dist/tex/latex/titlesec/margin.tss +++ b/Master/texmf-dist/tex/latex/titlesec/margin.tss @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -20,7 +20,7 @@ % % The Current Maintainer of this work is Javier Bezos. -\ProvidesFile{margin.tss}[2011/11/11] +\ProvidesFile{margin.tss}[2011/12/15] \gdef\ttlh@margin#1#2#3#4#5#6#7#8{% \global\@noskipsectrue diff --git a/Master/texmf-dist/tex/latex/titlesec/rightmargin.tss b/Master/texmf-dist/tex/latex/titlesec/rightmargin.tss index 39dce213c35..dc35f615985 100644 --- a/Master/texmf-dist/tex/latex/titlesec/rightmargin.tss +++ b/Master/texmf-dist/tex/latex/titlesec/rightmargin.tss @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % @@ -21,7 +21,7 @@ % % The Current Maintainer of this work is Javier Bezos. -\ProvidesFile{rightmargin.tss}[2011/11/11] +\ProvidesFile{rightmargin.tss}[2011/12/15] \gdef\ttlh@rightmargin#1#2#3#4#5#6#7#8{% \global\@noskipsectrue diff --git a/Master/texmf-dist/tex/latex/titlesec/titleps.sty b/Master/texmf-dist/tex/latex/titlesec/titleps.sty index bc75ccdb675..b52e3d83d04 100644 --- a/Master/texmf-dist/tex/latex/titlesec/titleps.sty +++ b/Master/texmf-dist/tex/latex/titlesec/titleps.sty @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -24,13 +24,11 @@ % ~~~~~~~ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{titleps}[2011/11/17 v1.0 Page styles] +\ProvidesPackage{titleps}[2011/12/15 v1.1.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). +% almost similar. First, some definitions from titlesec. \newif\ifttl@ps \newif\ifttl@toclabel @@ -40,33 +38,84 @@ {\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.}} +\newif\ifttl@premark % to be used in ttlps.def +\ttl@premarkfalse + +\def\ttl@premark#1#2{% + \protected@xdef\ttl@prevmarks{\ttl@marks}% + \csname#1mark\endcsname{#2}% + \gdef\ttl@prevmarks{\ttl@marks}} + +\let\ttl@savemark\@empty + +% Patching sectioning commands + +\newcommand\TitlepsPatchSection{% + \@ifstar{\ttl@setsec\@gobbletwo}% + {\ttl@setsec\pretitlemark}} + +\def\ttl@setsec#1#2{% + \@ifundefined{#2}{}{% + \expandafter\let\csname ttl@s@#2\expandafter\endcsname + \csname#2\endcsname + \@namedef{#2}{% + \@ifstar{\ttl@presec@s{#2}}% + {\@dblarg{\ttl@presec@x#1{#2}}}}}}% + +% premark/gobble, sect-name, opt, title +\def\ttl@presec@x#1#2[#3]#4{% + #1{#2}{#3}% + \@nameuse{ttl@s@#2}[#3]{#4}} +\def\ttl@presec@s#1#2{% + \gdef\ttl@savemark{\@nameuse{#1mark}{#2}}% + \@nameuse{ttl@s@#1}*{#2}} + +\def\ttl@atbegin{% + \TitlepsPatchSection*{chapter}% + \TitlepsPatchSection{section}% + \TitlepsPatchSection{subsection}% + \TitlepsPatchSection{subsubsection}% + \TitlepsPatchSection{paragraph}% + \TitlepsPatchSection{subparagraph}} + +\AtBeginDocument{\ttl@atbegin} + +% Package options + \DeclareOption{psfloats}{\let\ttl@replace\@empty} % a flag -\DeclareOption{outermarks}{\ttl@naerror{outermarks}} -\DeclareOption{topmarks}{\ttl@naerror{topmarks}} +\DeclareOption{outermarks}{% + \def\ttl@titlemarks{\outertitlemarks}} +\DeclareOption{topmarks}{ + \def\ttl@titlemarks{\toptitlemarks}} \DeclareOption{botmarks}{% \def\ttl@titlemarks{\bottitlemarks}} \DeclareOption{innermarks}{% \def\ttl@titlemarks{\innertitlemarks}} +\DeclareOption{extramarks}{\let\ttl@fetchmark\@empty} +\DeclareOption{nopatches}{\let\ttl@atbegin\relax} \ExecuteOptions{innermarks} \ProcessOptions +% Load the package body + \let\newpagestyle\@empty \let\renewpagestyle\@empty \let\widenhead\@empty \input ttlps.def -% Raise error if the following are used. +% Raise error if the following are used + +\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.}} \def\ttl@setifthe#1{% \expandafter\protected@edef\csname ifthe#1\endcsname{% @@ -80,8 +129,4 @@ \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
\ No newline at end of file diff --git a/Master/texmf-dist/tex/latex/titlesec/titlesec.sty b/Master/texmf-dist/tex/latex/titlesec/titlesec.sty index 63271d50635..c9c4f5d1650 100644 --- a/Master/texmf-dist/tex/latex/titlesec/titlesec.sty +++ b/Master/texmf-dist/tex/latex/titlesec/titlesec.sty @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -48,7 +48,7 @@ % ~~~~~~~ \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{titlesec}[2011/11/11 v2.9.2 Sectioning titles] +\ProvidesPackage{titlesec}[2011/12/15 v2.10.0 Sectioning titles] % Initialization % ~~~~~~~~~~~~~~ @@ -334,6 +334,16 @@ \ttl@elinemarks \global\ttl@toclabelfalse} +\newif\ifttl@premark % to be used in ttlps.def +\ttl@premarkfalse + +\def\ttl@premark#1#2{% + \protected@xdef\ttl@prevmarks{\ttl@marks}% + \ttl@blinemarks + \csname#1mark\endcsname{#2}% + \ttl@elinemarks + \gdef\ttl@prevmarks{\ttl@marks}} + % Must be preceded by a default \ttl@savewrite, which is used % in starred variants--\@empty in top and straight classes. % In straight class, it is preceded by the setting of @@ -360,9 +370,11 @@ \let\ifttl@toclabel\ifttl@label \ifx\ttl@savewrite\@empty\else % If marks \ifttl@ps - \ttl@blinemarks - \csname#1mark\endcsname{#2}% - \ttl@elinemarks + \ifttl@premark + \global\ttl@premarkfalse + \else % if no \pretitlemark + \ttl@premark{#1}{#2}% + \fi \fi \ifttl@label\else\ttl@Hy@steplink{#1}\fi \fi} @@ -396,13 +408,7 @@ \gdef\thetitle{\csname the#1\endcsname}% \if@noskipsec \leavevmode \fi \par - \ifttl@ps - \protected@xdef\ttl@prevmarks{\ttl@marks}% - \fi \ttl@labelling{#1}{#2}% - \ifttl@ps - \gdef\ttl@prevmarks{\ttl@marks}% - \fi \ttl@startargs\ttl@straight@ii{#1}{#3}} % 1:left 2:right 3:before 4:after 5:afterindent 6:name 7:title @@ -901,6 +907,7 @@ \DeclareOption{pagestyles}{\let\sectiontitle\@empty} +\DeclareOption{extramarks}{\let\ttl@fetchmark\@empty} \DeclareOption{floatps}{% \ifx\sectiontitle\@empty \let\ttl@replace\space diff --git a/Master/texmf-dist/tex/latex/titlesec/titletoc.sty b/Master/texmf-dist/tex/latex/titlesec/titletoc.sty index 945bdb85a83..1e758e76cdf 100644 --- a/Master/texmf-dist/tex/latex/titlesec/titletoc.sty +++ b/Master/texmf-dist/tex/latex/titlesec/titletoc.sty @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -91,7 +91,7 @@ % result with \included (F. Mittelbach) % 07/07/14: Removed the patch mechanism. -\ProvidesPackage{titletoc}[2011/11/11 v1.6 TOC entries] +\ProvidesPackage{titletoc}[2011/12/15 v1.6 TOC entries] % The following tags are used: % ttl@ : the generic one, shared with titlesec diff --git a/Master/texmf-dist/tex/latex/titlesec/ttlkeys.def b/Master/texmf-dist/tex/latex/titlesec/ttlkeys.def index e14837091b4..19d5cac879c 100644 --- a/Master/texmf-dist/tex/latex/titlesec/ttlkeys.def +++ b/Master/texmf-dist/tex/latex/titlesec/ttlkeys.def @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -20,7 +20,7 @@ % % The Current Maintainer of this work is Javier Bezos. -\ProvidesFile{ttlkeys.def}[2011/11/11] +\ProvidesFile{ttlkeys.def}[2011/12/15] % This command takes a list in "keyval" format, \ttl@a containing the % star spec, and returns \ttl@a with the full string name to be defined diff --git a/Master/texmf-dist/tex/latex/titlesec/ttlps.def b/Master/texmf-dist/tex/latex/titlesec/ttlps.def index c5156e81280..b68c4ece33c 100644 --- a/Master/texmf-dist/tex/latex/titlesec/ttlps.def +++ b/Master/texmf-dist/tex/latex/titlesec/ttlps.def @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -53,6 +53,12 @@ % 10/12/03: A little addition to the warning, for those who don't % read the docs. % +% History of v1.1 +% ~~~~~~~~~~~~~~~ +% 11/11/26: Add the extra mark mechanim +% 11/12/07: Enlarged, eg, multilevel \newtitlemark, \newtitlemark*, +% premarks +% % As before, all marks has two parts but now they don't refer to left or % 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 @@ -66,7 +72,7 @@ % values in the mark before the title, and the current values in the % mark after. -\ProvidesFile{ttlps.def}[2011/11/11] +\ProvidesFile{ttlps.def}[2011/12/15] % % Page Styles @@ -97,30 +103,39 @@ \expandafter\@firstoftwo \fi} +% \newtitlemarks belongs to a nameless markset (ie, \@empty). +% For named extra marksets see below. + \newcommand\newtitlemark{% - \@ifstar{\@tempswafalse\ttl@newmk@i}% - {\@tempswatrue\ttl@newmk@i}} - -\def\ttl@newmk@i#1{% - \edef\ttl@a{{\expandafter\@gobble\string#1}}% - \expandafter\ttl@newmk@ii\ttl@a} + \@ifstar{\@tempswafalse\ttl@newmk@i\@empty}% + {\@tempswatrue\ttl@newmk@i\@empty}} + +\def\ttl@newmk@i#1#2{% markset, macro/var + \edef\ttl@a{\expandafter\@gobble\string#2}% + \expandafter\ifx\csname\ttl@a\endcsname#2\else + \edef\ttl@a{c@#2}% + \fi + \expandafter\ttl@newmk@ii\expandafter{\ttl@a}{#1}} -\def\ttl@newmk@ii#1{% +\def\ttl@newmk@ii#1#2{% macro/var, markset + \expandafter\let\expandafter\ttl@a\csname ttl@mks@#2\endcsname \if@tempswa - \expandafter\def\expandafter\ttl@moremarks\expandafter{% - \ttl@moremarks + \expandafter\def\expandafter\ttl@a\expandafter{% + \ttl@a \protect\@namedef{#1}{\@nameuse{#1}}}% \else - \expandafter\def\expandafter\ttl@moremarks\expandafter{% - \ttl@moremarks + \expandafter\def\expandafter\ttl@a\expandafter{% + \ttl@a \protect\@nameuse{#1}=\the\@nameuse{#1}\relax}% - \fi} + \fi + \expandafter\let\csname ttl@mks@#2\endcsname\ttl@a} +\let\ttl@mks@\@empty +\def\ttl@moremarks{\ttl@mks@} % backward compat + \def\ttl@prevmarks{\ttl@marks} \let\ttl@marks\relax -\let\ttl@moremarks\@empty - % The following command sets the ifthe... commands to % be used in heads. When the call is from inside a sectioning % command, toclabel is either true (in most of cases) or false @@ -145,10 +160,18 @@ \ttl@setifthe{paragraph} \ttl@setifthe{subparagraph} +% Putting marks +% ------------- + \newtitlemark{\ttl@running} \let\ttl@enccode\relax \def\ttl@running{\ttl@enccode} +% \ttl@markboth redefines temporarily \mark to fetch changes made by +% babel or ams, saved in \ttl@running. When this is done, the actual +% \mark es emitted, which has \ttl@running as part of the markset (see +% the \newtitlemark above). + \def\ttl@markboth#1{% \begingroup \let\protect\@unexpandable@protect @@ -164,36 +187,68 @@ \xdef\ttl@marks{\ttl@marks}% \gdef\@themark{{\ttl@marks}{\ttl@prevmarks}}% \ttl@c{\@themark}% + \@nameuse{ttl@tem@#1}% \if@nobreak\ifvmode\nobreak\fi\fi \endgroup} -\newcommand\setmarks[2]{\def\ttl@marksset{{#1}{#2}}} +\newcommand\settitlemarks{\@ifstar\ttl@svmarks@s\ttl@svmarks@x} + +\def\ttl@svmarks@x#1{\def\ttl@marksset{{#1}}} +\def\ttl@svmarks@s#1{\def\ttl@marksset{*{#1}}} -\def\ttl@setmarks#1#2{% +\newcommand\setmarks[2]{\settitlemarks{#1,#2}} % back compat + +\def\ttl@settopmark#1\@@{% \expandafter\def\csname#1mark\endcsname##1{% \expandafter\gdef\csname#1title\endcsname{##1}% \ttl@setifthe{#1}% - \def\ttl@marks{% - \protect\@namedef{#1title}{##1}% - \protect\@namedef{#2title}{}% - \protect\@namedef{the#1}{\@nameuse{the#1}}% - \protect\@namedef{the#2}{}% - \protect\@namedef{ifthe#1}{\@nameuse{ifthe#1}}% - \protect\@namedef{ifthe#2}{\protect\@secondoftwo}% - \ttl@moremarks}% + \expandafter\let\expandafter\ttl@marks\csname ttl@tm@#1\endcsname \ttl@markboth{#1}}% - \expandafter\def\csname#2mark\endcsname##1{% - \expandafter\gdef\csname#2title\endcsname{##1}% - \ttl@setifthe{#2}% - \def\ttl@marks{% - \protect\@namedef{#1title}{\@nameuse{#1title}}% - \protect\@namedef{#2title}{##1}% - \protect\@namedef{the#1}{\@nameuse{the#1}}% - \protect\@namedef{the#2}{\@nameuse{the#2}}% - \protect\@namedef{ifthe#1}{\@nameuse{ifthe#1}}% - \protect\@namedef{ifthe#2}{\@nameuse{ifthe#2}}% - \ttl@moremarks}% - \ttl@markboth{#1}}}% + \global\@namedef{ttl@tm@#1}{% + \protect\@namedef{#1title}{\@nameuse{#1title}}% + \protect\@namedef{the#1}{\@nameuse{the#1}}% + \protect\@namedef{ifthe#1}{\@nameuse{ifthe#1}}}% + \def\ttl@elt##1{% + \expandafter\ttl@setsubmark\ttl@a\@@{##1}}% + \ttl@c}% + +\def\ttl@setsubmark#1\@@#2{% + \expandafter\g@addto@macro\csname ttl@tm@#2\endcsname{% + \protect\@namedef{#1title}{}% + \protect\@namedef{the#1}{}% + \protect\@namedef{ifthe#1}{\protect\@secondoftwo}} + \expandafter\g@addto@macro\csname ttl@tm@#1\endcsname{% + \protect\@namedef{#2title}{\@nameuse{#2title}}% + \protect\@namedef{the#2}{\@nameuse{the#2}}% + \protect\@namedef{ifthe#2}{\@nameuse{ifthe#2}}}}% + +\def\ttl@setmarks@x#1{% + \let\ttl@c\@empty % sub list + \@for\ttl@a:=#1\do{% + \expandafter\ttl@settopmark\ttl@a\@@ + \let\ttl@elt\relax + \xdef\ttl@c{\ttl@c\ttl@elt{\ttl@a}}}% + \@for\ttl@a:=#1\do{% + \expandafter\g@addto@macro\csname ttl@tm@\ttl@a\endcsname{% + \ttl@moremarks}}} + +\def\ttl@setmarks@s#1{% Solo con extramarks + \PackageError{titlesec}% + {You need `extramarks' for \string\settitlemarks*}% + {\string\settitlemarks* requires the package option `extramarks'}} + +\newcommand\pretitlemark{% + \global\ttl@premarktrue + \@ifstar{\ttl@pretitlemark\z@}% + {\ttl@pretitlemark\@ne}} + +\def\ttl@pretitlemark#1#2#3{% + \addtocounter{#2}#1% + \ttl@premark{#2}{#3}% + \addtocounter{#2}{-#1}} + +% Rules +% ----- \newcommand\headrule{\setheadrule{.4\p@}} \newcommand\footrule{\setfootrule{.4\p@}} @@ -231,36 +286,36 @@ \ttl@defaultps \def\ttl@headfmt{#3}% #4% - \def\setmarks####1####2{\def\ttl@marksset{{####1}{####2}}}}} + \def\settitlemarks{\@ifstar\ttl@svmarks@s\ttl@svmarks@x}}} \def\ttl@userunning#1#2{\csname ttlr@#1#2\endcsname} \def\ttl@defaultps{% - \let\makeheadrule\@empty - \let\makefootrule\@empty - \def\@mkboth{\ttl@savemark\@gobbletwo}% - \def\@oddfoot{\ttl@userunning of}% - \def\@evenfoot{\ttl@userunning ef}% - \def\@oddhead{\ttl@userunning oh}% - \def\@evenhead{\ttl@userunning eh}% - \def\ttlr@of{\ttl@makefoot\@empty\@@\ttl@hiol\ttl@hior}% - \def\ttlr@ef{\ttl@makefoot\@empty\@@\ttl@hiel\ttl@hier}% - \def\ttlr@oh{\ttl@makehead\@empty\@@\ttl@hiol\ttl@hior}% - \def\ttlr@eh{\ttl@makehead\@empty\@@\ttl@hiel\ttl@hier}% - \let\ttlr@of@b\relax \let\ttlr@of@p\relax - \let\ttlr@ef@b\relax \let\ttlr@ef@p\relax - \let\ttlr@oh@t\relax \let\ttlr@oh@p\relax - \let\ttlr@eh@t\relax \let\ttlr@eh@p\relax - \let\setmarks\ttl@setmarks - \expandafter\setmarks\ttl@marksset} + \let\makeheadrule\@empty + \let\makefootrule\@empty + \def\@mkboth{\ttl@savemark\@gobbletwo}% + \def\@oddfoot{\ttl@userunning of}% + \def\@evenfoot{\ttl@userunning ef}% + \def\@oddhead{\ttl@userunning oh}% + \def\@evenhead{\ttl@userunning eh}% + \def\ttlr@of{\ttl@makefoot\@empty\@@\ttl@hiol\ttl@hior}% + \def\ttlr@ef{\ttl@makefoot\@empty\@@\ttl@hiel\ttl@hier}% + \def\ttlr@oh{\ttl@makehead\@empty\@@\ttl@hiol\ttl@hior}% + \def\ttlr@eh{\ttl@makehead\@empty\@@\ttl@hiel\ttl@hier}% + \let\ttlr@of@b\relax \let\ttlr@of@p\relax + \let\ttlr@ef@b\relax \let\ttlr@ef@p\relax + \let\ttlr@oh@t\relax \let\ttlr@oh@p\relax + \let\ttlr@eh@t\relax \let\ttlr@eh@p\relax + \def\settitlemarks{\@ifstar\ttl@setmarks@s\ttl@setmarks@x}% + \expandafter\settitlemarks\ttl@marksset} \@ifundefined{chapter}% - {\setmarks{section}{subsection}}% - {\setmarks{chapter}{section}} + {\settitlemarks{section,subsection}}% + {\settitlemarks{chapter,section}} -\newcommand\usepage{\protect\thepage} +\newcommand\usepage{\protect\thepage} % back compat -\newcommand\toptitlemarks {\expandafter\@secondoftwo\firstmark{}{}{}} +\newcommand\toptitlemarks{\expandafter\@secondoftwo\firstmark{}{}{}} \def\firsttitlemarks{% \toks@\expandafter\expandafter\expandafter{% \expandafter\@secondoftwo \firstmark{}{}{}}% @@ -273,8 +328,8 @@ \else \expandafter\@firstoftwo \firstmark{}{}{}% \fi} -\newcommand\bottitlemarks {\expandafter\@secondoftwo\botmark{}{}{}} -\newcommand\nexttoptitlemarks{\expandafter\@firstoftwo \botmark{}{}{}} +\newcommand\bottitlemarks{\expandafter\@secondoftwo\botmark{}{}{}} +\newcommand\nexttoptitlemarks{\expandafter\@firstoftwo\botmark{}{}{}} \newcommand\outertitlemarks{% \if@twoside \ifodd\c@page\relax @@ -296,7 +351,6 @@ \bottitlemarks \fi} - \def\ttl@duplthreeargs#1#2#3#4{#1[#2][#3][#4]{#2}{#3}{#4}} \def\ttl@dupltwoargs#1#2#3{#1[#2][#3]{#2}{#3}} \def\ttl@duplthreeargsrev#1#2#3#4{#1[#4][#3][#2]{#2}{#3}{#4}} @@ -354,8 +408,8 @@ \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@titlemarks % Must precede the format. Defines \ttl@running + \def\ttl@enccode{\ttl@headinline#1{}{}{}}% which contains ttl@enccode \ttl@running \ttl@calcneg\hspace{#4}}% @@ -375,6 +429,141 @@ \def\ttl@hiel{\z@}\def\ttl@hier{\z@} \def\ttl@hiol{\z@}\def\ttl@hior{\z@} +% A tool: + +\def\ifsamemark#1#2{% + {#1\global\let\ttl@c#2}% + \ifx\ttl@c#2% + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi} + +% =========== +% EXTRA MARKS +% =========== + +\ifx\ttl@fetchmark\@empty + +\ifx\newmarks\@undefined + \PackageInfo{titleps}{% + You have requested `extramarks' but etex or similar\MessageBreak + has not been loaded. I'll do it for you.} + \RequirePackage{etex} +\fi + +\def\ttl@setmarks@s#1{% + \@for\ttl@a:=#1\do{% + \@ifundefined{ttl@mkc@\ttl@a}{% + \expandafter\newmarks\csname ttl@mkc@\ttl@a\endcsname}{}% + \expandafter\xdef\csname ttl@tem@\ttl@a\endcsname{% + \marks\expandafter\noexpand\csname ttl@mkc@\ttl@a\endcsname + {\noexpand\@themark}}}% + \ttl@setmarks@x{#1}}% + +\newcommand\newmarkset[1]{% + \expandafter\newmarks\csname ttl@mkc@#1\endcsname + \@namedef{ttl@mks@#1}{}% + \@namedef{ttl@premks@#1}{\@nameuse{ttl@mks@#1}}} + +\newcommand\newextramark{% + \@ifstar{\@tempswafalse\ttl@newmk@i}% + {\@tempswatrue\ttl@newmk@i}} + +\def\ttl@extramark#1{% + \begingroup + \let\protect\@unexpandable@protect + \let\@mkboth\@gobbletwo + \let\label\relax + \let\index\relax + \let\glossary\relax\endgroup} + +\newcommand\extramark[1]{% + \begingroup + \let\protect\@unexpandable@protect + \let\@mkboth\@gobbletwo + \let\label\relax + \let\index\relax + \let\glossary\relax + \marks\csname ttl@mkc@#1\endcsname{% + {\@nameuse{ttl@mks@#1}}% + {\@nameuse{ttl@mks@#1}}}% + \expandafter\xdef\csname ttl@premks@#1\endcsname + {\@nameuse{ttl@mks@#1}}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi}% + +\newcommand\preextramark[1]{% + \begingroup + \let\protect\@unexpandable@protect + \let\@mkboth\@gobbletwo + \let\label\relax + \let\index\relax + \let\glossary\relax + \marks\csname ttl@mkc@#1\endcsname{% + {\csname ttl@mks@#1\endcsname}% + {\csname ttl@premks@#1\endcsname}}% + \endgroup + \if@nobreak\ifvmode\nobreak\fi\fi} + +\newcommand\newshortmark[1]{% + \newmarkset{\string#1}% + \newextramark{\string#1}#1} + +\newcommand\shortmark[1]{\extramark{\string#1}} +\newcommand\preshortmark[1]{\preextramark{\string#1}} + +\newcommand\topshortmark[1]{{\topextramarks{\string#1}#1}} +\newcommand\firstshortmark[1]{{\firstextramarks{\string#1}#1}} +\newcommand\botshortmark[1]{{\botextramarks{\string#1}#1}} +\newcommand\nexttopshortmark[1]{{\nexttopextramarks{\string#1}#1}} + +\def\ttl@fetchmark#1#2#3{% + \expandafter#1#2\csname ttl@mkc@#3\endcsname{}{}{}} + +\newcommand\topextramarks[1]{\ttl@fetchmark\@secondoftwo\firstmarks{#1}} +\newcommand\firstextramarks[1]{% + \toks@\expandafter\expandafter\expandafter{% + \ttl@fetchmark\@secondoftwo\firstmarks{#1}}% + \@temptokena\expandafter\expandafter\expandafter{% + \ttl@fetchmark\@secondoftwo\botmarks{#1}}% + \edef\ttl@a{\the\toks@}% + \edef\ttl@b{\the\@temptokena}% + \ifx\ttl@a\ttl@b + \ttl@fetchmark\@secondoftwo\firstmarks{#1}% + \else + \ttl@fetchmark\@firstoftwo\firstmarks{#1}% + \fi} +\newcommand\botextramarks[1]{\ttl@fetchmark\@secondoftwo\botmarks{#1}} +\newcommand\nexttopextramarks[1]{\ttl@fetchmark\@firstoftwo\botmarks{#1}} + +\newcommand\outerextramarks[1]{% + \if@twoside + \ifodd\c@page\relax + \botextramarks{#1}% + \else + \topextramarks{#1}% + \fi + \else + \topextramarks{#1}% + \fi} +\newcommand\innerextramarks[1]{% + \if@twoside + \ifodd\c@page\relax + \firstextramarks{#1}% + \else + \botextramarks{#1}% + \fi + \else + \botextramarks{#1}% + \fi} + +\fi + +% ====== +% FLOATS +% ====== +% % Pagestyles with floats. There macros are defined only with the % psfloats package option. diff --git a/Master/texmf-dist/tex/latex/titlesec/wrap.tss b/Master/texmf-dist/tex/latex/titlesec/wrap.tss index 0dae34ad766..e0351dfd1eb 100644 --- a/Master/texmf-dist/tex/latex/titlesec/wrap.tss +++ b/Master/texmf-dist/tex/latex/titlesec/wrap.tss @@ -5,7 +5,7 @@ % Copyright (c) 1998-2011 by Javier Bezos. % All Rights Reserved. % -% This file is part of the titlesec distribution release 2.9.2 +% This file is part of the titlesec distribution release 2.10.0 % ----------------------------------------------------------- % % It may be distributed and/or modified under the @@ -20,7 +20,7 @@ % % The Current Maintainer of this work is Javier Bezos. -\ProvidesFile{wrap.tss}[2011/11/11] +\ProvidesFile{wrap.tss}[2011/12/15] \gdef\ttlh@wrap#1#2#3#4#5#6#7#8{% \global\@noskipsectrue |