diff options
author | Karl Berry <karl@freefriends.org> | 2014-09-11 22:45:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-09-11 22:45:27 +0000 |
commit | 66f4e61f437217d16e5bc69d2437fc2e8b2fea43 (patch) | |
tree | c01b376d8f7ee06623755583419f434dac8f7d1d /Master/texmf-dist/tex/latex/upmethodology/upmethodology-fmt.sty | |
parent | 3f19cec31ffdd0fbd89811940dd24f39534a6f86 (diff) |
upmethodology (11sep14)
git-svn-id: svn://tug.org/texlive/trunk@35153 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/upmethodology/upmethodology-fmt.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/upmethodology/upmethodology-fmt.sty | 98 |
1 files changed, 78 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/latex/upmethodology/upmethodology-fmt.sty b/Master/texmf-dist/tex/latex/upmethodology/upmethodology-fmt.sty index ecc0d1ba1a3..635a30e0607 100644 --- a/Master/texmf-dist/tex/latex/upmethodology/upmethodology-fmt.sty +++ b/Master/texmf-dist/tex/latex/upmethodology/upmethodology-fmt.sty @@ -17,7 +17,7 @@ % write to the Free Software Foundation, Inc., 59 Temple Place - Suite % 330, Boston, MA 02111-1307, USA. -\global\edef\upm@package@fmt@ver{2014/07/09} +\global\edef\upm@package@fmt@ver{2014/09/10} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{upmethodology-fmt}[\upm@package@fmt@ver] @@ -863,13 +863,16 @@ } } -% Overide the color configuration of the MINITOC package +% Overide the color and font configurations of the MINITOC package \AtBeginDocument{ \@ifundefined{minitoc}{}{% - \global\let\upm@format@mtcSfont@old\mtcSfont - \gdef\mtcSfont{\upm@format@mtcSfont@old\color{sectiontitlecolor}} - \global\let\upm@format@mtifont@old\mtifont - \gdef\mtifont{\upm@format@mtifont@old\color{chaptertitlecolor}} + % Chapter + \gdef\mtifont{\normalfont\large\upshape\bfseries\color{chaptertitlecolor}} + % Section + \gdef\mtcSfont{\normalfont\small\upshape\bfseries\color{sectiontitlecolor}} + % Sub-Section and SubSub-Section + \gdef\mtcSSfont{\normalfont\small\upshape\mdseries\normalcolor} + \global\let\mtcSSSfont\mtcSSfont } } @@ -1105,6 +1108,8 @@ %---------------------------------------- \newcounter{@upm@fmt@enumdescription@cnt@} +\gdef\upm@fmt@enumdescription@savedlabel{} +\gdef\upm@fmt@enumdescription@savedcounter{} \newcommand{\upm@fmt@enumdescription@fmt@}[1]{} \newcommand{\enumdescriptionlabel}[1]{\textbf{#1}} \newcommand{\enumdescriptioncounterseparator}{~-~} @@ -1116,24 +1121,34 @@ % #5: text between the description and the rest of the text. % #6: text between the counter (no description) and the rest of the text. \newenvironment{upm@fmt@enumdescription}[6]{% - \begingroup\setcounter{@upm@fmt@enumdescription@cnt@}{1}% - \let\upm@fmt@enumdescription@savedlabel\@currentlabel% - \ifthenelse{\equal{#1}{a}}{% - \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\alph{##1}#3}% - }{% - \ifthenelse{\equal{#1}{i}}{% - \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\roman{##1}#3}% + \begin{list}{}{% + \renewcommand{\upm@fmt@enumdescription@savedlabel}{\@currentlabel}% + \edef\upm@fmt@enumdescription@savedcounter{\the@upm@fmt@enumdescription@cnt@}% + \setcounter{@upm@fmt@enumdescription@cnt@}{1}% + \ifthenelse{\equal{#1}{a}}{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\alph{##1}#3}% }{% - \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\expandafter{\csname the##1\endcsname}#3}% + \ifthenelse{\equal{#1}{A}}{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\Alph{##1}#3}% + }{% + \ifthenelse{\equal{#1}{i}}{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\roman{##1}#3}% + }{% + \ifthenelse{\equal{#1}{I}}{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\Roman{##1}#3}% + }{% + \renewcommand{\upm@fmt@enumdescription@fmt@}[1]{#2\arabic{##1}#3}% + }% + }% + }% }% - }% - \begin{list}{}{% - \renewcommand{\makelabel}[1]{\xdef\@currentlabel{\upm@fmt@enumdescription@fmt@{@upm@fmt@enumdescription@cnt@}}\enumdescriptionlabel{\@currentlabel#4##1\ifthenelse{\equal{a##1}{a}}{#6}{#5}}{\addtocounter{@upm@fmt@enumdescription@cnt@}{1}}}% + \renewcommand{\makelabel}[1]{\edef\@currentlabel{\upm@fmt@enumdescription@fmt@{@upm@fmt@enumdescription@cnt@}}\enumdescriptionlabel{\@currentlabel#4##1\ifthenelse{\equal{a##1}{a}}{#6}{#5}}{\addtocounter{@upm@fmt@enumdescription@cnt@}{1}}}% \expandafter\settowidth{\labelwidth}{#2iii#3}% } }{% \global\let\@currentlabel\upm@fmt@enumdescription@savedlabel% - \end{list}\endgroup% + \setcounter{@upm@fmt@enumdescription@cnt@}{\upm@fmt@enumdescription@savedcounter}% + \end{list}% } \newenvironment{enumdescriptionx}[3][i]{% \begin{upm@fmt@enumdescription}{#1}{#2}{#3}{\enumdescriptioncounterseparator}{\enumdescriptionlabelseparator}{\enumdescriptionlabelseparator}% @@ -1148,12 +1163,55 @@ %% Issue #14: enumerate behaves as enumdescription \ifupm@use@override@standard@lists + \AtBeginDocument{ \message{*** Overriding the 'enumerate' environment. Pass option 'standardlists' for avoiding this override.} \global\let\enumerate\@undefined \global\let\endenumerate\@undefined - \global\NewEnviron{enumerate}[1][1]{ - \protect\begin{upm@fmt@enumdescription}{#1}{}{\string.~}{}{\enumdescriptionlabelseparator}{}% + \global\NewEnviron{enumerate}[1][1\string.~]{% + % Parse the parameter for extracting the type of the enumeration, the prefix and the postfix + \in@{a}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{a}% + \def\reserved@a##1a##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else\in@{1}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{1}% + \def\reserved@a##11##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else\in@{A}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{A}% + \def\reserved@a##1A##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else\in@{i}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{i}% + \def\reserved@a##1i##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else\in@{I}{#1}\ifin@ + \gdef\upm@fmt@enumerate@style{I}% + \def\reserved@a##1I##2\@nil{% + \def\upm@fmt@enumerate@prefix{##1}% + \def\upm@fmt@enumerate@postfix{##2}% + }% + \reserved@a#1\@nil% + \else% + \errmessage{Invalid format of the enumerate counter} + \fi\fi\fi\fi\fi% + \protected@xdef\upm@tmp{\protect\protect\protect\begin{upm@fmt@enumdescription}{\upm@fmt@enumerate@style}{\upm@fmt@enumerate@prefix}{\upm@fmt@enumerate@postfix}{}{\protect\enumdescriptionlabelseparator}{}}% + % + \upm@tmp% + %\protect\begin{upm@fmt@enumdescription}{#1}{}{\string.~}{}{\enumdescriptionlabelseparator}{}% \BODY% \protect\end{upm@fmt@enumdescription}% } |