diff options
author | Karl Berry <karl@freefriends.org> | 2014-01-05 22:57:58 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-01-05 22:57:58 +0000 |
commit | 1899ca043c36f94224898b8cad0f2cbaf633ab21 (patch) | |
tree | 27a96fd3c4f5dcc61bb010d4e4e597f95f2806a9 /Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty | |
parent | c81e0a4eecfaa071e03d673821d5b93f957c70ca (diff) |
cnltx (5jan14)
git-svn-id: svn://tug.org/texlive/trunk@32583 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty | 51 |
1 files changed, 42 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty index 41d910c4bcc..9e434f56877 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty @@ -8,7 +8,7 @@ % Web: https://github.com/cgnieder/cnltx/ % E-Mail: contact@mychemistry.eu % -------------------------------------------------------------------------- -% Copyright 2013 Clemens Niederberger +% Copyright 2013-2014 Clemens Niederberger % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3 @@ -25,8 +25,8 @@ % If you have any ideas, questions, suggestions or bugs to report, please % feel free to contact me. % -------------------------------------------------------------------------- -\def\cnltx@@date{2013/11/22} -\def\cnltx@@version{v0.9} +\def\cnltx@@date{2014/01/05} +\def\cnltx@@version{v0.10} \def\cnltx@@info{LaTeX tools and documenting facilities (CN)} \ProvidesPackage{cnltx-base}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info] \RequirePackage{pgfopts,etoolbox,ltxcmds,pdftexcmds} @@ -222,10 +222,31 @@ #3% } -% -------------------------------------------------------------------------- +% test string equality, expandably: +\newcommand\cnltx@ifstrequal[2]{% + \ifnum\pdf@strcmp{\unexpanded{#1}}{\unexpanded{#2}}=\z@ + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi +} -% \newcount\pdflastximagepages -% \def\pdfximage#1{\pdflastximagepages=\XeTeXpdfpagecount"#1"\relax} +% a check for etoolbox's lists where items may contain braces: +\newbool{cnltx@inlist} +\newrobustcmd\cnltx@ifinlist@type[5]{% + \def\do##1{% + \boolfalse{cnltx@inlist}% + \ifstrequal{##1}{#2} + {\booltrue{cnltx@inlist}\listbreak} + {}% + }% + #1{#3}% + \ifbool{cnltx@inlist} + {#4} + {#5}% +} +\newrobustcmd*\cnltx@ifinlist{\cnltx@ifinlist@type\dolistloop} +\newrobustcmd*\cnltx@ifinlistcs{\cnltx@ifinlist@type\dolistcsloop} % -------------------------------------------------------------------------- % expansion helper @@ -292,6 +313,9 @@ % expanding an environment argument or something: \newcommand\cnltx@fullexpand@afterarg{\cnltx@expandargs(nx)} +\providecommand*\expandtwice + {\unexpanded\expandafter\expandafter\expandafter} + % -------------------------------------------------------------------------- % tokenlist manipulation \newcommand*\cnltx@stripbs{\expandafter\@gobble\string} @@ -721,7 +745,8 @@ expandable => red , unexpandable => black , makeidxkey => cnltxgreen , - makeidxstring => black + makeidxstring => black , + math => cnltxgreen } \definecolorscheme{blue}{ @@ -742,7 +767,8 @@ expandable => red , unexpandable => black , makeidxkey => cnltxyellow , - makeidxstring => black + makeidxstring => black , + math => cnltxgreen } \definecolorscheme{formal}{ @@ -763,7 +789,8 @@ expandable => red , unexpandable => black , makeidxkey => black , - makeidxstring => black + makeidxstring => black , + math => cnltxgreen } % set the default: @@ -800,3 +827,9 @@ HISTORY: \cnltx@gremove@once, \cnltx@gremove@all - \cnltx@ifisnum now also returns <false> if the test argument is `<num>!' +2014/01/05 v0.10 - \expandtwice + - \cnltx@ifstrequal + +TODO: + `color-scheme' Option dokumentieren + |