From dff6d5d76d6ad664ee2dced8151b59ec3c0ac021 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 25 Oct 2013 21:58:13 +0000 Subject: cnltx (25oct13) git-svn-id: svn://tug.org/texlive/trunk@31996 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty | 37 +++++- Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls | 128 +++++++++++++++------ .../texmf-dist/tex/latex/cnltx/cnltx-listings.sty | 21 +--- 3 files changed, 134 insertions(+), 52 deletions(-) (limited to 'Master/texmf-dist/tex/latex/cnltx') diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty index 1d648e44de7..441a155d42d 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-base.sty @@ -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/10/04} -\def\cnltx@@version{v0.7a} +\def\cnltx@@date{2013/10/24} +\def\cnltx@@version{v0.8} \def\cnltx@@info{LaTeX tools and documenting facilities (CN)} \ProvidesPackage{cnltx-base}[\cnltx@@date\space \cnltx@@version\space \cnltx@@info] \RequirePackage{pgfopts,etoolbox,ltxcmds} @@ -149,6 +149,38 @@ \iftest{\if!\ifnum9<1#1!\else_\fi}% } +% ``\@ifnextchars'' +% list parser with no separator: +\DeclareListParser*\cnltx@add@tokens{} + +% the list that holds the tokens to be checked: +\def\cnltx@tokens@list{} + +% set the tokens list (the parser does not like blank lists): +\newrobustcmd*\cnltx@set@tokens[1]{% + \def\cnltx@tokens@list{}% + \ifblank{#1} + {} + {\cnltx@add@tokens{\listadd\cnltx@tokens@list}{#1}}% +} + +% check for token but leave it where it is: +\newrobustcmd\cnltx@ifnextchars[3]{% + \cnltx@set@tokens{#1}% + \ltx@ifnextchar{ } + {\cnltx@ifnextchars@aux{#2}{#3}{}} + {\cnltx@ifnextchars@aux{#2}{#3}}% +} + +\newrobustcmd\cnltx@ifnextchars@aux[3]{% + \ifblank{#3}{#2}{% + \ifinlist{#3}{\cnltx@tokens@list} + {#1} + {#2}% + }% + #3% +} + % -------------------------------------------------------------------------- % expansion helper % \cnltx@expandargs() @@ -711,3 +743,4 @@ HISTORY: - generalized expansion helpers (by copying expl3's \exp_arg:N idea) - \iftest and \nottest +2013/10/21 v0.8 - \cnltx@ifnextchars diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls b/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls index 82a826a11da..1354737e9da 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-doc.cls @@ -37,6 +37,8 @@ \newbool{cnltx@load@preamble} \newbool{cnltx@add@index} \newbool{cnltx@add@bib} +\newbool{cnltx@load@fonts} +\newbool{cnltx@microtype} \newcommand*\cnltx@scrartcl@options{} \newcommand*\cnltx@babel@options{english} @@ -44,12 +46,23 @@ \pgfkeys{ cnltx-doc/.cd, - scrartcl/.code = \PassOptionsToClass{#1}{scrartcl} , - load-preamble/.is if = cnltx@load@preamble , - add-index/.is if = cnltx@add@index , - add-bib/.is if = cnltx@add@bib , - load-preamble+/.code = + scrartcl/.code = \PassOptionsToClass{#1}{scrartcl} , + load-preamble--/.is if = cnltx@load@preamble , + load-fonts/.is if = cnltx@load@fonts , + load-microtype/.is if = cnltx@microtype , + load-preamble-/.code = \booltrue{cnltx@load@preamble} + \booltrue{cnltx@microtype} , + load-preamble/.code = + \booltrue{cnltx@load@preamble} + \booltrue{cnltx@load@fonts} + \booltrue{cnltx@microtype} , + add-index/.is if = cnltx@add@index , + add-bib/.is if = cnltx@add@bib , + load-preamble+/.code = + \booltrue{cnltx@load@preamble} + \booltrue{cnltx@load@fonts} + \booltrue{cnltx@microtype} \booltrue{cnltx@add@index} \booltrue{cnltx@add@bib} , babel-options/.code = \def\cnltx@babel@options{#1} @@ -94,49 +107,82 @@ \ifbool{cnltx@load@preamble}{ \RequirePackage{ifxetex,ifluatex} - \ifboolexpr{not bool{xetex} and not bool{luatex}} - {\RequirePackage[T1]{fontenc}} - {\RequirePackage{fontspec}} - \RequirePackage[oldstyle]{libertine} - \RequirePackage{libertinehologopatch} - \RequirePackage[supstfm=libertinesups]{superiors} - % libertine does not have superior letters: - \def\@makefnmark{% - \hbox{% - \cnltx@ifisnum{\@thefnmark} - {\textsu{\hspace*{\superiors@spaced}\@thefnmark}} - {\@textsuperscript{\normalfont\@thefnmark}}% - }% - } - \RequirePackage{microtype} - \ifboolexpr + \ifbool{cnltx@load@fonts} { - test {\ifcsdef{MT@pr@set@@romansans}} and - test {\ifcsdef{MT@ex@set@@romansans}} + \ifboolexpr{not bool{xetex} and not bool{luatex}} + {\RequirePackage[T1]{fontenc}} + {\RequirePackage{fontspec}} + \RequirePackage[oldstyle]{libertine} + \RequirePackage{libertinehologopatch} + \RequirePackage[supstfm=libertinesups]{superiors} + % libertine does not have superior letters: + \def\@makefnmark{% + \hbox{% + \cnltx@ifisnum{\@thefnmark} + {\textsu{\hspace*{\superiors@spaced}\@thefnmark}} + {\@textsuperscript{\normalfont\@thefnmark}}% + }% + } } {} + \ifbool{cnltx@microtype} + {\RequirePackage{microtype}} + {} + \ifboolexpr + { + bool {cnltx@microtype} and + not test {\ifcsdef{MT@pr@set@@romansans}} and + not test {\ifcsdef{MT@ex@set@@romansans}} and + bool {cnltx@load@fonts} + } { \DeclareMicrotypeSet{romansans}{ encoding = {*}, family = {rm*,sf*} } } - \ifcsdef{MT@tr@set@@scshape} {} + \ifboolexpr + { + bool {cnltx@microtype} and + not test {\ifcsdef{MT@tr@set@@scshape}} and + bool {cnltx@load@fonts} + } { \DeclareMicrotypeSet[tracking]{scshape}{ encoding = {*} , shape = {sc,scit,si} } } - \microtypesetup{ - tracking = scshape , - protrusion = romansans , - expansion = romansans - } - \ifboolexpr{not bool{xetex} and not bool{luatex}} - {\RequirePackage[scaled=.81]{beramono}} - {\setmonofont[Scale=MatchLowercase]{Bitstream Vera Sans Mono}} + {} + \ifboolexpr + { + not bool {xetex} and + bool {cnltx@load@fonts} and + bool {cnltx@microtype} + } + { + \microtypesetup{ + tracking = scshape , + protrusion = romansans , + expansion = romansans + } + \DisableLigatures{ family = tt* } + } + {} + \ifbool{cnltx@load@fonts} + { + \ifboolexpr{not bool{xetex} and not bool{luatex}} + {\RequirePackage[scaled=.81]{beramono}} + { + \setmonofont[ + Scale = MatchLowercase , + Ligatures = {NoCommon,NoRequired,NoContextual} + ]{Bitstream Vera Sans Mono} + } + \recalctypearea + } + {} \RequirePackage{fnpct} \expandafter\RequirePackage\expandafter[\cnltx@babel@options]{babel} \renewcommand*\othersectionlevelsformat[3]{% @@ -576,6 +622,19 @@ expandable-sign/.code = \def\expandablesign{#1} } +\newrobustcmd*\visualizespaces{% + \begingroup + \obeyspaces + \begingroup\lccode`~=`\ % + \lowercase{\endgroup\let~}\visiblespace + \cnltx@visualizespaces@aux} +\newrobustcmd\cnltx@visualizespaces@aux[1]{% + \edef\cnltx@x{#1}\scantokens\expandafter{\cnltx@x\noexpand}% + \endgroup +} +\newcommand*\visiblespace{\allowbreak\textvisiblespace\allowbreak} + + % -------------------------------------------------------------------------- % modules: \newcommand*\cnltx@module@sep{\,>>\,} @@ -897,6 +956,11 @@ HISTORY: 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 % -------------------------------------------------------------------------- TODO: diff --git a/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty b/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty index 14f27e7da55..5c7a552ecf3 100644 --- a/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty +++ b/Master/texmf-dist/tex/latex/cnltx/cnltx-listings.sty @@ -342,7 +342,6 @@ arcsin, arctan, arg, - array, arraycolsep, arrayrulewidth, arraystretch, @@ -456,7 +455,6 @@ cdot, cdotp, cdots, - center, centering, centerline, chapter, @@ -602,7 +600,6 @@ displayindent, displaylimits, displaylines, - displaymath, displaystyle, displaywidowpenalty, displaywidth, @@ -610,7 +607,6 @@ divide, dj,DJ, do, - document, documentclass, documentstyle, dospecials, @@ -636,16 +632,7 @@ emph, empty, emptyset, - endarray, - endcenter, endcsname, - enddisplaymath, - enddocument, - endenumerate, - endeqnarray, - endequation, - endflushleft, - endflushright, endgraf, endgroup, endinput, @@ -668,11 +655,9 @@ enskip, enspace, ensuremath, - enumerate, epsilon, eqalign, eqalignno, - eqnarray, eqno, equation, equiv, @@ -717,8 +702,6 @@ floatpagefraction, floatsep, flushbottom, - flushleft, - flushright, fmtname, fmtversion, fnsymbol, @@ -1341,6 +1324,7 @@ rceil, Re, read, + recalctypearea, ref, refstepcounter, relax, @@ -1766,7 +1750,7 @@ xdef, xdefinecolor, XeLaTeX, - XeTeX + XeTeX, xi, Xi, xleaders, @@ -1943,5 +1927,6 @@ HISTORY: 2013/10/04 v0.7a - the \listbib... commands remove duplicate entries from the list if they're equal both in entry type and cite key - added drivers `@class' and `@bundle' +2013/10/21 v0.8 - added missing comma in list of commands TODO: -- cgit v1.2.3