diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/upmethodology/upmethodology-p-common.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/upmethodology/upmethodology-p-common.sty | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/latex/upmethodology/upmethodology-p-common.sty b/Master/texmf-dist/tex/latex/upmethodology/upmethodology-p-common.sty index 119e4e320d7..e28af917933 100644 --- a/Master/texmf-dist/tex/latex/upmethodology/upmethodology-p-common.sty +++ b/Master/texmf-dist/tex/latex/upmethodology/upmethodology-p-common.sty @@ -16,7 +16,7 @@ % 330, Boston, MA 02111-1307, USA. % -\global\edef\upm@package@private@doctype@ver{2013/09/29} +\global\edef\upm@package@private@doctype@ver{2013/10/14} \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{upmethodology-p-common}[\upm@package@private@doctype@ver] @@ -24,6 +24,7 @@ \RequirePackage{ifthen} \RequirePackage{xspace} \RequirePackage{xcolor} +\RequirePackage{ifpdf} %---------------------------------------- % UPMVERSION MACRO @@ -58,6 +59,11 @@ \long\def\Ifelseempty#1#2#3{\ifthenelse{\equal{#1}{\@empty}}{#2}{#3}} %---------------------------------------- +% TOC MACROS +%---------------------------------------- +\newcommand{\newpageintoc}{\addtocontents{toc}{\protect\newpage}} + +%---------------------------------------- % DOCUMENT TYPE %---------------------------------------- \newif\ifupmbookformat @@ -158,10 +164,10 @@ \let\upm@foreach@end\relax -\def\upm@foreach@rec#1#2{% - {\upm@foreach@searchseparator#2\upm@foreach@end\@nil}% +\def\upm@foreach@rec#1{% + {\upm@foreach@searchseparator#1\upm@foreach@end\@nil}% \ifupm@foreach@hasseparator% - \protected@xdef\upm@foreach@continue{\protect\upm@foreach@rec{#1}{\upm@foreach@rest}}% + \protected@xdef\upm@foreach@continue{\protect\upm@foreach@rec{\upm@foreach@rest}}% \upm@foreach@body% \upm@foreach@continue% \else% @@ -188,10 +194,32 @@ \global\upm@foreach@hasseparatortrue% \global\upm@foreach@oneseparatortrue% \fi% - } + }% \gdef\upm@foreach@body{#3}% \gdef\upm@foreach@lastbody{#4}% - \upm@foreach@rec{#1}{#2#1}% + \upm@foreach@rec{#2#1}% +} + +%----------------------------------------- +% Option parameters +\newif\ifupm@common@optlist@needdefault +\gdef\upm@common@optlist@parseparams#1=#2\@nil{% + \ifthenelse{\equal{#2}{===}}{% + \global\upm@common@optlist@needdefaulttrue% + }{% + \global\upm@common@optlist@needdefaultfalse% + }% +} +\DeclareRobustCommand{\upm@common@optlist}[1]{% + {\upm@common@optlist@parseparams #1====\@nil}% +} +\newcommand{\upm@setkeys}[3]{% + \upm@common@optlist{#3}% + \ifupm@common@optlist@needdefault% + \expandafter\setkeys{#1}{#2=#3}% + \else% + \expandafter\setkeys{#1}{#3}% + \fi% } \endinput |