diff options
author | Karl Berry <karl@freefriends.org> | 2017-05-14 22:41:11 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-05-14 22:41:11 +0000 |
commit | e8a3bbca0649c257c934e198600a4547ca453b1d (patch) | |
tree | 7ef502f4fe58f30a5b867dfc7583d0b4f5be3d5f /Master/texmf-dist/source/latex/mwcls/mwcls.dtx | |
parent | e0c5d6d38a1f285f20a66692e46d2e607d6ff1dd (diff) |
mwcls (14may17)
git-svn-id: svn://tug.org/texlive/trunk@44352 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/mwcls/mwcls.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/mwcls/mwcls.dtx | 94 |
1 files changed, 80 insertions, 14 deletions
diff --git a/Master/texmf-dist/source/latex/mwcls/mwcls.dtx b/Master/texmf-dist/source/latex/mwcls/mwcls.dtx index 9e45e931167..d5c451d3e6a 100644 --- a/Master/texmf-dist/source/latex/mwcls/mwcls.dtx +++ b/Master/texmf-dist/source/latex/mwcls/mwcls.dtx @@ -1,6 +1,6 @@ % \iffalse meta-comment -*- doctex -*- % -% Copyright 2000-2003,2008-2009 by Marcin Woli\'nski +% Copyright 2000-2003,2008-2009,2017 by Marcin Woli\'nski % % % This work may be distributed and/or modified under the @@ -12,7 +12,7 @@ % version 1999/12/01 or later. % % \fi -% \CheckSum{3725} +% \CheckSum{3809} % % \iffalse % \section{Identification} @@ -38,7 +38,7 @@ %<*driver> \ProvidesFile{mwcls.drv} %</driver> - [2009/09/27 v0.74 + [2017/05/13 v0.75 %<article|report|book> A LaTeX document class (MW)] %<10pt|11pt|12pt> A document class size option (MW)] %<article|report|book>\typeout{*** Beta version. Formatting may change} @@ -59,6 +59,7 @@ \usepackage{doc} \usepackage{polski} \usepackage[utf8]{inputenc} +\usepackage[hidelinks]{hyperref} % \end{macrocode} % % We don't want everything to appear in the index @@ -531,7 +532,7 @@ % przechowywana była rozwinięta postać argumentów (chcemy bowiem % pewne wartości wprowadzać przez chwilowo definiowane nazwy % symboliczne). Nie narusza to kompatybilności, bo argumenty i~tak były -% rozwijane w~momencie wykonania \cs{mark}'a. +% rozwijane w~momencie wykonania \cs{mark}a. % % W~jądrze \LaTeX a z~datą 2000/06/01 nastąpiły pożądane przez nas % zmiany. Można by więc wyrzucić nasze definicje. Aby jednak @@ -2324,7 +2325,24 @@ {\HeadingNumberedtrue\@dblarg{\mw@sectionx{#1}}}} % \end{macrocode} % \end{macro} -% +% \begin{macro}{\mw@step@sectioning@counter} +% This macro advances sectioning counter used for numbered +% headings. Hyperref hijacks \cs{refstepcounter} to add a link to the +% title, so we have to be extra careful to avoid pagebreaks between +% this and the heading. +% \begin{macrocode} +\def\mw@step@sectioning@counter{% + \ifHeadingNumbered + \refstepcounter{\mw@HeadingType}% + \protected@edef\HeadingNumber{\expandafter\noexpand + \csname the\mw@HeadingType\endcsname\relax}% + \else + \mw@hyperref@phantom{\mw@HeadingType}% + \let\HeadingNumber\@empty + \fi +} +% \end{macrocode} +% \end{macro} % % \begin{macro}{\mw@sectionx} % @@ -2365,14 +2383,6 @@ \ifnum \mw@HeadingLevel>\c@secnumdepth \HeadingNumberedfalse \fi %<book> \if@mainmatter\else \HeadingNumberedfalse \fi \fi - \ifHeadingNumbered - \refstepcounter{#1}% - \protected@edef\HeadingNumber{\expandafter\noexpand - \csname the#1\endcsname\relax}% - \else - \mw@hyperref@phantom{#1}% - \let\HeadingNumber\@empty - \fi \def\HeadingRHeadText{#2}% \def\HeadingTOCText{#3}% \def\HeadingText{#4}% @@ -2453,6 +2463,7 @@ \if\mw@HeadingBreakBefore \hrule\@height\z@\nobreak \else \addpenalty\@secpenalty \fi \addvspace{\csname \mw@HeadingType @preskip\endcsname}% + \mw@step@sectioning@counter \bgroup\language\l@nohyphenation \raggedright \interlinepenalty\@M @@ -2495,6 +2506,7 @@ \global\@noskipsecfalse {\setbox\z@\lastbox}% \clubpenalty\@M + \mw@step@sectioning@counter \bgroup\language\l@nohyphenation \normalfont\sectsettings \csname \mw@HeadingType @head\endcsname @@ -3624,6 +3636,56 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\mw@caption@hyperref} +% Niestety pakiet hyperref przedefiniowuje caption dlatego musimy +% zasłonić jego redefinicję kolejną redefinicją zawierającą wersję +% hyperrefową z dodaną kropką i z \cs{captionsettings}. +% \begin{macrocode} +\long\def\mw@caption@hyperref#1[#2]#3{% + \expandafter\ifx\csname if@capstart\expandafter\endcsname + \csname iftrue\endcsname + \global\let\@currentHref\hc@currentHref + \else + \hyper@makecurrent{\@captype}% + \fi + \@ifundefined{NR@gettitle}{% + \def\@currentlabelname{#2}% + }{% + \NR@gettitle{#2}% + }% + \par\addcontentsline{\csname ext@#1\endcsname}{#1}{% + \protect\numberline{\csname the#1\endcsname.}{\ignorespaces #2}% + }% + \begingroup + \@parboxrestore + \if@minipage + \@setminipage + \fi + \captionsettings + \expandafter\ifx\csname if@capstart\expandafter\endcsname + \csname iftrue\endcsname + \global\@capstartfalse + \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces#3}% + \else + \@makecaption{\csname fnum@#1\endcsname}{% + \ignorespaces + \ifHy@nesting + \expandafter\hyper@@anchor\expandafter{\@currentHref}{#3}% + \else + \Hy@raisedlink{% + \expandafter\hyper@@anchor\expandafter{% + \@currentHref + }{\relax}% + }% + #3% + \fi + }% + \fi + \par + \endgroup +} +% \end{macrocode} +% \end{macro} % \begin{macro}{\@makecaption} % The definition of this macro is |\long| in order to allow more % then one paragraph in a caption. @@ -4422,7 +4484,11 @@ \xdef\@currentHref{#1*.\the\Hy@linkcounter}% \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}% }% -}{}} + \let\@caption\mw@caption@hyperref + }{% + \let\mw@caption@hyperref\@undefined + }% +} % \end{macrocode} % % \subsection{\cs{clubpenalty}} |