summaryrefslogtreecommitdiff
path: root/fonts/xcharter/tex/XCharter.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-09-03 03:01:08 +0000
committerNorbert Preining <norbert@preining.info>2021-09-03 03:01:08 +0000
commit3350516623348f356456f21cfc0694f36e94aeaf (patch)
tree85d5b984421bf8c0113be1609e711565363bc548 /fonts/xcharter/tex/XCharter.sty
parenta16eced7ce206f6c49ce7fe3cb15235d019f7a4a (diff)
CTAN sync 202109030301
Diffstat (limited to 'fonts/xcharter/tex/XCharter.sty')
-rw-r--r--fonts/xcharter/tex/XCharter.sty50
1 files changed, 46 insertions, 4 deletions
diff --git a/fonts/xcharter/tex/XCharter.sty b/fonts/xcharter/tex/XCharter.sty
index 72240550fc..1eea759aa7 100644
--- a/fonts/xcharter/tex/XCharter.sty
+++ b/fonts/xcharter/tex/XCharter.sty
@@ -3,8 +3,8 @@
%%
\NeedsTeXFormat{LaTeX2e}
-\def\fileversion{1.213}
-\def\filedate{2020/11/25}
+\def\fileversion{1.222}
+\def\filedate{2021/09/01}
\ProvidesPackage{XCharter}[\filedate\space v\fileversion]
@@ -30,8 +30,8 @@
\fa@naming@exception{figures}{{inferior}{tabular}}{Inf}
\def\infigures{\@nomath\infigures
\fontfigurestyle{inferior}\selectfont}
- \DeclareTextFontCommand{\textin}{\infigures}
- \let\textinferior\textin
+ \DeclareTextFontCommand{\textinf}{\infigures}
+ \let\textinferior\textinf
\fa@naming@exception{figures}{{numerators}{proportional}}{Numr}
\fa@naming@exception{figures}{{numerators}{tabular}}{Numr}
@@ -87,6 +87,7 @@
\fontfamily{XCharter-TOsF}\selectfont }
\def\textlf#1{{\lfstyle #1}}
%\def\textosf#1{{\osfstyle #1}}
+\edef\XCh@dfltfigurestyle{TLF}
\newcommand*{\XCharter@scale}{1}
\IfFileExists{xkeyval.sty}{
@@ -106,6 +107,8 @@
%\ifdefined\bbl@tempa \XCh@babeltrue\fi
\newif\if@XCh@scosf
\newif\if@XCh@srb
+\newif\ifXCh@thrm
+
\def\XCharter@altone{1}% default is to use 1, not I
\newif\if@XCh@sups
\DeclareOptionX{foresolidus}{\gdef\XCh@foresolidus{#1}}
@@ -116,6 +119,7 @@
\edef\XCharter@altone{1}}
\DeclareOptionX{oldstyleI}{\edef\XCharter@figurestyle{TOsF}%
\edef\XCharter@altone{}}
+\DeclareOptionX{theoremfont}{\XCh@thrmtrue}
\DeclareOptionX{osf}{\edef\XCharter@figurestyle{TOsF}\edef\XCharter@altone{1}}
\DeclareOptionX{osfI}{\edef\XCharter@figurestyle{TOsF}\edef\XCharter@altone{}}
\DeclareOptionX{sups}{\@XCh@supstrue}
@@ -136,6 +140,23 @@
\newcommand{\textosf}[1]{{\fontencoding{T1}\fontfamily{XCharterx}\selectfont #1}}% to get XCharter osf
\newcommand{\textosfI}[1]{{\fontencoding{T1}\fontfamily{XChartery}\selectfont #1}}% to get XCharter osfI
+\ifXCh@thrm
+ %\RequirePackage{amsmath,amsthm} % in case of theoremfont
+ \ifdefined\newtheoremstyle %amsthm and ntheorem, not theorem.sty
+ \@ifpackageloaded{ntheorem}\relax{%
+ \newtheoremstyle{plain}
+ {\medskipamount} % ABOVESPACE, was \topsep
+ {\medskipamount} % BELOWSPACE, was \topsep
+ {\thfamily} % BODYFONT--\thfamily is italic with upright figures and punctuation
+ {} % INDENT (empty value is the same as 0pt)
+ {\bfseries} % HEADFONT--you may want to add \tlfstyle so the number is tab lining, regardless of text figure selection
+ {.} % HEADPUNCT
+ {5pt plus 1pt minus 1pt} % HEADSPACE
+ {} % CUSTOM-HEAD-SPEC\newtheorem{thm}{Theorem}[section]
+ } % end @ifpackageloaded
+ \fi%
+\fi%}
+
\renewcommand*{\bfdefault}{b}
\renewcommand*{\scdefault}{sc}% for better compatibility with mathdesign
@@ -221,8 +242,29 @@
% \renewcommand*{\rmdefault}{XCharter-\XCharter@figurestyle}
% \normalfont
%\else
+
+\DeclareRobustCommand\thfamily % new family for theorem font
+ {\not@math@alphabet\thfamily\relax
+ \fontfamily\thdefault\fontshape{it}\selectfont}
+\DeclareRobustCommand{\textth}[1]{%
+ {\thfamily #1}%
+}
+\let\textthit\textth
+
\AtEndPreamble{%
\renewcommand*{\rmdefault}{XCharter-\XCharter@figurestyle}
+%\def\XCharter@thfigurestyle{\XCharter@figurestyle}
+\ifx\XCharter@figurestyle\XCh@dfltfigurestyle
+ \def\XCharter@thfigurestyle{tlf}
+\else
+ \def\XCharter@thfigurestyle{osf}
+\fi % there just two possible figure styles for the theorem font
+
+\newcommand*{\thdefault}{XCharterTH-\XCharter@thfigurestyle}
+\ifXCh@thrm
+ \theoremstyle{plain}
+ \patchcmd{\th@plain}{\itshape}{\thfamily}{\message{Replaced itshape by thfamily in theorem style plain.}}{\message{Unable to replace itshape by thfamily in theorem style plain.}}
+\fi
\normalfont}
%\fi