diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/cfr-lm/cfr-lm.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/cfr-lm/cfr-lm.sty | 449 |
1 files changed, 239 insertions, 210 deletions
diff --git a/Master/texmf-dist/tex/latex/cfr-lm/cfr-lm.sty b/Master/texmf-dist/tex/latex/cfr-lm/cfr-lm.sty index db98421f720..f4b718e9d45 100644 --- a/Master/texmf-dist/tex/latex/cfr-lm/cfr-lm.sty +++ b/Master/texmf-dist/tex/latex/cfr-lm/cfr-lm.sty @@ -1,182 +1,217 @@ -%% Copyright 2015 Clea F. Rees -% -% 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 Clea F. Rees. -% -% This work consists of all files listed in manifest.txt. -% -% Parts of this file are based on lmodern.sty which is included with -% the Latin Modern fonts released by GUST and available from -% http://www.gust.org.pl/projects/e-foundry/latin-modern. -% -% Improvements to this file in v1.2 (unpublished) and v1.3 owe almost -% everything to Enrico Gregorio. -% -% v1.4 adds family-specific support for microtype. This draws also on the -% documentation for the microtype package and MinionPro.sty. MinionPro.sty -% is available as part of the minionpro package and can be obtain from -% http://mirror.ctan.org/fonts/minionpro. MinionPro.sty is in the public -% domain. The documentation for microtype is available in English and German -% from http://ctan.org/pkg/microtype. It is part of the microtype package which -% is itself licensed under the LPPL. -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{cfr-lm}[2015/02/01 v1.5 cfr-lm for use with LatinModern v2.004] -\RequirePackage{xkeyval} -\RequirePackage[T1]{fontenc} -\RequirePackage{textcomp} -\RequirePackage{nfssext-cfr} - -%:boolkeys for roman osf/lf -\define@boolkey[cfrlm]{rm}{oldstyle}[true]{% - \ifcfrlm@rm@oldstyle - \def\cfrlm@rmol{j}% - \else - \def\cfrlm@rmol{}% - \fi} -\define@boolkey[cfrlm]{rm}{lining}[true]{% - \ifcfrlm@rm@lining - \def\cfrlm@rmol{}% - \else - \def\cfrlm@rmol{j}% - \fi} - -%:boolkeys for roman prop/tab figures -\define@boolkey[cfrlm]{rm}{proportional}[true]{% - \ifcfrlm@rm@proportional - \def\cfrlm@rmpt{2}% - \else - \def\cfrlm@rmpt{}% - \fi} -\define@boolkey[cfrlm]{rm}{tabular}[true]{% - \ifcfrlm@rm@tabular - \def\cfrlm@rmpt{}% - \else - \def\cfrlm@rmpt{2}% - \fi} - -%:boolkeys for sans osf/lf -\define@boolkey[cfrlm]{sf}{oldstyle}[true]{% - \ifcfrlm@sf@oldstyle - \def\cfrlm@sfol{j}% - \else - \def\cfrlm@sfol{}% - \fi} -\define@boolkey[cfrlm]{sf}{lining}[true]{% - \ifcfrlm@sf@lining - \def\cfrlm@sfol{}% - \else - \def\cfrlm@sfol{j}% - \fi} - -%:boolkeys for sans prop/tab figures -\define@boolkey[cfrlm]{sf}{proportional}[true]{% - \ifcfrlm@sf@proportional - \def\cfrlm@sfpt{2}% - \else - \def\cfrlm@sfpt{}% - \fi} -\define@boolkey[cfrlm]{sf}{tabular}[true]{% - \ifcfrlm@sf@tabular - \def\cfrlm@sfpt{}% - \else - \def\cfrlm@sfpt{2}% - \fi} - -%:boolkeys for typewriter osf/lf -\define@boolkey[cfrlm]{tt}{oldstyle}[true]{% - \ifcfrlm@tt@oldstyle - \def\cfrlm@ttol{j}% - \else - \def\cfrlm@ttol{}% - \fi} -\define@boolkey[cfrlm]{tt}{lining}[true]{% - \ifcfrlm@tt@lining - \def\cfrlm@ttol{}% - \else - \def\cfrlm@ttol{j}% - \fi} - -%:boolkeys for typewriter prop/tab figures -\define@boolkey[cfrlm]{tt}{proportional}[true]{% - \ifcfrlm@tt@proportional - \def\cfrlm@ttpt{2}% - \else - \def\cfrlm@ttpt{}% - \fi} -\define@boolkey[cfrlm]{tt}{tabular}[true]{% - \ifcfrlm@tt@tabular - \def\cfrlm@ttpt{}% - \else - \def\cfrlm@ttpt{2}% - \fi} - -%:boolkeys for typewriter mono/variable width -\define@boolkey[cfrlm]{tt}{monowidth}[true]{% - \ifcfrlm@tt@monowidth - \def\cfrlm@ttmv{t}% - \else - \def\cfrlm@ttmv{v}% - \fi} -\define@boolkey[cfrlm]{tt}{variable}[true]{% - \ifcfrlm@tt@variable - \def\cfrlm@ttmv{v}% - \else - \def\cfrlm@ttmv{t}% - \fi} - -%:options for roman -\define@key{cfr-lm.sty}{rm}{% - \setkeys[cfrlm]{rm}{#1}} - -%:options for sans -\define@key{cfr-lm.sty}{sf}{% - \setkeys[cfrlm]{sf}{#1}} - -%:options for typewriter -\define@key{cfr-lm.sty}{tt}{% - \setkeys[cfrlm]{tt}{#1}} +%% +%% This is file `cfr-lm.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% cfr-lm.dtx (with options: `sty') +%% Copyright (C) 2008-2024 Clea F. Rees. +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% of this license or (at your option) any later version. +%% The latest version of this license is in +%% https://www.latex-project.org/lppl.txt +%% and version 1.3c or later is part of all distributions of LaTeX +%% version 2008-05-04 or later. +%% +%% This work has the LPPL maintenance status `maintained'. +%% +%% The Current Maintainer of this work is Clea F. Rees. +%% +%% This file may only be distributed together with a copy of the package +%% cfr-lm. You may however distribute the package cfr-lm without +%% such generated files. +%% +%% This work consists of all files listed in manifest.txt. +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%:note that this option does nothing unless \qtfont is defined appropriately -\define@boolkey{cfr-lm.sty}[cfrlm@]{qt}[true]{% - \relax} -%:defaults to ensure everything is defined to something -\ExecuteOptionsX{rm={oldstyle,proportional},sf={oldstyle,proportional},tt={oldstyle,proportional,variable},qt=false} -%\ExecuteOptionsX{rm={lining,tabular},sf={oldstyle,proportional},tt={oldstyle,proportional,variable},qt=false} -%:options override defaults -\ProcessOptionsX - -%:make LM default for all families, implementing options for each -\renewcommand{\rmdefault}{clm\cfrlm@rmpt\cfrlm@rmol} -\renewcommand{\sfdefault}{clm\cfrlm@sfpt\cfrlm@sfol s} -\renewcommand{\ttdefault}{clm\cfrlm@ttpt\cfrlm@ttol\cfrlm@ttmv} - -%:handle the qt option, failing gracefully if somebody has enabled the option without defining \qtfont appropriately -\ifcfrlm@qt - \@ifundefined{qtfont}{% - \PackageWarning{cfr-lm}{Option 'qt' cannot be implemented unless\MessageBreak - the command qtfont is defined appropriately. This is not\MessageBreak - done automatically to maximise compatibility with other\MessageBreak - classes and packages. The suggested use is to have qtfont\MessageBreak - redefine a command such as quotefont which is initially\MessageBreak - set to some reasonable default and is then used in the\MessageBreak - definition of the quote and/or quotation environments.\MessageBreak - Since these are class and package dependent, it cannot\MessageBreak - be done by a font package and the option is ignored here.}}{% - \qtfont{\qtstyle}} -\fi - -%:based on lmodern.sty +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{svn-prov} +\ProvidesPackageSVN[\filebase.sty]{$Id: cfr-lm.dtx 10371 2024-09-20 15:51:48Z cfrees $}[v1.7 \revinfo][Extended support for Latin Modern 2.004] +\DefineFileInfoSVN[clm] +\RequirePackage[T1]{fontenc} +\RequirePackage{nfssext-cfr}[2024/01/01] +\IfFormatAtLeastTF {2020-02-02}{% + \DeclareEncodingSubset{TS1}{clm}{1}% + \DeclareEncodingSubset{TS1}{clm2}{1}% + \DeclareEncodingSubset{TS1}{clm2d}{1}% + \DeclareEncodingSubset{TS1}{clm2dj}{1}% + \DeclareEncodingSubset{TS1}{clm2j}{1}% + \DeclareEncodingSubset{TS1}{clm2jqs}{1}% + \DeclareEncodingSubset{TS1}{clm2js}{1}% + \DeclareEncodingSubset{TS1}{clm2jt}{1}% + \DeclareEncodingSubset{TS1}{clm2jv}{1}% + \DeclareEncodingSubset{TS1}{clm2qs}{1}% + \DeclareEncodingSubset{TS1}{clm2s}{1}% + \DeclareEncodingSubset{TS1}{clm2t}{1}% + \DeclareEncodingSubset{TS1}{clm2v}{1}% + \DeclareEncodingSubset{TS1}{clmd}{1}% + \DeclareEncodingSubset{TS1}{clmdj}{1}% + \DeclareEncodingSubset{TS1}{clmj}{1}% + \DeclareEncodingSubset{TS1}{clmjqs}{1}% + \DeclareEncodingSubset{TS1}{clmjs}{1}% + \DeclareEncodingSubset{TS1}{clmjt}{1}% + \DeclareEncodingSubset{TS1}{clmjv}{1}% + \DeclareEncodingSubset{TS1}{clmqs}{1}% + \DeclareEncodingSubset{TS1}{clms}{1}% + \DeclareEncodingSubset{TS1}{clmt}{1}% + \DeclareEncodingSubset{TS1}{clmv}{1}% +}{% + \RequirePackage{textcomp}} +\UndeclareTextCommand{\textperthousand}{T1} +\ExplSyntaxOn +%% +\bool_new:N \l__clm_rm_osf_bool +\bool_new:N \l__clm_rm_prop_bool +\bool_new:N \l__clm_sf_osf_bool +\bool_new:N \l__clm_sf_prop_bool +\bool_new:N \l__clm_tt_osf_bool +\bool_new:N \l__clm_tt_prop_bool +\bool_new:N \l__clm_tt_mono_bool +\bool_new:N \l__clm_qt_bool +\keys_define:nn { clm } +{ + rm / oldstyle .bool_set:N = \l__clm_rm_osf_bool, + rm / oldstyle .default:n = true, + rm / oldstyle .initial:n = true, + rm / osf .bool_set:N = \l__clm_rm_osf_bool, + rm / osf .default:n = true, + rm / lining .bool_set_inverse:N = \l__clm_rm_osf_bool, + rm / lining .default:n = true, + rm / lf .bool_set_inverse:N = \l__clm_rm_osf_bool, + rm / lf .default:n = true, + rm / proportional .bool_set:N = \l__clm_rm_prop_bool, + rm / proportional .default:n = true, + rm / proportional .initial:n = true, + rm / prop .bool_set:N = \l__clm_rm_prop_bool, + rm / prop .default:n = true, + rm / tabular .bool_set_inverse:N = \l__clm_rm_prop_bool, + rm / tabular .default:n = true, + rm / tab .bool_set_inverse:N = \l__clm_rm_prop_bool, + rm / tab .default:n = true, + sf / oldstyle .bool_set:N = \l__clm_sf_osf_bool, + sf / oldstyle .default:n = true, + sf / oldstyle .initial:n = true, + sf / osf .bool_set:N = \l__clm_sf_osf_bool, + sf / osf .default:n = true, + sf / lining .bool_set_inverse:N = \l__clm_sf_osf_bool, + sf / lining .default:n = true, + sf / lf .bool_set_inverse:N = \l__clm_sf_osf_bool, + sf / lf .default:n = true, + sf / proportional .bool_set:N = \l__clm_sf_prop_bool, + sf / proportional .default:n = true, + sf / proportional .initial:n = true, + sf / prop .bool_set:N = \l__clm_sf_prop_bool, + sf / prop .default:n = true, + sf / tabular .bool_set_inverse:N = \l__clm_sf_prop_bool, + sf / tabular .default:n = true, + sf / tab .bool_set_inverse:N = \l__clm_sf_prop_bool, + sf / tab .default:n = true, + tt / oldstyle .bool_set:N = \l__clm_tt_osf_bool, + tt / oldstyle .default:n = true, + tt / oldstyle .initial:n = true, + tt / osf .bool_set:N = \l__clm_tt_osf_bool, + tt / osf .default:n = true, + tt / lining .bool_set_inverse:N = \l__clm_tt_osf_bool, + tt / lining .default:n = true, + tt / lf .bool_set_inverse:N = \l__clm_tt_osf_bool, + tt / lf .default:n = true, + tt / proportional .bool_set:N = \l__clm_tt_prop_bool, + tt / proportional .default:n = true, + tt / proportional .initial:n = true, + tt / prop .bool_set:N = \l__clm_tt_prop_bool, + tt / prop .default:n = true, + tt / tabular .bool_set_inverse:N = \l__clm_tt_prop_bool, + tt / tabular .default:n = true, + tt / tab .bool_set_inverse:N = \l__clm_tt_prop_bool, + tt / tab .default:n = true, + tt / monowidth .bool_set:N = \l__clm_tt_mono_bool, + tt / monowidth .default:n = true, + tt / monowidth .initial:n = false, + tt / mono .bool_set:N = \l__clm_tt_mono_bool, + tt / mono .default:n = true, + tt / variable .bool_set_inverse:N = \l__clm_tt_mono_bool, + tt / variable .default:n = true, + tt / var .bool_set_inverse:N = \l__clm_tt_mono_bool, + tt / var .default:n = true, + rm .code:n ={ + \keys_set:nn { clm / rm } { #1 } + }, + rm .value_required:n = true, + rm .usage:n = load, + sf .code:n ={ + \keys_set:nn { clm / sf } { #1 } + }, + sf .value_required:n = true, + sf .usage:n = load, + tt .code:n ={ + \keys_set:nn { clm / tt } { #1 } + }, + tt .value_required:n = true, + tt .usage:n = load, + qt .bool_set:N = \l__clm_qt_bool, + qt .default:n = true, + qt .initial:n = false, + qt .usage:n = load, +} +\providecommand \IfFormatAtLeastTF { \@ifl@t@r \fmtversion } +\IfFormatAtLeastTF { 2022-06-01 } +{ + \ProcessKeyOptions [ clm ] +}{ + \RequirePackage { l3keys2e } + \ProcessKeysOptions { clm } +} +\IfFormatAtLeastTF { 2020-10-01 }{ +}{ + \RequirePackage { xparse } + \providecommand \ExpandArgs [1] + { \cs_if_exist_use:c { exp_args:N #1 } } +} +\tl_gset:Ne \rmdefault +{ + clm \bool_if:NT \l__clm_rm_prop_bool { 2 } + \bool_if:NT \l__clm_rm_osf_bool { j } +} +\tl_gset:Ne \sfdefault +{ + clm \bool_if:NT \l__clm_sf_prop_bool { 2 } + \bool_if:NT \l__clm_sf_osf_bool { j } s +} +\tl_gset:Ne \ttdefault +{ + clm \bool_if:NT \l__clm_tt_prop_bool { 2 } + \bool_if:NT \l__clm_tt_osf_bool { j } + \bool_if:NTF \l__clm_tt_mono_bool { t } { v } +} +\hook_gput_code:nnn { begindocument } { . } +{ + \bool_if:NT \l__clm_qt_bool + { + \cs_if_exist:NTF { \qtfont } + { + \qtfont{\qtstyle} + }{ + \PackageWarning{cfr-lm} + { + Option ~ 'qt' ~ cannot ~ be ~ implemented ~ unless \MessageBreak + '\backslash qtfont' ~ is ~ defined ~ appropriately. ~ This ~ is ~ not \MessageBreak + done ~ automatically ~ to ~ maximise ~ compatibility ~ with ~ other \MessageBreak + classes ~ and ~ packages. ~ The ~ suggested ~ use ~ is ~ to ~ have ~ '\backslash qtfont' \MessageBreak + redefine ~ a command ~ such ~ as ~ '\backslash quotefont' ~ which ~ is ~ initially \MessageBreak + set ~ to ~ some ~ reasonable ~ default ~ and ~ used ~ in ~ the \MessageBreak + definition ~ of ~ the ~ quote ~ and/or ~ quotation ~ environments. \MessageBreak + A ~ font ~ package ~ has ~ no ~ business ~ meddling ~ in ~ such \MessageBreak + things ~ so ~ I'm ~ going ~ to ~ ignore ~ this ~ option + } + } + } +} +\ExplSyntaxOff \SetSymbolFont{operators} {normal}{OT1}{lmr} {m}{n} \SetSymbolFont{letters} {normal}{OML}{lmm} {m}{it} \SetSymbolFont{symbols} {normal}{OMS}{lmsy}{m}{n} @@ -185,12 +220,10 @@ \SetSymbolFont{letters} {bold} {OML}{lmm} {b}{it} \SetSymbolFont{symbols} {bold} {OMS}{lmsy}{b}{n} \SetSymbolFont{largesymbols}{bold} {OMX}{lmex}{m}{n} - \DeclareFontSubstitution{OT1}{lmr}{m}{n} \DeclareFontSubstitution{OML}{lmm}{m}{it} \DeclareFontSubstitution{OMS}{lmsy}{m}{n} \DeclareFontSubstitution{OMX}{lmex}{m}{n} - \SetMathAlphabet{\mathbf}{normal}{OT1}{lmr}{bx}{n} \SetMathAlphabet{\mathsf}{normal}{OT1}{lmss}{m}{n} \SetMathAlphabet{\mathit}{normal}{OT1}{lmr}{m}{it} @@ -199,44 +232,40 @@ \SetMathAlphabet{\mathsf}{bold} {OT1}{lmss}{bx}{n} \SetMathAlphabet{\mathit}{bold} {OT1}{lmr}{bx}{it} \SetMathAlphabet{\mathtt}{bold} {OT1}{lmtt}{m}{n} - \def\mathsterling{\mathit{\mathchar"70BF}} - -%:new in v1.1 \DeclareRobustCommand{\dotdigitenc}{% \not@math@alphabet\dotdigitenc\relax \fontencoding{U}\selectfont} \DeclareTextFontCommand{\textdde}{\dotdigitenc} \newcommand*{\zeroslash}{\textdde{\char 250}} - -%:Partly from microtype docs; partly from MinionPro package -% -% We need to set up aliases for the font families created by cfr-lm so that -% microtype recognises them as similar to Computer Modern Roman. -% -% T1 families in cfr-lm: clm clm2 clm2d clm2dj clm2j clm2jqs clm2js clm2jt -% clm2jv clm2qs clm2s clm2t clm2v clmd clmdj clmj clmjqs clmjs clmjt clmjv -% clmqs clms clmt clmv -% -% See variants set in nfssext-cfr -% -% Ref: http://tex.stackexchange.com/a/75440/39222 -\newcommand{\cfr@ffs}{% alias to cmr - clm,clm2,clm2j,clmj,% roman - clms,clm2js,clm2s,clmjs,% sans - clmqs,clm2jqs,clm2qs,clmjqs% -% clm2d,clm2dj,clmd,clmdj,% leave unaliased? -% clm2jv,clmjv,clm2v,clmv,% leave unaliased? -% clmt,clm2t,clmjt,clm2jt% leave unaliased? +\ExplSyntaxOn +\cs_new_nopar:Nn \__clm_microtype_hook: +{ + \clist_map_inline:nn + { + clm,clm2,clm2j,clmj,% roman + clms,clm2js,clm2s,clmjs,% sans + clmqs,clm2jqs,clm2qs,clmjqs% + % clm2d,clm2dj,clmd,clmdj,% leave unaliased? + % clm2jv,clmjv,clm2v,clmv,% leave unaliased? + % clmt,clm2t,clmjt,clm2jt% leave unaliased? + }{ + \DeclareMicrotypeAlias { ##1 } { cmr } } -\gdef\cfrlm@MicroType@Aliases{% - \@for \xx:=\cfr@ffs \do {% - \DeclareMicrotypeAlias{\xx}{cmr}}% +} +\@ifpackageloaded{microtype} +{ + \__clm_microtype_hook: +}{ + \cs_if_free:cTF { Microtype@Hook } + {% MinionPro has \global before this + \cs_new_eq:NN \Microtype@Hook \__clm_microtype_hook: + }{ + \g@addto@macro\Microtype@Hook{\__clm_microtype_hook:} } -\def\cfrlm@MT@Hook{\cfrlm@MicroType@Aliases} -\@ifpackageloaded{microtype}{% - \cfrlm@MT@Hook}{% - \@ifundefined{Microtype@Hook}{% - \let\Microtype@Hook\cfrlm@MT@Hook}{% MinionPro has \global before this - \g@addto@macro\Microtype@Hook{\cfrlm@MT@Hook}}} +} +\ExplSyntaxOff +%% end cfr-lm.sty \endinput +%% +%% End of file `cfr-lm.sty'. |