From 1899ca043c36f94224898b8cad0f2cbaf633ab21 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 5 Jan 2014 22:57:58 +0000 Subject: cnltx (5jan14) git-svn-id: svn://tug.org/texlive/trunk@32583 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty | 51 +++++++-- Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls | 8 +- .../texmf-dist/tex/latex/cnltx/cnltx-example.sty | 123 +++++++++++++++++---- .../texmf-dist/tex/latex/cnltx/cnltx-listings.sty | 16 +-- Master/texmf-dist/tex/latex/cnltx/cnltx-tools.sty | 2 +- Master/texmf-dist/tex/latex/cnltx/cnltx.bbx | 37 +++++-- Master/texmf-dist/tex/latex/cnltx/cnltx.cbx | 37 +++++-- Master/texmf-dist/tex/latex/cnltx/cnltx.dbx | 37 +++++-- Master/texmf-dist/tex/latex/cnltx/cnltx.sty | 2 +- 9 files changed, 233 insertions(+), 80 deletions(-) (limited to 'Master/texmf-dist/tex') 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 if the test argument is `!' +2014/01/05 v0.10 - \expandtwice + - \cnltx@ifstrequal + +TODO: + `color-scheme' Option dokumentieren + diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls b/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls index 1354737e9da..24ec5d1cada 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls @@ -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 @@ -190,7 +190,10 @@ \renewcommand*\partformat{% \textcolor{cnltx}{\partname~\thepart\autodot}} \deffootnote{2em}{1em}{\llap{\thefootnotemark. }}% - \pagestyle{headings} + \RequirePackage{scrlayer-scrpage} + \chead{\rightmark} + \KOMAoptions{automark} + \pagestyle{scrheadings} \setcapindent{1.5em} \setkomafont{caption}{\cnltx@caption@font} \setkomafont{captionlabel}{\cnltx@captionlabel@font} @@ -961,6 +964,7 @@ HISTORY: * choice if fonts are loaded * choice if microtype is loaded - \visualizespaces and \visiblespace +2014/01/05 v0.10 - adapt to KOMA-Script v3.12 % -------------------------------------------------------------------------- TODO: diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-example.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-example.sty index cdc72321c06..ce75c9b1cd0 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx-example.sty +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-example.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 @@ -166,6 +166,7 @@ \newarg\darg{(}{)} \newarg[\code]\Darg{(}{)} \newcommand*\sarg{\textcolor{argument}{\code{*}}} +\newcommand*\parg{\textcolor{argument}{\code{+}}} % -------------------------------------------------------------------------- % source code examples: @@ -278,7 +279,8 @@ % control sequences that won't be indexed: texcsstyle = [6]\color{cs}, index = [6][texcs6], - indexstyle = [6]\@gobble + indexstyle = [6]\@gobble, + moredelim = *[s][\color{math}]{$}{$} } \def\cnltx@bibtex@listings@style{ @@ -402,17 +404,21 @@ } \def\cnltx@local@listings@options{} +\newbool{cnltx@local@sourcecode@overwrite} \pgfkeys{ cnltx/.cd, - gobble/.code = \def\cnltx@gobble{#1} , - add-cmds/.code = \cnltx@addcmds{#1} , - add-silent-cmds/.code = \cnltx@addsilentcmds{#1} , - add-listings-options/.code = \cnltx@addlistingsoptions{#1} , - listings-options/.code = \lstdefinestyle{cnltx}{#1} , - add-envs/.code = \cnltx@addenvs{#1} , - add-silent-envs/.code = \cnltx@addsilentenvs{#1} , - sourcecode-options/.code = \def\cnltx@local@listings@options{#1} , + gobble/.code = \def\cnltx@gobble{#1} , + add-cmds/.code = \cnltx@addcmds{#1} , + add-silent-cmds/.code = \cnltx@addsilentcmds{#1} , + add-listings-options/.code = \cnltx@addlistingsoptions{#1} , + listings-options/.code = \lstdefinestyle{cnltx}{#1} , + add-envs/.code = \cnltx@addenvs{#1} , + add-silent-envs/.code = \cnltx@addsilentenvs{#1} , + add-sourcecode-options/.code = \def\cnltx@local@listings@options{#1} , + sourcecode-options/.code = + \booltrue{cnltx@local@sourcecode@overwrite} + \def\cnltx@local@listings@options{#1} } \def\cnltx@mdframed@options @@ -431,6 +437,9 @@ {\expandonce\cnltx@mdframed@options,\unexpanded{#1}}% } +\def\cnltx@local@frame@options{} +\newbool{cnltx@local@frame@overwrite} + \newbool {cnltx@sidebyside} \newbool {cnltx@codeleft} \booltrue{cnltx@codeleft} @@ -438,6 +447,7 @@ \newbool {cnltx@compile} \newbool {cnltx@float} \newbool {cnltx@pagelist} +\newbool {cnltx@outside}% use this to allow floating material in the examples \newsavebox\cnltx@example@box @@ -480,6 +490,10 @@ after-output/.code = \def\cnltx@after@example@hook{#1} , add-frame-options/.code = \cnltx@addmdframedoptions{#1} , frame-options/.code = \mdfdefinestyle{cnltx}{#1} , + add-local-frame/.code = \def\cnltx@local@frame@options{#1} , + local-frame/.code = + \booltrue{cnltx@local@frame@overwrite} + \def\cnltx@local@frame@options{#1} , gobble/.code = \def\cnltx@gobble{#1} , max-pages/.code = \setcounter{cnltx@maxpages}{#1} , max-height/.code = \def\cnltx@image@max@height{#1} , @@ -506,10 +520,16 @@ } \cnltx@init@float , float/.default = true , + float-env/.code = \def\cnltx@float@type{#1} , caption/.code = \booltrue{cnltx@float}% \renewcommand\cnltx@float@caption{#1} , - float-pos/.code = \def\cnltx@float@pos{[#1]}\cnltx@init@float + float-pos/.code = \def\cnltx@float@pos{[#1]}\cnltx@init@float , + outside/.is if = cnltx@outside , + add-frame/.is choice , + add-frame/true/.code = \def\cnltx@adjustbox@frame{frame} , + add-frame/false/.code = \def\cnltx@adjustbox@frame{} , + add-frame/.default = true } \newcommand*\cnltx@get@page@list[1]{% @@ -608,15 +628,55 @@ \newcommand*\cnltx@example@start[1]{% \pgfqkeys{/cnltx}{#1}% - \cnltx@expandargs(x)\lstset{ - style=cnltx, - \expandonce\cnltx@local@listings@options - }% - \ifbool{cnltx@sidebyside} - {\mdframed[style=cnltx,nobreak=true]} - {\mdframed[style=cnltx,nobreak=false]}% + \ifbool{cnltx@local@sourcecode@overwrite} + {% + \cnltx@expandargs(x)\lstset{ + \expandonce\cnltx@local@listings@options + }% + } + {% + \cnltx@expandargs(x)\lstset{ + style=cnltx, + \expandonce\cnltx@local@listings@options + % no idea why this is necessary: + % \ifcsdef{lst@gtexcs3}{}{,moretexcs=[3]}% + }% + }% + \ifbool{cnltx@local@frame@overwrite} + {% + \cnltx@expandargs(nxx)% + \ifbool{cnltx@sidebyside} + {% + \noexpand\mdframed[ + \expandonce\cnltx@local@frame@options, + nobreak=true] + } + {% + \noexpand\mdframed[ + \expandonce\cnltx@local@frame@options, + nobreak=false] + }% + } + {% + \cnltx@expandargs(nxx)% + \ifbool{cnltx@sidebyside} + {% + \noexpand\mdframed[ + style=cnltx, + \expandonce\cnltx@local@frame@options, + nobreak=true] + } + {% + \noexpand\mdframed[ + style=cnltx, + \expandonce\cnltx@local@frame@options, + nobreak=false] + }% + }% } +\newcommand*\cnltx@adjustbox@frame{frame} + % #1: filename % #2: number of pages % #3: current page @@ -630,7 +690,7 @@ }% \ifblank{#3}{}{% \adjustbox{ - frame, + \cnltx@adjustbox@frame, max width = \cnltx@tmpa@length , max height = \cnltx@image@max@height }{% @@ -677,7 +737,8 @@ \ifboolexpr { bool {cnltx@codeonly} or - bool {cnltx@compile} + bool {cnltx@compile} or + bool {cnltx@outside} } {} {% direct input of code example @@ -753,7 +814,7 @@ } {% \cnltx@example@warning - {`shellescape' or `write18' nor enabled -- I'm not compiling}% + {`shell-escape' or `write18' not enabled -- I'm not compiling}% }% \IfFileExists{#1.\cnltx@example@fileext} {% @@ -808,7 +869,16 @@ } {\endmdframed}% }% - {\endmdframed}% + {% + \endmdframed + \ifbool{cnltx@outside} + {% + \cnltx@pre@example@hook + \cnltx@example@input{#1.code}% + \cnltx@after@example@hook + } + {}% + }% \ignorespacesafterend } @@ -953,5 +1023,14 @@ HISTORY: runs of the included example - new options `program' and `exe-with' - new option `float', `float-pos' and `caption' +2014/01/05 v0.10 - sometimes there is a spurious `undefined control sequence + \lst@gtexcs3' error: added hack to fix this => find out + where this comes from! + - new option `add-frame' for `compile'd examples + - new command \parg for an optional + argument + - new option `outside' for non-`compiled' examples + - new option `float-env' + +TODO: diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty index 2ae39f065b8..abc8f2e9890 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.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 @@ -675,7 +675,6 @@ eqalign, eqalignno, eqno, - equation, equiv, errhelp, errmessage, @@ -1894,19 +1893,6 @@ \cnltx@ifinlist{{#1}{#2}}\cnltx@bibfile@entries{} {\listadd\cnltx@bibfile@entries{{#1}{#2}}}% } -\newbool{cnltx@inlist} -\long\protected\def\cnltx@ifinlist#1#2#3#4{% - \def\do##1{% - \boolfalse{cnltx@inlist}% - \ifstrequal{##1}{#1} - {\booltrue{cnltx@inlist}\listbreak} - {}% - }% - \dolistloop{#2}% - \ifbool{cnltx@inlist} - {#3} - {#4}% -} \def\cnltx@read@bibfile@entry#1#2#3{#1#2#3} diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-tools.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-tools.sty index 8fa35c97df4..5b3ee29a4c9 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx-tools.sty +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-tools.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 diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx b/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx index de65f393e8c..0c8099fb0af 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx @@ -1,13 +1,30 @@ -% \@ifclassloaded{cnltx-doc}{}{% -% \GenericError -% {(cnltx.bbx)\@spaces\@spaces\@spaces\@spaces} -% {cnltx bibliography style error: invalid class} -% {See the cnltx bundle documentation for explanation.} -% {% -% The `cnltx' bibliography style can only be used with the `cnltx-doc' -% document class% -% }% -% } +% -------------------------------------------------------------------------- +% the CNLTX bundle +% +% LaTeX source code and output +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/cnltx/ +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% 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 +% 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 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Clemens Niederberger. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- \RequirePackage{cnltx-example} \ProvidesFile{cnltx.bbx}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info] diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx.cbx b/Master/texmf-dist/tex/latex/cnltx/cnltx.cbx index 3d7493b3cf7..1fd3158685b 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx.cbx +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx.cbx @@ -1,13 +1,30 @@ -% \@ifclassloaded{cnltx-doc}{}{% -% \GenericError -% {(cnltx.cbx)\@spaces\@spaces\@spaces\@spaces} -% {cnltx citation style error: invalid class} -% {See the cnltx bundle documentation for explanation.} -% {% -% The `cnltx' citation style can only be used with the `cnltx-doc' -% document class% -% }% -% } +% -------------------------------------------------------------------------- +% the CNLTX bundle +% +% LaTeX source code and output +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/cnltx/ +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% 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 +% 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 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Clemens Niederberger. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- \RequirePackage{cnltx-example} \ProvidesFile{cnltx.cbx}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info] diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx.dbx b/Master/texmf-dist/tex/latex/cnltx/cnltx.dbx index 94fd0e2c721..dacca354db6 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx.dbx +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx.dbx @@ -1,13 +1,30 @@ -% \@ifclassloaded{cnltx-doc}{}{% -% \GenericError -% {(cnltx.dbx)\@spaces\@spaces\@spaces\@spaces} -% {cnltx datamodel error: invalid class} -% {See the cnltx bundle documentation for explanation.} -% {% -% The `cnltx' biblatex datamodel can only be used with the `cnltx-doc' -% document class% -% }% -% } +% -------------------------------------------------------------------------- +% the CNLTX bundle +% +% LaTeX source code and output +% +% -------------------------------------------------------------------------- +% Clemens Niederberger +% Web: https://github.com/cgnieder/cnltx/ +% E-Mail: contact@mychemistry.eu +% -------------------------------------------------------------------------- +% 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 +% 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 2005/12/01 or later. +% +% This work has the LPPL maintenance status `maintained'. +% +% The Current Maintainer of this work is Clemens Niederberger. +% -------------------------------------------------------------------------- +% If you have any ideas, questions, suggestions or bugs to report, please +% feel free to contact me. +% -------------------------------------------------------------------------- \RequirePackage{cnltx-example} \DeclareDatamodelFields[type=list, datatype=name]{maintainer} \DeclareDatamodelEntryfields[package,class,bundle]{ diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx.sty index 6be04404bff..08ed2e80541 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx.sty +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx.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 -- cgit v1.2.3