summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/cnltx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-01-11 22:25:35 +0000
committerKarl Berry <karl@freefriends.org>2015-01-11 22:25:35 +0000
commitffd0a5d337e9ff3c89109f208771ec70f599ebef (patch)
tree1dfea0d60d89adbe1b9489c034939d9112ba8cb0 /Master/texmf-dist/tex/latex/cnltx
parentffc578485f0573fbef95749a3b239380be42da87 (diff)
cnltx (11jan15)
git-svn-id: svn://tug.org/texlive/trunk@36025 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/cnltx')
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty137
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls202
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx-example.sty170
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty9
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx-names.sty177
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx-tools.sty129
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx-translations.sty128
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx.bbx73
-rw-r--r--Master/texmf-dist/tex/latex/cnltx/cnltx.sty14
9 files changed, 725 insertions, 314 deletions
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty
index 9e434f56877..a4be7114fd9 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-2014 Clemens Niederberger
+% Copyright 2013-2015 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{2014/01/05}
-\def\cnltx@@version{v0.10}
+\def\cnltx@@date{2015/01/11}
+\def\cnltx@@version{v0.12}
\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}
@@ -115,6 +115,15 @@
\cnltx@create@bundle@message{base}{Info}
% --------------------------------------------------------------------------
+% modules
+\newrobustcmd*\cnltx@load@module[1]{\RequirePackage{cnltx-\trim@spaces{#1}}}
+\newrobustcmd*\cnltx@load@modules[1]{\forcsvlist{\cnltx@load@module}{#1}}
+
+\newrobustcmd*\cnltx@register@module[1]{%
+ \DeclareOption{#1}{\AtEndOfPackage{\cnltx@load@module{#1}}}%
+}
+
+% --------------------------------------------------------------------------
% setup command
\newrobustcmd\setcnltx[1]{\pgfqkeys{/cnltx}{#1}}
@@ -134,6 +143,46 @@
\newcommand*\cnltx@tmpc{}
% --------------------------------------------------------------------------
+% catcode stuff:
+\DeclareListParser*{\cnltx@map@tokenlist}{}
+
+\newrobustcmd*\cnltx@save@catcodes[1]{%
+ \cnltx@map@tokenlist\cnltx@save@catcode{#1}%
+}
+\newrobustcmd*\cnltx@save@catcode[1]{%
+ \csedef{cnltx@catcode@#1}{\the\catcode`#1}%
+}
+
+\newrobustcmd*\cnltx@restore@catcodes[1]{%
+ \cnltx@map@tokenlist\cnltx@restore@catcode{#1}%
+}
+\newrobustcmd*\cnltx@restore@catcode[1]{%
+ \catcode`#1=\csname cnltx@catcode@#1\endcsname
+ \csundef{cnltx@catcode@#1}%
+}
+
+\newrobustcmd*\cnltx@set@catcodes[2]{%
+ \cnltx@map@tokenlist{\cnltx@set@catcode{#2}}{#1}%
+}
+\newrobustcmd*\cnltx@set@catcode[2]{%
+ \catcode`#1=#2\relax
+}
+
+\newrobustcmd*\cnltx@make@letter[1]{\cnltx@set@catcode{#1}{11}}
+\newrobustcmd*\cnltx@make@other[1]{\cnltx@set@catcode{#1}{12}}
+\newrobustcmd*\cnltx@make@active[1]{\cnltx@set@catcode{#1}{13}}
+
+% --------------------------------------------------------------------------
+% damit wir beim Definieren der vielen assoziierten Makros nichts
+% überschreiben:
+\newrobustcmd*\cnltx@robust@cs[1]{%
+ \expandafter\newrobustcmd\expandafter*\csname#1\endcsname
+}
+\newrobustcmd*\cnltx@new@cs[1]{%
+ \expandafter\newcommand\expandafter*\csname#1\endcsname
+}
+
+% --------------------------------------------------------------------------
% who knows what they might be good for -- well, for indexing:
\newrobustcmd*\cnltxat{@}
\let\cnltxletterat\cnltxat
@@ -163,6 +212,15 @@
\fi
}
+\newcommand*\cnltx@ifcounter[1]{%
+ \ifboolexpe{
+ test {\ifcsdef{c@#1}} and
+ test {\ifcsdef{cl@#1}} and
+ test {\ifcsdef{p@#1}} and
+ test {\ifcsdef{the#1}}
+ }%
+}
+
\newrobustcmd*\cnltx@ifsym[2]{\@ifnextchar#1{\@firstoftwo{#2}}}
\newcommand*\cnltx@ifdash{\cnltx@ifsym{-}}
\newcommand*\cnltx@ifbang{\cnltx@ifsym{!}}
@@ -176,7 +234,10 @@
% make the test character an (hopefully extremely) unlikely % with
% catcode!=14; let's make & a temporary comment char
% save both catcodes just in case someone changed the defaults:
-\edef\cnltx@tmpa{\catcode`\%=\the\catcode`\% \catcode`\&=\the\catcode`\&}
+\edef\cnltx@tmpa{
+ \catcode`\noexpand\%=\the\catcode`\%
+ \catcode`\noexpand\&=\the\catcode`\&
+}
\catcode`\%=3
\catcode`\&=14
& the test:
@@ -370,7 +431,7 @@
\newrobustcmd\cnltx@remove@all[2]{\cnltx@replace@all#1{#2}{}}
% --------------------------------------------------------------------------
-% an equivalent of \newcommand that where the macro with the optional argument
+% an equivalent of \newcommand where the macro with the optional argument
% is expandable. For this to work the newly defined macro /needs/ to eat the
% first following token!
\def\cnltx@num@to@args#1{%
@@ -801,35 +862,39 @@
% --------------------------------------------------------------------------
HISTORY:
-2013/09/08 v0.1 - first working version
-2013/09/10 v0.2 - added `cnltx-tools' to the bundle
- - extended the messaging creation to class messages
-2013/09/12 v0.3 - added index style file `cnltx.ist'
- - added color `module'
- - added \cnltx@remove@once and \cnltx@remove@all
- - added long versions of tokenlist manipulation macros
-2013/09/14 v0.4 - added \cnltx@fullexpand@afterarg
- - new colors `bibentry' and `bibentryfield'
-2013/09/20 v0.5 - added colors `expandable' and `unexpandable'
- - added \definecolorscheme
-2013/09/24 v0.6 - added \cnltx@ifisnum
-2013/09/30 v0.7 - added functionality to look for trailing punctuation
- - added colors `makeidxkey' and `makeidxstring'
- - added counter representation command facilities
- - generalized expansion helpers (by copying expl3's
- \exp_arg:N<spec> idea)
- - \iftest and \nottest
-2013/10/21 v0.8 - \cnltx@ifnextchars
-2013/11/22 v0.9 - \cnltx@modulo
- - scratch variables
- - \cnltx@ifshellescape
- - \cnltx@greplace@once, \cnltx@greplace@all,
- \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
+2013/09/08 v0.1 - first working version
+2013/09/10 v0.2 - added `cnltx-tools' to the bundle
+ - extended the messaging creation to class messages
+2013/09/12 v0.3 - added index style file `cnltx.ist'
+ - added color `module'
+ - added \cnltx@remove@once and \cnltx@remove@all
+ - added long versions of tokenlist manipulation macros
+2013/09/14 v0.4 - added \cnltx@fullexpand@afterarg
+ - new colors `bibentry' and `bibentryfield'
+2013/09/20 v0.5 - added colors `expandable' and `unexpandable'
+ - added \definecolorscheme
+2013/09/24 v0.6 - added \cnltx@ifisnum
+2013/09/30 v0.7 - added functionality to look for trailing punctuation
+ - added colors `makeidxkey' and `makeidxstring'
+ - added counter representation command facilities
+ - generalized expansion helpers (by copying expl3's
+ \exp_arg:N<spec> idea)
+ - \iftest and \nottest
+2013/10/21 v0.8 - \cnltx@ifnextchars
+2013/11/22 v0.9 - \cnltx@modulo
+ - scratch variables
+ - \cnltx@ifshellescape
+ - \cnltx@greplace@once, \cnltx@greplace@all,
+ \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
+2014/03/11 v0.11 - \cnltx@save@catcode, \cnltx@save@catcodes,
+ \cnltx@set@catcode, \cnltx@set@catcodes,
+ \cnltx@restore@catcode, \cnltx@restore@catcodes
+ - \cnltx@make@letter, \cnltx@make@other, \cnltx@make@active
+ - \cnltx@load@module, \cnltx@load@modules
+2015/01/11 v0.12 - updating the bundle to CTAN
+ - more security for \cnltx@ifisnum
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls b/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls
index 24ec5d1cada..0044576bab8 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-2014 Clemens Niederberger
+% Copyright 2013-2015 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -94,7 +94,7 @@
}
-\RequirePackage{cnltx-tools,cnltx-example,cnltx-listings,translations}
+\cnltx@load@modules{tools,names,example,listings,translations}
\newcommand*\cnltx@caption@font{\normalfont\small\sffamily}
\newcommand*\cnltx@captionlabel@font{\cnltx@caption@font\scshape}
@@ -113,6 +113,9 @@
{\RequirePackage[T1]{fontenc}}
{\RequirePackage{fontspec}}
\RequirePackage[oldstyle]{libertine}
+ \ifboolexpr{not bool{xetex} and not bool{luatex}}
+ {}
+ {}
\RequirePackage{libertinehologopatch}
\RequirePackage[supstfm=libertinesups]{superiors}
% libertine does not have superior letters:
@@ -178,7 +181,7 @@
\setmonofont[
Scale = MatchLowercase ,
Ligatures = {NoCommon,NoRequired,NoContextual}
- ]{Bitstream Vera Sans Mono}
+ ]{DejaVu Sans Mono}
}
\recalctypearea
}
@@ -199,13 +202,12 @@
\setkomafont{captionlabel}{\cnltx@captionlabel@font}
}{}
-\ifbool{cnltx@add@index}{
+\ifbool{cnltx@add@bib}{
\RequirePackage[
backend=biber,
style=cnltx,
- sortlocale=en_EN,
- indexing=cite,
- useprefix]{biblatex}
+ sortlocale=en_US,
+ indexing=cite]{biblatex}
\addbibresource{cnltx.bib}
\AtEndDocument{\printbibliography}
}{}
@@ -319,16 +321,16 @@
}
\def\cnltx@write@author@email#1][\q@stop{%
\ifblank{#1}{}
- {\footnote{\href{mailto:#1}{#1}}}%
+ {\footnote{\email{#1}}}%
}
\protected\def\cnltx@get@first@and@second@name#1 #2\q@stop{%
\ifblank{#2}
{%
- \cnltx@name[]{#1}%
+ \name*{#1}%
\listgadd\cnltx@package@author@pdflist{#1}%
}
{%
- \cnltx@name[#1]{\trim@spaces{#2}}%
+ \name*{#1 #2}%
\listgadd\cnltx@package@author@pdflist{#1 \trim@spaces{#2}}%
}%
}
@@ -596,6 +598,8 @@
\newrobustcmd*\expandable{\cnltx@expandable@ornot\cnltx@expandable}
\newrobustcmd*\unexpandable{\cnltx@expandable@ornot\cnltx@unexpandable}
+\newrobustcmd*\expandablesymbol{\textcolor{expandable}{\expandablesign}}
+\newrobustcmd*\unexpandablesymbol{\textcolor{unexpandable}{\expandablesign}}
\newrobustcmd*\cnltx@expandable@ornot[1]{%
\let\cnltx@item\item
@@ -608,14 +612,10 @@
\endgroup
}
\newcommand*\cnltx@expandable{%
- \cnltx@expandable@note{%
- \textcolor{expandable}{\expandablesign}%
- }%
+ \cnltx@expandable@note{\expandablesymbol}%
}
\newcommand*\cnltx@unexpandable{%
- \cnltx@expandable@note{%
- \textcolor{unexpandable}{\expandablesign}%
- }%
+ \cnltx@expandable@note{\unexpandablesymbol}%
}
\newcommand*\expandablesign{\textasteriskcentered}
@@ -755,7 +755,7 @@
\ifbool{cnltx@package@email}
{%
\par\vskip.5cm\relax
- \href{mailto:\cnltx@package@email}{\cnltx@package@email}%
+ \email{\cnltx@package@email}%
}{}%
\ifbool{cnltx@package@abstract}
{%
@@ -763,8 +763,10 @@
\cnltx@package@abstract
}{}%
\end{center}
- \begin{multicols}{2}[\section*{\GetTranslation{cnltx-toc}}]
- \cnltx@tableofcontents
+ \begin{multicols}{2}[{%
+ \pdfbookmark[1]{\GetTranslation{cnltx-toc}}{toc}%
+ \section*{\GetTranslation{cnltx-toc}}
+ }]\cnltx@tableofcontents
\end{multicols}%
}
@@ -825,9 +827,15 @@
% --------------------------------------------------------------------------
% hyperlinks:
\newrobustcmd*\CTANurl[2][macros/latex/contrib]{%
- on \ctan\ as \code{#2}: \url{http://mirrors.ctan.org/#1/#2/}%
+ on \ctan\ as \cnltx@weblink@font{#2}: \url{http://mirrors.ctan.org/#1/#2/}%
}
+\newcommand*\cnltx@weblink@font[1]{\texttt{#1}}
+
+\newrobustcmd*\email[1]{\cnltx@weblink@font{\href{mailto:#1}{#1}}}
+\newrobustcmd*\website[1]{\cnltx@weblink@font{\href{http://#1/}{#1}}}
+\newrobustcmd*\securewebsite[1]{\cnltx@weblink@font{\href{https://#1/}{#1}}}
+
\newrobustcmd*\needpackage[2][macros/latex/contrib]{%
\pkg{#2}\footnote{\CTANurl[#1]{#2}}%
}
@@ -858,113 +866,63 @@
}%
}
-% --------------------------------------------------------------------------
-% localization strings:
-\DeclareTranslationFallback{cnltx-default}{Default}
-\DeclareTranslation{English}{cnltx-default}{Default}
-\DeclareTranslation{German}{cnltx-default}{Voreinstellung}
-
-\DeclareTranslationFallback{cnltx-required}{required}
-\DeclareTranslation{English}{cnltx-required}{required}
-\DeclareTranslation{German}{cnltx-required}{erforderlich}
-
-\DeclareTranslationFallback{cnltx-empty}{initially empty}
-\DeclareTranslation{English}{cnltx-empty}{initially empty}
-\DeclareTranslation{German}{cnltx-empty}{zun\"achst leer}
-
-\DeclareTranslationFallback{cnltx-toc}{Table of Contents}
-\DeclareTranslation{English}{cnltx-toc}{Table of Contents}
-\DeclareTranslation{German}{cnltx-toc}{Inhaltsverzeichnis}
-
-\DeclareTranslationFallback{cnltx-license}{%
- Permission is granted to copy, distribute and/or modify this software under
- the terms of the \LPPL\ (\lppl), version 1.3 or later
- (\url{http://www.latex-project.org/lppl.txt}). The software has the status%
-}
-\DeclareTranslation{English}{cnltx-license}{%
- Permission is granted to copy, distribute and/or modify this software under
- the terms of the \LPPL\ (\lppl), version 1.3 or later
- (\url{http://www.latex-project.org/lppl.txt}). The software has the status%
-}
-\DeclareTranslation{German}{cnltx-license}{%
- Es ist erlaubt, diese Software unter den Bedingungen der \LPPL\ (\lppl),
- Version 1.3 oder sp\"ater, zu kopieren und zu verteilen
- (\url{http://www.latex-project.org/lppl.txt}). Sie hat den Status%
-}
-
-\DeclareTranslationFallback{cnltx-introduced}{Introduced in version}
-\DeclareTranslation{English}{cnltx-introduced}{Introduced in version}
-\DeclareTranslation{German}{cnltx-introduced}{Eingef\"uhrt in Version}
-
-\DeclareTranslationFallback{cnltx-changed}{Changed in version}
-\DeclareTranslation{English}{cnltx-changed}{Changed in version}
-\DeclareTranslation{German}{cnltx-changed}{Ge\"andert in Version}
-
-\DeclareTranslationFallback{cnltx-f.}{f.}
-\DeclareTranslation{English}{cnltx-f.}{f.}
-\DeclareTranslation{German}{cnltx-f.}{f.}
-
-\DeclareTranslationFallback{cnltx-ff.}{ff.}
-\DeclareTranslation{English}{cnltx-ff.}{ff.}
-\DeclareTranslation{German}{cnltx-ff.}{ff.}
-
-\DeclareTranslationFallback{cnltx-maintainer}{current maintainer}
-\DeclareTranslation{English}{cnltx-maintainer}{current maintainer}
-\DeclareTranslation{German}{cnltx-maintainer}{aktueller Maintainer}
-
-\DeclareTranslationFallback{cnltx-maintainers}{current maintainers}
-\DeclareTranslation{English}{cnltx-maintainers}{current maintainers}
-\DeclareTranslation{German}{cnltx-maintainers}{aktuelle Maintainer}
-
\endinput
% --------------------------------------------------------------------------
HISTORY:
-2013/09/08 v0.1 - first working version
-2013/09/10 v0.2 - added optional argument to \license
- - \newname got moved to `cnltx-tools'
- - added possibility for internationalization
- - new macros \needpackage and \needclass
- - option for formatting the document title
-2013/09/12 v0.3 - new class options `add-index', `load-preamble+' and
- `scrartcl'
- - new options `index-prologue' and `index-space'
- - new file `cnltx.ist'
- - added \Module
- - added optional ! to the \Default command
- - add safety net: provide necessary commands in the aux-file
- if they're not defined at begin document
-2013/09/12 v0.3a - automatic preamble detects xelatex and lualatex and selects
- the fonts accordingly
-2013/09/15 v0.4 - possiblity to add an email address for each author, written
- as footnote; they get symbols if the `load-preamble'
- options is not used
- - fixed bug in index setup mechanism
- - added biblatex entry type `package' and biblatex style
- `cnltx'
-2013/09/20 v0.5 - new commands \expandable and \unexpandable
- - new environment `cnltxquote', formatting via options
- `quote-format' and `quote-author-format'
- - changed scaling of `beramono' from `.83' to `.81' -- seems
- a better fit in relation to Linux Libertine
-2013/09/24 v0.6 - workaround for footnotes in minipages => libertine does not
- have superior letters
- - new options `abstract-format' and `abstract-width'
-2013/09/30 v0.7 - added better microtype settings to the predefined preamble
- - replaced \def's with \newcommand or \newrobustcmd
-2013/10/04 v0.7a - renamed \cnltx@package@name@format into
- \cnltxpackagenameformat
- - added \cnltxpackagenameformat to the disabled pdfstring
- commands
- - added possibility to define a opitonal argument with
- \newnote
-2013/10/21 v0.8 - disable ligatures for teletype font
- - extended preamble loading
- * choice if fonts are loaded
- * choice if microtype is loaded
- - \visualizespaces and \visiblespace
-2014/01/05 v0.10 - adapt to KOMA-Script v3.12
+2013/09/08 v0.1 - first working version
+2013/09/10 v0.2 - added optional argument to \license
+ - \newname got moved to `cnltx-tools'
+ - added possibility for internationalization
+ - new macros \needpackage and \needclass
+ - option for formatting the document title
+2013/09/12 v0.3 - new class options `add-index', `load-preamble+' and
+ `scrartcl'
+ - new options `index-prologue' and `index-space'
+ - new file `cnltx.ist'
+ - added \Module
+ - added optional ! to the \Default command
+ - add safety net: provide necessary commands in the aux-file
+ if they're not defined at begin document
+2013/09/12 v0.3a - automatic preamble detects xelatex and lualatex and selects
+ the fonts accordingly
+2013/09/15 v0.4 - possiblity to add an email address for each author, written
+ as footnote; they get symbols if the `load-preamble'
+ options is not used
+ - fixed bug in index setup mechanism
+ - added biblatex entry type `package' and biblatex style
+ `cnltx'
+2013/09/20 v0.5 - new commands \expandable and \unexpandable
+ - new environment `cnltxquote', formatting via options
+ `quote-format' and `quote-author-format'
+ - changed scaling of `beramono' from `.83' to `.81' -- seems
+ a better fit in relation to Linux Libertine
+2013/09/24 v0.6 - workaround for footnotes in minipages => libertine does not
+ have superior letters
+ - new options `abstract-format' and `abstract-width'
+2013/09/30 v0.7 - added better microtype settings to the predefined preamble
+ - replaced \def's with \newcommand or \newrobustcmd
+2013/10/04 v0.7a - renamed \cnltx@package@name@format into
+ \cnltxpackagenameformat
+ - added \cnltxpackagenameformat to the disabled pdfstring
+ commands
+ - added possibility to define a opitonal argument with
+ \newnote
+2013/10/21 v0.8 - disable ligatures for teletype font
+ - extended preamble loading
+ * choice if fonts are loaded
+ * choice if microtype is loaded
+ - \visualizespaces and \visiblespace
+2014/01/23 v0.10 - adapt to KOMA-Script v3.12
+2014/03/11 v0.11 - change biblatex locale from en_EN to en_US
+ - fix bug: wrong boolean used for option `add-bib'
+ - some translations are now provided by the `tools' module
+ and by the `cnltx' bibliography style
+ - use \cnltx@load@modules
+ - new commands \email, \website, \securewebsite
+ - \expandablesymbol, \unexpandablesymbol
+
% --------------------------------------------------------------------------
TODO:
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-example.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-example.sty
index ce75c9b1cd0..256e154fb15 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-2014 Clemens Niederberger
+% Copyright 2013-2015 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -27,7 +27,7 @@
% --------------------------------------------------------------------------
\RequirePackage{cnltx-base}
\ProvidesPackage{cnltx-example}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info]
-\RequirePackage{cnltx-listings}
+\cnltx@load@modules{listings,translations}
\cnltx@create@bundle@message{example}{Error}
\cnltx@create@bundle@message{example}{Warning}
@@ -35,10 +35,10 @@
\cnltx@create@bundle@message{example}{Info}
% --------------------------------------------------------------------------
-\RequirePackage{translations}
\PassOptionsToPackage{framemethod=tikz}{mdframed}
\RequirePackage{mdframed}
\RequirePackage{idxcmds}
+\RequirePackage{textcomp}
\RequirePackage{adjustbox}
\RequirePackage{ifxetex}
@@ -58,7 +58,7 @@
\newidxcmd\cs{\code{\textbackslash\textcolor{cs}{#1}}}
% \env
-\newidxcmd\env{\code{#1}}[\ (\GetTranslation{cnltx-environment})]
+\newidxcmd\env{\code{\textcolor{env}{#1}}}[\ (\GetTranslation{cnltx-environment})]
% \begin, \end
\newidxcmd\beginend{\code{\textbackslash\textcolor{beginend}{#1}}}
@@ -207,7 +207,7 @@
}
\lst@RequireAspects{writefile}
-\providecommand*\MakePercentComment{\catcode`\%14\relax}
+\providecommand*\MakePercentComment{\cnltx@set@catcode{\%}{14}}
\def\cnltx@gobble{2}
@@ -229,7 +229,9 @@
{Ä}{{\"A}}1
{Ö}{{\"O}}1
{Ü}{{\"U}}1
- {ß}{{\ss}}1 ,
+ {ß}{{\ss}}1
+ {`}{\`{}}1
+ {'}{\textquotesingle}1 ,
breaklines = true,
keepspaces = true,
breakindent = 1em,
@@ -242,6 +244,7 @@
center,
description,document,
end,enumerate,
+ equation,eqnarray,
figure,flushleft,flushright,
itemize,list,
otherlanguage,
@@ -254,6 +257,7 @@
center,
description,document,
end,enumerate,
+ equation,eqnarray,
figure,flushleft,flushright,
itemize,list,
otherlanguage,
@@ -264,20 +268,20 @@
index = [2][texcs2],
indexstyle = [2]\@gobble,
moretexcs = [2]{begin,end},
- % added environments that'll be indexed:
- texcsstyle = [3]\color{env},
+ % control sequences that'll be indexed:
+ texcsstyle = [3]\color{cs},
index = [3][texcs3],
- indexstyle = [3]\indexenv,
- % environments that won't be indexed:
- texcsstyle = [4]\color{env},
+ indexstyle = [3]\indexcs,
+ % control sequences that won't be indexed:
+ texcsstyle = [4]\color{cs},
index = [4][texcs4],
indexstyle = [4]\@gobble,
- % control sequences that'll be indexed:
- texcsstyle = [5]\color{cs},
+ % added environments that'll be indexed:
+ texcsstyle = [5]\color{env},
index = [5][texcs5],
- indexstyle = [5]\indexcs,
- % control sequences that won't be indexed:
- texcsstyle = [6]\color{cs},
+ indexstyle = [5]\indexenv,
+ % environments that won't be indexed:
+ texcsstyle = [6]\color{env},
index = [6][texcs6],
indexstyle = [6]\@gobble,
moredelim = *[s][\color{math}]{$}{$}
@@ -357,18 +361,18 @@
\def\cnltx@addcmds#1{%
\cnltx@expandargs(nx)\lstdefinestyle
{cnltx}
- {\expandonce\cnltx@listings@style,\unexpanded{moretexcs={[5]#1}}}%
+ {\expandonce\cnltx@listings@style,\unexpanded{moretexcs={[3]#1}}}%
\edef\cnltx@listings@style{%
- \expandonce\cnltx@listings@style,\unexpanded{moretexcs={[5]#1}}%
+ \expandonce\cnltx@listings@style,\unexpanded{moretexcs={[3]#1}}%
}%
}
\def\cnltx@addsilentcmds#1{%
\cnltx@expandargs(nx)\lstdefinestyle
{cnltx}
- {\expandonce\cnltx@listings@style,\unexpanded{moretexcs={[6]#1}}}%
+ {\expandonce\cnltx@listings@style,\unexpanded{moretexcs={[4]#1}}}%
\edef\cnltx@listings@style{%
- \expandonce\cnltx@listings@style,\unexpanded{moretexcs={[6]#1}}%
+ \expandonce\cnltx@listings@style,\unexpanded{moretexcs={[4]#1}}%
}%
}
@@ -377,18 +381,18 @@
\def\cnltx@addenvs#1{%
\cnltx@expandargs(nx)\lstdefinestyle
{cnltx}
- {\expandonce\cnltx@listings@style,\unexpanded{moretexcs={[3]#1}}}%
+ {\expandonce\cnltx@listings@style,\unexpanded{moretexcs={[5]#1}}}%
\edef\cnltx@listings@style{%
- \expandonce\cnltx@listings@style,\unexpanded{moretexcs={[3]#1}}%
+ \expandonce\cnltx@listings@style,\unexpanded{moretexcs={[5]#1}}%
}%
}
\def\cnltx@addsilentenvs#1{%
\cnltx@expandargs(nx)\lstdefinestyle
{cnltx}
- {\expandonce\cnltx@listings@style,\unexpanded{moretexcs={[4]#1}}}%
+ {\expandonce\cnltx@listings@style,\unexpanded{moretexcs={[6]#1}}}%
\edef\cnltx@listings@style{%
- \expandonce\cnltx@listings@style,\unexpanded{moretexcs={[4]#1}}%
+ \expandonce\cnltx@listings@style,\unexpanded{moretexcs={[6]#1}}%
}%
}
@@ -415,17 +419,20 @@
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} ,
+ add-sourcecode-options/.code =
+ \edef\cnltx@local@listings@options{\trim@spaces@noexp{#1}} ,
sourcecode-options/.code =
\booltrue{cnltx@local@sourcecode@overwrite}
- \def\cnltx@local@listings@options{#1}
+ \edef\cnltx@local@listings@options{\trim@spaces@noexp{#1}}
}
\def\cnltx@mdframed@options
{
backgroundcolor = cnltxbg ,
linecolor = cnltx ,
- roundcorner = 5pt
+ roundcorner = 5pt ,
+ skipabove = .5\baselineskip ,
+ skipbelow = .5\baselineskip
}
\cnltx@expandargs(nx)\mdfdefinestyle
{cnltx}
@@ -451,6 +458,10 @@
\newsavebox\cnltx@example@box
+\newlength\cnltx@sidebysidewidth
+\newlength\cnltx@before@skip
+\newlength\cnltx@after@skip
+
\newcommand*\cnltx@examplesep{\hrulefill}
\newcommand*\cnltx@pre@source@hook{}
\newcommand*\cnltx@after@source@hook{}
@@ -529,9 +540,14 @@
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
+ add-frame/.default = true ,
+ before-skip/.code = \setlength\cnltx@before@skip{#1} ,
+ after-skip/.code = \setlength\cnltx@after@skip{#1}
}
+\setlength\cnltx@before@skip{\baselineskip}
+\setlength\cnltx@after@skip{\baselineskip}
+
\newcommand*\cnltx@get@page@list[1]{%
\forcsvlist{\cnltx@read@page@list@item}{#1}%
}
@@ -614,29 +630,43 @@
\endgroup
}
-\newcommand*\cnltx@source@input@start[1]{%
+\newrobustcmd*\cnltx@source@input@start[1]{%
\ifboolexpr{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
- {\setbox\cnltx@example@box=\hbox\bgroup}{\cnltx@pre@source@hook}%
- \lst@BeginAlsoWriteFile{#1}%
+ {%
+ \adjustbox{
+ % discard,
+ trim= 0pt 0pt \linewidth{} 0pt,
+ valign=c,
+ gstore=\cnltx@example@box,
+ discard
+ }\bgroup
+ }
+ {\cnltx@pre@source@hook}%
+ \lst@BeginAlsoWriteFile{#1}%
}
-\newcommand*\cnltx@source@input@end{%
+\newrobustcmd*\cnltx@source@input@end{%
\lst@EndWriteFile
\ifboolexpr{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
{\egroup}{\cnltx@after@source@hook}%
}
-\newcommand*\cnltx@example@start[1]{%
+\newrobustcmd*\cnltx@example@start[1]{%
\pgfqkeys{/cnltx}{#1}%
\ifbool{cnltx@local@sourcecode@overwrite}
{%
\cnltx@expandargs(x)\lstset{
+ \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
+ {linewidth=\cnltx@sidebysidewidth,}{}%
+ moretexcs=[3], moretexcs=[5],
\expandonce\cnltx@local@listings@options
}%
}
{%
\cnltx@expandargs(x)\lstset{
style=cnltx,
+ \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
+ {linewidth=\cnltx@sidebysidewidth,}{}%
\expandonce\cnltx@local@listings@options
% no idea why this is necessary:
% \ifcsdef{lst@gtexcs3}{}{,moretexcs=[3]}%
@@ -645,7 +675,7 @@
\ifbool{cnltx@local@frame@overwrite}
{%
\cnltx@expandargs(nxx)%
- \ifbool{cnltx@sidebyside}
+ \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
{%
\noexpand\mdframed[
\expandonce\cnltx@local@frame@options,
@@ -659,7 +689,7 @@
}
{%
\cnltx@expandargs(nxx)%
- \ifbool{cnltx@sidebyside}
+ \ifboolexpe{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
{%
\noexpand\mdframed[
style=cnltx,
@@ -680,7 +710,7 @@
% #1: filename
% #2: number of pages
% #3: current page
-\newcommand*\cnltx@print@documentpage[3]{%
+\newrobustcmd*\cnltx@print@documentpage[3]{%
\cnltx@expandargs(x)\setlength\cnltx@tmpa@length{%
\strip@pt\dimexpr1pt/%
\ifnumgreater{#2}{\value{cnltx@maxpages}}
@@ -728,11 +758,11 @@
}%
}
-\newcommand*\cnltx@stepcounter@ifnotempty[2]{%
+\newrobustcmd*\cnltx@stepcounter@ifnotempty[2]{%
\ifblank{#2}{}{\stepcounter{#1}}%
}
-\newcommand*\cnltx@example@end[1]{%
+\newrobustcmd*\cnltx@example@end[1]{%
\ifblank{#1}{\booltrue{cnltx@codeonly}}{}
\ifboolexpr
{
@@ -742,48 +772,32 @@
}
{}
{% direct input of code example
+ % \showthe\wd\cnltx@example@box
+ % \showthe\linewidth
\ifbool{cnltx@sidebyside}
{% side-by-side
\ifbool{cnltx@codeleft}
{% code on the left
- \minipage[c]{%
- \dimexpr
- .49\linewidth
- -.75\lst@xleftmargin
- \relax
- }%
+ \noindent
+ \minipage[c]{\cnltx@sidebysidewidth}%
\cnltx@pre@source@hook
\unhbox\cnltx@example@box
\cnltx@after@source@hook
\endminipage\hfill
- \minipage[c]{%
- \dimexpr
- .49\linewidth
- -.75\lst@xleftmargin
- \relax
- }%
+ \minipage[c]{\cnltx@sidebysidewidth}%
\cnltx@pre@example@hook
\cnltx@example@input{#1.code}%
\cnltx@after@example@hook
\endminipage
}
{% code on the right
- \minipage[c]{%
- \dimexpr
- .49\linewidth
- -.75\lst@xleftmargin
- \relax
- }%
+ \noindent
+ \minipage[c]{\cnltx@sidebysidewidth}%
\cnltx@pre@example@hook
\cnltx@example@input{#1.code}%
\cnltx@after@example@hook
\endminipage\hfill
- \minipage[c]{%
- \dimexpr
- .49\linewidth
- -.75\lst@xleftmargin
- \relax
- }%
+ \minipage[c]{\cnltx@sidebysidewidth}%
\cnltx@pre@source@hook
\unhbox\cnltx@example@box
\cnltx@after@source@hook
@@ -865,12 +879,13 @@
{%
\cnltx@after@example@hook
\endmdframed
+ \par
}%
}
- {\endmdframed}%
+ {\endmdframed\par}%
}%
{%
- \endmdframed
+ \endmdframed\par
\ifbool{cnltx@outside}
{%
\cnltx@pre@example@hook
@@ -885,6 +900,12 @@
\def\cnltx@new@sourcecode@env#1#2{%
\lstnewenvironment{#2}[1][]
{%
+ \vskip\cnltx@before@skip
+ \setlength\cnltx@sidebysidewidth
+ {\dimexpr .45\columnwidth -\lst@xleftmargin -\lst@xrightmargin\relax}%
+ \ifboolexpr{ bool {cnltx@sidebyside} and not bool {cnltx@codeonly} }
+ {\cnltx@addlistingsoptions{linewidth=\cnltx@sidebysidewidth}}
+ {}%
\cnltx@example@start{##1,#1}%
\ifbool{cnltx@compile}{%
\stepcounter{cnltx@filenumber}%
@@ -901,6 +922,8 @@
\if@nobreak
\@nobreakfalse
\fi
+ \csname par\endcsname
+ \vskip\cnltx@after@skip
}%
}
\newrobustcmd\newsourcecodeenv[2][]{%
@@ -967,22 +990,6 @@
}%
}
-\DeclareTranslationFallback{cnltx-package}{package}
-\DeclareTranslation{English}{cnltx-package}{package}
-\DeclareTranslation{German}{cnltx-package}{Paket}
-
-\DeclareTranslationFallback{cnltx-environment}{environment}
-\DeclareTranslation{English}{cnltx-environment}{environment}
-\DeclareTranslation{German}{cnltx-environment}{Umgebung}
-
-\DeclareTranslationFallback{cnltx-class}{class}
-\DeclareTranslation{English}{cnltx-class}{class}
-\DeclareTranslation{German}{cnltx-class}{Klasse}
-
-\DeclareTranslationFallback{cnltx-bundle}{bundle}
-\DeclareTranslation{English}{cnltx-bundle}{bundle}
-\DeclareTranslation{German}{cnltx-bundle}{Bundle}
-
\endinput
% --------------------------------------------------------------------------
@@ -1030,7 +1037,8 @@ HISTORY:
- new command \parg for an optional + argument
- new option `outside' for non-`compiled' examples
- new option `float-env'
-
+2014/03/11 v0.11 - \cnltx@load@modules
+2014/04/09 v0.12 - improvements on the sidebyside examples
TODO:
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty
index abc8f2e9890..7db538a102d 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-2014 Clemens Niederberger
+% Copyright 2013-2015 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -204,7 +204,7 @@
% custom fields:
namea,nameb,namec,
nameatype,namebtype,namectype,
- lista,listb,listc,listd,liste.listf,
+ lista,listb,listc,listd,liste,listf,
usera,userb,userc,userd,usere,userf,
verba,verbb,verbc,
% field aliases:
@@ -874,7 +874,7 @@
intop,
iota,
it,
- item.
+ item,
itemindent,
itemitem,
itemize,
@@ -1319,7 +1319,7 @@
protect,
protected,
protected@eappto,protected@xappto,
- protected@edef.protected@xdef,
+ protected@edef,protected@xdef,
protected@epreto,protected@xpreto,
protected@cseappto,protected@csxappto,
protected@csedef,protected@csxdef,
@@ -1958,4 +1958,5 @@ HISTORY:
2013/10/21 v0.8 - added missing comma in list of commands
2013/10/21 v0.9 - added internal LaTeX commands and a number of `etoolbox'
macros
+2014/03/11 v0.11 - small bug fixes in \cnltx@predefined@control@sequences
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-names.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-names.sty
new file mode 100644
index 00000000000..d97c975c79c
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-names.sty
@@ -0,0 +1,177 @@
+% a /very/ preliminary draft – don't use it
+\RequirePackage{cnltx-base}
+\ProvidesPackage{cnltx-names}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info]
+
+% --------------------------------------------------------------------------
+\cnltx@create@bundle@message{names}{Error}
+\cnltx@create@bundle@message{names}{Warning}
+\cnltx@create@bundle@message{names}{WarningNoLine}
+\cnltx@create@bundle@message{names}{Info}
+
+% \newfirstformat\foo
+%
+% definiert
+% => \foo{bar} % als `benutzt' markieren, verwendet zuerst
+% % \foofirstformat , dann \fooformat
+% => \foo*{bar} % nicht als `benutzt' markieren, verwendet \fooformat
+% => \fooformat % kann später umdefiniert werden nach eigenem Geschmack
+% => \foofirstformat % kann später umdefiniert werden nach eigenem Geschmack
+% => \resetfoo % setzt alle \foo wieder (lokal) auf unbenutzt zurück
+\newrobustcmd*\newfirstformat[1]{%
+ \newrobustcmd*#1{%
+ \@ifstar
+ {\csuse{\cnltx@stripbs#1@star}}
+ {\csuse{\cnltx@stripbs#1@nostar}}%
+ }%
+ \cnltx@robust@cs{\cnltx@stripbs#1@nostar}[1]{%
+ \ifcsdef{\cnltx@stripbs#1@\detokenize{##1}}
+ {\csuse{\cnltx@stripbs#1format}{##1}}
+ {\csuse{\cnltx@stripbs#1firstformat}{##1}\csuse{define@\cnltx@stripbs#1}{##1}}%
+ }%
+ \cnltx@robust@cs{\cnltx@stripbs#1@star}[1]{\csuse{\cnltx@stripbs#1starformat}{##1}}%
+ \cnltx@new@cs{\cnltx@stripbs#1@used}{}%
+ \cnltx@robust@cs{define@\cnltx@stripbs#1}[1]{%
+ \csgdef{\cnltx@stripbs#1@\detokenize{##1}}{}%
+ \listcsgadd{\cnltx@stripbs#1@used}{##1}%
+ }%
+ \cnltx@robust@cs{undefine@\cnltx@stripbs#1}[1]{%
+ \csundef{\cnltx@stripbs#1@\detokenize{##1}}%
+ }%
+ \cnltx@robust@cs{reset\cnltx@stripbs#1}{%
+ \forlistcsloop{\csuse{undefine@\cnltx@stripbs#1}}{\cnltx@stripbs#1@used}%
+ \csdef{\cnltx@stripbs#1@used}{}%
+ }%
+ \cnltx@new@cs{\cnltx@stripbs#1firstformat}[1]{##1}%
+ \cnltx@new@cs{\cnltx@stripbs#1format}[1]{##1}%
+ \cnltx@new@cs{\cnltx@stripbs#1starformat}[1]{##1}%
+}
+
+% --------------------------------------------------------------------------
+
+\newcommand*\writename[1]{\cnltx@write@name#1 \q@stop}
+
+\newcommand*\cnltx@write@firstname[1]{#1}
+\newcommand*\cnltx@write@middlename[1]{\cnltx@initial{#1}}
+\newcommand*\cnltx@write@lastname[1]{\textsc{#1}}
+\newcommand*\cnltx@between@names{\,}
+
+\newcommand*\cnltx@initial[1]{\cnltx@initial@aux#1\q@stop}
+\def\cnltx@initial@aux#1#2\q@stop{#1.}
+
+\newcommand*\cnltx@name@idx[3]{%
+ \ifblank{#1}
+ {\index{#3@\cnltx@write@lastname{#3}}}
+ {\index{#3, #1@\cnltx@write@lastname{#3}, \cnltx@write@firstname{#1}}}%
+}
+
+% TODO: Index hinzufügen \newcommand*\cnltx@name@idx[2]{\index{#1@#2}}
+\newcommand*\cnltx@write@fullname[2]{%
+ \cnltx@write@firstname{#1}\cnltx@between@names
+ \cnltx@write@lastname{#2}%
+}
+
+\newcommand*\cnltx@write@fullmiddlename[3]{%
+ \cnltx@write@firstname{#1}\cnltx@between@names
+ \cnltx@write@middlename{#2}\cnltx@between@names
+ \cnltx@write@lastname{#3}%
+}
+\def\cnltx@write@fullmiddlename@aux#1#2#3 \q@stop{%
+ \cnltx@write@fullmiddlename{#1}{#2}{#3}%
+ \ifbool{cnltx@name@noidx}{}{%
+ \cnltx@name@idx{#1}{#2}{#3}%
+ }%
+}
+
+\def\cnltx@write@name#1 #2\q@stop{%
+ \ifblank{#2}
+ {%
+ \cnltx@write@lastname{#1}%
+ \ifbool{cnltx@name@noidx}{}
+ {\cnltx@name@idx{}{}{#1}}%
+ }
+ {\cnltx@write@completename{#1}#2\q@stop}%
+}
+% TODO: erweitern auf mehrere mittlere Namen:
+\def\cnltx@write@completename#1#2 #3\q@stop{%
+ \ifblank{#3}
+ {%
+ \cnltx@write@fullname{#1}{#2}%
+ \ifbool{cnltx@name@noidx}{}
+ {\cnltx@name@idx{#1}{}{#2}}%
+ }
+ {\cnltx@write@fullmiddlename@aux{#1}{#2}#3\q@stop}%
+}
+
+% name formats:
+\newrobustcmd*\defnameformat[4]{%
+ \cnltx@def@nameformat{#1}{#2}{#3}{#4}%
+}
+\newrobustcmd*\cnltx@def@nameformat[4]{%
+ \protected\csdef{cnltx@nameformat@#1}{%
+ \def\cnltx@write@firstname####1{#2}%
+ \def\cnltx@write@middlename####1{#3}%
+ \def\cnltx@write@lastname####1{#4}%
+ }%
+}
+
+\defnameformat{fullname}
+ {##1}
+ {##1}
+ {\textsc{##1}}
+\defnameformat{middledot}
+ {##1}
+ {\cnltx@initial{##1}}
+ {\textsc{##1}}
+\defnameformat{firstmiddledot}
+ {\cnltx@initial{##1}}
+ {\cnltx@initial{##1}}
+ {\textsc{##1}}
+\defnameformat{alldot}
+ {\cnltx@initial{##1}}
+ {\cnltx@initial{##1}}
+ {\cnltx@initial{##1}}
+\defnameformat{nomiddle}
+ {##1}
+ {\@gobble}
+ {\textsc{##1}}
+\defnameformat{nomiddledot}
+ {\cnltx@initial{##1}}
+ {\@gobble}
+ {\textsc{##1}}
+% \show\cnltx@nameformat@nomiddledot
+\defnameformat{onlylast}
+ {\@gobble}
+ {\@gobble}
+ {\textsc{##1}}
+
+% choose name format:
+\newrobustcmd*\writenameformat[1]{%
+ \csuse{cnltx@nameformat@#1}%
+}
+
+% --------------------------------------------------------------------------
+
+\newbool{cnltx@name@noidx}
+
+\newfirstformat\name
+\renewcommand*\namefirstformat[1]{\writename{#1}}
+\renewcommand*\nameformat[1]{{\writenameformat{nomiddle}\writename{#1}}}
+\renewcommand*\namestarformat[1]{%
+ \begingroup
+ \booltrue{cnltx@name@noidx}%
+ \namefirstformat{#1}%
+ \endgroup
+}
+
+\newrobustcmd*\cnltx@newname[2]{%
+ \newrobustcmd*#1{%
+ \@ifstar
+ {\name*{#2}}
+ {\name{#2}}%
+ }%
+}
+
+\newrobustcmd*\newname{\cnltx@newname}
+
+\endinput
+% --------------------------------------------------------------------------
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-tools.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-tools.sty
index 5b3ee29a4c9..3b53ee0ec44 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-2014 Clemens Niederberger
+% Copyright 2013-2015 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -34,45 +34,72 @@
\cnltx@create@bundle@message{tools}{WarningNoLine}
\cnltx@create@bundle@message{tools}{Info}
-% --------------------------------------------------------------------------
-\newcommand*\cnltx@name@first[1]{#1}
-\newcommand*\cnltx@name@last[1]{\textsc{#1}}
-\newcommand*\cnltx@name@base[1]{#1}
-
-\pgfkeys{
- cnltx/.cd,
- last-name-format/.code = \def\cnltx@name@last##1{#1} ,
- first-name-format/.code = \def\cnltx@name@first##1{#1} ,
- name-format/.code = \def\cnltx@name@base##1{#1}
-}
+\cnltx@load@module{translations}
-\newcommand*\cnltx@name@idx[1]{\index{#1@#1}}
-\newrobustcmd*\cnltx@name@star[2][]{%
- \ifblank{#1}
- {\cnltx@name@base{\cnltx@name@last{#2}}}
- {\cnltx@name@base{\cnltx@name@first{#1} \cnltx@name@last{#2}}}%
-}
-\newrobustcmd*\cnltx@name@nostar[2][]{%
- \ifblank{#1}
- {\cnltx@name@base{\cnltx@name@last{#2}}\cnltx@name@idx{#2}}
- {%
- \cnltx@name@base{\cnltx@name@first{#1} \cnltx@name@last{#2}}%
- \cnltx@name@idx{#2, #1}%
- }%
-}
-\def\cnltx@name{\@ifstar{\cnltx@name@star}{\cnltx@name@nostar}}
-
-\newrobustcmd*\cnltx@newname[3]{%
- \csdef{\cnltx@stripbs#1@short}{\cnltx@name@base{#3}\cnltx@name@idx{#3, #2}}%
- \csdef{\cnltx@stripbs#1@long}{\cnltx@name@base{#2 #3}\cnltx@name@idx{#3, #2}}%
- \newrobustcmd*#1{%
- \@ifstar
- {\csuse{\cnltx@stripbs#1@short}}
- {\csuse{\cnltx@stripbs#1@long}}%
- }%
-}
+% --------------------------------------------------------------------------
+% \newcommand*\cnltx@name@first[1]{#1}
+% \newcommand*\cnltx@name@last[1]{\textsc{#1}}
+% \newcommand*\cnltx@name@base[1]{#1}
+
+% \pgfkeys{
+% cnltx/.cd,
+% last-name-format/.code = \def\cnltx@name@last##1{#1} ,
+% first-name-format/.code = \def\cnltx@name@first##1{#1} ,
+% name-format/.code = \def\cnltx@name@base##1{#1}
+% }
+
+% \newcommand*\cnltx@name@idx[2]{\index{#1@#2}}
+% \newrobustcmd*\cnltx@name@star[2]{%
+% \ifblank{#1}
+% {\cnltx@name@base{\cnltx@name@last{#2}}}
+% {\cnltx@name@base{\cnltx@name@first{#1} \cnltx@name@last{#2}}}%
+% }
+% \newrobustcmd*\cnltx@name@nostar[2]{%
+% \ifblank{#1}
+% {%
+% \cnltx@name@base{\cnltx@name@last{#2}}%
+% \cnltx@name@idx{#2}{\cnltx@name@base{\cnltx@name@last{#2}}}%
+% }
+% {%
+% \cnltx@name@base{\cnltx@name@first{#1} \cnltx@name@last{#2}}%
+% \cnltx@name@idx{#2, #1}{%
+% \cnltx@name@base{\cnltx@name@last{#2}},
+% \cnltx@name@base{\cnltx@name@first{#1}}%
+% }%
+% }%
+% }
+% \newrobustcmd*\cnltx@name{\@ifstar{\cnltx@name@star}{\cnltx@name@nostar}}
+
+% \newrobustcmd*\cnltx@newname[3]{%
+% \csdef{\cnltx@stripbs#1@short}{%
+% \cnltx@name@base{\cnltx@name@last{#3}}%
+% \cnltx@name@idx{#3, #2}{%
+% \cnltx@name@base{\cnltx@name@last{#3}, \cnltx@name@first{#2}}%
+% }%
+% }%
+% \csdef{\cnltx@stripbs#1@long}{%
+% \cnltx@name@base{\cnltx@name@first{#2} \cnltx@name@last{#3}}%
+% \cnltx@name@idx{#3, #2}{%
+% \cnltx@name@base{\cnltx@name@last{#3}},
+% \cnltx@name@base{\cnltx@name@first{#2}}%
+% }%
+% }%
+% \newrobustcmd*#1{%
+% \@ifstar
+% {\csuse{\cnltx@stripbs#1@short}}
+% {\csuse{\cnltx@stripbs#1@long}}%
+% }%
+% }
+
+% \newrobustcmd*\newname{\cnltx@newname}
+
+% \newrobustcmd*\name{%
+% \@ifstar
+% {\@testopt{\cnltx@name@user*}{}}
+% {\@testopt{\cnltx@name@user{}}{}}%
+% }
+% \def\cnltx@name@user#1[#2]#3{\cnltx@name#1{#2}{#3}}
-\newrobustcmd*\newname{\cnltx@newname}
% --------------------------------------------------------------------------
\PassOptionsToPackage{space=true}{accsupp}
@@ -91,7 +118,10 @@
\AtBeginDocument{%
\@ifpackageloaded{hyperref}
{}
- {\providecommand\texorpdfstring[2]{#1}}%
+ {%
+ \providecommand\nohyperpage[1]{#1}%
+ \providecommand\texorpdfstring[2]{#1}%
+ }%
}
\def\cnltx@acronym@format{\scshape}
@@ -173,26 +203,11 @@
\newcommand*\cnltxlatin[1]{\textit{#1}}
-\DeclareTranslationFallback{cnltx-i.e.}{\cnltxlatin{i.\,e}}
-\DeclareTranslation{English}{cnltx-i.e.}{\cnltxlatin{i.\,e}}
-\DeclareTranslation{German}{cnltx-i.e.}{d.\,h}
-
-\DeclareTranslationFallback{cnltx-e.g.}{\cnltxlatin{e.\,g}}
-\DeclareTranslation{English}{cnltx-e.g.}{\cnltxlatin{e.\,g}}
-\DeclareTranslation{German}{cnltx-e.g.}{z.\,B}
-
-\DeclareTranslationFallback{cnltx-cf.}{\cnltxlatin{cf}}
-\DeclareTranslation{English}{cnltx-cf.}{\cnltxlatin{cf}}
-\DeclareTranslation{German}{cnltx-cf.}{vgl}
-
-\DeclareTranslationFallback{cnltx-etc.}{\cnltxlatin{etc}}
-\DeclareTranslation{English}{cnltx-etc.}{\cnltxlatin{etc}}
-\DeclareTranslation{German}{cnltx-etc.}{etc}
-
\newabbr\ie{\GetTranslation{cnltx-i.e.}}
\newabbr\eg{\GetTranslation{cnltx-e.g.}}
\newabbr\cf{\GetTranslation{cnltx-cf.}}
\newabbr\etc{\GetTranslation{cnltx-etc.}}
+\newabbr\vs{\GetTranslation{cnltx-vs.}}
\newabbr\zB{z.\,B}
\newabbr\ZB{Z.\,B}
@@ -219,4 +234,8 @@ HISTORY:
2013/09/10 v0.2 - first published version
2013/09/30 v0.7 - added abbreviations
2013/11/22 v0.9 - \bzw
+2014/03/11 v0.11 - bug fixes in the \newname definitions
+ - new command \name
+ - use \cnltx@load@module
+2014/??/?? v0.?? - \vs
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-translations.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-translations.sty
new file mode 100644
index 00000000000..53dc2d4ed4a
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-translations.sty
@@ -0,0 +1,128 @@
+% --------------------------------------------------------------------------
+% the CNLTX bundle
+%
+% LaTeX source code and output
+%
+% --------------------------------------------------------------------------
+% Clemens Niederberger
+% Web: https://github.com/cgnieder/cnltx/
+% E-Mail: contact@mychemistry.eu
+% --------------------------------------------------------------------------
+% Copyright 2013-2015 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-base}
+\ProvidesPackage{cnltx-translations}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info]
+
+% --------------------------------------------------------------------------
+\cnltx@create@bundle@message{translations}{Error}
+\cnltx@create@bundle@message{translations}{Warning}
+\cnltx@create@bundle@message{translations}{WarningNoLine}
+\cnltx@create@bundle@message{translations}{Info}
+
+% --------------------------------------------------------------------------
+\RequirePackage{translations}
+
+\DeclareTranslationFallback{cnltx-f.}{f.}
+\DeclareTranslation{English}{cnltx-f.}{f.}
+\DeclareTranslation{German}{cnltx-f.}{f.}
+
+\DeclareTranslationFallback{cnltx-ff.}{ff.}
+\DeclareTranslation{English}{cnltx-ff.}{ff.}
+\DeclareTranslation{German}{cnltx-ff.}{ff.}
+
+\DeclareTranslationFallback{cnltx-package}{package}
+\DeclareTranslation{English}{cnltx-package}{package}
+\DeclareTranslation{German}{cnltx-package}{Paket}
+
+\DeclareTranslationFallback{cnltx-environment}{environment}
+\DeclareTranslation{English}{cnltx-environment}{environment}
+\DeclareTranslation{German}{cnltx-environment}{Umgebung}
+
+\DeclareTranslationFallback{cnltx-class}{class}
+\DeclareTranslation{English}{cnltx-class}{class}
+\DeclareTranslation{German}{cnltx-class}{Klasse}
+
+\DeclareTranslationFallback{cnltx-bundle}{bundle}
+\DeclareTranslation{English}{cnltx-bundle}{bundle}
+\DeclareTranslation{German}{cnltx-bundle}{Bundle}
+
+\DeclareTranslationFallback{cnltx-default}{Default}
+\DeclareTranslation{English}{cnltx-default}{Default}
+\DeclareTranslation{German}{cnltx-default}{Voreinstellung}
+
+\DeclareTranslationFallback{cnltx-required}{required}
+\DeclareTranslation{English}{cnltx-required}{required}
+\DeclareTranslation{German}{cnltx-required}{erforderlich}
+
+\DeclareTranslationFallback{cnltx-empty}{initially empty}
+\DeclareTranslation{English}{cnltx-empty}{initially empty}
+\DeclareTranslation{German}{cnltx-empty}{zun\"achst leer}
+
+\DeclareTranslationFallback{cnltx-toc}{Table of Contents}
+\DeclareTranslation{English}{cnltx-toc}{Table of Contents}
+\DeclareTranslation{German}{cnltx-toc}{Inhaltsverzeichnis}
+
+\DeclareTranslationFallback{cnltx-license}{%
+ Permission is granted to copy, distribute and/or modify this software under
+ the terms of the \LPPL\ (\lppl), version 1.3 or later
+ (\url{http://www.latex-project.org/lppl.txt}). The software has the status%
+}
+\DeclareTranslation{English}{cnltx-license}{%
+ Permission is granted to copy, distribute and/or modify this software under
+ the terms of the \LPPL\ (\lppl), version 1.3 or later
+ (\url{http://www.latex-project.org/lppl.txt}). The software has the status%
+}
+\DeclareTranslation{German}{cnltx-license}{%
+ Es ist erlaubt, diese Software unter den Bedingungen der \LPPL\ (\lppl),
+ Version 1.3 oder sp\"ater, zu kopieren und zu verteilen
+ (\url{http://www.latex-project.org/lppl.txt}). Sie hat den Status%
+}
+
+\DeclareTranslationFallback{cnltx-introduced}{Introduced in version}
+\DeclareTranslation{English}{cnltx-introduced}{Introduced in version}
+\DeclareTranslation{German}{cnltx-introduced}{Eingef\"uhrt in Version}
+
+\DeclareTranslationFallback{cnltx-changed}{Changed in version}
+\DeclareTranslation{English}{cnltx-changed}{Changed in version}
+\DeclareTranslation{German}{cnltx-changed}{Ge\"andert in Version}
+
+\DeclareTranslationFallback{cnltx-i.e.}{\cnltxlatin{i.\,e}}
+\DeclareTranslation{English}{cnltx-i.e.}{\cnltxlatin{i.\,e}}
+\DeclareTranslation{German}{cnltx-i.e.}{d.\,h}
+
+\DeclareTranslationFallback{cnltx-e.g.}{\cnltxlatin{e.\,g}}
+\DeclareTranslation{English}{cnltx-e.g.}{\cnltxlatin{e.\,g}}
+\DeclareTranslation{German}{cnltx-e.g.}{z.\,B}
+
+\DeclareTranslationFallback{cnltx-cf.}{\cnltxlatin{cf}}
+\DeclareTranslation{English}{cnltx-cf.}{\cnltxlatin{cf}}
+\DeclareTranslation{German}{cnltx-cf.}{vgl}
+
+\DeclareTranslationFallback{cnltx-etc.}{\cnltxlatin{etc}}
+\DeclareTranslation{English}{cnltx-etc.}{\cnltxlatin{etc}}
+\DeclareTranslation{German}{cnltx-etc.}{etc}
+
+\DeclareTranslationFallback{cnltx-vs.}{\cnltxlatin{vs}}
+\DeclareTranslation{English}{cnltx-vs.}{\cnltxlatin{vs}}
+\DeclareTranslation{German}{cnltx-vs.}{vs}
+
+% --------------------------------------------------------------------------
+\endinput
+
+2014/03/11 v0.11 - first published version
+2014/??/?? v0.?? - {cnltx-vs.}
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx b/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx
index 0c8099fb0af..1fd4dc2b1bc 100644
--- a/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx
+++ b/Master/texmf-dist/tex/latex/cnltx/cnltx.bbx
@@ -25,11 +25,13 @@
% If you have any ideas, questions, suggestions or bugs to report, please
% feel free to contact me.
% --------------------------------------------------------------------------
-\RequirePackage{cnltx-example}
+\RequirePackage{cnltx-base}
\ProvidesFile{cnltx.bbx}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info]
+\cnltx@load@modules{example,tools,translations}
+
\RequireBibliographyStyle{alphabetic}
-\ExecuteBibliographyOptions{block=ragged}
+\ExecuteBibliographyOptions{block=ragged,useprefix=true}
\DeclareBibliographyDriver{latex}{%
\usebibmacro{bibindex}%
@@ -77,13 +79,22 @@
}%
}
+\renewcommand*{\mkbibnamelast}[1]{\cnltx@write@lastname{#1}}
+\renewcommand*{\mkbibnamefirst}[1]{\cnltx@write@firstname{#1}}
+\renewcommand*{\mkbibnameprefix}[1]{\cnltx@write@lastname{#1}}
+
\DeclareNameAlias[package]{maintainer}{default}
\DeclareNameAlias[class]{maintainer}{default}
\DeclareNameAlias[bundle]{maintainer}{default}
-\DeclareIndexNameAlias[package]{maintainer}{default}
-\DeclareIndexNameAlias[class]{maintainer}{default}
-\DeclareIndexNameAlias[bundle]{maintainer}{default}
+\RequirePackage{translations}
+\DeclareTranslationFallback{cnltx-maintainer}{current maintainer}
+\DeclareTranslation{English}{cnltx-maintainer}{current maintainer}
+\DeclareTranslation{German}{cnltx-maintainer}{aktueller Maintainer}
+
+\DeclareTranslationFallback{cnltx-maintainers}{current maintainers}
+\DeclareTranslation{English}{cnltx-maintainers}{current maintainers}
+\DeclareTranslation{German}{cnltx-maintainers}{aktuelle Maintainer}
\DeclareFieldFormat[package]{title}{\pkg*{#1}}
\DeclareFieldFormat[class]{title}{\cls*{#1}}
@@ -121,6 +132,46 @@
{\bndidx{#1}}%
}
+\def\cnltx@onlyonefirstname#1\bibnamedelima#2\q@stop{#1}
+
+\DeclareIndexNameFormat{cnltx}{%
+ \cnltx@if@in{#3}{\bibnamedelima}
+ {%
+ \usebibmacro{index:entry}{\index}{%
+ \ifblank{#5}{}{#5 }%
+ \@firstofone#1%
+ \ifblank{#3}{}{, \cnltx@onlyonefirstname#3\q@stop}%
+ \actualoperator
+ \ifblank{#5}
+ {\cnltx@write@lastname{#1}}
+ {\cnltx@write@lastname{#5 #1}}%
+ \ifblank{#3}{}{, \cnltx@write@firstname{\cnltx@onlyonefirstname#3\q@stop}}%
+ }%
+ }
+ {%
+ \usebibmacro{index:entry}{\index}{%
+ \ifblank{#5}{}{#5 }%
+ \@firstofone#1%
+ \ifblank{#3}{}{, #3}%
+ \actualoperator
+ \ifblank{#5}
+ {\cnltx@write@lastname{#1}}
+ {\cnltx@write@lastname{#5 #1}}%
+ \ifblank{#3}{}{, \cnltx@write@firstname{#3}}%
+ }%
+ }%
+}
+
+\DeclareIndexNameAlias{labelname}{cnltx}
+\DeclareIndexNameAlias{author}{cnltx}
+\DeclareIndexNameAlias{maintainer}{cnltx}
+\DeclareIndexNameAlias{labelname}{cnltx}
+\DeclareIndexNameAlias{author}{cnltx}
+\DeclareIndexNameAlias{maintainer}{cnltx}
+\DeclareIndexNameAlias{labelname}{cnltx}
+\DeclareIndexNameAlias{author}{cnltx}
+\DeclareIndexNameAlias{maintainer}{cnltx}
+
\DeclareFieldFormat[package]{subtitle}{\mkbibemph{#1}}
\DeclareFieldFormat[class]{subtitle}{\mkbibemph{#1}}
\DeclareFieldFormat[bundle]{subtitle}{\mkbibemph{#1}}
@@ -143,8 +194,12 @@
\endinput
HISTORY:
-2013/09/14 v0.4 - first version added to the bundle
-2013/10/04 v0.7a - added drivers `@class' and `@bundle'
-2013/11/22 v0.9 - made independent from the `cnltx-doc' class
-
+2013/09/14 v0.4 - first version added to the bundle
+2013/10/04 v0.7a - added drivers `@class' and `@bundle'
+2013/11/22 v0.9 - made independent from the `cnltx-doc' class
+2014/03/11 v0.11 - change name format so that names are printed according to
+ the format of the \newname commands from the `tools'
+ module;
+ this is going to need tests if it really is consistent
+ for different types of name formats (prefixes, affixes...)
diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx.sty
index 08ed2e80541..298ba37b749 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-2014 Clemens Niederberger
+% Copyright 2013-2015 Clemens Niederberger
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
@@ -28,19 +28,19 @@
\RequirePackage{cnltx-base}
\ProvidesPackage{cnltx}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info]
-\newcommand*\cnltx@register@module[1]{%
- \DeclareOption{#1}{\AtEndOfPackage{\RequirePackage{cnltx-#1}}}%
-}
-
\cnltx@register@module{listings}
\cnltx@register@module{example}
+\cnltx@register@module{names}
\cnltx@register@module{tools}
+\cnltx@register@module{translations}
\ProcessOptions*
\endinput
HISTORY:
-2013/11/22 v0.9 - first added to the bundle
-
+2013/11/22 v0.9 - first added to the bundle
+2014/03/11 v0.11 - use \cnltx@load@module
+2015/01/11 v0.12 - move definition of \cnltx@register@module in base module
+ - add `names' module