% \iffalse meta-comment % % Copyright (C) 2019-2023 by Jan Hajer % ----------------------------------- % % This file 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: % % http://www.latex-project.org/lppl.txt % % and version 1.3c or later is part of all distributions of LaTeX % version 2005/12/01 or later. % % \fi % % \iffalse %\NeedsTeXFormat{LaTeX2e}[2005/12/01] %\ProvidesPackage{hep-math-font}[2024/11/01 v1.3 selection of math fonts for latin modern] %\ProvidesFile{hep-math-font-documentation.tex}[2024/11/01 v1.3 hep-math-Font documentation] % %<*documentation> \documentclass{ltxdoc} \renewcommand\theCodelineNo{\rmfamily\tstyle\footnotesize\arabic{CodelineNo}} \AtBeginEnvironment{macrocode}{\renewcommand{\ttdefault}{clmt}} \renewcommand{\MacroFont}{\codestyle} \AtBeginDocument{\DeleteShortVerb{\|}} \AtBeginDocument{\MakeShortVerb{\"}} \EnableCrossrefs \CodelineIndex \RecordChanges \usepackage{hologo} \usepackage{fonttable} \usepackage[parskip,oldstyle,font=10pt]{hep-paper} \bibliography{bibliography} \acronym{CM}{computer modern} \acronym{LM}{latin modern} \acronym{NFSS}{new font selection scheme} \acronym{PU}{PDF Unicode} \acronym{TU}{\hologo{TeX} Unicode} \acronym{LGR}{local Greek} % %<*driver> \expandafter\newif\csname ifshort\endcsname \shortfalse \begin{document} \DocInput{hep-math-font-implementation.dtx} \end{document} % % % \fi % % \CheckSum{1716} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z % Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z % Digits \0\1\2\3\4\5\6\7\8\9 % Exclamation \! Double quote \" Hash (number) \# % Dollar \$ Percent \% Ampersand \& % Acute accent \' Left paren \( Right paren \) % Asterisk \* Plus \+ Comma \, % Minus \- Point \. Solidus \/ % Colon \: Semicolon \; Less than \< % Equals \= Greater than \> Question mark \? % Commercial at \@ Left bracket \[ Backslash \\ % Right bracket \] Circumflex \^ Underscore \_ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % % \changes{v1.0}{2021/09/01}{Initial version of the style file.} % \changes{v1.1}{2022/11/01}{Bug fixes.} % \changes{v1.2}{2023/07/01}{Bug fixes.} % \changes{v1.3}{2024/11/01}{Bug fixes.} % % \ifshort %<*documentation> % \fi % \GetFileInfo{hep-math-font.sty} \title{The \software{hep-math-font} package\thanks{This document corresponds to \software{hep-math-font}~\fileversion.}} \subtitle{Extended Greek and sans-serif math} \author{Jan Hajer \email{jan.hajer@tecnico.ulisboa.pt}} \date{\filedate} % \ifshort \begin{document} % \fi \newgeometry{vscale=.8, vmarginratio=3:4, includeheadfoot, left=11em, marginparwidth=4.6cm, marginparsep=3mm, right=7em} \maketitle \begin{abstract} The \software{hep-math-font} package adjust the math fonts to be italic sans-serif if the document is sans-serif. Additionally Greek letters are redefined to be always italic and upright in math and text mode, respectively. Some math font macros are adjusted to give more consistently the naively expected results. \end{abstract} The package is loaded using "\usepackage{hep-math-font}". If the document "\familydefault" font is switched to the sansserif "\sfdefault" font the math font is adjusted accordingly using fonts compatible to \LM and \CM. \DescribeMacro{warning} In order to be able to easily switch large chucks of math from serif to sans-serif documents the meaning of "\mathrm" and "\mathsf" is adjusted in this case so that the first generates upright sans-serif math and the second serif math. This is is neither the literal meaning of the macros nor the best behaviour if a single large document is written in sans-serif. However, it simplifies working in an environment where one copies pieces of math between serif and sans-serif documents \eg publications \vs talks and funding applications. Using the \software{fixmath} \cite{fixmath} and \software{textalpha} \cite{textalpha} packages Greek letter are adjusted so that they are always italic and upright in math and text mode, respectively. Greek letters can be written by using their unicode characters, with code following the \software{alphabeta} package \cite{alphabeta}. \DescribeMacro{symbols} The "symbols"=\meta{family} class option sets the family of the symbol fonts. "symbols=ams" loads the two \hologo{AmS} fonts \cite{amsfonts} and the \software{bm} bold fonts. The default "symbols=true" replaces additionally the blackboard font with the \software{dsfont} \cite{dsfont}. "symbols=minion" switches the symbol fonts to the Adobe MinionPro companion font from the \software{MnSymbol} package \cite{MnSymbol}. "symbols=false" deactivates loading any additional symbol fonts, effectively restricting the package to only switch the math font according to the sans-serif property of the main text. \section{Macros} \DescribeMacro{\text} \DescribeMacro{\mathrm} The "\mathrm"\marg{math} macro and the "\text"\marg{text} macro from \software{amstext} \cite{amstext} are adjusted to produce upright Greek letters, \ie ($ \text A \text b \text \Gamma \text \delta \text{\textbf A} \text{\textbf b} \text{\textbf \Gamma} \text{\textbf \delta}$), by adjusting the code from the \software{alphabeta} \cite{alphabeta} package. \DescribeMacro{\mathbf} Bold math, via "\mathbf" is improved with the \software{bm} package \cite{bm}, \ie ($ A b \Gamma \delta \mathbf A \mathbf b \mathbf \Gamma \mathbf \delta$). Macros switching to "bfseries" such as "\section"\marg{text} are ensured to also typeset math in bold. \DescribeMacro{\mathsf} The math sans-serif alphabet is redefined to be italic sans-serif if the main text is serif and italic serif if the main text is sans-serif, \ie ($\mathsf A \mathsf b \mathsf \Gamma \mathsf \delta \mathbf{\mathsf A} \mathbf{\mathsf b} \mathbf{\mathsf \Gamma} \mathbf{\mathsf \delta}$). Ensuring that the distinction between these fonts is also kept if the \prefix{sans}{serif} option of the document is switched. \DescribeMacro{\mathscr} The "\mathcal" font \ie ($\mathcal{ABCD}$) is accompanied by the "\mathscr" font \ie ($\mathscr{ABCD}$). \DescribeMacro{\mathbb} The "\mathbb" font is improved by the \software{doublestroke} package \cite{dsfont} and adjusted depending on the \prefix{sans}{serif} option of the document \ie ($\mathbb{Ah1}$). \DescribeMacro{\mathtt} The "\mathtt" macro switches to \LM typewriter font \ie ($\mathtt A \mathtt b \mathtt \Gamma \mathbf{\mathtt A} \mathbf{\mathtt b} \mathbf{\mathtt \Gamma}$). \DescribeMacro{\mathfrak} Finally, the "\mathfrak" font is also available \ie ($\mathfrak{AaBb12}$). Details about the font handling in \hologo{TeX} can be found in \ccite{fntguide}. \section{Math alphabet allocation} \label{sec:allocation} \bgroup \makeatletter \renewcommand{\arraystretch}{0} \setlength{\tabcolsep}{0pt} \nodecimals \nohexoct \fntcolwidth=0pt \setlength\arrayrulewidth{0pt} \begin{figure} \begin{panels}[t]{4} \fonttable{rm-\ifhepmathfont@serif lmr\else lmss\fi10} \caption{Text} \panel \fontrange{0}{127} \fonttable{\ifhepmathfont@serif lm\else cmss\fi mi10} \caption{Math}\vspace{2ex} \fonttable{\ifhepmathfont@serif lm\else cmss\fi sy10} \caption{Symbol} \panel \fontrange{0}{127} \fonttable{\ifhepmathfont@serif\else ss\fi msam10} \caption{AMS a}\vspace{2ex} \fontrange{0}{79} \fonttable{\ifhepmathfont@serif\else ss\fi msbm10} \fontrange{96}{127} \fonttable{\ifhepmathfont@serif\else ss\fi msbm10} \caption{AMS b} \panel \fontrange{0}{8} \fonttable{eufm10} \fontrange{32}{127} \fonttable{eufm10} \caption{Euler fraktur}\vspace{2ex} \fontrange{64}{95} \fonttable{eusm10} \caption{Euler caligraphy}\vspace{2ex} \fonttable{MnSymbolS10} \caption{Minion caligraphy}\vspace{2ex} \fonttable{ds\ifhepmathfont@serif rom\else ss\fi10} \caption{Doublestroke} \end{panels} \caption{Basic math fonts} \end{figure} \begin{figure} \hspace*{-2cm}% \begin{panels}[t]{.3} \fontrange{0}{127} \fonttable{cm\ifhepmathfont@serif\else ss\fi ex10} \caption{Computer modern} \panel{.22} \fontrange{0}{143} \fonttable{MnSymbolE5} \caption{Mn Symbol E 1} \panel{.6} \fontrange{144}{215} \fonttable{MnSymbolE5} \caption{Mn Symbol E 2}\vspace{2ex} \begin{minipage}{.48\linewidth} \fontrange{0}{127}\fonttable{MnSymbolF10} \caption{Mn Symbols F} \end{minipage}% \begin{minipage}{.5\linewidth} \fontrange{0}{47}\fonttable{\ifhepmathfont@serif\else ss\fi esint10} \caption{Extended set of integrals} \end{minipage} \end{panels} \caption{Math extension fonts} \end{figure} \begin{figure} \begin{panels}[t]{.26} \fonttable{MnSymbolA10} \caption{Mn Symbol A} \panel{.26} \fonttable{MnSymbolB10} \caption{Mn Symbol B} \panel{.26} \fonttable{MnSymbolC10} \caption{Mn Symbol C} \panel{.2} \fonttable{MnSymbolD10} \caption{Mn Symbol D} \end{panels} \makeatother \caption{Minion symbol fonts} \end{figure} \egroup Of the 16 available math alphabets, \hologo{TeX} loads four by default \begin{enumdescript}[start=0,label=\arabic*)] \item{OT1} \label{it:math text} Text (latin, upper case greek, numerals, text symbols) The text font \ref{it:math text}\strut\ of \CM is \textbf{cmr10} "\OT1/cmr/m/n/10", which is replaced by \LM to be \textbf{rm-lmr10} "\OT1/lmr/m/n/10", the "sansserif" option uses \textbf{rm-lmss10} "\OT1/lmss/m/n/10". \item{OML} \label{it:math italic} Math Italic (latin, greek, numerals, text symbols) The italic math font \ref{it:math italic} of \CM is \textbf{cmmi10} "\OML/cmm/m/it/"\allowbreak"10", and is replaced by \LM to be \textbf{lmmi10} "\OML/lmm/m/it/10", the "sansserif" options uses \textbf{cmssmi10} "\OML/cmssrm/m/it/10" from the \software{sansmathfonts} package \cite{sansmathfonts}. \item{OMS} \label{it:math symbol} Symbol ("\mathcal", operators) The symbol font \ref{it:math symbol}\strut\ of \CM is \textbf{cmsy10} "\OMS/cmsy/m/n/10", and is replaced by \LM to be \textbf{lmsy10} "\OMS/lmsy/m/n/10", the "sansserif" options uses \textbf{cmsssy10} "\OMS/cmsssy/m/n/10" from the \software{sansmathfonts} package \cite{sansmathfonts}. \item{OMX} \label{it:math extension} Math Extension (big operators, delimiters) The extension font \ref{it:math extension}\strut\ of \CM is \textbf{cmex10} "\OMX/cmex/m/n/5", and is replaced by the \software{exscale} package \cite{exscale} to be \textbf{cmex10} "\OMX/cmex/m/n/10", the "sansserif" option loads \textbf{cmssex10} "\OMX/cmssex/m/n/10". \end{enumdescript} The \software{amssymb} (\software{amsfonts}) packages \cite{amssymb} load two more symbol fonts \begin{enumdescript}[start=4,label=\arabic*)] \item{msam10} \label{it:math ams a} "\U/msa/m/n/10" AMS symbol font A (special math operators) \item{msbm10} \label{it:math ams b} "\U/msb/m/n/10" AMS symbol font B ("\mathbb", negated operators) \end{enumdescript} The "sansserif" option replaces them with \textbf{ssmsam10} "\U/ssmsa/m/n/10" and \textbf{ssmsbm10} "\U/ssmsb/m/n/10" from the \software{sansmathfonts} package \cite{sansmathfonts}, respectively. The \software{bm} package \cite{bm} loads the bold version for the fonts \labelcref{it:math text,it:math italic,it:math symbol}. Other math alphabets are only loaded on demand, \eg "\mathsf" uses a sans-serif font and "\mathbf" without the \software{bm} package uses a bold font. The "\mathscr" macro uses the script font from the \software{mathrsfs} package \cite{mathrsfs} \begin{enumdescript}[start=9,label=\arabic*)] \item{rsfs10} "\U/rsfs/m/n/10" Math script font (capital letters) \end{enumdescript} The "\mathbb" macro loads the double stroke font from the \software{dsfont} package \cite{dsfont}, this can be prevented with the "symbols=ams" option. \begin{enumdescript}[start=10,label=\arabic*)] \item{dsrom10} "\U/dsrom/m/n/10" Double stroke font \end{enumdescript} The "\mathfrak" macro loads the fractur font from the \software{amssymb} package \cite{amssymb} \begin{enumdescript}[start=11,label=\arabic*)] \item{eufm10} "\U/euf/m/n/10" Math fraktur (Basic Latin) \end{enumdescript} The \software{hep-math-font} package uses nine of the available 16 math alphabets. This number can be reduced by three using "\newcommand{\bmmax}{0}" from the \software{bm} package \cite{bm} and brought down to the default of four with the option "symbols=false". The "symbols=minion" options replaces the fonts \labelcref{it:math symbol,it:math extension,it:math ams a,it:math ams b} with corresponding fonts from the \software{MnSymbol} package \cite{MnSymbol}. Additionally, two more symbol alphabets are allocated, the \software{bm} package \cite{bm} loads one more font and now "\mathcal" triggers the use of one additional alphabet. Hence, the minion option uses three to four more math alphabets than a usual setup. % \ifshort \printbibliography \end{document} % % % \fi % % \StopEventually{ % \printbibliography % \PrintChanges %} % % \appendix % % \section{Implementation} % %<*package> % % Use the \software{kvoptions} package \cite{kvoptions}. % \begin{macrocode} \RequirePackage{kvoptions} \SetupKeyvalOptions{ family=hepmathfont, prefix=hepmathfont@ } % \end{macrocode} % % \begin{macro}{symbols} % Provide the "symbols" option allowing to switch the symbol font. % \begin{macrocode} \DeclareStringOption[true]{symbols} % \end{macrocode} % \end{macro} % % \begin{macrocode} \ProcessKeyvalOptions* % \end{macrocode} % % \begin{macro}{\ifxetexorluatex} % Load the \software{ifluatex} \cite{ifluatex} and \software{ifxetex} \cite{ifxetex} packages. % Define the "\ifxetexorluatex" conditional checking if the package is executed by \hologo{LuaLaTeX} or \hologo{XeLaTeX}. % \begin{macrocode} \RequirePackage{ifluatex} \RequirePackage{ifxetex} \newif\ifxetexorluatex \ifxetex\xetexorluatextrue \else\ifluatex\xetexorluatextrue \else\xetexorluatexfalse\fi \fi % \end{macrocode} % \end{macro} % % Define conditionals based on the "symbols" package option using the \software{pdftexcmds} package \cite{pdftexcmds}. % \begin{macrocode} \RequirePackage{pdftexcmds} \newif\ifhepmathfont@symbols \ifnum \pdf@strcmp{\hepmathfont@symbols}{false}=0 \else \hepmathfont@symbolstrue \fi \newif\ifhep@ams \ifnum\pdf@strcmp{\hepmathfont@symbols}{ams}=0 \hep@amstrue\fi \newif\ifhep@minion \ifnum\pdf@strcmp{\hepmathfont@symbols}{minion}=0 \hep@miniontrue\fi % \end{macrocode} % % \subsection{Sans serif} % % Check if document is set to sans-serif using the \software{xstring} package \cite{xstring}. % \begin{macrocode} \newif\ifhepmathfont@serif \RequirePackage{xstring} \IfStrEq{\familydefault}{\sfdefault}{% \hepmathfont@seriffalse}{\hepmathfont@seriftrue% } % \end{macrocode} % If the "sansserif" package option is active use code adjusted from the \software{sansmathfonts} package \cite{sansmathfonts}. % Ensure that "\mathsf" is italic as well as sans-serif and sans for sans and sans-serif documents, respectively. % \begin{macrocode} \ifhepmathfont@serif % \end{macrocode} % \begin{macro}{\mathsf} % Declare "\mathsf" for serif documents. % \begin{macrocode} \newcommand\hep@font@sf{cmssm} \DeclareMathAlphabet{\mathsf}{OML}{\hep@font@sf}{m}{it} \SetMathAlphabet{\mathsf}{bold}{OML}{\hep@font@sf}{b}{it} \newcommand\hep@textfont@sf{lmss} \DeclareMathAlphabet{\mathsftext}{OT1}{\hep@textfont@sf}{m}{n} \SetMathAlphabet{\mathsftext}{bold}{OT1}{\hep@textfont@sf}{bx}{n} % \end{macrocode} % \end{macro} % Define fonts for sans-serif documents. % \begin{macrocode} \else \newcommand\hep@font@sf{lmr} \newcommand\hep@font@text{lmss} \newcommand\hep@font@math{cmssm} \newcommand\hep@font@symbol{cmsssy} \newcommand\hep@font@extra{cmssex} % \end{macrocode} % Declare font substitutions. % \begin{macrocode} \DeclareFontSubstitution{OML}{\hep@font@math}{m}{it} \ifhepmathfont@symbols\ifhep@minion\else \DeclareFontSubstitution{OMS}{\hep@font@symbol}{m}{n} \DeclareFontSubstitution{OMX}{\hep@font@extra}{m}{n} \fi\fi % \end{macrocode} % Declare the symbol fonts. % \begin{macrocode} \DeclareSymbolFont{operators}{OT1}{\hep@font@text}{m}{n} \DeclareSymbolFont{letters}{OML}{\hep@font@math}{m}{it} \ifhepmathfont@symbols\ifhep@minion\else \DeclareSymbolFont{symbols}{OMS}{\hep@font@symbol}{m}{n} \DeclareSymbolFont{largesymbols}{OMX}{\hep@font@extra}{m}{n} \fi\fi % \end{macrocode} % Set bold symbol fonts. % \begin{macrocode} \SetSymbolFont{operators}{bold}{OT1}{\hep@font@text}{b}{n} \SetSymbolFont{letters}{bold}{OML}{\hep@font@math}{b}{it} \ifhepmathfont@symbols\ifhep@minion\else \SetSymbolFont{symbols}{bold}{OMS}{\hep@font@symbol}{b}{n} \fi\fi % \end{macrocode} % Adjust the fonts loaded by the \software{amsfonts} \cite{amsfonts} and \software{esint} \cite{esint} packages. % \begin{macrocode} \ifhepmathfont@symbols\ifhep@minion\else \DeclareSymbolFont{AMSa}{U}{ssmsa}{m}{n} \DeclareSymbolFont{AMSb}{U}{ssmsb}{m}{n} \fi\fi \AtBeginDocument{% \@ifpackageloaded{esint}{% \DeclareSymbolFont{largesymbolsA}{U}{ssesint}{m}{n} }{} } % \end{macrocode} % \begin{macro}{\mathrm} % \begin{macro}{\mathnormal} % \begin{macro}{\mathcal} % Declare the symbol font alphabets. % \begin{macrocode} \DeclareSymbolFontAlphabet{\mathrm}{operators} \DeclareSymbolFontAlphabet{\mathnormal}{letters} \ifhep@minion\else \DeclareSymbolFontAlphabet{\mathcal}{symbols} \fi % \end{macrocode} % \end{macro} % \end{macro} % \end{macro} % \begin{macro}{\mathit} % Declare "\mathit". % \begin{macrocode} \DeclareMathAlphabet{\mathit}{OML}{\hep@font@text}{m}{it} \SetMathAlphabet\mathit{bold}{OML}{\hep@font@text}{bx}{it} % \end{macrocode} % \end{macro} % \begin{macro}{\mathsf} % Declare "\mathsf" for sans-serif documents to produce serif. % \begin{macrocode} \DeclareMathAlphabet{\mathsf}{OML}{\hep@font@sf}{m}{it} \SetMathAlphabet{\mathsf}{bold}{OML}{\hep@font@sf}{bx}{it} % \end{macrocode} % \end{macro} % End of "sansserif". % \begin{macrocode} \fi % \end{macrocode} % % \subsection{Greek letters} % % Load the \software{fixmath} \cite{fixmath} and \software{textalpha} \cite{textalpha} packages ensuring that upper Greek letters in math mode are italic and providing upright Greek letters in text mode, respectively. % Define the "hep@greek" macro ensuring that both "\text" and "\mathrm" produce upright Greek letters using the \software{amssymb} \cite{amssymb} and \software{amstext} \cite{amstext} packages. % \begin{macrocode} \ifhepmathfont@symbols \RequirePackage{amssymb} \RequirePackage{amstext} \RequirePackage{fixmath} \RequirePackage{textalpha} \def\hep@Greek#1#2#3{ \protected\def#1{\TextOrMath{#3}{\ifnum\fam=0 \text{#3}\else#2\fi}}% } \def\hep@greek#1#2#3{\let#2=#1\hep@Greek#1#2#3} % \end{macrocode} % The following code follows closely the \software{alphabeta} package \cite{alphabeta}. % % \subsubsection{Commands to access Greek letters by name} % % For letters defined in math mode, the commands work in both, text and math. % Some Greek letters look identical to Latin letters and can therefore not be used as variable symbols in math formulas. % These letters are not defined in \hologo{TeX}'s math mode, we provide an alias to the corrsponding "\text..." command. % % Mathematical notation distinguishes `variant shape symbols` for \pi, \phi, \rho, \theta\ (small and capital), \beta, and \kappa\ (characters for the latter three symbols are not included in \hologo{TeX}’s math fonts). % These variations have no syntactic meaning in Greek text and are not given code-points in the \LGR encoding while Unicode defines separate code points for the symbol variants. % % \subsubsection{Greek Alphabet} % % Macros keep their meaning in mathematical mode (\ie use the same shape as without this package) and refer to "greek letter ..." in text. % For "\epsilon" and "\phi", this means that the selected symbol variant differs in text \vs math mode. % Use "\varepsilon" and "\varphi" (see section `variant shape symbols` below) to select the "greek letter ..." in both, text and math mode. % \begin{macrocode} \providecommand*{\Alpha}{\textAlpha} % Α \providecommand*{\Beta}{\textBeta} % Β \hep@greek\Gamma\mathGamma\textGamma % Γ \hep@greek\Delta\mathDelta\textDelta % Δ \providecommand*{\Epsilon}{\textEpsilon} % Ε \providecommand*{\Zeta}{\textZeta} % Ζ \providecommand*{\Eta}{\textEta} % Η \hep@greek\Theta\mathTheta\textTheta % Θ \providecommand*{\Iota}{\textIota} % Ι \providecommand*{\Kappa}{\textKappa} % Κ \hep@greek\Lambda\mathLambda\textLambda % Λ \providecommand*{\Mu}{\textMu} % Μ \providecommand*{\Nu}{\textNu} % Ν \hep@greek\Xi\mathXi\textXi % Ξ \providecommand*{\Omicron}{\textOmicron} % Ο \hep@greek\Pi\mathPi\textPi % Π \providecommand*{\Rho}{\textRho} % Ρ \hep@greek\Sigma\mathSigma\textSigma % Σ \providecommand*{\Tau}{\textTau} % Τ \hep@greek\Upsilon\mathUpsilon\textUpsilon % Υ \hep@greek\Phi\mathPhi\textPhi % Φ \providecommand*{\Chi}{\textChi} % Χ \hep@greek\Psi\mathPsi\textPsi % Ψ \hep@greek\Omega\mathOmega\textOmega % Ω % \end{macrocode} % Apply to minuscule Greek letters. % \begin{macrocode} \hep@greek\alpha\mathalpha\textalpha % α \hep@greek\beta\mathbeta\textbeta % β \hep@greek\gamma\mathgamma\textgamma % γ \hep@greek\delta\mathdelta\textdelta % δ \hep@greek\epsilon\mathepsilon\textepsilon % ε \hep@greek\zeta\mathzeta\textzeta % ζ \hep@greek\eta\matheta\texteta % η \hep@greek\theta\maththeta\texttheta % θ \hep@greek\iota\mathiota\textiota % ι \hep@greek\kappa\mathkappa\textkappa % κ \hep@greek\lambda\mathlambda\textlambda % λ \hep@greek\mu\mathmu\textmu % μ \hep@greek\nu\mathnu\textnu % ν \hep@greek\xi\mathxi\textxi % ξ \providecommand*{\omicron}{\textomicron} % ο \hep@greek\pi\mathpi\textpi % π \hep@greek\rho\mathrho\textrho % ρ \hep@greek\sigma\mathsigma\textsigma % σ \hep@greek\varsigma\mathvarsigma\textvarsigma % ς \providecommand*{\finalsigma}{\varsigma} % ς \hep@greek\tau\mathtau\texttau % τ \hep@greek\upsilon\mathupsilon\textupsilon % υ \hep@greek\phi\mathphi\textphi % φ \hep@greek\chi\mathchi\textchi % χ \hep@greek\psi\mathpsi\textpsi % ψ \hep@greek\omega\mathomega\textomega % ω % \end{macrocode} % Archaic letters \textvarsigma % \begin{macrocode} \hep@greek\digamma\mathdigamma\textdigamma % ϝ \providecommand*{\Digamma}{\textDigamma} % Ϝ \providecommand*{\stigma}{\textstigma} % ϛ \providecommand*{\varstigma}{\textvarstigma} % ϛ stigma variant (CB.enc, teubner) not in LM \providecommand*{\koppa}{\textkoppa} % ϟ (greek small letter koppa) \providecommand*{\Koppa}{\textKoppa} % Ϟ (greek letter koppa) % \end{macrocode} % babel-greek defines "\qoppa" as alias for ϟ ("\textkoppa")! % \begin{macrocode} \def\qoppa{\textqoppa} % ϙ (archaic koppa) \providecommand*{\Qoppa}{\textQoppa} % Ϙ (archaic Koppa) \providecommand*{\Stigma}{\textStigma} % Ϛ (in some fonts CT ligature) \providecommand*{\Sampi}{\textSampi} % Ϡ \providecommand*{\sampi}{\textsampi} % ϡ % \end{macrocode} % % \subsubsection{Variant shape symbols} % % \hologo{TeX}'s concept of \enquote{standard} \vs \enquote{variant} math symbols does not map to the % distinction between "greek letter ..." \vs "greek ... symbol" in the Unicode standard (see "test-tuenc-greek.pdf"). % % The "\...symbol" macros select the "greek ... symbol" in both, text and math mode. % For "\epsilonsymbol" and "\phisymbol" this is the default shape in math mode. % The "\var..." macros select the shape used by \hologo{TeX} math (or, if not supported, the "symbol" shape) % % "...symbol == var..." Does not work 8-bit % \begin{macrocode} \hep@greek\varpi\mathvarpi\textpisymbol % \providecommand*{\pisymbol}{\varpi} % \hep@greek\varrho\mathvarrho\textrhosymbol % \hep@greek\rhosymbol\mathvarrho\textrhosymbol % \hep@greek\vartheta\mathvartheta\textthetasymbol % \providecommand*{\thetasymbol}{\vartheta} % % \end{macrocode} % "...symbol != var..." Does not work 8-bit % \begin{macrocode} \hep@greek\varepsilon\mathvarepsilon\textepsilon % \hep@Greek\epsilonsymbol\mathepsilon\textepsilonsymbol % \hep@greek\varphi\mathvarphi\textphi % \hep@Greek\phisymbol\mathphi\textphisymbol % % \end{macrocode} % only text (in standard 8-bit \hologo{TeX}, may be defined with additional packages): % \begin{macrocode} \ifdefined\varbeta \hep@greek\varbeta\mathvarbeta\textbetasymbol % \else \providecommand*{\varbeta}{\textbetasymbol} % \fi \providecommand*{\betasymbol}{\varbeta} \ifdefined\varkappa \hep@greek\varkappa\mathvarkappa\textkappasymbol \else \providecommand*{\varkappa}{\textkappasymbol} \fi \providecommand*{\kappasymbol}{\varkappa} % \end{macrocode} % "\Theta/\varTheta" are not a symbol variants but upright/italic shape of Theta % \begin{macrocode} \providecommand*{\Thetasymbol}{\textThetasymbol} % \end{macrocode} % % \subsubsection{TextCompositeCommands for the letter-name macros} % % The \NFSS TextComposite mechanism looks for the next token without expanding it. % In order to let compositions like "\ensuregreek{\'\Alpha}" or "\ensuregreek"\allowbreak"{\>''\alpha}" work as expected we define TextComposites with the `letter name commands`. % % TextCompositeCommands are always specific for the font-encoding. % Documents may use \TU, \LGR, and \PU in parallel. % We define auxiliary commands with definitions % that are required by more than one font encoding. % % \paragraph{Select pre-composed characters} % % Required by \LGR and \PU. % % \begin{macro}{\alphabeta@select@precomposed} % With \TU, most pre-composed characters are selected by the the engine. % (Actually by the `Harfbuzz` renderer which is default for \hologo{XeTeX} and can be selected with fontspec for \hologo{LuaTeX}). % \begin{macrocode} \newcommand*{\alphabeta@select@precomposed}[1]{ % \end{macrocode} % Minuscule letters. % \begin{macrocode} \DeclareTextCompositeCommand{\accvaria}{#1}{\alpha}{\accvaria\textalpha} \DeclareTextCompositeCommand{\accdasia}{#1}{\alpha}{\accdasia\textalpha} \DeclareTextCompositeCommand{\accpsili}{#1}{\alpha}{\accpsili\textalpha} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\alpha}{\accdasiavaria\textalpha} \DeclareTextCompositeCommand{\acctonos}{#1}{\alpha}{\acctonos\textalpha} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\alpha}{\accdasiaoxia\textalpha} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\alpha}{\accpsilioxia\textalpha} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\alpha}{\accpsilivaria\textalpha} \DeclareTextCompositeCommand{\accperispomeni}{#1}{\alpha}{\accperispomeni\textalpha} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\alpha}{\accdasiaperispomeni\textalpha} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\alpha}{\accpsiliperispomeni\textalpha} \DeclareTextCompositeCommand{\accvaria}{#1}{\eta}{\accvaria\texteta} \DeclareTextCompositeCommand{\accdasia}{#1}{\eta}{\accdasia\texteta} \DeclareTextCompositeCommand{\accpsili}{#1}{\eta}{\accpsili\texteta} \DeclareTextCompositeCommand{\acctonos}{#1}{\eta}{\acctonos\texteta} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\eta}{\accdasiaoxia\texteta} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\eta}{\accpsilioxia\texteta} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\eta}{\accdasiavaria\texteta} \DeclareTextCompositeCommand{\accperispomeni}{#1}{\eta}{\accperispomeni\texteta} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\eta}{\accdasiaperispomeni\texteta} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\eta}{\accpsiliperispomeni\texteta} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\eta}{\accpsilivaria\texteta} \DeclareTextCompositeCommand{\accvaria}{#1}{\omega}{\accvaria\textomega} \DeclareTextCompositeCommand{\accdasia}{#1}{\omega}{\accdasia\textomega} \DeclareTextCompositeCommand{\accpsili}{#1}{\omega}{\accpsili\textomega} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\omega}{\accdasiavaria\textomega} \DeclareTextCompositeCommand{\acctonos}{#1}{\omega}{\acctonos\textomega} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\omega}{\accdasiaoxia\textomega} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\omega}{\accpsilioxia\textomega} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\omega}{\accpsilivaria\textomega} \DeclareTextCompositeCommand{\accperispomeni}{#1}{\omega}{\accperispomeni\textomega} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\omega}{\accdasiaperispomeni\textomega} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\omega}{\accpsiliperispomeni\textomega} \DeclareTextCompositeCommand{\accvaria}{#1}{\iota}{\accvaria\textiota} \DeclareTextCompositeCommand{\accdasia}{#1}{\iota}{\accdasia\textiota} \DeclareTextCompositeCommand{\accpsili}{#1}{\iota}{\accpsili\textiota} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\iota}{\accdasiavaria\textiota} \DeclareTextCompositeCommand{\acctonos}{#1}{\iota}{\acctonos\textiota} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\iota}{\accdasiaoxia\textiota} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\iota}{\accpsilioxia\textiota} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\iota}{\accpsilivaria\textiota} \DeclareTextCompositeCommand{\accperispomeni}{#1}{\iota}{\accperispomeni\textiota} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\iota}{\accdasiaperispomeni\textiota} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\iota}{\accpsiliperispomeni\textiota} \DeclareTextCompositeCommand{\accdialytika}{#1}{\iota}{\accdialytika\textiota} \DeclareTextCompositeCommand{\accdialytikavaria}{#1}{\iota}{\accdialytikavaria\textiota} \DeclareTextCompositeCommand{\accdialytikatonos}{#1}{\iota}{\accdialytikatonos\textiota} \DeclareTextCompositeCommand{\accdialytikaperispomeni}{#1}{\iota}{\accdialytikaperispomeni\textiota} \DeclareTextCompositeCommand{\accvaria}{#1}{\upsilon}{\accvaria\textupsilon} \DeclareTextCompositeCommand{\accdasia}{#1}{\upsilon}{\accdasia\textupsilon} \DeclareTextCompositeCommand{\accpsili}{#1}{\upsilon}{\accpsili\textupsilon} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\upsilon}{\accdasiavaria\textupsilon} \DeclareTextCompositeCommand{\acctonos}{#1}{\upsilon}{\acctonos\textupsilon} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\upsilon}{\accdasiaoxia\textupsilon} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\upsilon}{\accpsilioxia\textupsilon} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\upsilon}{\accpsilivaria\textupsilon} \DeclareTextCompositeCommand{\accperispomeni}{#1}{\upsilon}{\accperispomeni\textupsilon} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\upsilon}{\accdasiaperispomeni\textupsilon} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\upsilon}{\accpsiliperispomeni\textupsilon} \DeclareTextCompositeCommand{\accdialytika}{#1}{\upsilon}{\accdialytika\textupsilon} \DeclareTextCompositeCommand{\accdialytikavaria}{#1}{\upsilon}{\accdialytikavaria\textupsilon} \DeclareTextCompositeCommand{\accdialytikatonos}{#1}{\upsilon}{\accdialytikatonos\textupsilon} \DeclareTextCompositeCommand{\accdialytikaperispomeni}{#1}{\upsilon}{\accdialytikaperispomeni\textupsilon} \DeclareTextCompositeCommand{\accvaria}{#1}{\epsilon}{\accvaria\textepsilon} \DeclareTextCompositeCommand{\accdasia}{#1}{\epsilon}{\accdasia\textepsilon} \DeclareTextCompositeCommand{\accpsili}{#1}{\epsilon}{\accpsili\textepsilon} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\epsilon}{\accdasiavaria\textepsilon} \DeclareTextCompositeCommand{\acctonos}{#1}{\epsilon}{\acctonos\textepsilon} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\epsilon}{\accdasiaoxia\textepsilon} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\epsilon}{\accpsilioxia\textepsilon} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\epsilon}{\accpsilivaria\textepsilon} \DeclareTextCompositeCommand{\accvaria}{#1}{\omicron}{\accvaria\textomicron} \DeclareTextCompositeCommand{\accdasia}{#1}{\omicron}{\accdasia\textomicron} \DeclareTextCompositeCommand{\accpsili}{#1}{\omicron}{\accpsili\textomicron} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\omicron}{\accdasiavaria\textomicron} \DeclareTextCompositeCommand{\acctonos}{#1}{\omicron}{\acctonos\textomicron} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\omicron}{\accdasiaoxia\textomicron} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\omicron}{\accpsilioxia\textomicron} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\omicron}{\accpsilivaria\textomicron} % \end{macrocode} % Majuscule letters. % \begin{macrocode} \DeclareTextCompositeCommand{\accdasia}{#1}{\Alpha}{\accdasia\textAlpha} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\Alpha}{\accdasiavaria\textAlpha} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\Alpha}{\accdasiaoxia\textAlpha} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\Alpha}{\accdasiaperispomeni\textAlpha} \DeclareTextCompositeCommand{\accpsili}{#1}{\Alpha}{\accpsili\textAlpha} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\Alpha}{\accpsilivaria\textAlpha} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\Alpha}{\accpsilioxia\textAlpha} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\Alpha}{\accpsiliperispomeni\textAlpha} \DeclareTextCompositeCommand{\acctonos}{#1}{\Alpha}{\acctonos\textAlpha} \DeclareTextCompositeCommand{\accvaria}{#1}{\Alpha}{\accvaria\textAlpha} \DeclareTextCompositeCommand{\accdasia}{#1}{\Epsilon}{\accdasia\textEpsilon} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\Epsilon}{\accdasiaoxia\textEpsilon} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\Epsilon}{\accdasiavaria\textEpsilon} \DeclareTextCompositeCommand{\accpsili}{#1}{\Epsilon}{\accpsili\textEpsilon} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\Epsilon}{\accpsilioxia\textEpsilon} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\Epsilon}{\accpsilivaria\textEpsilon} \DeclareTextCompositeCommand{\acctonos}{#1}{\Epsilon}{\acctonos\textEpsilon} \DeclareTextCompositeCommand{\accvaria}{#1}{\Epsilon}{\accvaria\textEpsilon} \DeclareTextCompositeCommand{\accdasia}{#1}{\Eta}{\accdasia\textEta} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\Eta}{\accdasiavaria\textEta} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\Eta}{\accdasiaoxia\textEta} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\Eta}{\accdasiaperispomeni\textEta} \DeclareTextCompositeCommand{\accpsili}{#1}{\Eta}{\accpsili\textEta} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\Eta}{\accpsilivaria\textEta} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\Eta}{\accpsilioxia\textEta} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\Eta}{\accpsiliperispomeni\textEta} \DeclareTextCompositeCommand{\acctonos}{#1}{\Eta}{\acctonos\textEta} \DeclareTextCompositeCommand{\accvaria}{#1}{\Eta}{\accvaria\textEta} \DeclareTextCompositeCommand{\accdasia}{#1}{\Iota}{\accdasia\textIota} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\Iota}{\accdasiavaria\textIota} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\Iota}{\accdasiaoxia\textIota} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\Iota}{\accdasiaperispomeni\textIota} \DeclareTextCompositeCommand{\accdialytika}{#1}{\Iota}{\accdialytika\textIota} \DeclareTextCompositeCommand{\accpsili}{#1}{\Iota}{\accpsili\textIota} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\Iota}{\accpsilivaria\textIota} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\Iota}{\accpsilioxia\textIota} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\Iota}{\accpsiliperispomeni\textIota} \DeclareTextCompositeCommand{\acctonos}{#1}{\Iota}{\acctonos\textIota} \DeclareTextCompositeCommand{\accvaria}{#1}{\Iota}{\accvaria\textIota} \DeclareTextCompositeCommand{\accdasia}{#1}{\Omicron}{\accdasia\textOmicron} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\Omicron}{\accdasiavaria\textOmicron} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\Omicron}{\accdasiaoxia\textOmicron} \DeclareTextCompositeCommand{\accpsili}{#1}{\Omicron}{\accpsili\textOmicron} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\Omicron}{\accpsilivaria\textOmicron} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\Omicron}{\accpsilioxia\textOmicron} \DeclareTextCompositeCommand{\acctonos}{#1}{\Omicron}{\acctonos\textOmicron} \DeclareTextCompositeCommand{\accvaria}{#1}{\Omicron}{\accvaria\textOmicron} \DeclareTextCompositeCommand{\accdasia}{#1}{\Upsilon}{\accdasia\textUpsilon} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\Upsilon}{\accdasiavaria\textUpsilon} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\Upsilon}{\accdasiaoxia\textUpsilon} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\Upsilon}{\accdasiaperispomeni\textUpsilon} \DeclareTextCompositeCommand{\accdialytika}{#1}{\Upsilon}{\accdialytika\textUpsilon} \DeclareTextCompositeCommand{\acctonos}{#1}{\Upsilon}{\acctonos\textUpsilon} \DeclareTextCompositeCommand{\accvaria}{#1}{\Upsilon}{\accvaria\textUpsilon} \DeclareTextCompositeCommand{\accdasia}{#1}{\Rho}{\accdasia\textRho} \DeclareTextCompositeCommand{\accdasia}{#1}{\Omega}{\accdasia\textOmega} \DeclareTextCompositeCommand{\accdasiavaria}{#1}{\Omega}{\accdasiavaria\textOmega} \DeclareTextCompositeCommand{\accdasiaoxia}{#1}{\Omega}{\accdasiaoxia\textOmega} \DeclareTextCompositeCommand{\accdasiaperispomeni}{#1}{\Omega}{\accdasiaperispomeni\textOmega} \DeclareTextCompositeCommand{\accpsili}{#1}{\Omega}{\accpsili\textOmega} \DeclareTextCompositeCommand{\accpsilivaria}{#1}{\Omega}{\accpsilivaria\textOmega} \DeclareTextCompositeCommand{\accpsilioxia}{#1}{\Omega}{\accpsilioxia\textOmega} \DeclareTextCompositeCommand{\accpsiliperispomeni}{#1}{\Omega}{\accpsiliperispomeni\textOmega} \DeclareTextCompositeCommand{\acctonos}{#1}{\Omega}{\acctonos\textOmega} \DeclareTextCompositeCommand{\accvaria}{#1}{\Omega}{\accvaria\textOmega} } % \end{macrocode} % \end{macro} % % \paragraph{Drop \enquote{capital} accents} % % Definitions in "babel-greek_" let "\MakeUppercase" convert standard accents "\'", "\", "\~", and \verb+\"+ to \enquote{capital} versions. % % In \LGR, the \enquote{capital} accents are generally dropped. % In \PU and \TU, they must be kept on Latin letters but dropped from Greek letters. % \begin{macrocode} \newcommand*{\alphabeta@drop@capital@accents}[1]{ % \end{macrocode} % acute % \begin{macrocode} \DeclareTextCompositeCommand{\accACUTE}{#1}{\Alpha}{\alphabeta@alpha@hiatus} \DeclareTextCompositeCommand{\accACUTE}{#1}{\Epsilon}{\alphabeta@epsilon@hiatus} \DeclareTextCompositeCommand{\accACUTE}{#1}{\Eta}{\textEta} \DeclareTextCompositeCommand{\accACUTE}{#1}{\Iota}{\textIota} \DeclareTextCompositeCommand{\accACUTE}{#1}{\Upsilon}{\textUpsilon} \DeclareTextCompositeCommand{\accACUTE}{#1}{\Omega}{\textOmega} % \end{macrocode} % grave % \begin{macrocode} \DeclareTextCompositeCommand{\accGRAVE}{#1}{\Alpha}{\textAlpha} \DeclareTextCompositeCommand{\accGRAVE}{#1}{\Epsilon}{\textEpsilon} \DeclareTextCompositeCommand{\accGRAVE}{#1}{\Eta}{\textEta} \DeclareTextCompositeCommand{\accGRAVE}{#1}{\Iota}{\textIota} \DeclareTextCompositeCommand{\accGRAVE}{#1}{\Upsilon}{\textUpsilon} \DeclareTextCompositeCommand{\accGRAVE}{#1}{\Omega}{\textOmega} % \end{macrocode} % tilde % \begin{macrocode} \DeclareTextCompositeCommand{\accTILDE}{#1}{\Alpha}{\textAlpha} \DeclareTextCompositeCommand{\accTILDE}{#1}{\Eta}{\textEta} \DeclareTextCompositeCommand{\accTILDE}{#1}{\Iota}{\textIota} \DeclareTextCompositeCommand{\accTILDE}{#1}{\Upsilon}{\textUpsilon} \DeclareTextCompositeCommand{\accTILDE}{#1}{\Omega}{\textOmega} } % \end{macrocode} % \paragraph{Hiatus feature} % % Look ahead and place a diaeresis on Ι or Υ. % Leads to errors in \PU. % \begin{macrocode} \newcommand*{\alphabeta@hiatus@composites}[1]{ \DeclareTextCommand{\alphabeta@alpha@hiatus}{#1}{% \csname LGR@ifnextchar\endcsname {\Iota}{\Alpha\"}{% \csname LGR@ifnextchar\endcsname {\Upsilon}{\Alpha\"}{\Alpha}% }% } \DeclareTextCommand{\alphabeta@epsilon@hiatus}{#1}{% \csname LGR@ifnextchar\endcsname {\Iota}{\Epsilon\"}{% \csname LGR@ifnextchar\endcsname {\Upsilon}{\Epsilon\"}{\Epsilon}% }% } \DeclareTextCompositeCommand{\LGR@hiatus}{#1}{\Alpha}{\alphabeta@alpha@hiatus} \DeclareTextCompositeCommand{\LGR@hiatus}{#1}{\Epsilon}{\alphabeta@epsilon@hiatus} } % \end{macrocode} % \paragraph{Composites for \TU} % % With font encoding \TU, pre-composed characters are selected by the the Harfbuzz renderer (default for \hologo{XeTeX}, select with fontspec for \hologo{LuaTeX}). % Exception: the (standard) combining tilde. % \begin{macrocode} \@ifl@aded{def}{tuenc-greek}{ \DeclareUnicodeComposite{\~}{\alpha}{"1FB6} % ᾶ \DeclareUnicodeComposite{\~}{\eta}{"1FC6} % ῆ \DeclareUnicodeComposite{\~}{\iota}{"1FD6} % ῖ \DeclareUnicodeComposite{\~}{\upsilon}{"1FE6} % ῦ \DeclareUnicodeComposite{\~}{\omega}{"1FF6} % ῶ \alphabeta@drop@capital@accents{\UnicodeEncodingName} \alphabeta@hiatus@composites{\UnicodeEncodingName} }{} % \end{macrocode} % \paragraph{Composites for \LGR} % \begin{macrocode} \@ifl@aded{def}{lgrenc}{ \alphabeta@select@precomposed{LGR} \alphabeta@hiatus@composites{LGR} }{} % \end{macrocode} % \paragraph{Composites for \PU} % % Load composite defs % \begin{macrocode} \@ifl@aded{def}{puenc}{ \alphabeta@select@precomposed{PU} \alphabeta@drop@capital@accents{PU} % \end{macrocode} % The hiatus feature leads to errors in \PU % \begin{macrocode} \DeclareTextCompositeCommand{\LGR@hiatus}{PU}{\Alpha}{\textAlpha} \DeclareTextCompositeCommand{\LGR@hiatus}{PU}{\Epsilon}{\textEpsilon} % \end{macrocode} % fix "\'\alpha" and "\'\epsilon" (\'{\alpha} works): % \begin{macrocode} \DeclareTextCompositeCommand{\accACUTE}{PU}{\Alpha}{\textAlpha} \DeclareTextCompositeCommand{\accACUTE}{PU}{\Epsilon}{\textEpsilon} }{} % \end{macrocode} % % Drop auxiliary definitions to free memory % \begin{macrocode} \renewcommand*{\alphabeta@select@precomposed}{\relax} \renewcommand*{\alphabeta@drop@capital@accents}{\relax} \renewcommand*{\alphabeta@hiatus@composites}{\relax} % \end{macrocode} % \subsubsection{Case changing} % % We need to extend the case-mapping "\@uclclist" for characters that are defined with "\DeclareTextCommandDefault". % % The definition of an auxiliary, self-resetting macro makes this idempotent (only the first use of this function will expand the "@uclclist"). % The second and third lines are \hologo{TeX}'s way of writing "@uclclist += …". % % Since 2022, "\MakeUppercase" expects the default for ambiguous mappings in first position, before, the default was in last position. % \begin{macrocode} \providecommand*\alphabeta@update@uclclist{% \expandafter\def\expandafter\@uclclist\expandafter{% \@uclclist \alpha \Alpha \epsilon \Epsilon \epsilonsymbol \Epsilon \varepsilon \Epsilon \eta \Eta \iota \Iota \omicron \Omicron \rho \Rho \varrho \Rho \rhosymbol \Rho \upsilon \Upsilon \omega \Omega % \end{macrocode} % repeat default for pre-2022 "\MakeUppercase" % \begin{macrocode} \epsilon \Epsilon \rho \Rho }% \let\alphabeta@update@uclclist\relax } % \end{macrocode} % % Expand the "@uclclist" using the just defined macro:: % % \begin{macrocode} \alphabeta@update@uclclist % \end{macrocode} % \subsubsection{Re-definition for Greek Unicode input in math mode} % % Check with "\ifdefined" for the definition of % "\DeclareUnicodeCharacter". In contrast to "\@ifdefined", this works % without side-effects. It makes the package dependent on the \hologo{eTeX} % extensions but these are standard in all current \hologo{TeX} distributions anyway. % Map Greek characters that are also defined in math mode to the generic macros. % \begin{macrocode} \ifdefined\DeclareUnicodeCharacter % \end{macrocode} % Majuscule % \begin{macrocode} \DeclareUnicodeCharacter{0393}{\Gamma} % Γ \DeclareUnicodeCharacter{0394}{\Delta} % Δ \DeclareUnicodeCharacter{0398}{\Theta} % Θ \DeclareUnicodeCharacter{039B}{\Lambda} % Λ \DeclareUnicodeCharacter{039E}{\Xi} % Ξ \DeclareUnicodeCharacter{03A0}{\Pi} % Π \DeclareUnicodeCharacter{03A3}{\Sigma} % Σ \DeclareUnicodeCharacter{03A5}{\Upsilon} % Υ \DeclareUnicodeCharacter{03A6}{\Phi} % Φ \DeclareUnicodeCharacter{03A8}{\Psi} % Ψ \DeclareUnicodeCharacter{03A9}{\Omega} % Ω % \end{macrocode} % Minuscule % \begin{macrocode} \DeclareUnicodeCharacter{03B1}{\alpha} % α \DeclareUnicodeCharacter{03B2}{\beta} % β \DeclareUnicodeCharacter{03B3}{\gamma} % γ \DeclareUnicodeCharacter{03B4}{\delta} % δ \DeclareUnicodeCharacter{03B5}{\varepsilon} % ε textepsilon/varepsilon \DeclareUnicodeCharacter{03B6}{\zeta} % ζ \DeclareUnicodeCharacter{03B7}{\eta} % η \DeclareUnicodeCharacter{03B8}{\theta} % θ \DeclareUnicodeCharacter{03B9}{\iota} % ι \DeclareUnicodeCharacter{03BA}{\kappa} % κ \DeclareUnicodeCharacter{03BB}{\lambda} % λ \DeclareUnicodeCharacter{03BC}{\mu} % μ \DeclareUnicodeCharacter{03BD}{\nu} % ν \DeclareUnicodeCharacter{03BE}{\xi} % ξ \DeclareUnicodeCharacter{03C0}{\pi} % π \DeclareUnicodeCharacter{03C1}{\rho} % ρ \DeclareUnicodeCharacter{03C2}{\varsigma} % ς \DeclareUnicodeCharacter{03C3}{\sigma} % σ \DeclareUnicodeCharacter{03C4}{\tau} % τ \DeclareUnicodeCharacter{03C5}{\upsilon} % υ \DeclareUnicodeCharacter{03C6}{\varphi} % φ textphi/varphi \DeclareUnicodeCharacter{03C7}{\chi} % χ \DeclareUnicodeCharacter{03C8}{\psi} % ψ \DeclareUnicodeCharacter{03C9}{\omega} % ω % \end{macrocode} % Symbols (Does not work 8-bit) % \begin{macrocode} \DeclareUnicodeCharacter{03D1}{\thetasymbol} % \DeclareUnicodeCharacter{03D5}{\phisymbol} % \DeclareUnicodeCharacter{03D6}{\pisymbol} \DeclareUnicodeCharacter{03DD}{\digamma} \DeclareUnicodeCharacter{03F1}{\rhosymbol} \DeclareUnicodeCharacter{03F5}{\epsilonsymbol} \fi % \end{macrocode} % Ensure that this works also after loading other fonts packages such as \software{cfr-lm}. % \begin{macrocode} \ifxetexorluatex % missing code \else \DeclareFontFamilySubstitution{LGR}{\rmdefault}{lmr} \DeclareFontFamily{LGR}{\rmdefault}{} \DeclareFontShape{LGR}{\rmdefault}{b}{n}{<->ssub*lmr/bx/n}{} \DeclareFontShape{LGR}{\rmdefault}{b}{sc}{<->ssub*lmr/bx/sc}{} \DeclareFontFamilySubstitution{LGR}{\ttdefault}{lmtt} \DeclareFontFamily{LGR}{\ttdefault}{} \DeclareFontShape{LGR}{\ttdefault}{b}{n}{<->ssub*lmtt/bx/n}{} \DeclareFontFamilySubstitution{LGR}{\sfdefault}{lmss} \DeclareFontFamily{LGR}{\sfdefault}{} \DeclareFontShape{LGR}{\sfdefault}{b}{n}{<->ssub*lmss/bx/n}{} \DeclareFontShape{LGR}{\sfdefault}{b}{sc}{<->ssub*lmss/bx/sc}{} \fi % \end{macrocode} % % \subsection{Additional math fonts} % % Either load the \software{MnSymbol} package \cite{MnSymbol} or the the \software{exscale} package \cite{exscale} in order to fix Latin Modern "lmex" fonts. % Additionally, load the \software{amssymb} package \cite{amsfonts} which provides further math symbols and also loads the \software{amsfonts} package \cite{amsfonts}. % \begin{macrocode} \ifhep@minion \RequirePackage{MnSymbol} \else \RequirePackage{exscale} \RequirePackage{amssymb} \fi % \end{macrocode} % % \begin{macro}{\mathbf} % Load the \software{bm} package \cite{bm} for superior boldmath. % Make math symbols bold whenever they appear in bold macros such as "\section"\marg{text}. % \begin{macrocode} \RequirePackage{bm} \AtBeginDocument{\let\mathbf\bm} \g@addto@macro\bfseries{\boldmath} % \end{macrocode} % \end{macro} % % \begin{macro}{\mathtt} % Typewriter math font % \begin{macrocode} \DeclareMathAlphabet{\mathtt}{OT1}{lmtt}{m}{n} \SetMathAlphabet{\mathtt}{bold}{OT1}{lmtt}{bx}{n} % \end{macrocode} % \end{macro} % % \begin{macro}{\mathscr} % Provid the "\mathscr" math script font from the \software{mathrsfs} package \cite{mathrsfs}. % \begin{macrocode} \DeclareMathAlphabet{\mathscr}{U}{rsfs}{m}{n} % \end{macrocode} % \end{macro} % \begin{macro}{\mathbb} % Redefine the the "\mathbb" math blackboard style font according to the \prefix{sans}{serif} option with the font from the \software{dsfont} package \cite{dsfont}. % \begin{macrocode} \ifhep@minion \DeclareMathAlphabet{\mathbb}{U}{% \ifhepmathfont@serif dsrom\else dsss\fi% }{m}{n} \else \ifhep@ams\else \SetMathAlphabet{\mathbb}{normal}{U}{% \ifhepmathfont@serif dsrom\else dsss\fi% }{m}{n} \fi \fi % \end{macrocode} % End of symbols conditional. % \begin{macrocode} \fi % \end{macrocode} % \end{macro} % % % % \section{Tests} % %<*testserif|testsans> % % \begin{macrocode} \documentclass{article} %\renewcommand{\familydefault}{\sfdefault} \usepackage[oldstyle]{hep-font} \usepackage{hep-math-font} \usepackage{fancyvrb}\DefineShortVerb{\|} \newenvironment{vrb}{\begin{tabular}{@{}p{6cm}l@{}}}{\end{tabular}} \begin{document} \begin{vrb} || & $Ab\Gamma\delta123$ \\ |\mathbf | & $\mathbf{Ab\Gamma\delta123}$ \\ |\mathrm | & $\mathrm{Ab\Gamma\delta123}$ \\ | \mathbf | & $\mathbf{\mathrm{Ab\Gamma\delta123}}$ !! \\ |\text | & $\text{Ab\Gamma\delta123}$ \\ | \textbf | & $\textbf{\text{Ab\Gamma\delta123}}$ \\ |\mathsf | & $\mathsf{Ab\Gamma\delta123}$ \\ | \mathbf | & $\mathbf{\mathsf{Ab\Gamma\delta123}}$ \\ |\mathtt | & $\mathtt{Ab\Gamma123}$ \\ | \mathbf | & $\mathbf{\mathtt{Ab\Gamma123}}$ \\ |\mathcal | & $\mathcal{ABC}$ \\ |\mathscr | & $\mathscr{ABC123}$ \\ |\mathbb | & $\mathbb{ABC1}$ \\ |\mathfrak | & $\mathfrak{ABC123}$ \\ \end{vrb} $\Gamma\Delta\Lambda\Phi\Pi\Psi\Sigma\Theta\Upsilon\Xi\Omega$ $\rm\Gamma\Delta\Lambda\Phi\Pi\Psi\Sigma\Theta\Upsilon\Xi\Omega$ \Gamma\Delta\Lambda\Phi\Pi\Psi\Sigma\Theta\Upsilon\Xi\Omega $\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda \mu\nu\xi\pi\rho\sigma\varsigma\tau\upsilon\phi\chi\psi\omega$ $\rm\alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda \mu\nu\xi\pi\rho\sigma\varsigma\tau\upsilon\phi\chi\psi\omega$ \alpha\beta\gamma\delta\epsilon\zeta\eta\theta\iota\kappa\lambda \mu\nu\xi\pi\rho\sigma\varsigma\tau\upsilon\phi\chi\psi\omega \end{document} % \end{macrocode} % % % % \section{Readme} % %<*readme> % % \begin{macrocode} # The `hep-math-font` package Extended Greek and sans-serif math ## Introduction The `hep-math-font` package adjust the math fonts to be sans-serif if the document is sans-serif. Additionally Greek letters are redefined to be always italic and upright in math and text mode respectively. Some math font macros are adjusted to give more consistently the naively expected results. The package is loaded using `\usepackage{hep-math-font}`. ## Author Jan Hajer ## License This file 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 `http://www.latex-project.org/lppl.txt` and version 1.3c or later is part of all distributions of LaTeX version 2005/12/01 or later. % \end{macrocode} % % % % \Finale \endinput % \PrintIndex % makeindex -s gglo.ist -o hep-math-font-implementation.gls hep-math-font-implementation.glo % makeindex -s gglo.ist -o hep-math-font-implementation.ind hep-math-font-implementation.idx