% \iffalse *first meta-comment*; see the second meta-comment % for copyright and package information % % % This file is mathfont_code.dtx from version 1.6 of the % LaTeX2e package "mathfont," to be used in conjunction with % the XeTeX or LuaTeX engines. It is used to typeset % documentation and files for mathfont, and running LaTeX on % mathfont_code.dtx will produce the following files: % % (1) the package code mathfont.sty; % % (2) the pdf documentation file mathfont_code.pdf; % % (3) the derived files mathfont_symbol_list.tex and % mathfont_user_guide.tex, which can be used to typeset % further documentation for mathfont; % % (4) the stand-alone derived files mathfont_heading.tex, % mathfont_doc_patch.tex, and mathfont_index_warning, % which are used to produce documentation; and % % (5) a number of other derived files. % % To install mathfont on your computer, run this file through % LaTeX and move mathfont.sty into a directory searchable by % TeX. % % % \fi % \iffalse *preamble and second meta-comment*; see the first % meta-comment for information about this file % % % This file is file from version 1.6 of the LaTeX package "mathfont," % to be used in conjunction with the XeTeX or LuaTeX engines. % % Copyright 2018-2019 by Conrad Kosowsky % % This file may be distributed and modified under the terms of the % LaTeX Public Project License, version 1.3c or any later version. % The most recent version of this license is available online at % % https://www.latex-project.org/lppl/. % % This work has the LPPL status "maintained," and the current % maintainer is the package author, Conrad Kosowsky. He can be % reached at kosowsky.latex@gmail.com. The work consists of the % following items: % % (1) the base file mathfont_code.dtx; % % (2) the package code contained in mathfont.sty; % % (3) the derived files mathfont_symbol_list.tex, % mathfont_user_guide.tex, mathfont_heading.tex, % mathfont_doc_patch.tex, and mathfont_index_warning.tex; % % (4) the pdf documentation files mathfont_code.pdf, % mathfont_symbol_list.pdf, and mathfont_user_guide.pdf; % % (5) all other files created through the configuration % process including mathfont_code.ind; and % % (6) the associated README.txt file. % % For more information, see the original mathfont.dtx file. To % install mathfont on your computer, run mathfont_code.dtx through % LaTeX and place the derived file mathfont.sty in a directory % searchable by TeX. % % % \fi % \iffalse % % The installation and driver files are incorporated into mathfont.dtx, % so we do not need to generate them separately. The and % tags are for reference. % %<*batchfile> \begingroup \input docstrip.tex \keepsilent \askforoverwritefalse \preamble This file is file from version 1.6 of the LaTeX package "mathfont," to be used in conjunction with the XeTeX or LuaTeX engines. Copyright 2018-2019 by Conrad Kosowsky This file may be distributed and modified under the terms of the LaTeX Public Project License, version 1.3c or any later version. The most recent version of this license is available online at https://www.latex-project.org/lppl/. This work has the LPPL status "maintained," and the current maintainer is the package author, Conrad Kosowsky. He can be reached at kosowsky.latex@gmail.com. The work consists of the following items: (1) the base file mathfont_code.dtx; (2) the package code contained in mathfont.sty; (3) the derived files mathfont_symbol_list.tex, mathfont_user_guide.tex, mathfont_heading.tex, and mathfont_doc_patch.tex; (4) the pdf documentation files mathfont_code.pdf, mathfont_symbol_list.pdf, and mathfont_user_guide.pdf; (5) all other files created through the configuration process such as mathfont.idx and mathfont.ind; and (6) the associated README.txt file. For more information, see the original mathfont.dtx file. To install mathfont on your computer, run mathfont_code.dtx through LaTeX and place the derived file mathfont.sty in a directory searchable by TeX. \endpreamble \generate{ \file{mathfont.sty}{\from{mathfont_code.dtx}{package}} \file{mathfont_symbol_list.tex}{\from{mathfont_code.dtx}{chars}} \file{mathfont_user_guide.tex}{\from{mathfont_code.dtx}{user}} \file{mathfont_heading.tex}{\from{mathfont_code.dtx}{heading}} \file{mathfont_doc_patch.tex}{\from{mathfont_code.dtx}{doc}} \file{mathfont_index_warning.tex}{\from{mathfont_code.dtx}{idxwarning}}} \catcode`\ =12\relax \message{^^J^^J ******************************************^^J * *^^J * To finish the installation, move the *^^J * following file into a directory *^^J * searchable by TeX once mathfont.dtx *^^J * finishes compiling: *^^J * *^^J * mathfont.sty *^^J * *^^J ******************************************^^J^^J^^J^^J^^J^^J} \endgroup % %<*driver> \documentclass[12pt,twoside]{ltxdoc} \makeatletter \usepackage[margin=72.27pt]{geometry} \usepackage[factor=700,stretch=14,shrink=14,step=1]{microtype} \usepackage{graphicx} \pretolerance=20 \hyphenpenalty=10 \exhyphenpenalty=5 \brokenpenalty=0 \finalhyphendemerits=300 \doublehyphendemerits=500 \c@IndexColumns=2 \columnsep=20pt \MacroIndent=1.32em \expandafter\newif\csname ifind\endcsname \let\index@prologue\relax \EnableCrossrefs\CodelineIndex \input mathfont_doc_patch.tex \begin{document} \def\documentname{Code Implementation} \input mathfont_heading.tex \DocInput{mathfont_code.dtx} \vfil\eject \section*{Index} \IfFileExists{mathfont_code.ind}\indtrue\indfalse \ifind Entries in italics refer to pages in this document, and non-italic entries refer to lines in the code. Bold indicates a definition. \medskip \input mathfont_code.ind \else \typeout{INCOMPLETE DOCUMENTATION: No file mathfont_chars.ind.} \input mathfont_index_warning.tex \fi \end{document} % %<*package> % % \fi % % % \CheckSum{5105} % \init@checksum % % % \makeatother\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 \~} % \makeatletter % % % % \DoNotIndex{\NeedsTeXFormat,\ProvidesPackage,\DeclareOption,\ProcessOptions,% % \def,\edef,\global,\let,\csname,\endcsname,\expandafter,\relax,\advance,% % \newcount,\newif,\z@,\@ne,\m@ne,\ifx,\ifcat,\ifnum,\ifmmode,\else,\fi,% % \PackageInfo,\PackageWarning,\PackageError,\message,\@undefined,% % \space,\MessageBreak,\string,\M@count,\count@,\noexpand,\protect,% % \@tempa,\@tempb,\@tempc,\@i,\@j,\@k,\count,\tw@,\@empty,% % \do,\DeclareMathSymbol,\the,\mathalpha,\mathord,\protect,\multiply,% % \M@symbols,\mathop,\mathbin,\mathrel,\mathopen,\mathclose,\mathpunct,% % \M@lower,\M@upper,\M@greeklower,\M@greekupper,\M@digits,% % \M@bb,\M@cal,\M@frak,\M@bcal,\M@bfrak,\mathinner,% % \DeclareRobustCommand,\joinrel,\smash,\newtoks,\if,\\,\@nil,\leavevmode,% % \begingroup,\endgroup,\+,\active,\@gobbletwo,\GenericError,\catcode, % \wlog,\typeout,\EasterEggUpdate,\E@sterEggUpdate,\show,\@temperror,% % \xdef,\@for,\@tfor,\@ifundefined,\@ifpackageloaded,\@nnil,\@onlypreamble,% % \AtBeginDocument,\AtEndOfPackage,\AtVeryVeryEnd,\bgroup,\CurrentOption,% % \egroup,\escapechar,\if@upper,\if@lower,\if@diacritics,% % \if@greekupper,\if@greeklower,\if@agreekupper,% % \if@agreeklower,\if@cyrillicupper,\if@cyrilliclower,% % \if@hebrew,\if@digits,\if@operator,\if@symbols,% % \if@extsymbols,\if@delimiters,\if@arrows,\if@bigops,% % \if@extbigops,\if@bb,\if@cal,\if@frak,\if@bcal,% % \if@bfrak,\if@optionpresent,\if@suboptionpresent,\M@arrows,\M@bigops,% % \M@delimiters,\M@diacritics,\M@extbigops,\M@extsymbols,\M@hebrew,% % \mathgroup,\nolimits,\on@line,\PackageWarningNoLine,\RequirePackage,% % \thr@@,\M@toks,\inputlineno,\M@agreekupper,\M@agreeklower,% % \M@cyrillicupper,\M@cyrilliclower,\mathchar@type,\DeclareMathAccent,% % \ifM@special,\M@specialtrue,\M@specialfalse,\IfFileExists,\M@SpecialHook} % \DoNotIndex{\M@bb@A,\M@bb@B,\M@bb@C,\M@bb@D,\M@bb@E,% % \M@bb@F,\M@bb@G,\M@bb@H,\M@bb@I,\M@bb@J,\M@bb@K,% % \M@bb@L,\M@bb@M,\M@bb@N,\M@bb@O,\M@bb@P,\M@bb@Q,% % \M@bb@R,\M@bb@S,\M@bb@T,\M@bb@U,\M@bb@V,\M@bb@W,% % \M@bb@X,\M@bb@Y,\M@bb@Z,\M@bb@a,\M@bb@b,\M@bb@c,% % \M@bb@d,\M@bb@e,\M@bb@f,\M@bb@g,\M@bb@h,\M@bb@i,% % \M@bb@j,\M@bb@k,\M@bb@l,\M@bb@m,\M@bb@n,\M@bb@o,% % \M@bb@p,\M@bb@q,\M@bb@r,\M@bb@s,\M@bb@t,\M@bb@u,% % \M@bb@v,\M@bb@w,\M@bb@x,\M@bb@y,\M@bb@z} % \DoNotIndex{\M@cal@A,\M@cal@B,\M@cal@C,\M@cal@D,\M@cal@E,% % \M@cal@F,\M@cal@G,\M@cal@H,\M@cal@I,\M@cal@J,\M@cal@K,% % \M@cal@L,\M@cal@M,\M@cal@N,\M@cal@O,\M@cal@P,\M@cal@Q,% % \M@cal@R,\M@cal@S,\M@cal@T,\M@cal@U,\M@cal@V,\M@cal@W,% % \M@cal@X,\M@cal@Y,\M@cal@Z,\M@cal@a,\M@cal@b,\M@cal@c,% % \M@cal@d,\M@cal@e,\M@cal@f,\M@cal@g,\M@cal@h,\M@cal@i,% % \M@cal@j,\M@cal@k,\M@cal@l,\M@cal@m,\M@cal@n,\M@cal@o,% % \M@cal@p,\M@cal@q,\M@cal@r,\M@cal@s,\M@cal@t,\M@cal@u,% % \M@cal@v,\M@cal@w,\M@cal@x,\M@cal@y,\M@cal@z} % \DoNotIndex{\M@frak@A,\M@frak@B,\M@frak@C,\M@frak@D,\M@frak@E,% % \M@frak@F,\M@frak@G,\M@frak@H,\M@frak@I,\M@frak@J,\M@frak@K,% % \M@frak@L,\M@frak@M,\M@frak@N,\M@frak@O,\M@frak@P,\M@frak@Q,% % \M@frak@R,\M@frak@S,\M@frak@T,\M@frak@U,\M@frak@V,\M@frak@W,% % \M@frak@X,\M@frak@Y,\M@frak@Z,\M@frak@a,\M@frak@b,\M@frak@c,% % \M@frak@d,\M@frak@e,\M@frak@f,\M@frak@g,\M@frak@h,\M@frak@i,% % \M@frak@j,\M@frak@k,\M@frak@l,\M@frak@m,\M@frak@n,\M@frak@o,% % \M@frak@p,\M@frak@q,\M@frak@r,\M@frak@s,\M@frak@t,\M@frak@u,% % \M@frak@v,\M@frak@w,\M@frak@x,\M@frak@y,\M@frak@z} % \DoNotIndex{\M@bcal@A,\M@bcal@B,\M@bcal@C,\M@bcal@D,\M@bcal@E,% % \M@bcal@F\M@bcal@G,\M@bcal@H,\M@bcal@I,\M@bcal@J,\M@bcal@K,% % \M@bcal@L\M@bcal@M,\M@bcal@N,\M@bcal@O,\M@bcal@P,\M@bcal@Q,% % \M@bcal@R,\M@bcal@S,\M@bcal@T,\M@bcal@U,\M@bcal@V,\M@bcal@W,% % \M@bcal@X,\M@bcal@Y,\M@bcal@Z,\M@bcal@a,\M@bcal@b,\M@bcal@c,% % \M@bcal@d,\M@bcal@e,\M@bcal@f,\M@bcal@g,\M@bcal@h,\M@bcal@i,% % \M@bcal@j,\M@bcal@k,\M@bcal@l,\M@bcal@m,\M@bcal@n,\M@bcal@o,% % \M@bcal@p,\M@bcal@q,\M@bcal@r,\M@bcal@s,\M@bcal@t,\M@bcal@u,% % \M@bcal@v,\M@bcal@w,\M@bcal@x,\M@bcal@y,\M@bcal@z} % \DoNotIndex{\M@bfrak@A,\M@bfrak@B,\M@bfrak@C,\M@bfrak@D,% % \M@bfrak@E,\M@bfrak@F,\M@bfrak@G,\M@bfrak@H,\M@bfrak@I,% % \M@bfrak@J,\M@bfrak@K,\M@bfrak@L,\M@bfrak@M,\M@bfrak@N,% % \M@bfrak@O,\M@bfrak@P,\M@bfrak@Q,\M@bfrak@R,\M@bfrak@S,% % \M@bfrak@T,\M@bfrak@U,\M@bfrak@V,\M@bfrak@W,\M@bfrak@X,% % \M@bfrak@Y,\M@bfrak@Z,\M@bfrak@a,\M@bfrak@b,\M@bfrak@c,% % \M@bfrak@d,\M@bfrak@e,\M@bfrak@f,\M@bfrak@g,\M@bfrak@h,% % \M@bfrak@i,\M@bfrak@j,\M@bfrak@k,\M@bfrak@l,\M@bfrak@m,% % \M@bfrak@n,\M@bfrak@o,\M@bfrak@p,\M@bfrak@q,\M@bfrak@r,% % \M@bfrak@s,\M@bfrak@t,\M@bfrak@u,\M@bfrak@v,\M@bfrak@w,% % \M@bfrak@x,\M@bfrak@y,\M@bfrak@z} % % % \DoNotIndexMain{\@@set@mathchar,\@@set@mathsymbol,% % \@@set@mathaccent,\set@mathchar,\set@mathsymbol,% % \set@mathaccent,\Umathcode,\Umathchardef,% % \colon,\mathellipsis,\angle,\sqsubset,\sqsupset,\bowtie,% % \doteq,\neq,\ng,\clubsuit,\spadesuit,\diamondsuit,% % \heartsuit,\cong,\uparrow,\Uparrow,\downarrow,\Downarrow,% % \updownarrow,\Updownarrow,\longrightarrow,\longleftarrow,$ % \longleftrightarrow,\hookrightarrow,\hookleftarrow,% % \Longrightarrow,\Longleftarrow,\Longleftrightarrow,% % \rightleftharpoons,\to,\mapsto,\mapsto,\longmapsto,% % \from,\mapsfrom,\longmapsfrom,\lightningboltarrow,\sum,% % \prod,\coprod,\bigvee,\bigwedge,\bigcup,\bigcap,% % \bigoplus,\bigotimes,\bigodot,\bigsqcup,\iint,\iiint,% % \oint,\oiint,\oiiint,\Umathaccent,\@uppershape,% % \@lowershape,\@diacriticsshape,\@greekuppershape,% % \@greeklowershape,\@agreekuppershape,\@agreeklowershape,% % \@cyrillicuppershape,\@cyrilliclowershape,\@hebrewshape,% % \@digitsshape,\@operatorshape,\@symbolsshape,% % \@extsymbolsshape,\@delimitersshape,\@arrowsshape,% % \@bigopsshape,\@extbigopsshape,\@bbshape,\@calshape,% % \@frakshape,\@bcalshape,\@bfrakshape} % % % This file documents the code for the \textsf{mathfont} package. It is fairly technical, and first-time users may prefer to start with the user guide. Section~1 begins with the implementation basics, including package declaration, package-option declaration, and error messages. Section~2 deals with errors and messaging, and section~3 contains the code that adjusts the \LaTeX\ kernel as well as necessary booleans and default font shapes. Section~4 contains the optional-argument parser for |\mathfont|, and section~5 contains the code for the |\mathfont| command itself. In section~6, the package initializes the commands for alphanumeric symbols, and section~7 contains the code for local font changes. Section~8 contains concluding material, and section~9 lists the unicode hex values used in symbol declaration. Version history and code index appear on subsequent pages. For documentation of the user-level commands, see |mathfont_user_guide.pdf|, and for a list of symbols accessible with \textsf{mathfont}, see |mathfont_symbol_list.pdf|. Both documentation files are included with the \textsf{mathfont} installation and are available on \textsc{ctan}. % % \section{Implementation Basics} % % First and foremost, the package needs to declare itself. % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{mathfont}[2019/12/05 v. 1.6 Package mathfont] \newif\ifM@font@loaded \newif\ifM@special\M@specialtrue \newif\ifM@XeTeXLuaTeX % \end{macrocode} % We begin by disabling the five user-level commands. If \textsf{mathfont} runs normally, it will override these definitions later, but if it throws one of its two fatal errors, it will |\endinput| while the user-level commands are error messages. That way the commands don't do anything, and the user gets information on why not. We make the ``bad'' definitions gobble their original arguments to avoid a ``missing |\begin{document}|'' error.\indexpage{invalid command error} % \begin{macrocode} \def\@gobbletwo@brackets[#1]#2{} \def\M@NoMathfontError#1{\PackageError{mathfont} {\MessageBreak Invalid command\MessageBreak \string#1 on line \the\inputlineno} {Your command was ignored. I couldn't\MessageBreak load mathfont successfully, so this\MessageBreak control sequence was never defined.}} \def\mathfont{\M@NoMathfontError\mathfont \@ifnextchar[\@gobbletwo@brackets\@gobble} \def\setfont{\M@NoMathfontError\setfont\@gobble} \def\newmathrm{\M@NoMathfontError\newmathrm\@gobbletwo} \def\newmathit{\M@NoMathfontError\newmathit\@gobbletwo} \def\newmathbf{\M@NoMathfontError\newmathbf\@gobbletwo} \def\newmathbfit{\M@NoMathfontError\newmathbf\@gobbletwo} \def\newmathfontcommand{\M@NoMathfontError\newmathfontcommand\@gobblefour} % \end{macrocode} % We absolutely must have \textsf{fontspec}. Before anything else, \TeX\ should check for |fontspec.sty| and stop reading in \textsf{mathfont} if it can't find the file. We change |+| to active to force \TeX\ to print the required spaces in the message, and we put the entire production inside a group to make this change local. The |\@gobbletwo| eats the extra period and return that \LaTeX\ adds to the error message. Notice the strategic placement of the |\endgroup|s. We need |\M@NoFontspecError| to both tokenize its definition and then evaluate while |+| has catcode 13. If we evaluate |\M@NoFontspecError| outside the group, \TeX\ will issue an |\inaccessible| error, so we should place the macro inside the group. However, we want |\AtBeginDocument| and |\endinput| outside the group, so we need a separate |\endgroup| for each branch. We put the |\endgroup| in the false branch between the error and the remaining material.\indexpage{fontspec=\textsf{fontspec}}\indexpage{fatal error}\indexpage{catcode changes}\indexpage{could not find fontspec=could not find \textsf{fontspec}} % \begin{macrocode} \begingroup \catcode`\+=\active \def+{ } \def\M@NoFontspecError{\GenericError{} {\MessageBreak\MessageBreak Package mathfont fatal error: \MessageBreak\MessageBreak +*********************\MessageBreak +*+++++++++++++++++++*\MessageBreak +*++!!FATAL ERROR!!++*\MessageBreak +*+++++++++++++++++++*\MessageBreak +*+++++Could not+++++*\MessageBreak +*+++find+fontspec+++*\MessageBreak +*+++++++++++++++++++*\MessageBreak +*********************\MessageBreak\@gobbletwo} {See the mathfont package documentation for explanation.} {Um, I couldn't find the file fontspec.sty.\MessageBreak The mathfont package is useless without\MessageBreak fontspec, so I'm going to stop reading it\MessageBreak in now. (You won't be able to use any\MessageBreak commands from mathfont in your document.)\MessageBreak To make mathfont work correctly, please\MessageBreak install fontspec on your computer.}} \IfFileExists{fontspec.sty}{\endgroup} {\M@NoFontspecError\endgroup \AtEndOfPackage{\typeout{Package mathfont failed to load\on@line}} \endinput} % \end{macrocode} % We also want a salient error message if the engine doesn't define the required \XeTeX\ or Lua\TeX\ primitives.\indexpage{fatal error}\indexpage{XeTeX=\XeTeX}\indexpage{primitives}\indexpage{LuaTeX=Lua\TeX}\indexpage{catcode changes}\indexpage{missing xetex or luatex=missing \XeTeX\ or Lua\TeX} % \begin{macrocode} \begingroup \catcode`\+=\active \def+{ } \def\M@XeTeXLuaTeXError{\GenericError{} {\MessageBreak\MessageBreak Package mathfont fatal error: \MessageBreak\MessageBreak +*********************\MessageBreak +*+++++++++++++++++++*\MessageBreak +*++!!FATAL ERROR!!++*\MessageBreak +*+++++++++++++++++++*\MessageBreak +*+++Missing XeTeX+++*\MessageBreak +*+++++or LuaTeX+++++*\MessageBreak +*+++++++++++++++++++*\MessageBreak +*********************\MessageBreak\@gobbletwo} {See the mathfont package documentation for explanation.} {I need XeTeX or LuaTeX to make this\MessageBreak package work properly. It looks like the\MessageBreak current engine is something else, so I'm\MessageBreak going to stop reading in the package file\MessageBreak now. (You won't be able to use commands\MessageBreak from mathfont in your document.) To make\MessageBreak mathfont work correctly, please retypeset\MessageBreak this file with one of those two engines.}} % \end{macrocode} % Check that the engine has defined the necessary primitives.\indexpage{engine checks}\indexpage{fatal error}\indexpage{primitives} % \begin{macrocode} \ifx\Umathcode\@undefined \else \ifx\Umathchardef\@undefined \else \ifx\Umathaccent\@undefined \else \M@XeTeXLuaTeXtrue \fi \fi \fi \ifM@XeTeXLuaTeX \endgroup \else \M@XeTeXLuaTeXError\endgroup \AtEndOfPackage{\typeout{Package mathfont failed to load\on@line}} \expandafter\endinput% we should \endinput with a balanced conditional \fi % \end{macrocode} % Some package options are now depreciated.\indexpage{depreciated} % \begin{macrocode} \def\M@OptionDepreciated#1#2{\PackageError{mathfont} {Option "#1" depreciated} {Your option was ignored. Please\MessageBreak use #2\MessageBreak instead. For more information,\MessageBreak see the mathfont documentation.}} % \end{macrocode} % We code the package options, and for font names, |\DeclareOption*| tells \textsf{mathfont} how to handle an unknown option. The package sets |\ifM@font@loaded| to true and stores the font name in |\M@font@load|. % \begin{macrocode} \IfFileExists{atveryend.sty} {\RequirePackage{atveryend}\let\M@SpecialHook\AtVeryVeryEnd} {\let\M@SpecialHook\AtEndDocument} \DeclareOption{packages}{\M@OptionDepreciated{packages} {\string\restoremathinternals}} \DeclareOption{operators}{\M@OptionDepreciated{operators} {the bigops keyword with \string\mathfont}} \DeclareOption{no-operators}{\M@OptionDepreciated{no-operators} {the bigops keyword with \string\mathfont}} \DeclareOption{easter-egg}{\ifM@special\M@specialfalse \def\EasterEggUpdate{\show\E@sterEggUpdate} \def\E@sterEggUpdate{Okay, opening your Easter egg} \EasterEggUpdate \def\E@sterEggUpdate{..} \EasterEggUpdate \EasterEggUpdate \typeout{^^JHm, I think it flew out the^^J% window. Check back here when^^J% everything's done compiling^^J} \def\E@sterEggUpdate{Uh oh} \EasterEggUpdate \def\E@sterEggUpdate{Still wrangling. Try back later} \AtBeginDocument\EasterEggUpdate \M@SpecialHook{% \typeout{^^JHappy, happy day! Happy,^^J% happy day! Clap your hands,^^J% and be glad your hovercraft^^J% isn't full of eels!^^J} \def\E@sterEggUpdate{Got it} \EasterEggUpdate} \fi}% my easter egg :) % \end{macrocode} % Interpret an unknown option as a font name and save it to feed to \textsf{fontspec}.\?\ifM@font@loaded\indexpage{optional package argument} % \begin{macrocode} \DeclareOption*{\M@font@loadedtrue\edef\M@font@load{\CurrentOption}} \ProcessOptions* % \end{macrocode} % % % \section{Errors and Messaging} % % Some error and informational messages. We begin with general informational messages.\indexpage{log file=\texttt{log} file}\indexpage{LaTeX kernel=\LaTeX\ kernel} % \begin{macrocode} \def\M@FontChangeInfo#1#2{\wlog{Package mathfont Info: Changing #1 characters to #2!}} \def\M@CommandInitializeInfo#1{\wlog{Package mathfont Info: Initializing \noexpand#1 font-change command on line \the\inputlineno.}} \def\M@NewFontCommandInfo#1#2#3#4{\wlog{Package mathfont Info: Creating math alphabet command \noexpand#1 using^^J% #2 font with series #3 and shape #4 on line \the\inputlineno.}} \def\M@SetInternalsInfo{\wlog{Package mathfont Info: Setting \string\set@mathchar, \string\set@mathsymbol, \string\set@mathaccent.}} \def\M@RestoreInternalsInfo{\wlog{Package mathfont Info: Fixing \string\set@mathchar, \string\set@mathsymbol, \string\set@mathaccent.}} \def\M@CharsSetWarning#1{\PackageWarning{mathfont} {Font for #1 chars has already\MessageBreak been set, so I'm ignoring this\MessageBreak keyword}} % \end{macrocode} % Warnings for the |\mathbb|, etc.\ commands.\indexpage{multiple characters warning}\indexpage{nested argument warning}\indexpage{control sequence warning}\indexpage{alphanumeric symbols} % \begin{macrocode} \def\M@DoubleArgWarning#1#2{\PackageWarning{mathfont} {I'm ignoring the multiple characters\MessageBreak "#1" that are grouped together in\MessageBreak the argument of your \expandafter\string#2\space command\MessageBreak}} \def\M@NestedArgWarning#1#2{\PackageWarning{mathfont} {I'm ignoring the nested argument\MessageBreak "#1" from your \expandafter\string#2\MessageBreak command}} \def\M@ControlSequenceArgWarning#1#2{\PackageWarning{mathfont} {I'm ignoring the unexpandable control\MessageBreak sequence \expandafter\string#1\space that appears in the\MessageBreak argument of your \expandafter\string#2\space command\MessageBreak}} \def\M@CharacterArgWarning#1#2{\PackageWarning{mathfont} {I'm ignoring the "#1" in the\MessageBreak argument of your \expandafter\string#2\MessageBreak command because it isn't a\MessageBreak letter or digit}} % \end{macrocode} % Warning for depreciated commands.\indexpage{depreciated} % \begin{macrocode} \def\M@DepreciatedWarning#1#2{\PackageWarning{mathfont} {Your \string#1\space command is\MessageBreak depreciated, and I replaced it with\MessageBreak \string#2}} % \end{macrocode} % Error message from loading \textsf{fontspec} without |no-math|.\indexpage{fontspec=\textsf{fontspec}}\indexpage{no-math option=\texttt{no-math} option for \textsf{fontspec}} % \begin{macrocode} \def\M@NoMathError{\PackageError{mathfont} {Package fontspec was loaded\MessageBreak without the "no-math" option} {This isn't really an error--it's fine to load\MessageBreak fontspec without "no-math." However, strange\MessageBreak things could happen, so beware of any sudden\MessageBreak and unexpected font changes. To resolve this\MessageBreak error message, load fontspec with the "no-\MessageBreak math" option. If you haven't loaded fontspec\MessageBreak manually, try loading mathfont earlier in your\MessageBreak preamble.}} % \end{macrocode} % Error messages associated with |\mathfont|.\indexpage{default font changes}\indexpage{invalid option or suboption}\indexpage{missing option or suboption}\indexpage{internal commands restored} % \begin{macrocode} \def\M@InvalidOptionError#1{\PackageError{mathfont} {Invalid option "#1"\MessageBreak for \string\mathfont\on@line} {Hm. Check that you spelled the\MessageBreak option correctly. Otherwise, I'm\MessageBreak not sure what's wrong. Is this\MessageBreak option listed in the package\MessageBreak documentation? In any event, I'm\MessageBreak going to ignore this option.}} \def\M@InvalidSuboptionError#1{\PackageError{mathfont} {Invalid suboption "#1"\MessageBreak for \string\mathfont\on@line} {Hm. Check that you spelled the\MessageBreak suboption correctly. Otherwise, I'm\MessageBreak not sure what's wrong. Is this\MessageBreak suboption listed in the package\MessageBreak documentation? In any event, I'm\MessageBreak going to ignore this suboption.}} \def\M@MissingOptionError{\PackageError{mathfont} {Missing option for\MessageBreak \string\mathfont\on@line} {It looks like you included a , or = in\MessageBreak the optional argument of \string\mathfont\MessageBreak but didn't put anything before it.}} \def\M@MissingSuboptionError{\PackageError{mathfont} {Missing suboption for\MessageBreak \string\mathfont\on@line} {It looks like you included an = somewhere\MessageBreak but didn't put the suboption after it. Either\MessageBreak that or you typed == instead of = in the\MessageBreak optional argument of \string\mathfont.}} \def\M@InternalsRestoredError{\PackageError{mathfont} {Internal commands restored} {This package slightly changes two LaTeX\MessageBreak internal commands, and you really shouldn't\MessageBreak be loading new math fonts without those\MessageBreak adjustments. What happened here is that you\MessageBreak used \string\mathfont\space in a situation where those\MessageBreak two commands retain their original defini-\MessageBreak tions. Presumably you used \string\mathfont\space after\MessageBreak calling the \string\restoremathinternals\space command.\MessageBreak I'm going to ignore this call to \string\mathfont.\MessageBreak Try retypesetting this document with all\MessageBreak \string\mathfont\space commands placed before you call\MessageBreak \string\restoremathinternals.}} % \end{macrocode} % Error messages for the |\newmathrm|, etc.\ commands.\indexpage{local font changes}\indexpage{missing control sequence}\indexpage{multiple characters error}\indexpage{missing \$=missing \texttt\$ inserted}\index{local font changes} % \begin{macrocode} \def\M@MissingControlSequenceError#1#2{\PackageError{mathfont} {Missing control sequence\MessageBreak for\string#1\MessageBreak on input line \the\inputlineno} {Your command was ignored. Right now the\MessageBreak first argument of \string#1\space is "#2."\MessageBreak Please use a control sequence instead.}} \def\M@DoubleArgError#1#2{\PackageError{mathfont} {Multiple characters in\MessageBreak first argument of \string#2\MessageBreak on input line \the\inputlineno} {Your command was ignored. Right now the\MessageBreak first argument of \string#2\space is "#1,"\MessageBreak which is multiple characters. Please use\MessageBreak a single character instead.}} \def\M@HModeError#1{\PackageError{mathfont} {Missing \$ inserted. The\MessageBreak command \string#1\space must be used in\MessageBreak math mode\on@line} {I generated an error because\MessageBreak you used \string#1\space outside of\MessageBreak math mode. I've inserted a \string$\MessageBreak just before your \string#1, so\MessageBreak we should be all good now.}} % \end{macrocode} % % \section{Default Settings} % % We load the \textsf{fontspec} package in order to use its main font loading mechanism, and we |\let| the macro |\@newfont| take on this function. We also make sure that \textsf{fontspec} was loaded with the |no-math| option because without it, \textsf{fontspec} may cause trouble with some of the math characters. If |\g__fontspec_math_bool| is equal to 1, \textsf{mathfont} will issue an error message.\indexpage{default font changes}\indexpage{fontspec=\textsf{fontspec}}\indexpage{fontspecsetfamily=\fontspeccommand}\indexpage{no-math option=\texttt{no-math} option for \textsf{fontspec}} % \begin{macrocode} \@ifpackageloaded{fontspec} {\ifnum\csname g__fontspec_math_bool\endcsname=\@ne \M@NoMathError \fi}{\RequirePackage[no-math]{fontspec}} \expandafter\let\expandafter\@newfont \csname fontspec_set_family:Nnn\endcsname % \end{macrocode} % We save |\set@mathchar| and |\set@mathsymbol| from the \LaTeX\ kernel so we can change their definitions. We need to adapt these macros for use with unicode fonts, and we replace |\mathcode| and |\mathchardef| respectively with the \XeTeX\ and Lua\TeX\ primitives |\Umathcode| and |\Umathchardef|. The unicode primitives support decimal input using a |+| sign, and we take advantage of that feature to avoid hexadecimal conversions.\indexpage{LaTeX kernel=\LaTeX\ kernel}\indexpage{primitives} % \begin{macrocode} \M@SetInternalsInfo \let\@@set@mathchar\set@mathchar \let\@@set@mathsymbol\set@mathsymbol \let\@@set@mathaccent\set@mathaccent % \end{macrocode} % Kernel command to set math characters from keystrokes. % \begin{macrocode} \def\set@mathchar#1#2#3#4{% \multiply\count\z@ by 16\relax \advance\count\z@\count\tw@ \global\Umathcode`#2=\mathchar@type#3+#1+\count\z@\relax} % \end{macrocode} % Kernel command to set math characters from control sequences. % \begin{macrocode} \def\set@mathsymbol#1#2#3#4{% \multiply\count\z@ by 16\relax \advance\count\z@\count\tw@ \global\Umathchardef#2\mathchar@type#3+#1+\count\z@\relax} % \end{macrocode} % Kernel command to set accents. % \begin{macrocode} \def\set@mathaccent#1#2#3#4{% \multiply\count\z@ by 16\relax \advance\count\z@\count\tw@ \xdef#2{\Umathaccent\mathchar@type#3+#1+\the\count\z@\relax}} % \end{macrocode} % We need to keep track of the number of times we have loaded a font, and the count |\M@count| fulfills this role. The |\M@toks| object will record a message that displays when the user calls |\mathfont|, and |\M@return| will keep track of when to add a carriage return to |\M@toks|. % \begin{macrocode} \newcount\M@count \newcount\M@return \M@count\z@ \newtoks\M@toks % \end{macrocode} % We create necessary booleans and the default math font shapes.\indexpage{default shapes} % \begin{macrocode} \newif\if@upper \newif\if@lower \newif\if@diacritics \newif\if@greekupper \newif\if@greeklower \newif\if@agreekupper \newif\if@agreeklower \newif\if@cyrillicupper \newif\if@cyrilliclower \newif\if@hebrew \newif\if@digits \newif\if@operator \newif\if@symbols \newif\if@extsymbols \newif\if@delimiters \newif\if@arrows \newif\if@bigops \newif\if@extbigops \newif\if@bb \newif\if@cal \newif\if@frak \newif\if@bcal \newif\if@bfrak \newif\if@optionpresent \newif\if@suboptionpresent \newif\ifM@mathfont@firstoption \newif\ifM@anychars@changed \newif\ifM@arg@good \def\@uppershape{italic}% latin upper \def\@lowershape{italic}% latin lower \def\@diacriticsshape{roman}% diacritics \def\@greekuppershape{roman}% greek upper \def\@greeklowershape{italic}% greek lower \def\@agreekuppershape{roman}% ancient greek upper \def\@agreeklowershape{italic}% ancient greek lower \def\@cyrillicuppershape{roman}% cyrillic upper \def\@cyrilliclowershape{italic}% cyrillic lower \def\@hebrewshape{roman}% hebrew \def\@digitsshape{roman}% numerals \def\@operatorshape{roman}% operator font \def\@symbolsshape{roman}% basic symbols \def\@extsymbolsshape{roman}% extended symbols \def\@delimitersshape{roman}% delimiters \def\@arrowsshape{roman}% arrows \def\@bigopsshape{roman}% big operators \def\@extbigopsshape{roman}% extended big operators \def\@bbshape{roman}% blackboard bold \def\@calshape{roman}% caligraphic \def\@frakshape{roman}% fraktur \def\@bcalshape{roman}% bold caligraphic \def\@bfrakshape{roman}% bold fraktur \def\@defaultkeys{upper,lower,diacritics,greekupper,greeklower,% digits,symbols,operator} \def\@normalkeys{upper,lower,diacritics,greekupper,greeklower,agreekupper,% agreeklower,cyrillicupper,cyrilliclower,hebrew,digits,operator,symbols,% extsymbols,delimiters,arrows,bigops,extbigops} \def\@alphanumkeys{bb,cal,frak,bcal,bfrak} % \end{macrocode} % % % % \section{Parse Input} % % The command |\M@check@option@valid| confirms that a user's keyword option is legitimate. The macro defines |\@temperror| to be an invalid option error and loops through all possible options. If the command argument matches one of the correct possibilities, the package changes |\@temperror| to |\relax|. The macro ends this process with a call to |\@temperror|, so the package issues an error if and only if the specified option is invalid. We switch the |\if@optionpresent| and |\if@suboptionpresent| booleans to true in these macros when the respective |\@for| loops match the prospective option or suboption to a valid choice. We have to initialize the blackboard, calligraphic, and fraktur commands separately because they don't use the same encoding-alphabet system as the regular letters and digits, and the |\define@|\argtext{keyword} macro does this.\indexpage{keyword option=keyword options for \texttt{\string\string\string\mathfont}}\indexpage{invalid option or suboption}\indexpage{missing option or suboption} % \begin{macrocode} \def\M@check@option@valid#1{% \def\@temperror{\M@InvalidOptionError{#1}} \@for\@j:=\@normalkeys\do{% \ifx\@j#1 \let\@temperror\relax \@optionpresenttrue% set switch to true if option is valid \advance\M@return\@ne \fi} % \end{macrocode} % We have to initialize alphanumeric symbols separately.\indexpage{alphanumeric symbols} % \begin{macrocode} \@for\@j:=\@alphanumkeys\do{% \ifx\@j#1 \let\@temperror\relax \expandafter\M@CommandInitializeInfo\csname math\@j\endcsname \csname define@\@j\endcsname% initialize \@optionpresenttrue% set switch to true if option is valid \advance\M@return\@ne \fi} \@temperror} % \end{macrocode} % Do the same thing for the suboption. % \indexpage{suboption roman=suboption \texttt{roman}}% % \indexpage{suboption italic=suboption \texttt{italic}}% % \begin{macrocode} \def\M@check@suboption@valid#1{% \def\@temperror{\M@InvalidSuboptionError{#1}} \@for\@j:=roman,italic\do{% \ifx\@j#1 \let\@temperror\relax \@suboptionpresenttrue% set switch to true if suboption is valid \advance\M@return\@ne \fi} \@temperror} % \end{macrocode} % We want to allow the user to specify options using an \textsf{xkeyval}-type syntax. However, we do not need the full package; a slim 22 lines of code will suffice. When |\mathfont| reads one segment of \textit{text} from its comma-delimited optional argument, it calls |\M@parse@option|\argtext{text}|=\@nil|. The |\M@parse@option| macro splits the option and suboption by looking for the first |=|. It puts its |#1| argument in |\@tempa| and |#2| in |\@tempb| and then checks whether option and suboption are present and valid. If the user specifies a suboption, their \textit{text} will contain an |=|, so the option ends up in |\@tempa| while |\@tempb| contains \argtext{suboption}|=|. Calling |\M@strip@equals| extracts the suboption. If the user does not specify a suboption, the user's \textit{text} will not contain an |=|, and |\@tempb| will end up empty. We check for errors by determining whether (1) |\@tempa| is empty, meaning the user did not specify an option; (2) |@tempb| is |=|, meaning the user did not specify a suboption; and (3) the contents of |\@tempa| and |\@tempb| correspond to valid options and suboptions. The macros |\M@check@option@valid| and |\M@check@suboption@valid| handle the last step. % \indexpage{parse mathfont arguments=parse \texttt{\char`\\mathfont} arguments} % \begin{macrocode} \def\M@strip@equals#1={#1} \def\M@parse@option#1=#2\@nil{% \@optionpresentfalse% set switch to false by default \@suboptionpresentfalse% set switch to false by default \def\@tempa{#1} \def\@tempb{#2} \ifx\@tempa\@empty \M@MissingOptionError \else \M@check@option@valid\@tempa \def\@tempc{=} \ifx\@tempb\@tempc \M@MissingSuboptionError \else \ifx\@tempb\@empty \else \edef\@tempb{\expandafter\M@strip@equals\@tempb} \M@check@suboption@valid\@tempb \fi \fi \fi} % \end{macrocode} % Define a variant of |\zap@space| that will work with control sequences. Used for removing spaces from the optional argument of |\mathfont|.\indexpage{parse spaces} % \begin{macrocode} \def\M@eat@spaces#1{\expandafter\zap@space#1 \@empty} % \end{macrocode} % We end this section by coding a macro used later in error checking. Here |#1| is an argument that we expect to be a single token or set of tokens inside braces, so we check whether |#2| is empty. The parameters |#3| and |#4| correspond to an error and to the original command respectively.\indexpage{error checking} % \begin{macrocode} \def\M@check@arglength#1#2\@nil#3#4{% \ifx\@nnil#2\@nnil \else #3{#1#2}{#4}% \M@arg@goodfalse \fi} % \end{macrocode} % % % % \section{Default Font Changes}\indexpage{default font changes} % % The user-level command |\mathfont| functions as the main font-changing command. It takes no argument directly but rather checks for an optional argument and passes keyword information to the internal command |\@mathfont|. It scans next nonspace token using |\@ifnextchar| and determines whether it is a |[|. If yes, the user specified an optional argument, and the package converts the space character to catcode 9 before scanning the optional argument with |\m@thf@nt|. If no, the package calls |\@mathfont| directly with the default list of keywords stored in |\@defaultkeys|. The |\m@thf@nt| macro scans a single argument delimited by brackets, resets the catcode of spaces, and calls |\@mathfont| with the user's scanned and de-spaced argument. We put the catcode change inside a group to make it local. % % The internal |\@mathfont| accepts two arguments: a list of keywords and suboptions |#1| and a font name |#2|. The macro proceeds in several steps: (1) it checks if |\set@mathchar| has been reset, and if so, the current call to |\mathfont| does nothing; (2) the macro loads the user's font with |\@newfont| and stores the internal name in |\M@font|\argtext{number}; (3) it expands the optional argument with an |\edef| and stores it in |\@tempa|; and (5) it calls |\M@eat@spaces|, which is a wrapped version of |\zap@space|, on the contents of |\@tempa| to remove any spaces that remain after scanning with |\m@thf@nt|. At this point, the package is ready to parse the optional argument. It loops through the segments of |#1| with |\@for| and calls |\M@parse@option|\argtext{text}|=\@nil| on each piece of text. If they exist, the argument keyword ends up in |\@tempa|, and the suboption goes into |\@tempb|. The macro punctuates |\M@toks| accordingly and then defines symbol fonts with the information from |\@tempa|, |\@tempb|, and the argument |#2|. Finally, the package calls |\M@|\argtext{keyword}|@set| to set the default font and changes the corresponding boolean from false to true. % % The package stores each new font in a macro of the form |\M@font|\argtext{number}, where \textit{number} is given by the current value of |\M@count|. The name of the corresponding symbol fonts is |M|\argtext{shape}\argtext{number}, where \textit{shape} is either \texttt{roman} or \texttt{italic} and \textit{number} is again the value of |\M@count|. For each package keyword, the package defined |\@|\argtext{keyword}|shape| as the default shape in section~3, and if the user specifies a suboption for any keyword in the optional argument of |\mathfont|, the package overrides the default shape by redefining |\@|\argtext{keyword}|shape|. For example, if the user writes % \begin{code} % |\mathfont[upper=roman]{Zapfino}| % \end{code} % immediately after loading \textsf{mathfont}, the package will define |\M@font0| to be the internal name of Zapfino, and the corresponding symbol font names will be |Mroman0| and |Mitalic0|. Because the user specified a suboption, |\@mathfont| redefines |\@uppershape| to the token string \texttt{roman}, and \textsf{mathfont} uses |\@uppershape| later to specify the symbol font for capital Latin characters. This happens inside |\@mathfont| when the package calls |\M@upper@set| and defines |\M@upper| as the expansion of |M\@uppershape\the\M@count|.\?\mathfont\indexpage{parse spaces}\indexpage{catcode changes} % \begin{macrocode} \def\mathfont{\@ifnextchar[% next line is the two possible branches {\bgroup\catcode`\ =9\relax\m@thf@nt}{\@mathfont[\@defaultkeys]}} \def\m@thf@nt[#1]{\egroup\@mathfont[#1]} % \end{macrocode} % The internal default-font-changing command.\?\M@font\indexpage{internal commands restored} % \begin{macrocode} \def\@mathfont[#1]#2{% \ifx\set@mathchar\@@set@mathchar \M@InternalsRestoredError % \end{macrocode} % If the kernel commands have not been reset, we can do fun stuff. % \begin{macrocode} \else \M@return\thr@@ \M@toks{} \M@mathfont@firstoptiontrue % \end{macrocode} % Use |\@newfont| to load the user's font.\indexpage{log file=\texttt{log} file} % \begin{macrocode} \wlog{Package mathfont Info: Loading font #2 with package fontspec.} \expandafter\@newfont\csname M@font\the\M@count\endcsname{}{#2} % \end{macrocode} % Expand, zap spaces from, and store the optional argument in |\@tempa|, and then perform the loop. We store the current keyword-suboption pair in |\@i| and then feed it to |\M@parse@option|. We need two |\edef|s here because |\zap@space| appears before |\@tempa| in |\M@eat@spaces|. We expand the argument with the first |\edef| and remove the spaces with the second. % \indexpage{parse \texttt{\char`\\mathfont} arguments}\indexpage{parse spaces} % \begin{macrocode} \edef\@tempa{#1} \edef\@tempa{\M@eat@spaces\@tempa} \@for\@i:=\@tempa\do{\expandafter\M@parse@option\@i=\@nil \if@optionpresent % \end{macrocode} % If the user calls |\mathfont| and tries multiple times to set the font for a certain class of characters, \textsf{mathfont} will issue a warning, and the package will not adjust the font for those characters. Notice the particularly awkward syntax with the |\csname|-|\endcsname| pairs. Without this construct, \TeX\ won't realize that |\csname if@\@tempa\endcsname| matches the eventual |\fi|, and the |\@for| loop will break. (\TeX\ does not have a smart if-parser!)\indexpage{keyword option=keyword options for \texttt{\string\string\string\mathfont}}\indexpage{parse conditionals} % \begin{macrocode} \expandafter\ifx% next line is two cs to be compared \csname if@\@tempa\expandafter\endcsname\csname iftrue\endcsname \M@CharsSetWarning{\@tempa} % \end{macrocode} % The case where the keyword-option has not already been set. This will be (almost) all situations. We begin by punctuating the toks. The |\ifM@mathfont@firstoption| boolean is a bookkeeping variable that determines whether to add a |,| to the list of keywords in |\M@toks|, and |\M@return| counts how many keywords we have added to |\M@toks|. When this number gets high enough, we start a new line. % \begin{macrocode} \else \ifM@mathfont@firstoption \M@mathfont@firstoptionfalse \else \ifnum\M@return>5\relax \expandafter\M@toks\expandafter{\the\M@toks,^^J} \M@return\z@ \else \expandafter\M@toks\expandafter{\the\M@toks, } \fi \fi % \end{macrocode} % Add the keyword-option to the toks. % \begin{macrocode} \edef\@tempc{\the\M@toks\@tempa} \expandafter\M@toks\expandafter{\@tempc} % \end{macrocode} % Handle the case with a suboption. % \begin{macrocode} \if@suboptionpresent \expandafter\edef\csname @\@tempa shape\endcsname{\@tempb} \edef\@tempc{\the\M@toks\space(\@tempb)} \expandafter\M@toks\expandafter{\@tempc} \fi % \end{macrocode}\indexpage{suboption roman=suboption \texttt{roman}} % \indexpage{suboption italic=suboption \texttt{italic}} % For either possible suboption, check whether the package has already declared that version of the current font for use in math mode using |\@ifundefined|. If not, do so. % \begin{macrocode} \def\@tempb{roman} \expandafter\ifx\csname @\@tempa shape\endcsname\@tempb \@ifundefined{symMroman\the\M@count} {\DeclareSymbolFont{Mroman\the\M@count}{TU} {\csname M@font\the\M@count\endcsname}{m}{n}}{} \fi \def\@tempb{italic} \expandafter\ifx\csname @\@tempa shape\endcsname\@tempb \@ifundefined{symMitalic\the\M@count} {\DeclareSymbolFont{Mitalic\the\M@count}{TU} {\csname M@font\the\M@count\endcsname}{m}{it}}{} \fi % \end{macrocode} % Store the new font information so we can write it to the |log| file |\AtBeginDocument|.\indexpage{log file=\texttt{log} file} % \begin{macrocode} \expandafter\edef\csname M@\@tempa @fontinfo\endcsname{#2} \M@anychars@changedtrue % \end{macrocode} % And now the magic happens.\indexpage{default font changes}\indexpage{M@keyword@set=\texttt{\char`\\M@}\string\argtext{keyword}\texttt{@set}} % \begin{macrocode} \M@FontChangeInfo{\@tempa}{#2} \csname M@\@tempa @set\endcsname% set default font \csname @\@tempa true\endcsname% set switch to true \fi \fi} % \end{macrocode} % Finally, advance |\M@count| and display messages for the user.\indexpage{log file=\texttt{log} file} % \begin{macrocode} \advance\M@count\@ne \edef\@tempa{\the\M@toks} \ifx\@tempa\@empty \wlog{The \string\mathfont\space command on line \the\inputlineno\space did not change the font for any characters!} \else \typeout{:: mathfont :: Math font set to #2\space on line \the\inputlineno.} \wlog{Character classes changed: \the\M@toks.^^J} \fi \fi} \@onlypreamble\mathfont \@onlypreamble\m@thf@nt \@onlypreamble\@mathfont % \end{macrocode} % We end the section by coding |\setfont|.\indexpage{optional package argument} % \begin{macrocode} \def\setfont#1{\setmainfont[Ligatures=TeX]{#1}\mathfont{#1}} \@onlypreamble\setfont % \end{macrocode} % % % % \section{Alphanumeric Symbols} % % Each |\define@|\argtext{keyword} macro redefines one of the standard |\math|\argtext{keyword} commands. The new versions first check if they are in math mode using |\M@check@mode| and then scan all tokens of their argument using |\@tfor|. For each token, the macro calls |\M@|\argtext{keyword}|@|\argtext{token}, which evaluates to a |\mathord| symbol in the desired style.\indexpage{alphanumeric symbols} % \begin{macrocode} \def\M@check@mode#1{% \let\@tempa#1% \ifmmode \expandafter\@tempa \else % \end{macrocode} % Temporarily change the escape character code to $-1$ so we can gobble the |@| in |@math|\argtext{keyword} without worrying about the escape character. We need to do this for error messaging purposes because |\M@HModeError| displays the user-level command that caused the error. Finally, the package adds a missing |$| in order to enter math mode. % \indexpage{missing \$=missing \texttt\$ inserted}\indexpage{error checking} % \begin{macrocode} \bgroup \escapechar\m@ne \expandafter \egroup \expandafter\M@HModeError\csname\expandafter\@gobble\string#1\endcsname \leavevmode\expandafter$\expandafter\@tempa \fi} % \end{macrocode} % The |\M@process@tokens| macro turns the letters into alphanumeric symbols. This macro loops through the argument of the original |\math|\argtext{keyword} macro with |\@tfor| and calls |\M@check@token| on each |\@k| to validate the input. If the \textit{token} is valid, \TeX\ calls the corresponding |\M@|\argtext{keyword}|@|\argtext{token} math character command, and if not, |\M@check@token| will issue an error. % \begin{macrocode} \def\M@process@tokens#1#2{% \edef\@tempa{#1}% \expandafter\@tfor\expandafter\@k\expandafter:\expandafter=\@tempa\do{% \expandafter\M@check@token\expandafter{\@k}{#2}% % \end{macrocode} % And typeset the character. Error checking has set |\ifM@arg@good| to either true or false depending on whether |\@k| is a valid input or not. % \begin{macrocode} \ifM@arg@good \csname M@#2@\@k\endcsname \fi}} % \end{macrocode} % We check for errors with |\M@check@token|. The argument |#1| is the argument to be checked, and argument |#2| is a keyword that goes into warning messages. Checking happens in five steps: (1) verify \TeX\ cannot split the contents of |#1| (which in |\M@process@tokens| is |\@k|) into multiple arguments; (2) verify that the argument does not begin with a character of catcode 1, i.e.\ |{|; (3) verify that the token is not a control sequence; (4) check whether the character is a letter; and (5) if the argument does not have catcode 11, check that it's a number. If any of these checks fail, \textsf{mathfont} switches |\ifM@arg@good| from true to false and skips the remaining steps.\indexpage{multiple characters warning}\indexpage{error checking} % \begin{macrocode} \def\M@check@token#1#2{% \M@arg@goodtrue \M@check@arglength#1\@nil\M@DoubleArgWarning{\csname math#2\endcsname}% \ifM@arg@good% good % \end{macrocode} % Checking for a nested argument involves what I think of as catcode jujitsu and inevitably feels super hacky. We use |\ifcat\bgroup| to check whether the first token of |#1| has catcode 1, and we take care to avoid unbalanced braces because |\ifcat| will eat the first token in the |#1| argument when it expands. If the comparison succeeds, the first token had catcode 1, and we are now missing a |{|. We place one before |\ifcat|, and we |\@gobble| the argument to prevent \TeX\ from typesetting it. The extra left brace balances the final right brace in |#1|, and both tokens delimit the argument of |\@gobble|. If the comparison fails, \TeX\ eliminates everything in the first branch, and we need to balance the |{| from before |\ifcat|. Thus we add a right brace immediately after |\else|, and the argument of |\@gobble| ends up being empty.% % \indexpage{nested argument warning} % \begin{macrocode} \expandafter\@gobble\expandafter{\ifcat\bgroup#1% bad \M@NestedArgWarning{#1}{\csname math#2\endcsname}% \M@arg@goodfalse \else}% % \end{macrocode} % Check whether |#1| is a control sequence.\indexpage{control sequence warning} % \begin{macrocode} \ifcat\relax\noexpand#1% bad \M@ControlSequenceArgWarning{#1}{\csname math#2\endcsname}% \M@arg@goodfalse \else % \end{macrocode} % Check that |#1| is a letter. % \begin{macrocode} \ifcat a#1% good \else % \end{macrocode} % Finally, check that |#1| is a digit. % \begin{macrocode} \if 0#1% good \else \if 1#1% good \else \if 2#1% good \else \if 3#1% good \else \if 4#1% good \else \if 5#1% good \else \if 6#1% good \else \if 7#1% good \else \if 8#1% good \else \if 9#1% good \else % \end{macrocode} % If all checks fail, issue a warning and switch |\ifM@arg@good| to false. % \begin{macrocode} \M@CharacterArgWarning {#1}{\csname math#2\endcsname}% \M@arg@goodfalse \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi \fi} % \end{macrocode} % Now initialize the five commands. We start with the blackboard-bold font-changing command.\indexpage{keywordbb=keyword \texttt{bb}} % \begin{macrocode} \def\define@bb{% \def\mathbb{\M@check@mode\@mathbb}% \def\@mathbb##1{\M@process@tokens{##1}{bb}}} % \end{macrocode} % Calligraphic characters.\indexpage{keywordcal=keyword \texttt{cal}} % \begin{macrocode} \def\define@cal{% \def\mathcal{\M@check@mode\@mathcal}% \def\@mathcal##1{\M@process@tokens{##1}{cal}}} % \end{macrocode} % Fraktur characters.\indexpage{keywordfrak=keyword \texttt{frak}} % \begin{macrocode} \def\define@frak{% \def\mathfrak{\M@check@mode\@mathfrak}% \def\@mathfrak##1{\M@process@tokens{##1}{frak}}} % \end{macrocode} % Bold calligraphic characters.\indexpage{keywordbcal=keyword \texttt{bcal}} % \begin{macrocode} \def\define@bcal{% \def\mathbcal{\M@check@mode\@mathbcal}% \def\@mathbcal##1{\M@process@tokens{##1}{bcal}}} % \end{macrocode} % Bold fraktur characters.\indexpage{keywordbfrak=keyword \texttt{bfrak}} % \begin{macrocode} \def\define@bfrak{% \def\mathbfrak{\M@check@mode\@mathbfrak}% \def\@mathbfrak##1{\M@process@tokens{##1}{bfrak}}} % \end{macrocode} % % \break\section{Local Font Changes}\indexpage{local font changes} % % The general |\newmathfontcommand| macro creates commands that locally change the math font. This macro creates a new math alphabet, and it stores that alphabet in the user-provided control sequence. The way |\M@check@csarg| scans the following tokens is a bit tricky. For error messaging purposes, its first argument should be the control sequence that called it. Error checking happens in two stages: (1) check the length of the argument using |\M@check@arglength|; and (2) check that the argument is a control sequence. If the user specifies an argument of the form |{..}|, i.e.\ extra text inside braces, the |\ifcat| will catch it and issue an error. If |\M@check@csarg| likes the input, the macro passes it to |\@newmathfontcommand|, which behaves like |\DeclareMathAlphabet|, and if the error checking is unsuccessful, the command gobbles the next two arguments in the input stream.\?\M@check@csarg\indexpage{log file=\texttt{log} file}\indexpage{multiple characters error}\indexpage{missing control sequence}\indexpage{error checking} % \begin{macrocode} \def\M@check@csarg#1#2#3{% \M@arg@goodtrue \M@check@arglength#2\@nil\M@DoubleArgError{#1} \ifM@arg@good% good \ifcat\relax\noexpand#2% good \else \M@MissingControlSequenceError{#1}{#2} \M@arg@goodfalse \fi \fi \ifM@arg@good \def\@tempa{#2} \wlog{Package mathfont Info: Loading font #3 with package fontspec.} \@newfont\@tempb{}{#3} \expandafter\@newmathfontcommand \else \expandafter\@gobbletwo \fi} \@onlypreamble\M@check@csarg % \end{macrocode} % Now declare the math alphabet. This macro has just two parameters because we call it inside |\M@check@csarg| when |\@tempa| and |\@tempb| already have definitions.\?\newmathfontcommand % \begin{macrocode} \def\@newmathfontcommand#1#2{% \expandafter\M@NewFontCommandInfo\expandafter {\@tempa}{\@tempb}{#1}{#2} \expandafter\DeclareMathAlphabet\expandafter {\@tempa}{TU}{\@tempb}{#1}{#2}} \def\newmathfontcommand{\M@check@csarg\newmathfontcommand} \@onlypreamble\@newmathfontcommand \@onlypreamble\newmathfontcommand % \end{macrocode} % Then provide the four default versions.\indexpage{default local font-change commands}\?\newmathrm\?\newmathit\?\newmathbf\?\newmathbfit % \begin{macrocode} \def\newmathrm#1#2{\M@check@csarg\newmathrm{#1}{#2} {\mddefault}{\updefault}} \def\newmathit#1#2{\M@check@csarg\newmathit{#1}{#2} {\mddefault}{\itdefault}} \def\newmathbf#1#2{\M@check@csarg\newmathbf{#1}{#2} {\bfdefault}{\updefault}} \def\newmathbfit#1#2{\M@check@csarg\newmathbfit{#1}{#2} {\bfdefault}{\itdefault}} \@onlypreamble\newmathrm \@onlypreamble\newmathit \@onlypreamble\newmathbf \@onlypreamble\newmathbfit % \end{macrocode} % We provide |\newmathbold| and |\newmathboldit| for backwards compatibility but issue a warning.\indexpage{depreciated} % \begin{macrocode} \def\newmathbold{% \M@DepreciatedWarning\newmathbold\newmathbf \newmathbf} \def\newmathboldit{% \M@DepreciatedWarning\newmathboldit\newmathbfit \newmathbfit} % \end{macrocode} % % \section{Concluding Material} % % Provide the command to reset macros.\indexpage{LaTeX kernel=\LaTeX\ kernel}\indexpage{internal commands restored} % \begin{macrocode} \def\restoremathinternals{% \ifx\set@mathchar\@@set@mathchar \else \M@RestoreInternalsInfo \fi \let\set@mathchar\@@set@mathchar \let\set@mathsymbol\@@set@mathsymbol \let\set@mathaccent\@@set@mathaccent} % \end{macrocode} % We write to the |log| file |\AtBeginDocument| all font changes carried out by \textsf{mathfont}.\indexpage{log file=\texttt{log} file}\indexpage{parse conditionals} % \begin{macrocode} \def\keyword@info@begindocument#1{% \expandafter\ifx% next line is two cs to be compared \csname if@#1\expandafter\endcsname\csname iftrue\endcsname \wlog{Keyword #1: Set to \csname M@#1@fontinfo\endcsname\space with \csname @#1shape\endcsname\space shape.} \else \wlog{Keyword #1: No change.} \fi} \AtBeginDocument{% \ifM@anychars@changed \edef\@tempa{\@normalkeys,\@alphanumkeys} \wlog{^^J:: mathfont :: List of fonts changed by mathfont:} \@for\@i:=\@tempa\do{% \expandafter\keyword@info@begindocument\expandafter{\@i}} \wlog{} \else \wlog{^^J:: mathfont :: No fonts were changed by mathfont.^^J} \fi} % \end{macrocode} % Some fonts do not contain characters that \textsf{mathfont} can declare as math symbols. We want to make sure that if this happens, \TeX\ prints a message in the |log| file.\indexpage{log file=\texttt{log} file} % \begin{macrocode} \tracinglostchars=1 % \end{macrocode} % Warn the user about possible problems with a multi-word optional argument in \XeTeX.\indexpage{XeTeX=\XeTeX} % \begin{macrocode} \ifx\XeTeXrevision\@undefined \else \ifM@font@loaded \AtEndOfPackage{% \PackageWarningNoLine{mathfont} {XeTeX detected. It looks like you\MessageBreak specified a font when you loaded\MessageBreak mathfont. If you run into problems\MessageBreak with a font whose name is multiple\MessageBreak words, try compiling with LuaLaTeX\MessageBreak instead or call \string\setfont\space or \string\mathfont\MessageBreak manually}} \fi \fi % \end{macrocode} % If the user passed a font name to \textsf{mathfont}, we set it as the default |\AtEndOfPackage|.\indexpage{optional package argument}\indexpage{default font changes} % \begin{macrocode} \ifM@font@loaded \AtEndOfPackage{% \setfont\M@font@load \newmathrm\mathrm\M@font@load \newmathit\mathit\M@font@load \newmathbf\mathbf\M@font@load \newmathbfit\mathbfit\M@font@load} \fi % \end{macrocode} % Warn the user about possible cosmetic issues arising from a clash with the |align| environment from the \textsf{amsmath} package.\indexpage{amsmath=\textsf{amsmath}} % \begin{macrocode} \AtBeginDocument{% \if@bb \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont} {Package amsmath detected. Some warning\MessageBreak messages for \string\mathbb\space may be duplicated\MessageBreak inside the align environment}}{} \fi \if@cal \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont} {Package amsmath detected. Some warning\MessageBreak messages for \string\mathcal\space may be duplicated\MessageBreak inside the align environment}}{} \fi \if@frak \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont} {Package amsmath detected. Some warning\MessageBreak messages for \string\mathfrak\space may be duplicated\MessageBreak inside the align environment}}{} \fi \if@bcal \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont} {Package amsmath detected. Some warning\MessageBreak messages for \string\mathbcal\space may be duplicated\MessageBreak inside the align environment}}{} \fi \if@bfrak \@ifpackageloaded{amsmath}{\PackageWarningNoLine{mathfont} {Package amsmath detected. Some warning\MessageBreak messages for \string\mathbfrak\space may be duplicated\MessageBreak inside the align environment}}{} \fi} % \end{macrocode} % Finally, make all character-setting commands inaccessible outside the preamble. % \begin{macrocode} \@onlypreamble\M@upper@set \@onlypreamble\M@lower@set \@onlypreamble\M@diacritics@set \@onlypreamble\M@greekupper@set \@onlypreamble\M@greeklower@set \@onlypreamble\M@agreekupper@set \@onlypreamble\M@agreeklower@set \@onlypreamble\M@cyrillicupper@set \@onlypreamble\M@cyrilliclower@set \@onlypreamble\M@hebrew@set \@onlypreamble\M@digits@set \@onlypreamble\M@operator@set \@onlypreamble\M@symbols@set \@onlypreamble\M@extsymbols@set \@onlypreamble\M@delimiters@set \@onlypreamble\M@arrows@set \@onlypreamble\M@bigops@set \@onlypreamble\M@extbigops@set \@onlypreamble\M@bb@set \@onlypreamble\M@cal@set \@onlypreamble\M@frak@set \@onlypreamble\M@bcal@set \@onlypreamble\M@bfrak@set % \end{macrocode} % % \section{Unicode Hex Values} % % % % Set capital Latin characters. We use an |\edef| for |\M@upper| because % every expansion now will save \LaTeX\ twenty-six expansions later when it % evaluates each |\DeclareMathSymbol|.\?\M@upper\indexpage{keywordupper=keyword \texttt{upper}}% % \begin{macrocode} \def\M@upper@set{% \edef\M@upper{M\@uppershape\the\M@count} \DeclareMathSymbol{A}{\mathalpha}{\M@upper}{`A} \DeclareMathSymbol{B}{\mathalpha}{\M@upper}{`B} \DeclareMathSymbol{C}{\mathalpha}{\M@upper}{`C} \DeclareMathSymbol{D}{\mathalpha}{\M@upper}{`D} \DeclareMathSymbol{E}{\mathalpha}{\M@upper}{`E} \DeclareMathSymbol{F}{\mathalpha}{\M@upper}{`F} \DeclareMathSymbol{G}{\mathalpha}{\M@upper}{`G} \DeclareMathSymbol{H}{\mathalpha}{\M@upper}{`H} \DeclareMathSymbol{I}{\mathalpha}{\M@upper}{`I} \DeclareMathSymbol{J}{\mathalpha}{\M@upper}{`J} \DeclareMathSymbol{K}{\mathalpha}{\M@upper}{`K} \DeclareMathSymbol{L}{\mathalpha}{\M@upper}{`L} \DeclareMathSymbol{M}{\mathalpha}{\M@upper}{`M} \DeclareMathSymbol{N}{\mathalpha}{\M@upper}{`N} \DeclareMathSymbol{O}{\mathalpha}{\M@upper}{`O} \DeclareMathSymbol{P}{\mathalpha}{\M@upper}{`P} \DeclareMathSymbol{Q}{\mathalpha}{\M@upper}{`Q} \DeclareMathSymbol{R}{\mathalpha}{\M@upper}{`R} \DeclareMathSymbol{S}{\mathalpha}{\M@upper}{`S} \DeclareMathSymbol{T}{\mathalpha}{\M@upper}{`T} \DeclareMathSymbol{U}{\mathalpha}{\M@upper}{`U} \DeclareMathSymbol{V}{\mathalpha}{\M@upper}{`V} \DeclareMathSymbol{W}{\mathalpha}{\M@upper}{`W} \DeclareMathSymbol{X}{\mathalpha}{\M@upper}{`X} \DeclareMathSymbol{Y}{\mathalpha}{\M@upper}{`Y} \DeclareMathSymbol{Z}{\mathalpha}{\M@upper}{`Z}} % \end{macrocode} % Set minuscule Latin characters. % \?\M@lower\indexpage{keywordlower=keyword \texttt{lower}} % \begin{macrocode} \def\M@lower@set{% \edef\M@lower{M\@lowershape\the\M@count} \DeclareMathSymbol{a}{\mathalpha}{\M@lower}{`a} \DeclareMathSymbol{b}{\mathalpha}{\M@lower}{`b} \DeclareMathSymbol{c}{\mathalpha}{\M@lower}{`c} \DeclareMathSymbol{d}{\mathalpha}{\M@lower}{`d} \DeclareMathSymbol{e}{\mathalpha}{\M@lower}{`e} \DeclareMathSymbol{f}{\mathalpha}{\M@lower}{`f} \DeclareMathSymbol{g}{\mathalpha}{\M@lower}{`g} \DeclareMathSymbol{h}{\mathalpha}{\M@lower}{`h} \DeclareMathSymbol{i}{\mathalpha}{\M@lower}{`i} \DeclareMathSymbol{\imath}{\mathalpha}{\M@lower}{"131} \DeclareMathSymbol{j}{\mathalpha}{\M@lower}{`j} \DeclareMathSymbol{\jmath}{\mathalpha}{\M@lower}{"237} \DeclareMathSymbol{k}{\mathalpha}{\M@lower}{`k} \DeclareMathSymbol{l}{\mathalpha}{\M@lower}{`l} \DeclareMathSymbol{m}{\mathalpha}{\M@lower}{`m} \DeclareMathSymbol{n}{\mathalpha}{\M@lower}{`n} \DeclareMathSymbol{o}{\mathalpha}{\M@lower}{`o} \DeclareMathSymbol{p}{\mathalpha}{\M@lower}{`p} \DeclareMathSymbol{q}{\mathalpha}{\M@lower}{`q} \DeclareMathSymbol{r}{\mathalpha}{\M@lower}{`r} \DeclareMathSymbol{s}{\mathalpha}{\M@lower}{`s} \DeclareMathSymbol{t}{\mathalpha}{\M@lower}{`t} \DeclareMathSymbol{u}{\mathalpha}{\M@lower}{`u} \DeclareMathSymbol{v}{\mathalpha}{\M@lower}{`v} \DeclareMathSymbol{w}{\mathalpha}{\M@lower}{`w} \DeclareMathSymbol{x}{\mathalpha}{\M@lower}{`x} \DeclareMathSymbol{y}{\mathalpha}{\M@lower}{`y} \DeclareMathSymbol{z}{\mathalpha}{\M@lower}{`z}} % \end{macrocode} % Set diacritics.\?\M@diacritics\indexpage{keyworddiacritics=keyword \texttt{diacritics}} % \begin{macrocode} \def\M@diacritics@set{% \edef\M@diacritics{M\@diacriticsshape\the\M@count} \DeclareMathAccent{\acute}{\mathalpha}{\M@diacritics}{"B4} \DeclareMathAccent{\aacute}{\mathalpha}{\M@diacritics}{"2DD} \DeclareMathAccent{\dot}{\mathalpha}{\M@diacritics}{"2D9} \DeclareMathAccent{\ddot}{\mathalpha}{\M@diacritics}{"A8} \DeclareMathAccent{\grave}{\mathalpha}{\M@diacritics}{"60} \DeclareMathAccent{\breve}{\mathalpha}{\M@diacritics}{"2D8} \DeclareMathAccent{\hat}{\mathalpha}{\M@diacritics}{"2C6} \DeclareMathAccent{\check}{\mathalpha}{\M@diacritics}{"2C7} \DeclareMathAccent{\bar}{\mathalpha}{\M@diacritics}{"AF} \DeclareMathAccent{\mathring}{\mathalpha}{\M@diacritics}{"2DA} \DeclareMathAccent{\tilde}{\mathalpha}{\M@diacritics}{"2DC}} % \end{macrocode} % Set capital Greek characters.\?{\M@greekupper}\indexpage{keywordgreeklower=keyword \texttt{greekupper}} % \begin{macrocode} \def\M@greekupper@set{% \edef\M@greekupper{M\@greekuppershape\the\M@count} \DeclareMathSymbol{\Alpha}{\mathalpha}{\M@greekupper}{"391} \DeclareMathSymbol{\Beta}{\mathalpha}{\M@greekupper}{"392} \DeclareMathSymbol{\Gamma}{\mathalpha}{\M@greekupper}{"393} \DeclareMathSymbol{\Delta}{\mathalpha}{\M@greekupper}{"394} \DeclareMathSymbol{\Epsilon}{\mathalpha}{\M@greekupper}{"395} \DeclareMathSymbol{\Zeta}{\mathalpha}{\M@greekupper}{"396} \DeclareMathSymbol{\Eta}{\mathalpha}{\M@greekupper}{"397} \DeclareMathSymbol{\Theta}{\mathalpha}{\M@greekupper}{"398} \DeclareMathSymbol{\Iota}{\mathalpha}{\M@greekupper}{"399} \DeclareMathSymbol{\Kappa}{\mathalpha}{\M@greekupper}{"39A} \DeclareMathSymbol{\Lambda}{\mathalpha}{\M@greekupper}{"39B} \DeclareMathSymbol{\Mu}{\mathalpha}{\M@greekupper}{"39C} \DeclareMathSymbol{\Nu}{\mathalpha}{\M@greekupper}{"39D} \DeclareMathSymbol{\Xi}{\mathalpha}{\M@greekupper}{"39E} \DeclareMathSymbol{\Omicron}{\mathalpha}{\M@greekupper}{"39F} \DeclareMathSymbol{\Pi}{\mathalpha}{\M@greekupper}{"3A0} \DeclareMathSymbol{\Rho}{\mathalpha}{\M@greekupper}{"3A1} \DeclareMathSymbol{\Sigma}{\mathalpha}{\M@greekupper}{"3A3} \DeclareMathSymbol{\Tau}{\mathalpha}{\M@greekupper}{"3A4} \DeclareMathSymbol{\Upsilon}{\mathalpha}{\M@greekupper}{"3A5} \DeclareMathSymbol{\Phi}{\mathalpha}{\M@greekupper}{"3A6} \DeclareMathSymbol{\Chi}{\mathalpha}{\M@greekupper}{"3A7} \DeclareMathSymbol{\Psi}{\mathalpha}{\M@greekupper}{"3A8} \DeclareMathSymbol{\Omega}{\mathalpha}{\M@greekupper}{"3A9} \DeclareMathSymbol{\varTheta}{\mathalpha}{\M@greekupper}{"3F4}} % \end{macrocode} % Set minuscule Greek characters.\?\M@greeklower\indexpage{keywordgreeklower=keyword \texttt{greeklower}} % \begin{macrocode} \def\M@greeklower@set{% \edef\M@greeklower{M\@greeklowershape\the\M@count} \DeclareMathSymbol{\alpha}{\mathalpha}{\M@greeklower}{"3B1} \DeclareMathSymbol{\beta}{\mathalpha}{\M@greeklower}{"3B2} \DeclareMathSymbol{\gamma}{\mathalpha}{\M@greeklower}{"3B3} \DeclareMathSymbol{\delta}{\mathalpha}{\M@greeklower}{"3B4} \DeclareMathSymbol{\epsilon}{\mathalpha}{\M@greeklower}{"3F5} \DeclareMathSymbol{\zeta}{\mathalpha}{\M@greeklower}{"3B6} \DeclareMathSymbol{\eta}{\mathalpha}{\M@greeklower}{"3B7} \DeclareMathSymbol{\theta}{\mathalpha}{\M@greeklower}{"3B8} \DeclareMathSymbol{\iota}{\mathalpha}{\M@greeklower}{"3B9} \DeclareMathSymbol{\kappa}{\mathalpha}{\M@greeklower}{"3BA} \DeclareMathSymbol{\lambda}{\mathalpha}{\M@greeklower}{"3BB} \DeclareMathSymbol{\mu}{\mathalpha}{\M@greeklower}{"3BC} \DeclareMathSymbol{\nu}{\mathalpha}{\M@greeklower}{"3BD} \DeclareMathSymbol{\xi}{\mathalpha}{\M@greeklower}{"3BE} \DeclareMathSymbol{\omicron}{\mathalpha}{\M@greeklower}{"3BF} \DeclareMathSymbol{\pi}{\mathalpha}{\M@greeklower}{"3C0} \DeclareMathSymbol{\rho}{\mathalpha}{\M@greeklower}{"3C1} \DeclareMathSymbol{\sigma}{\mathalpha}{\M@greeklower}{"3C3} \DeclareMathSymbol{\tau}{\mathalpha}{\M@greeklower}{"3C4} \DeclareMathSymbol{\upsilon}{\mathalpha}{\M@greeklower}{"3C5} \DeclareMathSymbol{\phi}{\mathalpha}{\M@greeklower}{"3D5} \DeclareMathSymbol{\chi}{\mathalpha}{\M@greeklower}{"3C7} \DeclareMathSymbol{\psi}{\mathalpha}{\M@greeklower}{"3C8} \DeclareMathSymbol{\omega}{\mathalpha}{\M@greeklower}{"3C9} \DeclareMathSymbol{\varbeta}{\mathalpha}{\M@greeklower}{"3D0} \DeclareMathSymbol{\varepsilon}{\mathalpha}{\M@greeklower}{"3B5} \DeclareMathSymbol{\vartheta}{\mathalpha}{\M@greeklower}{"3D1} \DeclareMathSymbol{\varrho}{\mathalpha}{\M@greeklower}{"3F1} \DeclareMathSymbol{\varsigma}{\mathalpha}{\M@greeklower}{"3C2} \DeclareMathSymbol{\varphi}{\mathalpha}{\M@greeklower}{"3C6}} % \end{macrocode} % Set capital ancient Greek characters.\?\M@agreekupper\indexpage{keywordagreekupper=keyword \texttt{agreekupper}} % \begin{macrocode} \def\M@agreekupper@set{% \edef\M@agreekupper{M\@agreekuppershape\the\M@count} \DeclareMathSymbol{\Heta}{\mathalpha}{\M@agreekupper}{"370} \DeclareMathSymbol{\Sampi}{\mathalpha}{\M@agreekupper}{"3E0} \DeclareMathSymbol{\Digamma}{\mathalpha}{\M@agreekupper}{"3DC} \DeclareMathSymbol{\Koppa}{\mathalpha}{\M@agreekupper}{"3D8} \DeclareMathSymbol{\Stigma}{\mathalpha}{\M@agreekupper}{"3DA} \DeclareMathSymbol{\Sho}{\mathalpha}{\M@agreekupper}{"3F7} \DeclareMathSymbol{\San}{\mathalpha}{\M@agreekupper}{"3FA} \DeclareMathSymbol{\varSampi}{\mathalpha}{\M@agreekupper}{"372} \DeclareMathSymbol{\varDigamma}{\mathalpha}{\M@agreekupper}{"376} \DeclareMathSymbol{\varKoppa}{\mathalpha}{\M@agreekupper}{"3DE}} % \end{macrocode} % Set minuscule ancient Greek characters.\?\M@agreeklower\indexpage{keywordagreeklower=keyword \texttt{agreeklower}} % \begin{macrocode} \def\M@agreeklower@set{% \edef\M@agreeklower{M\@agreeklowershape\the\M@count} \DeclareMathSymbol{\heta}{\mathalpha}{\M@agreeklower}{"371} \DeclareMathSymbol{\sampi}{\mathalpha}{\M@agreeklower}{"3E1} \DeclareMathSymbol{\digamma}{\mathalpha}{\M@agreeklower}{"3DD} \DeclareMathSymbol{\koppa}{\mathalpha}{\M@agreeklower}{"3D9} \DeclareMathSymbol{\stigma}{\mathalpha}{\M@agreeklower}{"3DB} \DeclareMathSymbol{\sho}{\mathalpha}{\M@agreeklower}{"3F8} \DeclareMathSymbol{\san}{\mathalpha}{\M@agreeklower}{"3FB} \DeclareMathSymbol{\varsampi}{\mathalpha}{\M@agreeklower}{"373} \DeclareMathSymbol{\vardigamma}{\mathalpha}{\M@agreeklower}{"377} \DeclareMathSymbol{\varkoppa}{\mathalpha}{\M@agreeklower}{"3DF}} % \end{macrocode} % Set capital Cyrillic characters.\?\M@cyrillicupper\indexpage{keywordcyrillicupper=keyword \texttt{cyrillicupper}} % \begin{macrocode} \def\M@cyrillicupper@set{% \edef\M@cyrillicupper{M\@cyrillicuppershape\the\M@count} \DeclareMathSymbol{\cyrA}{\mathalpha}{\M@cyrillicupper}{"410} \DeclareMathSymbol{\cyrBe}{\mathalpha}{\M@cyrillicupper}{"411} \DeclareMathSymbol{\cyrVe}{\mathalpha}{\M@cyrillicupper}{"412} \DeclareMathSymbol{\cyrGhe}{\mathalpha}{\M@cyrillicupper}{"413} \DeclareMathSymbol{\cyrDe}{\mathalpha}{\M@cyrillicupper}{"414} \DeclareMathSymbol{\cyrIe}{\mathalpha}{\M@cyrillicupper}{"415} \DeclareMathSymbol{\cyrZhe}{\mathalpha}{\M@cyrillicupper}{"416} \DeclareMathSymbol{\cyrZe}{\mathalpha}{\M@cyrillicupper}{"417} \DeclareMathSymbol{\cyrI}{\mathalpha}{\M@cyrillicupper}{"418} \DeclareMathSymbol{\cyrKa}{\mathalpha}{\M@cyrillicupper}{"41A} \DeclareMathSymbol{\cyrEl}{\mathalpha}{\M@cyrillicupper}{"41B} \DeclareMathSymbol{\cyrEm}{\mathalpha}{\M@cyrillicupper}{"41C} \DeclareMathSymbol{\cyrEn}{\mathalpha}{\M@cyrillicupper}{"41D} \DeclareMathSymbol{\cyrO}{\mathalpha}{\M@cyrillicupper}{"41E} \DeclareMathSymbol{\cyrPe}{\mathalpha}{\M@cyrillicupper}{"41F} \DeclareMathSymbol{\cyrEr}{\mathalpha}{\M@cyrillicupper}{"420} \DeclareMathSymbol{\cyrEs}{\mathalpha}{\M@cyrillicupper}{"421} \DeclareMathSymbol{\cyrTe}{\mathalpha}{\M@cyrillicupper}{"422} \DeclareMathSymbol{\cyrU}{\mathalpha}{\M@cyrillicupper}{"423} \DeclareMathSymbol{\cyrEf}{\mathalpha}{\M@cyrillicupper}{"424} \DeclareMathSymbol{\cyrHa}{\mathalpha}{\M@cyrillicupper}{"425} \DeclareMathSymbol{\cyrTse}{\mathalpha}{\M@cyrillicupper}{"426} \DeclareMathSymbol{\cyrChe}{\mathalpha}{\M@cyrillicupper}{"427} \DeclareMathSymbol{\cyrSha}{\mathalpha}{\M@cyrillicupper}{"428} \DeclareMathSymbol{\cyrShcha}{\mathalpha}{\M@cyrillicupper}{"429} \DeclareMathSymbol{\cyrHard}{\mathalpha}{\M@cyrillicupper}{"42A} \DeclareMathSymbol{\cyrYeru}{\mathalpha}{\M@cyrillicupper}{"42B} \DeclareMathSymbol{\cyrSoft}{\mathalpha}{\M@cyrillicupper}{"42C} \DeclareMathSymbol{\cyrE}{\mathalpha}{\M@cyrillicupper}{"42D} \DeclareMathSymbol{\cyrYu}{\mathalpha}{\M@cyrillicupper}{"42E} \DeclareMathSymbol{\cyrYa}{\mathalpha}{\M@cyrillicupper}{"42F} \DeclareMathSymbol{\cyrvarI}{\mathalpha}{\M@cyrillicupper}{"419}} % \end{macrocode} % Set minuscule Cyrillic characters.\?\M@cyrilliclower\indexpage{keywordcyrilliclower=keyword \texttt{cyrilliclower}} % \begin{macrocode} \def\M@cyrilliclower@set{% \edef\M@cyrilliclower{M\@cyrilliclowershape\the\M@count} \DeclareMathSymbol{\cyra}{\mathalpha}{\M@cyrilliclower}{"430} \DeclareMathSymbol{\cyrbe}{\mathalpha}{\M@cyrilliclower}{"431} \DeclareMathSymbol{\cyrve}{\mathalpha}{\M@cyrilliclower}{"432} \DeclareMathSymbol{\cyrghe}{\mathalpha}{\M@cyrilliclower}{"433} \DeclareMathSymbol{\cyrde}{\mathalpha}{\M@cyrilliclower}{"434} \DeclareMathSymbol{\cyrie}{\mathalpha}{\M@cyrilliclower}{"435} \DeclareMathSymbol{\cyrzhe}{\mathalpha}{\M@cyrilliclower}{"436} \DeclareMathSymbol{\cyrze}{\mathalpha}{\M@cyrilliclower}{"437} \DeclareMathSymbol{\cyri}{\mathalpha}{\M@cyrilliclower}{"438} \DeclareMathSymbol{\cyrka}{\mathalpha}{\M@cyrilliclower}{"43A} \DeclareMathSymbol{\cyrel}{\mathalpha}{\M@cyrilliclower}{"43B} \DeclareMathSymbol{\cyrem}{\mathalpha}{\M@cyrilliclower}{"43C} \DeclareMathSymbol{\cyren}{\mathalpha}{\M@cyrilliclower}{"43D} \DeclareMathSymbol{\cyro}{\mathalpha}{\M@cyrilliclower}{"43E} \DeclareMathSymbol{\cyrpe}{\mathalpha}{\M@cyrilliclower}{"43F} \DeclareMathSymbol{\cyrer}{\mathalpha}{\M@cyrilliclower}{"440} \DeclareMathSymbol{\cyres}{\mathalpha}{\M@cyrilliclower}{"441} \DeclareMathSymbol{\cyrte}{\mathalpha}{\M@cyrilliclower}{"442} \DeclareMathSymbol{\cyru}{\mathalpha}{\M@cyrilliclower}{"443} \DeclareMathSymbol{\cyref}{\mathalpha}{\M@cyrilliclower}{"444} \DeclareMathSymbol{\cyrha}{\mathalpha}{\M@cyrilliclower}{"445} \DeclareMathSymbol{\cyrtse}{\mathalpha}{\M@cyrilliclower}{"446} \DeclareMathSymbol{\cyrche}{\mathalpha}{\M@cyrilliclower}{"447} \DeclareMathSymbol{\cyrsha}{\mathalpha}{\M@cyrilliclower}{"448} \DeclareMathSymbol{\cyrshcha}{\mathalpha}{\M@cyrilliclower}{"449} \DeclareMathSymbol{\cyrhard}{\mathalpha}{\M@cyrilliclower}{"44A} \DeclareMathSymbol{\cyryeru}{\mathalpha}{\M@cyrilliclower}{"44B} \DeclareMathSymbol{\cyrsoft}{\mathalpha}{\M@cyrilliclower}{"44C} \DeclareMathSymbol{\cyre}{\mathalpha}{\M@cyrilliclower}{"44D} \DeclareMathSymbol{\cyryu}{\mathalpha}{\M@cyrilliclower}{"44E} \DeclareMathSymbol{\cyrya}{\mathalpha}{\M@cyrilliclower}{"44F} \DeclareMathSymbol{\cyrvari}{\mathalpha}{\M@cyrilliclower}{"439}} % \end{macrocode} % Set Hebrew characters.\?\M@hebrew\indexpage{keywordhebrew=keyword \texttt{hebrew}} % \begin{macrocode} \def\M@hebrew@set{% \edef\M@hebrew{M\@hebrewshape\the\M@count} \DeclareMathSymbol{\aleph}{\mathalpha}{\M@hebrew}{"5D0} \DeclareMathSymbol{\beth}{\mathalpha}{\M@hebrew}{"5D1} \DeclareMathSymbol{\gimel}{\mathalpha}{\M@hebrew}{"5D2} \DeclareMathSymbol{\daleth}{\mathalpha}{\M@hebrew}{"5D3} \DeclareMathSymbol{\he}{\mathalpha}{\M@hebrew}{"5D4} \DeclareMathSymbol{\vav}{\mathalpha}{\M@hebrew}{"5D5} \DeclareMathSymbol{\zayin}{\mathalpha}{\M@hebrew}{"5D6} \DeclareMathSymbol{\het}{\mathalpha}{\M@hebrew}{"5D7} \DeclareMathSymbol{\tet}{\mathalpha}{\M@hebrew}{"5D8} \DeclareMathSymbol{\yod}{\mathalpha}{\M@hebrew}{"5D9} \DeclareMathSymbol{\kaf}{\mathalpha}{\M@hebrew}{"5DB} \DeclareMathSymbol{\lamed}{\mathalpha}{\M@hebrew}{"5DC} \DeclareMathSymbol{\mem}{\mathalpha}{\M@hebrew}{"5DE} \DeclareMathSymbol{\nun}{\mathalpha}{\M@hebrew}{"5E0} \DeclareMathSymbol{\samekh}{\mathalpha}{\M@hebrew}{"5E1} \DeclareMathSymbol{\ayin}{\mathalpha}{\M@hebrew}{"5E2} \DeclareMathSymbol{\pe}{\mathalpha}{\M@hebrew}{"5E4} \DeclareMathSymbol{\tsadi}{\mathalpha}{\M@hebrew}{"5E6} \DeclareMathSymbol{\qof}{\mathalpha}{\M@hebrew}{"5E7} \DeclareMathSymbol{\resh}{\mathalpha}{\M@hebrew}{"5E8} \DeclareMathSymbol{\shin}{\mathalpha}{\M@hebrew}{"5E9} \DeclareMathSymbol{\tav}{\mathalpha}{\M@hebrew}{"5EA} \DeclareMathSymbol{\varkaf}{\mathalpha}{\M@hebrew}{"5DA} \DeclareMathSymbol{\varmem}{\mathalpha}{\M@hebrew}{"5DD} \DeclareMathSymbol{\varnun}{\mathalpha}{\M@hebrew}{"5DF} \DeclareMathSymbol{\varpe}{\mathalpha}{\M@hebrew}{"5E3} \DeclareMathSymbol{\vartsadi}{\mathalpha}{\M@hebrew}{"5E5}} % \end{macrocode} % Set digits.\?\M@digits\indexpage{keyworddigits=keyword \texttt{digits}} % \begin{macrocode} \def\M@digits@set{% \edef\M@digits{M\@digitsshape\the\M@count} \DeclareMathSymbol{0}{\mathalpha}{\M@digits}{`0} \DeclareMathSymbol{1}{\mathalpha}{\M@digits}{`1} \DeclareMathSymbol{2}{\mathalpha}{\M@digits}{`2} \DeclareMathSymbol{3}{\mathalpha}{\M@digits}{`3} \DeclareMathSymbol{4}{\mathalpha}{\M@digits}{`4} \DeclareMathSymbol{5}{\mathalpha}{\M@digits}{`5} \DeclareMathSymbol{6}{\mathalpha}{\M@digits}{`6} \DeclareMathSymbol{7}{\mathalpha}{\M@digits}{`7} \DeclareMathSymbol{8}{\mathalpha}{\M@digits}{`8} \DeclareMathSymbol{9}{\mathalpha}{\M@digits}{`9}} % \end{macrocode} % Set new operator font.\indexpage{keywordoperator=keyword \texttt{operator}} % \begin{macrocode} \def\M@operator@set{% \edef\operator@font{\noexpand\mathgroup \expandafter\noexpand\csname symM\@operatorshape\the\M@count\endcsname}} % \end{macrocode} % Set symbols.\?\M@symbols\indexpage{keywordsymbols=keyword \texttt{symbols}} % \begin{macrocode} \def\M@symbols@set{% \edef\M@symbols{M\@symbolsshape\the\M@count} \let\colon\@undefined \let\mathellipsis\@undefined \DeclareMathSymbol{.}{\mathord}{\M@symbols}{"2E} \DeclareMathSymbol{@}{\mathord}{\M@symbols}{"40} \DeclareMathSymbol{\mathhash}{\mathord}{\M@symbols}{"23} \DeclareMathSymbol{\mathdollar}{\mathord}{\M@symbols}{"24} \DeclareMathSymbol{\mathpercent}{\mathord}{\M@symbols}{"25} \DeclareMathSymbol{\mathand}{\mathord}{\M@symbols}{"26} \DeclareMathSymbol{\mathparagraph}{\mathord}{\M@symbols}{"B6} \DeclareMathSymbol{\mathsection}{\mathord}{\M@symbols}{"A7} \DeclareMathSymbol{\mathsterling}{\mathord}{\M@symbols}{"A3} \DeclareMathSymbol{|}{\mathord}{\M@symbols}{"7C} \DeclareMathSymbol{\neg}{\mathord}{\M@symbols}{"AC} \DeclareMathSymbol{\infty}{\mathord}{\M@symbols}{"221E} \DeclareMathSymbol{\partial}{\mathord}{\M@symbols}{"2202} \DeclareMathSymbol{\mathbackslash}{\mathord}{\M@symbols}{"5C} \DeclareMathSymbol{\degree}{\mathord}{\M@symbols}{"B0} \DeclareMathSymbol{\increment}{\mathord}{\M@symbols}{"2206} \DeclareMathSymbol{\hbar}{\mathord}{\M@symbols}{"127} \DeclareMathSymbol{'}{\mathord}{\M@symbols}{"2032} \DeclareMathSymbol{"}{\mathord}{\M@symbols}{"2033} \DeclareMathSymbol{\comma}{\mathord}{\M@symbols}{"2C} \DeclareMathSymbol{+}{\mathbin}{\M@symbols}{"2B} \DeclareMathSymbol{-}{\mathbin}{\M@symbols}{"2212} \DeclareMathSymbol{*}{\mathbin}{\M@symbols}{"2A} \DeclareMathSymbol{\times}{\mathbin}{\M@symbols}{"D7} \DeclareMathSymbol{/}{\mathbin}{\M@symbols}{"2215} \DeclareMathSymbol{\div}{\mathbin}{\M@symbols}{"F7} \DeclareMathSymbol{\pm}{\mathbin}{\M@symbols}{"B1} \DeclareMathSymbol{\bullet}{\mathbin}{\M@symbols}{"2022} \DeclareMathSymbol{\dagger}{\mathbin}{\M@symbols}{"2020} \DeclareMathSymbol{\ddagger}{\mathbin}{\M@symbols}{"2021} \DeclareMathSymbol{\cdot}{\mathbin}{\M@symbols}{"2219} \DeclareMathSymbol{\setminus}{\mathbin}{\M@symbols}{"5C} \DeclareMathSymbol{=}{\mathrel}{\M@symbols}{"3D} \DeclareMathSymbol{<}{\mathrel}{\M@symbols}{"3C} \DeclareMathSymbol{>}{\mathrel}{\M@symbols}{"3E} \DeclareMathSymbol{\leq}{\mathrel}{\M@symbols}{"2264} \DeclareMathSymbol{\geq}{\mathrel}{\M@symbols}{"2265} \DeclareMathSymbol{\sim}{\mathrel}{\M@symbols}{"7E} \DeclareMathSymbol{\approx}{\mathrel}{\M@symbols}{"2248} \DeclareMathSymbol{\equiv}{\mathrel}{\M@symbols}{"2261} \DeclareMathSymbol{\mid}{\mathrel}{\M@symbols}{"7C} \DeclareMathSymbol{\parallel}{\mathrel}{\M@symbols}{"2016} \DeclareMathSymbol{:}{\mathrel}{\M@symbols}{"3A} \DeclareMathSymbol{?}{\mathclose}{\M@symbols}{"3F} \DeclareMathSymbol{!}{\mathclose}{\M@symbols}{"21} \DeclareMathSymbol{,}{\mathpunct}{\M@symbols}{"2C} \DeclareMathSymbol{;}{\mathpunct}{\M@symbols}{"3B} \DeclareMathSymbol{\colon}{\mathpunct}{\M@symbols}{"3A} \DeclareMathSymbol{\mathellipsis}{\mathinner}{\M@symbols}{"2026} % \end{macrocode} % Finally a bit of housekeeping. We redefine |\#|, |\%|, and |\&| as robust commands that expand to previously declared |\mathhash|, etc.\ commands in math mode and retain their standard |\char| definitions otherwise. Other commands that function in both math and horizontal modes such as |\S| or |\dag| also use this technique. The last three commands defined here preserve the Computer Modern font for charcters used in several math-mode symbols.\indexpage{robust commands} % \begin{macrocode} \DeclareRobustCommand\#{\ifmmode\mathhash\else\char"23\relax\fi} \DeclareRobustCommand\%{\ifmmode\mathpercent\else\char"25\relax\fi} \DeclareRobustCommand\&{\ifmmode\mathand\else\char"26\relax\fi} \DeclareMathSymbol{\@relbar}{\mathbin}{symbols}{"00} \DeclareMathSymbol{\@Relbar}{\mathrel}{operators}{"3D} \DeclareMathSymbol{\@verticalbar}{\mathord}{symbols}{"6A} \DeclareRobustCommand\relbar{\mathrel{\smash\@relbar}} \DeclareRobustCommand\Relbar{\mathrel{\@Relbar}} \DeclareRobustCommand\models{\mathrel{\@verticalbar}\joinrel\Relbar}} % \end{macrocode} % Set extended symbols.\?\M@extsymbols\indexpage{keywordextsymbols=keyword \texttt{extsymbols}} % \begin{macrocode} \def\M@extsymbols@set{% \edef\M@extsymbols{M\@extsymbolsshape\the\M@count} \let\angle\@undefined \let\sqsubset\@undefined \let\sqsupset\@undefined \let\bowtie\@undefined \let\doteq\@undefined \let\neq\@undefined \let\ng\@undefined \DeclareMathSymbol{\wp}{\mathord}{\M@extsymbols}{"2118} \DeclareMathSymbol{\Re}{\mathord}{\M@extsymbols}{"211C} \DeclareMathSymbol{\Im}{\mathord}{\M@extsymbols}{"2111} \DeclareMathSymbol{\ell}{\mathord}{\M@extsymbols}{"2113} \DeclareMathSymbol{\forall}{\mathord}{\M@extsymbols}{"2200} \DeclareMathSymbol{\exists}{\mathord}{\M@extsymbols}{"2203} \DeclareMathSymbol{\emptyset}{\mathord}{\M@extsymbols}{"2205} \DeclareMathSymbol{\nabla}{\mathord}{\M@extsymbols}{"2207} \DeclareMathSymbol{\in}{\mathord}{\M@extsymbols}{"2208} \DeclareMathSymbol{\ni}{\mathord}{\M@extsymbols}{"220B} \DeclareMathSymbol{\mp}{\mathord}{\M@extsymbols}{"2213} \DeclareMathSymbol{\angle}{\mathord}{\M@extsymbols}{"2220} \DeclareMathSymbol{\top}{\mathord}{\M@extsymbols}{"22A4} \DeclareMathSymbol{\bot}{\mathord}{\M@extsymbols}{"22A5} \DeclareMathSymbol{\vdash}{\mathord}{\M@extsymbols}{"22A2} \DeclareMathSymbol{\dashv}{\mathord}{\M@extsymbols}{"22A3} \DeclareMathSymbol{\flat}{\mathord}{\M@extsymbols}{"266D} \DeclareMathSymbol{\natural}{\mathord}{\M@extsymbols}{"266E} \DeclareMathSymbol{\sharp}{\mathord}{\M@extsymbols}{"266F} \DeclareMathSymbol{\fflat}{\mathord}{\M@extsymbols}{"1D12B} \DeclareMathSymbol{\ssharp}{\mathord}{\M@extsymbols}{"1D12A} \DeclareMathSymbol{\bclubsuit}{\mathord}{\M@extsymbols}{"2663} \let\clubsuit\bclubsuit \DeclareMathSymbol{\bdiamondsuit}{\mathord}{\M@extsymbols}{"2666} \DeclareMathSymbol{\bheartsuit}{\mathord}{\M@extsymbols}{"2665} \DeclareMathSymbol{\bspadesuit}{\mathord}{\M@extsymbols}{"2660} \let\spadesuit\bspadesuit \DeclareMathSymbol{\wclubsuit}{\mathord}{\M@extsymbols}{"2667} \DeclareMathSymbol{\wdiamondsuit}{\mathord}{\M@extsymbols}{"2662} \let\diamondsuit\wdiamondsuit \DeclareMathSymbol{\wheartsuit}{\mathord}{\M@extsymbols}{"2661} \let\heartsuit\wheartsuit \DeclareMathSymbol{\wspadesuit}{\mathord}{\M@extsymbols}{"2664} \DeclareMathSymbol{\wedge}{\mathbin}{\M@extsymbols}{"2227} \DeclareMathSymbol{\vee}{\mathbin}{\M@extsymbols}{"2228} \DeclareMathSymbol{\cap}{\mathord}{\M@extsymbols}{"2229} \DeclareMathSymbol{\cup}{\mathbin}{\M@extsymbols}{"222A} \DeclareMathSymbol{\sqcap}{\mathbin}{\M@extsymbols}{"2293} \DeclareMathSymbol{\sqcup}{\mathbin}{\M@extsymbols}{"2294} \DeclareMathSymbol{\amalg}{\mathbin}{\M@extsymbols}{"2A3F} \DeclareMathSymbol{\wr}{\mathbin}{\M@extsymbols}{"2240} \DeclareMathSymbol{\ast}{\mathbin}{\M@extsymbols}{"2217} \DeclareMathSymbol{\star}{\mathbin}{\M@extsymbols}{"22C6} \DeclareMathSymbol{\diamond}{\mathbin}{\M@extsymbols}{"22C4} \DeclareMathSymbol{\varcdot}{\mathbin}{\M@extsymbols}{"22C5} \DeclareMathSymbol{\varsetminus}{\mathbin}{\M@extsymbols}{"2216} \DeclareMathSymbol{\oplus}{\mathbin}{\M@extsymbols}{"2295} \DeclareMathSymbol{\otimes}{\mathbin}{\M@extsymbols}{"2297} \DeclareMathSymbol{\ominus}{\mathbin}{\M@extsymbols}{"2296} \DeclareMathSymbol{\odiv}{\mathbin}{\M@extsymbols}{"2A38} \DeclareMathSymbol{\oslash}{\mathbin}{\M@extsymbols}{"2298} \DeclareMathSymbol{\odot}{\mathbin}{\M@extsymbols}{"2299} \DeclareMathSymbol{\sqplus}{\mathbin}{\M@extsymbols}{"229E} \DeclareMathSymbol{\sqtimes}{\mathbin}{\M@extsymbols}{"22A0} \DeclareMathSymbol{\sqminus}{\mathbin}{\M@extsymbols}{"229F} \DeclareMathSymbol{\sqdot}{\mathbin}{\M@extsymbols}{"22A1} \DeclareMathSymbol{\in}{\mathrel}{\M@extsymbols}{"2208} \DeclareMathSymbol{\ni}{\mathrel}{\M@extsymbols}{"220B} \DeclareMathSymbol{\subset}{\mathrel}{\M@extsymbols}{"2282} \DeclareMathSymbol{\supset}{\mathrel}{\M@extsymbols}{"2283} \DeclareMathSymbol{\subseteq}{\mathrel}{\M@extsymbols}{"2286} \DeclareMathSymbol{\supseteq}{\mathrel}{\M@extsymbols}{"2287} \DeclareMathSymbol{\sqsubset}{\mathrel}{\M@extsymbols}{"228F} \DeclareMathSymbol{\sqsupset}{\mathrel}{\M@extsymbols}{"2290} \DeclareMathSymbol{\sqsubseteq}{\mathrel}{\M@extsymbols}{"2291} \DeclareMathSymbol{\sqsupseteq}{\mathrel}{\M@extsymbols}{"2292} \DeclareMathSymbol{\triangleleft}{\mathrel}{\M@extsymbols}{"22B2} \DeclareMathSymbol{\triangleright}{\mathrel}{\M@extsymbols}{"22B3} \DeclareMathSymbol{\trianglelefteq}{\mathrel}{\M@extsymbols}{"22B4} \DeclareMathSymbol{\trianglerighteq}{\mathrel}{\M@extsymbols}{"22B5} \DeclareMathSymbol{\propto}{\mathrel}{\M@extsymbols}{"221D} \DeclareMathSymbol{\bowtie}{\mathrel}{\M@extsymbols}{"22C8} \DeclareMathSymbol{\hourglass}{\mathrel}{\M@extsymbols}{"29D6} \DeclareMathSymbol{\therefore}{\mathrel}{\M@extsymbols}{"2234} \DeclareMathSymbol{\because}{\mathrel}{\M@extsymbols}{"2235} \DeclareMathSymbol{\ratio}{\mathrel}{\M@extsymbols}{"2236} \DeclareMathSymbol{\proportion}{\mathrel}{\M@extsymbols}{"2237} \DeclareMathSymbol{\ll}{\mathrel}{\M@extsymbols}{"226A} \DeclareMathSymbol{\gg}{\mathrel}{\M@extsymbols}{"226B} \DeclareMathSymbol{\lll}{\mathrel}{\M@extsymbols}{"22D8} \DeclareMathSymbol{\ggg}{\mathrel}{\M@extsymbols}{"22D9} \DeclareMathSymbol{\leqq}{\mathrel}{\M@extsymbols}{"2266} \DeclareMathSymbol{\geqq}{\mathrel}{\M@extsymbols}{"2267} \DeclareMathSymbol{\lapprox}{\mathrel}{\M@extsymbols}{"2A85} \DeclareMathSymbol{\gapprox}{\mathrel}{\M@extsymbols}{"2A86} \DeclareMathSymbol{\simeq}{\mathrel}{\M@extsymbols}{"2243} \DeclareMathSymbol{\eqsim}{\mathrel}{\M@extsymbols}{"2242} \DeclareMathSymbol{\simeqq}{\mathrel}{\M@extsymbols}{"2245} \let\cong\simeqq \DeclareMathSymbol{\approxeq}{\mathrel}{\M@extsymbols}{"224A} \DeclareMathSymbol{\sssim}{\mathrel}{\M@extsymbols}{"224B} \DeclareMathSymbol{\seq}{\mathrel}{\M@extsymbols}{"224C} \DeclareMathSymbol{\doteq}{\mathrel}{\M@extsymbols}{"2250} \DeclareMathSymbol{\coloneq}{\mathrel}{\M@extsymbols}{"2254} \DeclareMathSymbol{\eqcolon}{\mathrel}{\M@extsymbols}{"2255} \DeclareMathSymbol{\ringeq}{\mathrel}{\M@extsymbols}{"2257} \DeclareMathSymbol{\arceq}{\mathrel}{\M@extsymbols}{"2258} \DeclareMathSymbol{\wedgeeq}{\mathrel}{\M@extsymbols}{"2259} \DeclareMathSymbol{\veeeq}{\mathrel}{\M@extsymbols}{"225A} \DeclareMathSymbol{\stareq}{\mathrel}{\M@extsymbols}{"225B} \DeclareMathSymbol{\triangleeq}{\mathrel}{\M@extsymbols}{"225C} \DeclareMathSymbol{\defeq}{\mathrel}{\M@extsymbols}{"225D} \DeclareMathSymbol{\qeq}{\mathrel}{\M@extsymbols}{"225F} \DeclareMathSymbol{\lsim}{\mathrel}{\M@extsymbols}{"2272} \DeclareMathSymbol{\gsim}{\mathrel}{\M@extsymbols}{"2273} \DeclareMathSymbol{\prec}{\mathrel}{\M@extsymbols}{"227A} \DeclareMathSymbol{\succ}{\mathrel}{\M@extsymbols}{"227B} \DeclareMathSymbol{\preceq}{\mathrel}{\M@extsymbols}{"227C} \DeclareMathSymbol{\succeq}{\mathrel}{\M@extsymbols}{"227D} \DeclareMathSymbol{\preceqq}{\mathrel}{\M@extsymbols}{"2AB3} \DeclareMathSymbol{\succeqq}{\mathrel}{\M@extsymbols}{"2AB4} \DeclareMathSymbol{\precsim}{\mathrel}{\M@extsymbols}{"227E} \DeclareMathSymbol{\succsim}{\mathrel}{\M@extsymbols}{"227F} \DeclareMathSymbol{\precapprox}{\mathrel}{\M@extsymbols}{"2AB7} \DeclareMathSymbol{\succapprox}{\mathrel}{\M@extsymbols}{"2AB8} \DeclareMathSymbol{\precprec}{\mathrel}{\M@extsymbols}{"2ABB} \DeclareMathSymbol{\succsucc}{\mathrel}{\M@extsymbols}{"2ABC} \DeclareMathSymbol{\asymp}{\mathrel}{\M@extsymbols}{"224D} \DeclareMathSymbol{\nin}{\mathrel}{\M@extsymbols}{"2209} \DeclareMathSymbol{\nni}{\mathrel}{\M@extsymbols}{"220C} \DeclareMathSymbol{\nsubset}{\mathrel}{\M@extsymbols}{"2284} \DeclareMathSymbol{\nsupset}{\mathrel}{\M@extsymbols}{"2285} \DeclareMathSymbol{\nsubseteq}{\mathrel}{\M@extsymbols}{"2288} \DeclareMathSymbol{\nsupseteq}{\mathrel}{\M@extsymbols}{"2289} \DeclareMathSymbol{\subsetneq}{\mathrel}{\M@extsymbols}{"228A} \DeclareMathSymbol{\supsetneq}{\mathrel}{\M@extsymbols}{"228B} \DeclareMathSymbol{\nsqsubseteq}{\mathrel}{\M@extsymbols}{"22E2} \DeclareMathSymbol{\nsqsupseteq}{\mathrel}{\M@extsymbols}{"22E3} \DeclareMathSymbol{\sqsubsetneq}{\mathrel}{\M@extsymbols}{"22E4} \DeclareMathSymbol{\sqsupsetneq}{\mathrel}{\M@extsymbols}{"22E5} \DeclareMathSymbol{\neq}{\mathrel}{\M@extsymbols}{"2260} \DeclareMathSymbol{\nl}{\mathrel}{\M@extsymbols}{"226E} \DeclareMathSymbol{\ng}{\mathrel}{\M@extsymbols}{"226F} \DeclareMathSymbol{\nleq}{\mathrel}{\M@extsymbols}{"2270} \DeclareMathSymbol{\ngeq}{\mathrel}{\M@extsymbols}{"2271} \DeclareMathSymbol{\lneq}{\mathrel}{\M@extsymbols}{"2A87} \DeclareMathSymbol{\gneq}{\mathrel}{\M@extsymbols}{"2A88} \DeclareMathSymbol{\lneqq}{\mathrel}{\M@extsymbols}{"2268} \DeclareMathSymbol{\gneqq}{\mathrel}{\M@extsymbols}{"2269} \DeclareMathSymbol{\ntriangleleft}{\mathrel}{\M@extsymbols}{"22EA} \DeclareMathSymbol{\ntriangleright}{\mathrel}{\M@extsymbols}{"22EB} \DeclareMathSymbol{\ntrianglelefteq}{\mathrel}{\M@extsymbols}{"22EC} \DeclareMathSymbol{\ntrianglerighteq}{\mathrel}{\M@extsymbols}{"22ED} \DeclareMathSymbol{\nsim}{\mathrel}{\M@extsymbols}{"2241} \DeclareMathSymbol{\napprox}{\mathrel}{\M@extsymbols}{"2249} \DeclareMathSymbol{\nsimeq}{\mathrel}{\M@extsymbols}{"2244} \DeclareMathSymbol{\nsimeqq}{\mathrel}{\M@extsymbols}{"2247} \DeclareMathSymbol{\simneqq}{\mathrel}{\M@extsymbols}{"2246} \DeclareMathSymbol{\nlsim}{\mathrel}{\M@extsymbols}{"2274} \DeclareMathSymbol{\ngsim}{\mathrel}{\M@extsymbols}{"2275} \DeclareMathSymbol{\lnsim}{\mathrel}{\M@extsymbols}{"22E6} \DeclareMathSymbol{\gnsim}{\mathrel}{\M@extsymbols}{"22E7} \DeclareMathSymbol{\lnapprox}{\mathrel}{\M@extsymbols}{"2A89} \DeclareMathSymbol{\gnapprox}{\mathrel}{\M@extsymbols}{"2A8A} \DeclareMathSymbol{\nprec}{\mathrel}{\M@extsymbols}{"2280} \DeclareMathSymbol{\nsucc}{\mathrel}{\M@extsymbols}{"2281} \DeclareMathSymbol{\npreceq}{\mathrel}{\M@extsymbols}{"22E0} \DeclareMathSymbol{\nsucceq}{\mathrel}{\M@extsymbols}{"22E1} \DeclareMathSymbol{\precneq}{\mathrel}{\M@extsymbols}{"2AB1} \DeclareMathSymbol{\succneq}{\mathrel}{\M@extsymbols}{"2AB2} \DeclareMathSymbol{\precneqq}{\mathrel}{\M@extsymbols}{"2AB5} \DeclareMathSymbol{\succneqq}{\mathrel}{\M@extsymbols}{"2AB6} \DeclareMathSymbol{\precnsim}{\mathrel}{\M@extsymbols}{"22E8} \DeclareMathSymbol{\succnsim}{\mathrel}{\M@extsymbols}{"22E9} \DeclareMathSymbol{\precnapprox}{\mathrel}{\M@extsymbols}{"2AB9} \DeclareMathSymbol{\succnapprox}{\mathrel}{\M@extsymbols}{"2ABA} \DeclareMathSymbol{\nequiv}{\mathrel}{\M@extsymbols}{"2262}} % \end{macrocode} % Set delimiters.\?\M@delimiters\indexpage{keyworddelimiters=keyword \texttt{delimiters}} % \begin{macrocode} \def\M@delimiters@set{% \edef\M@delimiters{M\@delimitersshape\the\M@count} \DeclareMathSymbol{(}{\mathopen}{\M@delimiters}{"28} \DeclareMathSymbol{)}{\mathclose}{\M@delimiters}{"29} \DeclareMathSymbol{[}{\mathopen}{\M@delimiters}{"5B} \DeclareMathSymbol{]}{\mathclose}{\M@delimiters}{"5D} \DeclareMathSymbol{\leftbrace}{\mathopen}{\M@delimiters}{"7B} \DeclareMathSymbol{\rightbrace}{\mathclose}{\M@delimiters}{"7D}} % \end{macrocode} % Set arrows.\?{\M@arrows}\indexpage{keywordarrows=keyword \texttt{arrows}} % \begin{macrocode} \def\M@arrows@set{% \edef\M@arrows{M\@arrowsshape\the\M@count} \let\uparrow\@undefined \let\Uparrow\@undefined \let\downarrow\@undefined \let\Downarrow\@undefined \let\updownarrow\@undefined \let\Updownarrow\@undefined \let\longrightarrow\@undefined \let\longleftarrow\@undefined \let\longleftrightarrow\@undefined \let\hookrightarrow\@undefined \let\hookleftarrow\@undefined \let\Longrightarrow\@undefined \let\Longleftarrow\@undefined \let\Longleftrightarrow\@undefined \let\rightleftharpoons\@undefined \DeclareMathSymbol{\rightarrow}{\mathrel}{\M@arrows}{"2192} \let\to\rightarrow \DeclareMathSymbol{\nrightarrow}{\mathrel}{\M@arrows}{"219B} \DeclareMathSymbol{\Rightarrow}{\mathrel}{\M@arrows}{"21D2} \DeclareMathSymbol{\nRightarrow}{\mathrel}{\M@arrows}{"21CF} \DeclareMathSymbol{\Rrightarrow}{\mathrel}{\M@arrows}{"21DB} \DeclareMathSymbol{\longrightarrow}{\mathrel}{\M@arrows}{"27F6} \DeclareMathSymbol{\Longrightarrow}{\mathrel}{\M@arrows}{"27F9} \DeclareMathSymbol{\rightbararrow}{\mathrel}{\M@arrows}{"21A6} \let\mapsto\rightbararrow \DeclareMathSymbol{\Rightbararrow}{\mathrel}{\M@arrows}{"2907} \DeclareMathSymbol{\longrightbararrow}{\mathrel}{\M@arrows}{"27FC} \let\longmapsto\longrightbararrow \DeclareMathSymbol{\Longrightbararrow}{\mathrel}{\M@arrows}{"27FE} \DeclareMathSymbol{\hookrightarrow}{\mathrel}{\M@arrows}{"21AA} \DeclareMathSymbol{\rightdasharrow}{\mathrel}{\M@arrows}{"21E2} \DeclareMathSymbol{\rightharpoonup}{\mathrel}{\M@arrows}{"21C0} \DeclareMathSymbol{\rightharpoondown}{\mathrel}{\M@arrows}{"21C1} \DeclareMathSymbol{\rightarrowtail}{\mathrel}{\M@arrows}{"21A3} \DeclareMathSymbol{\rightoplusarrow}{\mathrel}{\M@arrows}{"27F4} \DeclareMathSymbol{\rightwavearrow}{\mathrel}{\M@arrows}{"219D} \DeclareMathSymbol{\rightsquigarrow}{\mathrel}{\M@arrows}{"21DD} \DeclareMathSymbol{\longrightsquigarrow}{\mathrel}{\M@arrows}{"27FF} \DeclareMathSymbol{\looparrowright}{\mathrel}{\M@arrows}{"21AC} \DeclareMathSymbol{\curvearrowright}{\mathrel}{\M@arrows}{"293B} \DeclareMathSymbol{\circlearrowright}{\mathrel}{\M@arrows}{"21BB} \DeclareMathSymbol{\twoheadrightarrow}{\mathrel}{\M@arrows}{"21A0} \DeclareMathSymbol{\rightarrowtobar}{\mathrel}{\M@arrows}{"21E5} \DeclareMathSymbol{\rightwhitearrow}{\mathrel}{\M@arrows}{"21E8} \DeclareMathSymbol{\rightrightarrows}{\mathrel}{\M@arrows}{"21C9} \DeclareMathSymbol{\rightrightrightarrows}{\mathrel}{\M@arrows}{"21F6} \DeclareMathSymbol{\leftarrow}{\mathrel}{\M@arrows}{"2190} \let\from\leftarrow \DeclareMathSymbol{\nleftarrow}{\mathrel}{\M@arrows}{"219A} \DeclareMathSymbol{\Leftarrow}{\mathrel}{\M@arrows}{"21D0} \DeclareMathSymbol{\nLeftarrow}{\mathrel}{\M@arrows}{"21CD} \DeclareMathSymbol{\Lleftarrow}{\mathrel}{\M@arrows}{"21DA} \DeclareMathSymbol{\longleftarrow}{\mathrel}{\M@arrows}{"27F5} \DeclareMathSymbol{\Longleftarrow}{\mathrel}{\M@arrows}{"27F8} \DeclareMathSymbol{\leftbararrow}{\mathrel}{\M@arrows}{"21A4} \let\mapsfrom\leftbararrow \DeclareMathSymbol{\Leftbararrow}{\mathrel}{\M@arrows}{"2906} \DeclareMathSymbol{\longleftbararrow}{\mathrel}{\M@arrows}{"27FB} \let\longmapsfrom\longleftbararrow \DeclareMathSymbol{\Longleftbararrow}{\mathrel}{\M@arrows}{"27FD} \DeclareMathSymbol{\hookleftarrow}{\mathrel}{\M@arrows}{"21A9} \DeclareMathSymbol{\leftdasharrow}{\mathrel}{\M@arrows}{"21E0} \DeclareMathSymbol{\leftharpoonup}{\mathrel}{\M@arrows}{"21C0} \DeclareMathSymbol{\leftharpoondown}{\mathrel}{\M@arrows}{"21C1} \DeclareMathSymbol{\leftarrowtail}{\mathrel}{\M@arrows}{"21A2} \DeclareMathSymbol{\leftoplusarrow}{\mathrel}{\M@arrows}{"2B32} \DeclareMathSymbol{\leftwavearrow}{\mathrel}{\M@arrows}{"219C} \DeclareMathSymbol{\leftsquigarrow}{\mathrel}{\M@arrows}{"21DC} \DeclareMathSymbol{\longleftsquigarrow}{\mathrel}{\M@arrows}{"2B33} \DeclareMathSymbol{\looparrowleft}{\mathrel}{\M@arrows}{"21AB} \DeclareMathSymbol{\curvearrowleft}{\mathrel}{\M@arrows}{"293A} \DeclareMathSymbol{\circlearrowleft}{\mathrel}{\M@arrows}{"21BA} \DeclareMathSymbol{\twoheadleftarrow}{\mathrel}{\M@arrows}{"219E} \DeclareMathSymbol{\leftarrowtobar}{\mathrel}{\M@arrows}{"21E4} \DeclareMathSymbol{\leftwhitearrow}{\mathrel}{\M@arrows}{"21E6} \DeclareMathSymbol{\leftleftarrows}{\mathrel}{\M@arrows}{"21C7} \DeclareMathSymbol{\leftleftleftarrows}{\mathrel}{\M@arrows}{"2B31} \DeclareMathSymbol{\leftrightarrow}{\mathrel}{\M@arrows}{"2194} \DeclareMathSymbol{\Leftrightarrow}{\mathrel}{\M@arrows}{"21D4} \DeclareMathSymbol{\nLeftrightarrow}{\mathrel}{\M@arrows}{"21CE} \DeclareMathSymbol{\longleftrightarrow}{\mathrel}{\M@arrows}{"27F7} \DeclareMathSymbol{\Longleftrightarrow}{\mathrel}{\M@arrows}{"27FA} \DeclareMathSymbol{\leftrightwavearrow}{\mathrel}{\M@arrows}{"21AD} \DeclareMathSymbol{\leftrightarrows}{\mathrel}{\M@arrows}{"21C6} \DeclareMathSymbol{\leftrightharpoons}{\mathrel}{\M@arrows}{"21CB} \DeclareMathSymbol{\leftrightarrowstobar}{\mathrel}{\M@arrows}{"21B9} \DeclareMathSymbol{\rightleftarrows}{\mathrel}{\M@arrows}{"21C4} \DeclareMathSymbol{\rightleftharpoons}{\mathrel}{\M@arrows}{"21CC} \DeclareMathSymbol{\uparrow}{\mathrel}{\M@arrows}{"2191} \DeclareMathSymbol{\Uparrow}{\mathrel}{\M@arrows}{"21D1} \DeclareMathSymbol{\Uuparrow}{\mathrel}{\M@arrows}{"290A} \DeclareMathSymbol{\upbararrow}{\mathrel}{\M@arrows}{"21A5} \DeclareMathSymbol{\updasharrow}{\mathrel}{\M@arrows}{"21E1} \DeclareMathSymbol{\upharpoonleft}{\mathrel}{\M@arrows}{"21BF} \DeclareMathSymbol{\upharpoonright}{\mathrel}{\M@arrows}{"21BE} \DeclareMathSymbol{\twoheaduparrow}{\mathrel}{\M@arrows}{"219F} \DeclareMathSymbol{\uparrowtobar}{\mathrel}{\M@arrows}{"2912} \DeclareMathSymbol{\upwhitearrow}{\mathrel}{\M@arrows}{"21E7} \DeclareMathSymbol{\upwhitebararrow}{\mathrel}{\M@arrows}{"21EA} \DeclareMathSymbol{\upuparrows}{\mathrel}{\M@arrows}{"21C8} \DeclareMathSymbol{\downarrow}{\mathrel}{\M@arrows}{"2193} \DeclareMathSymbol{\Downarrow}{\mathrel}{\M@arrows}{"21D3} \DeclareMathSymbol{\Ddownarrow}{\mathrel}{\M@arrows}{"290B} \DeclareMathSymbol{\downbararrow}{\mathrel}{\M@arrows}{"21A7} \DeclareMathSymbol{\downdasharrow}{\mathrel}{\M@arrows}{"21E3} \DeclareMathSymbol{\zigzagarrow}{\mathrel}{\M@arrows}{"21AF} \let\lightningboltarrow\zigzagarrow \DeclareMathSymbol{\downharpoonleft}{\mathrel}{\M@arrows}{"21C3} \DeclareMathSymbol{\downharpoonright}{\mathrel}{\M@arrows}{"21C2} \DeclareMathSymbol{\twoheaddownarrow}{\mathrel}{\M@arrows}{"21A1} \DeclareMathSymbol{\downarrowtobar}{\mathrel}{\M@arrows}{"2913} \DeclareMathSymbol{\downwhitearrow}{\mathrel}{\M@arrows}{"21E9} \DeclareMathSymbol{\downdownarrows}{\mathrel}{\M@arrows}{"21CA} \DeclareMathSymbol{\updownarrow}{\mathrel}{\M@arrows}{"2195} \DeclareMathSymbol{\Updownarrow}{\mathrel}{\M@arrows}{"21D5} \DeclareMathSymbol{\updownarrows}{\mathrel}{\M@arrows}{"21C5} \DeclareMathSymbol{\downuparrows}{\mathrel}{\M@arrows}{"21F5} \DeclareMathSymbol{\updownharpoons}{\mathrel}{\M@arrows}{"296E} \DeclareMathSymbol{\downupharpoons}{\mathrel}{\M@arrows}{"296F} \DeclareMathSymbol{\nearrow}{\mathrel}{\M@arrows}{"2197} \DeclareMathSymbol{\Nearrow}{\mathrel}{\M@arrows}{"21D7} \DeclareMathSymbol{\nwarrow}{\mathrel}{\M@arrows}{"2196} \DeclareMathSymbol{\Nwarrow}{\mathrel}{\M@arrows}{"21D6} \DeclareMathSymbol{\searrow}{\mathrel}{\M@arrows}{"2198} \DeclareMathSymbol{\Searrow}{\mathrel}{\M@arrows}{"21D8} \DeclareMathSymbol{\swarrow}{\mathrel}{\M@arrows}{"2199} \DeclareMathSymbol{\Swarrow}{\mathrel}{\M@arrows}{"21D9} \DeclareMathSymbol{\nwsearrow}{\mathrel}{\M@arrows}{"2921} \DeclareMathSymbol{\neswarrow}{\mathrel}{\M@arrows}{"2922} \DeclareMathSymbol{\lcirclearrow}{\mathrel}{\M@arrows}{"27F2} \DeclareMathSymbol{\rcirclearrow}{\mathrel}{\M@arrows}{"27F3}} % \end{macrocode} % Big operators.\?\M@bigops\indexpage{keywordbigops=keyword \texttt{bigops}} % \begin{macrocode} \def\M@bigops@set{% \edef\M@bigops{M\@bigopsshape\the\M@count} \let\sum\@undefined \let\prod\@undefined \DeclareMathSymbol{\sum}{\mathop}{\M@bigops}{"2211} \DeclareMathSymbol{\prod}{\mathop}{\M@bigops}{"220F} \DeclareMathSymbol{\intop}{\mathop}{\M@bigops}{"222B}} % \end{macrocode} % Set extended big operators.\?\M@extbigops\indexpage{keywordextbigops=keyword \texttt{extbigops}} % \begin{macrocode} \def\M@extbigops@set{% \edef\M@extbigops{M\@extbigopsshape\the\M@count} \let\coprod\@undefined \let\bigvee\@undefined \let\bigwedge\@undefined \let\bigcup\@undefined \let\bigcap\@undefined \let\bigoplus\@undefined \let\bigotimes\@undefined \let\bigodot\@undefined \let\bigsqcup\@undefined \DeclareMathSymbol{\coprod}{\mathop}{\M@extbigops}{"2210} \DeclareMathSymbol{\bigvee}{\mathop}{\M@extbigops}{"22C1} \DeclareMathSymbol{\bigwedge}{\mathop}{\M@extbigops}{"22C0} \DeclareMathSymbol{\bigcup}{\mathop}{\M@extbigops}{"22C3} \DeclareMathSymbol{\bigcap}{\mathord}{\M@extbigops}{"22C2} \DeclareMathSymbol{\iintop}{\mathop}{\M@extbigops}{"222C} \def\iint{\iintop\nolimits} \DeclareMathSymbol{\iiintop}{\mathop}{\M@extbigops}{"222D} \def\iiint{\iiintop\nolimits} \DeclareMathSymbol{\ointop}{\mathop}{\M@extbigops}{"222E} \def\oint{\ointop\nolimits} \DeclareMathSymbol{\oiintop}{\mathop}{\M@extbigops}{"222F} \def\oiint{\oiintop\nolimits} \DeclareMathSymbol{\oiiintop}{\mathop}{\M@extbigops}{"2230} \def\oiiint{\oiiintop\nolimits} \DeclareMathSymbol{\bigoplus}{\mathop}{\M@extbigops}{"2A01} \DeclareMathSymbol{\bigotimes}{\mathop}{\M@extbigops}{"2A02} \DeclareMathSymbol{\bigodot}{\mathop}{\M@extbigops}{"2A00} \DeclareMathSymbol{\bigsqcap}{\mathop}{\M@extbigops}{"2A05} \DeclareMathSymbol{\bigsqcup}{\mathop}{\M@extbigops}{"2A06}} % \end{macrocode} % Set blackboard bold letters and numbers.\?\M@bb\indexpage{keywordbb=keyword \texttt{bb}} % \begin{macrocode} \def\M@bb@set{% \edef\M@bb{M\@bbshape\the\M@count} \DeclareMathSymbol{\M@bb@A}{\mathord}{\M@bb}{"1D538} \DeclareMathSymbol{\M@bb@B}{\mathord}{\M@bb}{"1D539} \DeclareMathSymbol{\M@bb@C}{\mathord}{\M@bb}{"2102} \DeclareMathSymbol{\M@bb@D}{\mathord}{\M@bb}{"1D53B} \DeclareMathSymbol{\M@bb@E}{\mathord}{\M@bb}{"1D53C} \DeclareMathSymbol{\M@bb@F}{\mathord}{\M@bb}{"1D53D} \DeclareMathSymbol{\M@bb@G}{\mathord}{\M@bb}{"1D53E} \DeclareMathSymbol{\M@bb@H}{\mathord}{\M@bb}{"210D} \DeclareMathSymbol{\M@bb@I}{\mathord}{\M@bb}{"1D540} \DeclareMathSymbol{\M@bb@J}{\mathord}{\M@bb}{"1D541} \DeclareMathSymbol{\M@bb@K}{\mathord}{\M@bb}{"1D542} \DeclareMathSymbol{\M@bb@L}{\mathord}{\M@bb}{"1D543} \DeclareMathSymbol{\M@bb@M}{\mathord}{\M@bb}{"1D544} \DeclareMathSymbol{\M@bb@N}{\mathord}{\M@bb}{"2115} \DeclareMathSymbol{\M@bb@O}{\mathord}{\M@bb}{"1D546} \DeclareMathSymbol{\M@bb@P}{\mathord}{\M@bb}{"2119} \DeclareMathSymbol{\M@bb@Q}{\mathord}{\M@bb}{"211A} \DeclareMathSymbol{\M@bb@R}{\mathord}{\M@bb}{"211D} \DeclareMathSymbol{\M@bb@S}{\mathord}{\M@bb}{"1D54A} \DeclareMathSymbol{\M@bb@T}{\mathord}{\M@bb}{"1D54B} \DeclareMathSymbol{\M@bb@U}{\mathord}{\M@bb}{"1D54C} \DeclareMathSymbol{\M@bb@V}{\mathord}{\M@bb}{"1D54D} \DeclareMathSymbol{\M@bb@W}{\mathord}{\M@bb}{"1D54E} \DeclareMathSymbol{\M@bb@X}{\mathord}{\M@bb}{"1D54F} \DeclareMathSymbol{\M@bb@Y}{\mathord}{\M@bb}{"1D550} \DeclareMathSymbol{\M@bb@Z}{\mathord}{\M@bb}{"2124} \DeclareMathSymbol{\M@bb@a}{\mathord}{\M@bb}{"1D552} \DeclareMathSymbol{\M@bb@b}{\mathord}{\M@bb}{"1D553} \DeclareMathSymbol{\M@bb@c}{\mathord}{\M@bb}{"1D554} \DeclareMathSymbol{\M@bb@d}{\mathord}{\M@bb}{"1D555} \DeclareMathSymbol{\M@bb@e}{\mathord}{\M@bb}{"1D556} \DeclareMathSymbol{\M@bb@f}{\mathord}{\M@bb}{"1D557} \DeclareMathSymbol{\M@bb@g}{\mathord}{\M@bb}{"1D558} \DeclareMathSymbol{\M@bb@h}{\mathord}{\M@bb}{"1D559} \DeclareMathSymbol{\M@bb@i}{\mathord}{\M@bb}{"1D55A} \DeclareMathSymbol{\M@bb@j}{\mathord}{\M@bb}{"1D55B} \DeclareMathSymbol{\M@bb@k}{\mathord}{\M@bb}{"1D55C} \DeclareMathSymbol{\M@bb@l}{\mathord}{\M@bb}{"1D55D} \DeclareMathSymbol{\M@bb@m}{\mathord}{\M@bb}{"1D55E} \DeclareMathSymbol{\M@bb@n}{\mathord}{\M@bb}{"1D55F} \DeclareMathSymbol{\M@bb@o}{\mathord}{\M@bb}{"1D560} \DeclareMathSymbol{\M@bb@p}{\mathord}{\M@bb}{"1D561} \DeclareMathSymbol{\M@bb@q}{\mathord}{\M@bb}{"1D562} \DeclareMathSymbol{\M@bb@r}{\mathord}{\M@bb}{"1D563} \DeclareMathSymbol{\M@bb@s}{\mathord}{\M@bb}{"1D564} \DeclareMathSymbol{\M@bb@t}{\mathord}{\M@bb}{"1D565} \DeclareMathSymbol{\M@bb@u}{\mathord}{\M@bb}{"1D566} \DeclareMathSymbol{\M@bb@v}{\mathord}{\M@bb}{"1D567} \DeclareMathSymbol{\M@bb@w}{\mathord}{\M@bb}{"1D568} \DeclareMathSymbol{\M@bb@x}{\mathord}{\M@bb}{"1D569} \DeclareMathSymbol{\M@bb@y}{\mathord}{\M@bb}{"1D56A} \DeclareMathSymbol{\M@bb@z}{\mathord}{\M@bb}{"1D56B} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@0\endcsname}{\mathord}{\M@bb}{"1D7D8} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@1\endcsname}{\mathord}{\M@bb}{"1D7D9} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@2\endcsname}{\mathord}{\M@bb}{"1D7DA} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@3\endcsname}{\mathord}{\M@bb}{"1D7DB} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@4\endcsname}{\mathord}{\M@bb}{"1D7DC} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@5\endcsname}{\mathord}{\M@bb}{"1D7DD} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@6\endcsname}{\mathord}{\M@bb}{"1D7DE} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@7\endcsname}{\mathord}{\M@bb}{"1D7DF} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@8\endcsname}{\mathord}{\M@bb}{"1D7E0} \expandafter\DeclareMathSymbol\expandafter {\csname M@bb@9\endcsname}{\mathord}{\M@bb}{"1D7E1}} % \end{macrocode} % Set caligraphic letters.\?\M@cal\indexpage{keywordcal=keyword \texttt{cal}} % \begin{macrocode} \def\M@cal@set{% \edef\M@cal{M\@calshape\the\M@count} \DeclareMathSymbol{\M@cal@A}{\mathord}{\M@cal}{"1D49C} \DeclareMathSymbol{\M@cal@B}{\mathord}{\M@cal}{"212C} \DeclareMathSymbol{\M@cal@C}{\mathord}{\M@cal}{"1D49E} \DeclareMathSymbol{\M@cal@D}{\mathord}{\M@cal}{"1D49F} \DeclareMathSymbol{\M@cal@E}{\mathord}{\M@cal}{"2130} \DeclareMathSymbol{\M@cal@F}{\mathord}{\M@cal}{"2131} \DeclareMathSymbol{\M@cal@G}{\mathord}{\M@cal}{"1D4A2} \DeclareMathSymbol{\M@cal@H}{\mathord}{\M@cal}{"210B} \DeclareMathSymbol{\M@cal@I}{\mathord}{\M@cal}{"2110} \DeclareMathSymbol{\M@cal@J}{\mathord}{\M@cal}{"1D4A5} \DeclareMathSymbol{\M@cal@K}{\mathord}{\M@cal}{"1D4A6} \DeclareMathSymbol{\M@cal@L}{\mathord}{\M@cal}{"2112} \DeclareMathSymbol{\M@cal@M}{\mathord}{\M@cal}{"2133} \DeclareMathSymbol{\M@cal@N}{\mathord}{\M@cal}{"1D4A9} \DeclareMathSymbol{\M@cal@O}{\mathord}{\M@cal}{"1D4AA} \DeclareMathSymbol{\M@cal@P}{\mathord}{\M@cal}{"1D4AB} \DeclareMathSymbol{\M@cal@Q}{\mathord}{\M@cal}{"1D4AC} \DeclareMathSymbol{\M@cal@R}{\mathord}{\M@cal}{"211B} \DeclareMathSymbol{\M@cal@S}{\mathord}{\M@cal}{"1D4AE} \DeclareMathSymbol{\M@cal@T}{\mathord}{\M@cal}{"1D4AF} \DeclareMathSymbol{\M@cal@U}{\mathord}{\M@cal}{"1D4B0} \DeclareMathSymbol{\M@cal@V}{\mathord}{\M@cal}{"1D4B1} \DeclareMathSymbol{\M@cal@W}{\mathord}{\M@cal}{"1D4B2} \DeclareMathSymbol{\M@cal@X}{\mathord}{\M@cal}{"1D4B3} \DeclareMathSymbol{\M@cal@Y}{\mathord}{\M@cal}{"1D4B4} \DeclareMathSymbol{\M@cal@Z}{\mathord}{\M@cal}{"1D4B5} \DeclareMathSymbol{\M@cal@a}{\mathord}{\M@cal}{"1D4B6} \DeclareMathSymbol{\M@cal@b}{\mathord}{\M@cal}{"1D4B7} \DeclareMathSymbol{\M@cal@c}{\mathord}{\M@cal}{"1D4B8} \DeclareMathSymbol{\M@cal@d}{\mathord}{\M@cal}{"1D4B9} \DeclareMathSymbol{\M@cal@e}{\mathord}{\M@cal}{"212F} \DeclareMathSymbol{\M@cal@f}{\mathord}{\M@cal}{"1D4BB} \DeclareMathSymbol{\M@cal@g}{\mathord}{\M@cal}{"210A} \DeclareMathSymbol{\M@cal@h}{\mathord}{\M@cal}{"1D4BD} \DeclareMathSymbol{\M@cal@i}{\mathord}{\M@cal}{"1D4BE} \DeclareMathSymbol{\M@cal@j}{\mathord}{\M@cal}{"1D4BF} \DeclareMathSymbol{\M@cal@k}{\mathord}{\M@cal}{"1D4C0} \DeclareMathSymbol{\M@cal@l}{\mathord}{\M@cal}{"1D4C1} \DeclareMathSymbol{\M@cal@m}{\mathord}{\M@cal}{"1D4C2} \DeclareMathSymbol{\M@cal@n}{\mathord}{\M@cal}{"1D4C3} \DeclareMathSymbol{\M@cal@o}{\mathord}{\M@cal}{"2134} \DeclareMathSymbol{\M@cal@p}{\mathord}{\M@cal}{"1D4C5} \DeclareMathSymbol{\M@cal@q}{\mathord}{\M@cal}{"1D4C6} \DeclareMathSymbol{\M@cal@r}{\mathord}{\M@cal}{"1D4C7} \DeclareMathSymbol{\M@cal@s}{\mathord}{\M@cal}{"1D4C8} \DeclareMathSymbol{\M@cal@t}{\mathord}{\M@cal}{"1D4C9} \DeclareMathSymbol{\M@cal@u}{\mathord}{\M@cal}{"1D4CA} \DeclareMathSymbol{\M@cal@v}{\mathord}{\M@cal}{"1D4CB} \DeclareMathSymbol{\M@cal@w}{\mathord}{\M@cal}{"1D4CC} \DeclareMathSymbol{\M@cal@x}{\mathord}{\M@cal}{"1D4CD} \DeclareMathSymbol{\M@cal@y}{\mathord}{\M@cal}{"1D4CE} \DeclareMathSymbol{\M@cal@z}{\mathord}{\M@cal}{"1D4CF}} % \end{macrocode} % Set fraktur letters.\?\M@frak\indexpage{keywordfrak=keyword \texttt{frak}} % \begin{macrocode} \def\M@frak@set{% \edef\M@frak{M\@frakshape\the\M@count} \DeclareMathSymbol{\M@frak@A}{\mathord}{\M@frak}{"1D504} \DeclareMathSymbol{\M@frak@B}{\mathord}{\M@frak}{"1D505} \DeclareMathSymbol{\M@frak@C}{\mathord}{\M@frak}{"212D} \DeclareMathSymbol{\M@frak@D}{\mathord}{\M@frak}{"1D507} \DeclareMathSymbol{\M@frak@E}{\mathord}{\M@frak}{"1D508} \DeclareMathSymbol{\M@frak@F}{\mathord}{\M@frak}{"1D509} \DeclareMathSymbol{\M@frak@G}{\mathord}{\M@frak}{"1D50A} \DeclareMathSymbol{\M@frak@H}{\mathord}{\M@frak}{"210C} \DeclareMathSymbol{\M@frak@I}{\mathord}{\M@frak}{"2111} \DeclareMathSymbol{\M@frak@J}{\mathord}{\M@frak}{"1D50D} \DeclareMathSymbol{\M@frak@K}{\mathord}{\M@frak}{"1D50E} \DeclareMathSymbol{\M@frak@L}{\mathord}{\M@frak}{"1D50F} \DeclareMathSymbol{\M@frak@M}{\mathord}{\M@frak}{"1D510} \DeclareMathSymbol{\M@frak@N}{\mathord}{\M@frak}{"1D511} \DeclareMathSymbol{\M@frak@O}{\mathord}{\M@frak}{"1D512} \DeclareMathSymbol{\M@frak@P}{\mathord}{\M@frak}{"1D513} \DeclareMathSymbol{\M@frak@Q}{\mathord}{\M@frak}{"1D514} \DeclareMathSymbol{\M@frak@R}{\mathord}{\M@frak}{"212C} \DeclareMathSymbol{\M@frak@S}{\mathord}{\M@frak}{"1D516} \DeclareMathSymbol{\M@frak@T}{\mathord}{\M@frak}{"1D517} \DeclareMathSymbol{\M@frak@U}{\mathord}{\M@frak}{"1D518} \DeclareMathSymbol{\M@frak@V}{\mathord}{\M@frak}{"1D519} \DeclareMathSymbol{\M@frak@W}{\mathord}{\M@frak}{"1D51A} \DeclareMathSymbol{\M@frak@X}{\mathord}{\M@frak}{"1D51B} \DeclareMathSymbol{\M@frak@Y}{\mathord}{\M@frak}{"1D51C} \DeclareMathSymbol{\M@frak@Z}{\mathord}{\M@frak}{"2128} \DeclareMathSymbol{\M@frak@a}{\mathord}{\M@frak}{"1D51E} \DeclareMathSymbol{\M@frak@b}{\mathord}{\M@frak}{"1D51F} \DeclareMathSymbol{\M@frak@c}{\mathord}{\M@frak}{"1D520} \DeclareMathSymbol{\M@frak@d}{\mathord}{\M@frak}{"1D521} \DeclareMathSymbol{\M@frak@e}{\mathord}{\M@frak}{"1D522} \DeclareMathSymbol{\M@frak@f}{\mathord}{\M@frak}{"1D523} \DeclareMathSymbol{\M@frak@g}{\mathord}{\M@frak}{"1D524} \DeclareMathSymbol{\M@frak@h}{\mathord}{\M@frak}{"1D525} \DeclareMathSymbol{\M@frak@i}{\mathord}{\M@frak}{"1D526} \DeclareMathSymbol{\M@frak@j}{\mathord}{\M@frak}{"1D527} \DeclareMathSymbol{\M@frak@k}{\mathord}{\M@frak}{"1D528} \DeclareMathSymbol{\M@frak@l}{\mathord}{\M@frak}{"1D529} \DeclareMathSymbol{\M@frak@m}{\mathord}{\M@frak}{"1D52A} \DeclareMathSymbol{\M@frak@n}{\mathord}{\M@frak}{"1D52B} \DeclareMathSymbol{\M@frak@o}{\mathord}{\M@frak}{"1D52C} \DeclareMathSymbol{\M@frak@p}{\mathord}{\M@frak}{"1D52D} \DeclareMathSymbol{\M@frak@q}{\mathord}{\M@frak}{"1D52E} \DeclareMathSymbol{\M@frak@r}{\mathord}{\M@frak}{"1D52F} \DeclareMathSymbol{\M@frak@s}{\mathord}{\M@frak}{"1D530} \DeclareMathSymbol{\M@frak@t}{\mathord}{\M@frak}{"1D531} \DeclareMathSymbol{\M@frak@u}{\mathord}{\M@frak}{"1D532} \DeclareMathSymbol{\M@frak@v}{\mathord}{\M@frak}{"1D533} \DeclareMathSymbol{\M@frak@w}{\mathord}{\M@frak}{"1D534} \DeclareMathSymbol{\M@frak@x}{\mathord}{\M@frak}{"1D535} \DeclareMathSymbol{\M@frak@y}{\mathord}{\M@frak}{"1D536} \DeclareMathSymbol{\M@frak@z}{\mathord}{\M@frak}{"1D537}} % \end{macrocode} % Set bold caligraphic letters.\?\M@bcal\indexpage{keywordbcal=keyword \texttt{bcal}} % \begin{macrocode} \def\M@bcal@set{% \edef\M@bcal{M\@bcalshape\the\M@count} \DeclareMathSymbol{\M@bcal@A}{\mathord}{\M@bcal}{"1D4D0} \DeclareMathSymbol{\M@bcal@B}{\mathord}{\M@bcal}{"1D4D1} \DeclareMathSymbol{\M@bcal@C}{\mathord}{\M@bcal}{"1D4D2} \DeclareMathSymbol{\M@bcal@D}{\mathord}{\M@bcal}{"1D4D3} \DeclareMathSymbol{\M@bcal@E}{\mathord}{\M@bcal}{"1D4D4} \DeclareMathSymbol{\M@bcal@F}{\mathord}{\M@bcal}{"1D4D5} \DeclareMathSymbol{\M@bcal@G}{\mathord}{\M@bcal}{"1D4D6} \DeclareMathSymbol{\M@bcal@H}{\mathord}{\M@bcal}{"1D4D7} \DeclareMathSymbol{\M@bcal@I}{\mathord}{\M@bcal}{"1D4D8} \DeclareMathSymbol{\M@bcal@J}{\mathord}{\M@bcal}{"1D4D9} \DeclareMathSymbol{\M@bcal@K}{\mathord}{\M@bcal}{"1D4DA} \DeclareMathSymbol{\M@bcal@L}{\mathord}{\M@bcal}{"1D4DB} \DeclareMathSymbol{\M@bcal@M}{\mathord}{\M@bcal}{"1D4DC} \DeclareMathSymbol{\M@bcal@N}{\mathord}{\M@bcal}{"1D4DD} \DeclareMathSymbol{\M@bcal@O}{\mathord}{\M@bcal}{"1D4DE} \DeclareMathSymbol{\M@bcal@P}{\mathord}{\M@bcal}{"1D4DF} \DeclareMathSymbol{\M@bcal@Q}{\mathord}{\M@bcal}{"1D4E0} \DeclareMathSymbol{\M@bcal@R}{\mathord}{\M@bcal}{"1D4E1} \DeclareMathSymbol{\M@bcal@S}{\mathord}{\M@bcal}{"1D4E2} \DeclareMathSymbol{\M@bcal@T}{\mathord}{\M@bcal}{"1D4E3} \DeclareMathSymbol{\M@bcal@U}{\mathord}{\M@bcal}{"1D4E4} \DeclareMathSymbol{\M@bcal@V}{\mathord}{\M@bcal}{"1D4E5} \DeclareMathSymbol{\M@bcal@W}{\mathord}{\M@bcal}{"1D4E6} \DeclareMathSymbol{\M@bcal@X}{\mathord}{\M@bcal}{"1D4E7} \DeclareMathSymbol{\M@bcal@Y}{\mathord}{\M@bcal}{"1D4E8} \DeclareMathSymbol{\M@bcal@Z}{\mathord}{\M@bcal}{"1D4E9} \DeclareMathSymbol{\M@bcal@a}{\mathord}{\M@bcal}{"1D4EA} \DeclareMathSymbol{\M@bcal@b}{\mathord}{\M@bcal}{"1D4EB} \DeclareMathSymbol{\M@bcal@c}{\mathord}{\M@bcal}{"1D4EC} \DeclareMathSymbol{\M@bcal@d}{\mathord}{\M@bcal}{"1D4ED} \DeclareMathSymbol{\M@bcal@e}{\mathord}{\M@bcal}{"1D4EE} \DeclareMathSymbol{\M@bcal@f}{\mathord}{\M@bcal}{"1D4EF} \DeclareMathSymbol{\M@bcal@g}{\mathord}{\M@bcal}{"1D4F0} \DeclareMathSymbol{\M@bcal@h}{\mathord}{\M@bcal}{"1D4F1} \DeclareMathSymbol{\M@bcal@i}{\mathord}{\M@bcal}{"1D4F2} \DeclareMathSymbol{\M@bcal@j}{\mathord}{\M@bcal}{"1D4F3} \DeclareMathSymbol{\M@bcal@k}{\mathord}{\M@bcal}{"1D4F4} \DeclareMathSymbol{\M@bcal@l}{\mathord}{\M@bcal}{"1D4F5} \DeclareMathSymbol{\M@bcal@m}{\mathord}{\M@bcal}{"1D4F6} \DeclareMathSymbol{\M@bcal@n}{\mathord}{\M@bcal}{"1D4F7} \DeclareMathSymbol{\M@bcal@o}{\mathord}{\M@bcal}{"1D4F8} \DeclareMathSymbol{\M@bcal@p}{\mathord}{\M@bcal}{"1D4F9} \DeclareMathSymbol{\M@bcal@q}{\mathord}{\M@bcal}{"1D4FA} \DeclareMathSymbol{\M@bcal@r}{\mathord}{\M@bcal}{"1D4FB} \DeclareMathSymbol{\M@bcal@s}{\mathord}{\M@bcal}{"1D4FC} \DeclareMathSymbol{\M@bcal@t}{\mathord}{\M@bcal}{"1D4FD} \DeclareMathSymbol{\M@bcal@u}{\mathord}{\M@bcal}{"1D4FE} \DeclareMathSymbol{\M@bcal@v}{\mathord}{\M@bcal}{"1D4FF} \DeclareMathSymbol{\M@bcal@w}{\mathord}{\M@bcal}{"1D500} \DeclareMathSymbol{\M@bcal@x}{\mathord}{\M@bcal}{"1D501} \DeclareMathSymbol{\M@bcal@y}{\mathord}{\M@bcal}{"1D502} \DeclareMathSymbol{\M@bcal@z}{\mathord}{\M@bcal}{"1D503}} % \end{macrocode} % Set bold fraktur letters.\?\M@bfrak\indexpage{keywordbfrak=keyword \texttt{bfrak}} % \begin{macrocode} \def\M@bfrak@set{% \edef\M@bfrak{M\@bfrakshape\the\M@count} \DeclareMathSymbol{\M@bfrak@A}{\mathord}{\M@bfrak}{"1D56C} \DeclareMathSymbol{\M@bfrak@B}{\mathord}{\M@bfrak}{"1D56D} \DeclareMathSymbol{\M@bfrak@C}{\mathord}{\M@bfrak}{"1D56E} \DeclareMathSymbol{\M@bfrak@D}{\mathord}{\M@bfrak}{"1D56F} \DeclareMathSymbol{\M@bfrak@E}{\mathord}{\M@bfrak}{"1D570} \DeclareMathSymbol{\M@bfrak@F}{\mathord}{\M@bfrak}{"1D571} \DeclareMathSymbol{\M@bfrak@G}{\mathord}{\M@bfrak}{"1D572} \DeclareMathSymbol{\M@bfrak@H}{\mathord}{\M@bfrak}{"1D573} \DeclareMathSymbol{\M@bfrak@I}{\mathord}{\M@bfrak}{"1D574} \DeclareMathSymbol{\M@bfrak@J}{\mathord}{\M@bfrak}{"1D575} \DeclareMathSymbol{\M@bfrak@K}{\mathord}{\M@bfrak}{"1D576} \DeclareMathSymbol{\M@bfrak@L}{\mathord}{\M@bfrak}{"1D577} \DeclareMathSymbol{\M@bfrak@M}{\mathord}{\M@bfrak}{"1D578} \DeclareMathSymbol{\M@bfrak@N}{\mathord}{\M@bfrak}{"1D579} \DeclareMathSymbol{\M@bfrak@O}{\mathord}{\M@bfrak}{"1D57A} \DeclareMathSymbol{\M@bfrak@P}{\mathord}{\M@bfrak}{"1D57B} \DeclareMathSymbol{\M@bfrak@Q}{\mathord}{\M@bfrak}{"1D57C} \DeclareMathSymbol{\M@bfrak@R}{\mathord}{\M@bfrak}{"1D57D} \DeclareMathSymbol{\M@bfrak@S}{\mathord}{\M@bfrak}{"1D57E} \DeclareMathSymbol{\M@bfrak@T}{\mathord}{\M@bfrak}{"1D57F} \DeclareMathSymbol{\M@bfrak@U}{\mathord}{\M@bfrak}{"1D580} \DeclareMathSymbol{\M@bfrak@V}{\mathord}{\M@bfrak}{"1D581} \DeclareMathSymbol{\M@bfrak@W}{\mathord}{\M@bfrak}{"1D582} \DeclareMathSymbol{\M@bfrak@X}{\mathord}{\M@bfrak}{"1D583} \DeclareMathSymbol{\M@bfrak@Y}{\mathord}{\M@bfrak}{"1D584} \DeclareMathSymbol{\M@bfrak@Z}{\mathord}{\M@bfrak}{"1D585} \DeclareMathSymbol{\M@bfrak@a}{\mathord}{\M@bfrak}{"1D586} \DeclareMathSymbol{\M@bfrak@b}{\mathord}{\M@bfrak}{"1D587} \DeclareMathSymbol{\M@bfrak@c}{\mathord}{\M@bfrak}{"1D588} \DeclareMathSymbol{\M@bfrak@d}{\mathord}{\M@bfrak}{"1D589} \DeclareMathSymbol{\M@bfrak@e}{\mathord}{\M@bfrak}{"1D58A} \DeclareMathSymbol{\M@bfrak@f}{\mathord}{\M@bfrak}{"1D58B} \DeclareMathSymbol{\M@bfrak@g}{\mathord}{\M@bfrak}{"1D58C} \DeclareMathSymbol{\M@bfrak@h}{\mathord}{\M@bfrak}{"1D58D} \DeclareMathSymbol{\M@bfrak@i}{\mathord}{\M@bfrak}{"1D58E} \DeclareMathSymbol{\M@bfrak@j}{\mathord}{\M@bfrak}{"1D58F} \DeclareMathSymbol{\M@bfrak@k}{\mathord}{\M@bfrak}{"1D590} \DeclareMathSymbol{\M@bfrak@l}{\mathord}{\M@bfrak}{"1D591} \DeclareMathSymbol{\M@bfrak@m}{\mathord}{\M@bfrak}{"1D592} \DeclareMathSymbol{\M@bfrak@n}{\mathord}{\M@bfrak}{"1D593} \DeclareMathSymbol{\M@bfrak@o}{\mathord}{\M@bfrak}{"1D594} \DeclareMathSymbol{\M@bfrak@p}{\mathord}{\M@bfrak}{"1D595} \DeclareMathSymbol{\M@bfrak@q}{\mathord}{\M@bfrak}{"1D596} \DeclareMathSymbol{\M@bfrak@r}{\mathord}{\M@bfrak}{"1D597} \DeclareMathSymbol{\M@bfrak@s}{\mathord}{\M@bfrak}{"1D598} \DeclareMathSymbol{\M@bfrak@t}{\mathord}{\M@bfrak}{"1D599} \DeclareMathSymbol{\M@bfrak@u}{\mathord}{\M@bfrak}{"1D59A} \DeclareMathSymbol{\M@bfrak@v}{\mathord}{\M@bfrak}{"1D59B} \DeclareMathSymbol{\M@bfrak@w}{\mathord}{\M@bfrak}{"1D59C} \DeclareMathSymbol{\M@bfrak@x}{\mathord}{\M@bfrak}{"1D59D} \DeclareMathSymbol{\M@bfrak@y}{\mathord}{\M@bfrak}{"1D59E} \DeclareMathSymbol{\M@bfrak@z}{\mathord}{\M@bfrak}{"1D59F}} % \end{macrocode} % % \vfill\eject % % \section*{Version History} % % % \begin{multicols*}{2} % \bgroup\raggedright\parskip\z@\parindent\z@\leftskip1em\obeylines % \setbox0\hbox{\hskip 1pt.\hskip 1pt} % \def\version#1#2{\bigskip\hbox to \hsize{\textbf{#1} \cleaders\copy0\hfill\ #2}\par} % \def\item{\leavevmode\raise0.5ex\hbox{\vrule height 1pt width 0.5em}\kern1pt} % \def\item{--\kern0.2ex\relax}^^A I like the en dash better than a vrule % % \version{1.1b}{July 2018} % \item initial release % % \version{1.2}{August 2018} % \item minor bug fix for |\mathfrak| % \item eliminated redundant batchfile % % \version{1.3}{January 2019} % \item added |symbols| keyword\par % \item created |mathfont_example.pdf| % \item corrected the description of the \textsf{mathastext} package % \item font-change |\message| added to |\mathfont| % % \version{1.4}{April 2019} % \item |\setfont| command added % \item |\mathfont| optional argument can parse spaces % \item |no-operators| now default package optional argument % \item added |\comma| command % \item new fancy fatal error message % \item improved messaging for |\mathfont| % \item internal command |\mathpound| changed to |\mathhash| % \item added a missing |#1| after |\char`\"| in the example code redefining |"| in the user guide % % \version{1.5}{April 2019} % \item separated |\increment| and |\Delta| % \item version history added % \item initial off-the-shelf use insert added % % \version{1.6}{November 2019} % \item separated implementation and user documentation % \item created |mathfont_heading.tex| % \item created |mathfont_doc_patch.tex| for use with the index % \item changed |mathfont_greek.pdf| to |mathfont_symbol_list.pdf| % \item eliminated |mathfont_example.pdf| % \item eliminated |operators| package option % \item eliminated |packages| package option % \item font name can be package option % \item added Hebrew and Cyrillic characters % \item separated ancient Greek from modern Greek characters % \item created new keywords: |extsymbols|, |delimiters|, |arrows|, |diacritics|, |bigops|, |extbigops| % \item improved messaging % \item improved internal code for local font-change commands % \item improved space parsing for the optional argument of |\mathfont| % \item bug fix for |\#|, etc.\ commands % \item bad input for |\mathbb|, etc.\ now gives a warning % \item improved error checking for |\newmathrm|, etc.\ commands % \item |\mathfont| now ignores bad options (on top of issuing an error) % \item iternal commands now begin with |\M@|\dots % \item added Easter egg % \item improved indexing % \item |mathfont.dtx| renamed as |mathfont_code.dtx| % \item |\newmathbold| renamed as |\newmathbf| % \item default local font changes now use |\updefault|, etc. % \item added fatal error for missing \textsf{fontspec} % \item fatal errors result in |\endinput| rather than |\@@end| % % % % \egroup % \end{multicols*} % % \iffalse % % %<*chars> \documentclass[12pt,twoside]{article} \makeatletter \let\@@imath\imath \let\@@jmath\jmath \usepackage[margin=72.27pt]{geometry} \usepackage{multicol} \usepackage{graphicx} \usepackage{mathfont} \mathfont[greekupper]{Courier New} \mathfont[greeklower,delimiters,bigops]{Times New Roman} \mathfont[agreekupper,extsymbols,bb,cal,frak,bcal,bfrak]{Symbola} \mathfont[agreeklower=roman]{Didot Bold} \mathfont[hebrew]{New Peninim MT} \mathfont[cyrillicupper]{EB Garamond} \mathfont[cyrilliclower=roman]{Comic Sans MS} \mathfont[symbols]{Arial} \mathfont[arrows,extbigops]{STIXGeneral} \mathfont[diacritics,lower]{Baskerville} \usepackage{shortvrb} \MakeShortVerb{|} \pretolerance=20 \hyphenpenalty=10 \exhyphenpenalty=5 \brokenpenalty=0 \finalhyphendemerits=300 \doublehyphendemerits=500 \raggedcolumns \parskip=0pt \smallskipamount=2pt plus 1pt minus 1pt \multicolsep=0pt \premulticols=0pt \begin{document} \def\documentname{Symbol List} \input mathfont_heading.tex The \textsf{mathfont} package acts on some 300 alphanumeric characters and 500 general math symbols, and this document lists all such symbols besides Latin characters and Arabic numerals. The characters are organized by keyword, and when the user calls |\mathfont| on one of the keyword classes below, the package acts on every control sequence listed under that keyword. It changes the math-mode font of the character-commands that already exist in \LaTeX, and for the control sequences that do not exist in \LaTeX, it defines them to be new characters for use in math mode. Unlike most character-providing packages, \textsf{mathfont} does not provide extra symbols by default, and users can access additional control sequences only once they act |\mathfont| on some keyword-option. Of course, typesetting these symbols depends on having a font that contains them, and most major unicode fonts lack many or most of the symbols in this document. Choose your font wisely! Finally, as stated in the user guide, the \texttt{delimiters}, \texttt{bigops}, and |\big|\argtext{symbol} (such as |\bigvee|) characters do not in general change size in different mathematical contexts. I hope to address this limitation in future package updates. For documentation of user-level commands, see |mathfont_user_guide.pdf|, and for version history and code implementation, see |mathfont_code.pdf|. Both documentation files are included with the \textsf{mathfont} installation and available on \textsc{ctan}. This document does not contain tables for the keywords |upper|, |lower|, and |digits|. The first of these keywords contains all capital Latin letters, and the second contains all lower-case Latin letters as well as the ``mathematical i'' $\@@imath$ coded with |\imath| and ``mathematical j'' $\@@jmath$ coded with |\jmath|. The |digits| category contains the digits 0 through 9. Unlike the \LaTeX\ kernel, \textsf{mathfont} declares both |\imath| and |\jmath| as math alphabet characters, so the package's local font-change commands will adjust the font of these two symbols. \catcode`\|=12 \parskip=1pt \blockheader{diacritics}{Accent}{Baskerville} \begin{multicols}{3} \makeaccent{\acute} \makeaccent{\aacute} \makeaccent{\dot} \makeaccent{\ddot} \makeaccent{\grave} \makeaccent{\breve} \makeaccent{\hat} \makeaccent{\check} \makeaccent{\bar} \makeaccent{\mathring} \makeaccent{\tilde} \end{multicols} \blockheader{greekupper}{Upper-Case Greek}{Courier New} \begin{multicols}{3} \makechar{\Alpha} \makechar{\Beta} \makechar{\Gamma} \makechar{\Delta} \makechar{\Epsilon} \makechar{\Zeta} \makechar{\Eta} \makechar{\Theta} \makechar{\Iota} \makechar{\Kappa} \makechar{\Lambda} \makechar{\Mu} \makechar{\Nu} \makechar{\Xi} \makechar{\Omicron} \makechar{\Pi} \makechar{\Rho} \makechar{\Sigma} \makechar{\Tau} \makechar{\Upsilon} \makechar{\Phi} \makechar{\Chi} \makechar{\Psi} \makechar{\Omega} \makechar{\varTheta} \end{multicols} \blockheader{greeklower}{Lower-Case Greek}{Times New Roman} \begin{multicols}{3} \makechar{\alpha} \makechar{\beta} \makechar{\gamma} \makechar{\delta} \makechar{\epsilon} \makechar{\zeta} \makechar{\eta} \makechar{\theta} \makechar{\iota} \makechar{\kappa} \makechar{\lambda} \makechar{\mu} \makechar{\nu} \makechar{\xi} \makechar{\omicron} \makechar{\pi} \makechar{\rho} \makechar{\sigma} \makechar{\tau} \makechar{\upsilon} \makechar{\phi} \makechar{\chi} \makechar{\psi} \makechar{\omega} \makechar{\varbeta} \makechar{\varepsilon} \makechar{\vartheta} \makechar{\varrho} \makechar{\varsigma} \makechar{\varphi} \end{multicols} \blockheader{agreekupper}{Upper-Case Ancient Greek}{Symbola} \begin{multicols}{3} \makechar{\Heta} \makechar{\Sampi} \makechar{\Digamma} \makechar{\Koppa} \makechar{\Stigma} \makechar{\Sho} \makechar{\San} \makechar{\varSampi} \makechar{\varDigamma} \makechar{\varKoppa} \end{multicols} \blockheader{agreeklower}{Lower-Case Ancient Greek}{Didot Bold} \begin{multicols}{3} \makechar{\heta} \makechar{\sampi} \makechar{\digamma} \makechar{\koppa} \makechar{\stigma} \makechar{\sho} \makechar{\san} \makechar{\varsampi} \makechar{\vardigamma} \makechar{\varkoppa} \end{multicols} \blockheader{cyrillicupper}{Upper-Case Cyrillic}{EB Garamond} \begin{multicols}{3} \makechar{\cyrA} \makechar{\cyrBe} \makechar{\cyrVe} \makechar{\cyrGhe} \makechar{\cyrDe} \makechar{\cyrIe} \makechar{\cyrZhe} \makechar{\cyrZe} \makechar{\cyrI} \makechar{\cyrKa} \makechar{\cyrEl} \makechar{\cyrEm} \makechar{\cyrEn} \makechar{\cyrO} \makechar{\cyrPe} \makechar{\cyrEr} \makechar{\cyrEs} \makechar{\cyrTe} \makechar{\cyrU} \makechar{\cyrEf} \makechar{\cyrHa} \makechar{\cyrTse} \makechar{\cyrChe} \makechar{\cyrSha} \makechar{\cyrShcha} \makechar{\cyrHard} \makechar{\cyrYeru} \makechar{\cyrSoft} \makechar{\cyrE} \makechar{\cyrYu} \makechar{\cyrYa} \makechar{\cyrvarI} \end{multicols} \blockheader{cyrilliclower}{Lower-Case Cyrillic}{Comic Sans MS% \footnote{Yes, you too can now create beautifully spaced mathematics in Comic Sans!}} \begin{multicols}{3} \makechar{\cyra} \makechar{\cyrbe} \makechar{\cyrve} \makechar{\cyrghe} \makechar{\cyrde} \makechar{\cyrie} \makechar{\cyrzhe} \makechar{\cyrze} \makechar{\cyri} \makechar{\cyrka} \makechar{\cyrel} \makechar{\cyrem} \makechar{\cyren} \makechar{\cyro} \makechar{\cyrpe} \makechar{\cyrer} \makechar{\cyres} \makechar{\cyrte} \makechar{\cyru} \makechar{\cyref} \makechar{\cyrha} \makechar{\cyrtse} \makechar{\cyrche} \makechar{\cyrsha} \makechar{\cyrshcha} \makechar{\cyrhard} \makechar{\cyryeru} \makechar{\cyrsoft} \makechar{\cyre} \makechar{\cyryu} \makechar{\cyrya} \makechar{\cyrvari} \end{multicols} \blockheader{hebrew}{Hebrew}{New Peninim MT} \begin{multicols}{3} \makechar{\aleph} \makechar{\beth} \makechar{\gimel} \makechar{\daleth} \makechar{\he} \makechar{\vav} \makechar{\zayin} \makechar{\het} \makechar{\tet} \makechar{\yod} \makechar{\kaf} \makechar{\lamed} \makechar{\mem} \makechar{\nun} \makechar{\samekh} \makechar{\ayin} \makechar{\pe} \makechar{\tsadi} \makechar{\qof} \makechar{\resh} \makechar{\shin} \makechar{\tav} \makechar{\varkaf} \makechar{\varmem} \makechar{\varnun} \makechar{\varpe} \makechar{\vartsadi} \end{multicols} \blockheader{symbols}{Basic Math}{Arial} \begin{multicols}{3} \makechar{.} \makechar{@} \let\par\relax \makechar{\#}\footnote{When it acts on \vrb\#, \vrb\%, and \vrb\&, \textsf{mathfont} redefines them as robust commands that expand to their usual \vrb\char\ definition in horizontal mode and a math symbol in math mode. This prevents any changes to their font outside of math mode and is how other commands such as \vrb\$ or \vrb\P\ function in both math mode and horizontal mode.}\@@par \makechar{\$}\footnote{Technically, \textsf{mathfont} doesn't redefine \vrb\$, \vrb\P, \vrb\S, \vrb\pounds, \vrb\dag, or \vrb\ddag. The package recodes the character-command that these macros expand to when in math mode.}\@par \makechar{\%} \makechar{\&} \makechar{\P} \makechar{\S} \makechar{\pounds} \makechar{|} \makechar{\neg} \makechar{\infty} \makechar{\partial} \makechar{\mathbackslash} \makechar{\degree} \makechar{\increment} \makechar{\hbar} \makechar{'} \makechar{"} \let\par\relax \makechar{\comma}\footnote{In addition to the comma and colon punctuation marks, the package defines \vrb\comma\ and \vrb\colon. The difference lies in the spacing. \TeX\ treats the comma and colon keystrokes as \vrb\mathpunct\ and \vrb\mathrel\ types respectively. The package codes the \vrb\comma\ and \vrb\colon\ control sequences as \vrb\mathord\ and \vrb\mathpunct\ types respectively, so both control sequence result in less space than the corresponding keystroke. I recommend using \vrb\comma\ to typeset commas in large real numbers and \vrb\colon\ to typeset colon punctuation marks, for example following a function or to indicate a subset specification.}\@par \makechar{+} \makechar{-} \makechar{*} \makechar{\times} \makechar{/} \makechar{\div} \makechar{\pm} \makechar{\bullet} \makechar{\dag} \makechar{\ddag} \makechar{\cdot} \makechar{\setminus} \makechar{=} \makechar{<} \makechar{>} \makechar{\leq} \makechar{\geq} \makechar{\sim} \makechar{\approx} \makechar{\equiv} \makechar{\mid} \makechar{\parallel} \makechar{:} \makechar{?} \makechar{!} \makechar{,} \makechar{;} \makechar{\colon} \makechar{\mathellipsis} \end{multicols} \blockheader{extsymbols}{Extended Math}{Symbola} \begin{multicols}{3} \makechar{\wp} \makechar{\Re} \makechar{\Im} \makechar{\ell} \makechar{\forall} \makechar{\exists} \makechar{\emptyset} \makechar{\nabla} \makechar{\in} \makechar{\ni} \makechar{\mp} \makechar{\angle} \makechar{\top} \makechar{\bot} \makechar{\vdash} \makechar{\dashv} \makechar{\flat} \makechar{\natural} \makechar{\sharp} \makechar{\fflat} \makechar{\ssharp} \let\par\relax \makechar{\bclubsuit}\footnote{Also \vrb\clubsuit.}\@par \makechar{\bdiamondsuit} \makechar{\bheartsuit} \let\par\relax \makechar{\bspadesuit}\footnote{Also \vrb\spadesuit.}\@par \makechar{\wclubsuit} \let\par\relax \makechar{\wdiamondsuit}\footnote{Also \vrb\diamondsuit.}\@@par \makechar{\wheartsuit}\footnote{Also \vrb\heartsuit.}\@par \makechar{\wspadesuit} \makechar{\wedge} \makechar{\vee} \makechar{\cap} \makechar{\cup} \makechar{\sqcap} \makechar{\sqcup} \makechar{\amalg} \makechar{\wr} \makechar{\ast} \makechar{\star} \makechar{\diamond} \makechar{\varcdot} \makechar{\varsetminus} \makechar{\oplus} \makechar{\otimes} \makechar{\ominus} \makechar{\odiv} \makechar{\oslash} \makechar{\odot} \makechar{\sqplus} \makechar{\sqtimes} \makechar{\sqminus} \makechar{\sqdot} \makechar{\in} \makechar{\ni} \makechar{\subset} \makechar{\supset} \makechar{\subseteq} \makechar{\supseteq} \makechar{\sqsubset} \makechar{\sqsupset} \makechar{\sqsubseteq} \makechar{\sqsupseteq} \makechar{\triangleleft} \makechar{\triangleright} \makechar{\trianglelefteq} \makechar{\trianglerighteq} \makechar{\propto} \makechar{\bowtie} \makechar{\hourglass} \makechar{\therefore} \makechar{\because} \makechar{\ratio} \makechar{\proportion} \makechar{\ll} \makechar{\gg} \makechar{\lll} \makechar{\ggg} \makechar{\leqq} \makechar{\geqq} \makechar{\lapprox} \makechar{\gapprox} \makechar{\simeq} \makechar{\eqsim} \let\par\relax \makechar{\simeqq}\footnote{Also \vrb\cong.}\@par \makechar{\approxeq} \makechar{\sssim} \makechar{\seq} \makechar{\doteq} \makechar{\coloneq} \makechar{\eqcolon} \makechar{\ringeq} \makechar{\arceq} \makechar{\wedgeeq} \makechar{\veeeq} \makechar{\stareq} \makechar{\triangleeq} \makechar{\defeq} \makechar{\qeq} \makechar{\lsim} \makechar{\gsim} \makechar{\prec} \makechar{\succ} \makechar{\preceq} \makechar{\succeq} \makechar{\preceqq} \makechar{\succeqq} \makechar{\precsim} \makechar{\succsim} \makechar{\precapprox} \makechar{\succapprox} \makechar{\precprec} \makechar{\succsucc} \makechar{\asymp} \makechar{\nin} \makechar{\nni} \makechar{\nsubset} \makechar{\nsupset} \makechar{\nsubseteq} \makechar{\nsupseteq} \makechar{\subsetneq} \makechar{\supsetneq} \makechar{\nsqsubseteq} \makechar{\nsqsupseteq} \makechar{\sqsubsetneq} \makechar{\sqsupsetneq} \makechar{\neq} \makechar{\nl} \makechar{\ng} \makechar{\nleq} \makechar{\ngeq} \makechar{\lneq} \makechar{\gneq} \makechar{\lneqq} \makechar{\gneqq} \makechar{\ntriangleleft} \makechar{\ntriangleright} \makechar{\ntrianglelefteq} \makechar{\ntrianglerighteq} \makechar{\nsim} \makechar{\napprox} \makechar{\nsimeq} \makechar{\nsimeqq} \makechar{\simneqq} \makechar{\nlsim} \makechar{\ngsim} \makechar{\lnsim} \makechar{\gnsim} \makechar{\lnapprox} \makechar{\gnapprox} \makechar{\nprec} \makechar{\nsucc} \makechar{\npreceq} \makechar{\nsucceq} \makechar{\precneq} \makechar{\succneq} \makechar{\precneqq} \makechar{\succneqq} \makechar{\precnsim} \makechar{\succnsim} \makechar{\precnapprox} \makechar{\succnapprox} \makechar{\nequiv} \end{multicols} \blockheader{delimiters}{Delimiter}{Times New Roman} \begin{multicols}{3} \makechar{(} \makechar{)} \makechar{[} \makechar{]} \makechar{\leftbrace} \makechar{\rightbrace} \end{multicols} \blockheader{arrows}{Arrow}{STIXGeneral} \begin{multicols}{2} \let\par\relax \makechar{\rightarrow}\footnote{Also \vrb\to.}\@par \makechar{\nrightarrow} \makechar{\Rightarrow} \makechar{\nRightarrow} \makechar{\Rrightarrow} \makechar{\longrightarrow} \makechar{\Longrightarrow} \let\par\relax \makechar{\rightbararrow}\footnote{Also \vrb\mapsto.}\@par \makechar{\Rightbararrow} \let\par\relax \makechar{\longrightbararrow}\footnote{Also \vrb\longmapsto.}\@par \makechar{\Longrightbararrow} \makechar{\hookrightarrow} \makechar{\rightdasharrow} \makechar{\rightharpoonup} \makechar{\rightharpoondown} \makechar{\rightarrowtail} \makechar{\rightoplusarrow} \makechar{\rightwavearrow} \makechar{\rightsquigarrow} \makechar{\longrightsquigarrow} \makechar{\looparrowright} \makechar{\curvearrowright} \makechar{\circlearrowright} \makechar{\twoheadrightarrow} \makechar{\rightarrowtobar} \makechar{\rightwhitearrow} \makechar{\rightrightarrows} \makechar{\rightrightrightarrows} \let\par\relax \makechar{\leftarrow}\footnote{Also \vrb\from.}\@par \makechar{\nleftarrow} \makechar{\Leftarrow} \makechar{\nLeftarrow} \makechar{\Lleftarrow} \makechar{\longleftarrow} \makechar{\Longleftarrow} \let\par\relax \makechar{\leftbararrow}\footnote{Also \vrb\mapsfrom.}\@par \makechar{\Leftbararrow} \let\par\relax \makechar{\longleftbararrow}\footnote{Also \vrb\longmapsfrom.}\@par \makechar{\Longleftbararrow} \makechar{\hookleftarrow} \makechar{\leftdasharrow} \makechar{\leftharpoonup} \makechar{\leftharpoondown} \makechar{\leftarrowtail} \makechar{\leftoplusarrow} \makechar{\leftwavearrow} \makechar{\leftsquigarrow} \makechar{\longleftsquigarrow} \makechar{\looparrowleft} \makechar{\curvearrowleft} \makechar{\circlearrowleft} \makechar{\twoheadleftarrow} \makechar{\leftarrowtobar} \makechar{\leftwhitearrow} \makechar{\leftleftarrows} \makechar{\leftleftleftarrows} \makechar{\leftrightarrow} \makechar{\Leftrightarrow} \makechar{\nLeftrightarrow} \makechar{\longleftrightarrow} \makechar{\Longleftrightarrow} \makechar{\leftrightwavearrow} \makechar{\leftrightarrows} \makechar{\leftrightharpoons} \makechar{\leftrightarrowstobar} \makechar{\rightleftarrows} \makechar{\rightleftharpoons} \makechar{\uparrow} \makechar{\Uparrow} \makechar{\Uuparrow} \makechar{\upbararrow} \makechar{\updasharrow} \makechar{\upharpoonleft} \makechar{\upharpoonright} \makechar{\twoheaduparrow} \makechar{\uparrowtobar} \makechar{\upwhitearrow} \makechar{\upwhitebararrow} \makechar{\upuparrows} \makechar{\downarrow} \makechar{\Downarrow} \makechar{\Ddownarrow} \makechar{\downbararrow} \makechar{\downdasharrow} \makechar{\zigzagarrow} \makechar{\downharpoonleft} \makechar{\downharpoonright} \makechar{\twoheaddownarrow} \makechar{\downarrowtobar} \makechar{\downwhitearrow} \makechar{\downdownarrows} \makechar{\updownarrow} \makechar{\Updownarrow} \makechar{\updownarrows} \makechar{\downuparrows} \makechar{\updownharpoons} \makechar{\downupharpoons} \makechar{\nearrow} \makechar{\Nearrow} \makechar{\nwarrow} \makechar{\Nwarrow} \makechar{\searrow} \makechar{\Searrow} \makechar{\swarrow} \makechar{\Swarrow} \makechar{\nwsearrow} \makechar{\neswarrow} \makechar{\lcirclearrow} \makechar{\rcirclearrow} \end{multicols} \blockheader{bigops}{Big Operator}{Times New Roman} \begin{multicols}{3} \makechar{\sum} \makechar{\prod} \makechar{\intop} \end{multicols} \blockheader{extbigops}{Extended Big Operators}{STIXGeneral} \begin{multicols}{3} \makechar{\coprod} \makechar{\bigvee} \makechar{\bigwedge} \makechar{\bigcup} \makechar{\bigcap} \makechar{\iint} \makechar{\iiint} \makechar{\oint} \makechar{\oiint} \makechar{\oiiint} \makechar{\bigoplus} \makechar{\bigotimes} \makechar{\bigodot} \makechar{\bigsqcap} \makechar{\bigsqcup} \end{multicols} \blockheader{bb}{Blackboard Bold}{Symbola and Accessed with \vrb\mathbb} \letterlikechars\mathbb \hbox to 10em{\printchars\digits} \blockheader{cal}{Calligraphic}{Symbola and Accessed with \vrb\mathcal} \letterlikechars\mathcal \blockheader{frak}{Fraktur}{Symbola and Accessed with \vrb\mathfrak} \letterlikechars\mathfrak \blockheader{bcal}{Bold Calligraphic}{Symbola and Accessed with \vrb\mathbcal} \letterlikechars\mathbcal \blockheader{bfrak}{Bold Fraktur}{Symbola and Accessed with \vrb\mathbfrak} \letterlikechars\mathbfrak \end{document} % %<*user> \documentclass[12pt,twoside]{article} \makeatletter \usepackage[margin=72.27pt]{geometry} \usepackage[factor=700,stretch=14,shrink=14,step=1]{microtype} \usepackage[bottom]{footmisc} \usepackage{booktabs} \usepackage{graphicx} \usepackage{tabularx} \usepackage{shortvrb} \skip\footins=7pt \MakeShortVerb{|} \hyphenpenalty=10 \pretolerance=20 \hyphenpenalty=10 \exhyphenpenalty=5 \brokenpenalty=0 \clubpenalty=5 \widowpenalty=5 \finalhyphendemerits=300 \doublehyphendemerits=500 \renewcommand\textfraction{0.4} \begin{document} \def\documentname{User Guide} \input mathfont_heading.tex Handling fonts in \TeX\ and \LaTeX\ is a notoriously difficult task. Donald Knuth originally designed \TeX\ to support fonts created with Metafont, and while subsequent versions of \TeX\ extended this functionality to postscript fonts, Plain \TeX's font-loading capabilities remain limited. Many, if not most, \LaTeX\ users are unfamiliar with the |fd| files that must be used in font declaration, and the minutiae of \TeX's |\font| primitive can be esoteric and confusing. \LaTeXe's New Font Selection System (\textsc{nfss}) implemented a straightforward syntax for loading and managing fonts, but \LaTeX\ macros overlaying a \TeX\ core face the same versatility issues as Plain \TeX\ itself. Fonts in math mode present a double challenge: after loading a font either in Plain \TeX\ or through the \textsc{nfss}, defining math symbols can be unintuitive for users who are unfamiliar with \TeX's |\mathcode| primitive. More recent engines such as Jonathan Kew's \XeTeX\ and Hans Hagen, et al.'s Lua\TeX\ significantly extend the font-loading capabilities of \TeX.\footnote{Information on \XeTeX\ is available at \texttt{https://tug.org/xetex/}, and information on Lua\TeX\ is available at the official website for Lua\TeX: \texttt{http://www.luatex.org/}.} Both support TrueType and OpenType font formats and provide many additional primitives for managing fonts, and the \textsf{fontspec} package by Will Robertson and Khaled Hosny acts as a front-end for the font management built into these two engines.\footnote{Will Robertson and Khaled Hosny, ``\textsf{fontspec}---Advanced font selection in \XeLaTeX\ and Lua\LaTeX,'' \texttt{https://ctan.org/pkg/fontspec}.} The \textsf{mathfont} package applies \textsf{fontspec}'s advances in font selection to mathematics typesetting, and this document explains the package's user-level commands. Section~1 presents the basic functionality and related packages. Section~2 explains how to use the default font-change commands, and users in a hurry will find the most important information here. Section~3 describes the local font-change commands, and section~4 discusses mathematical symbols and aspects of their implementation. Section~5 addresses error messages. For version history and code implementation, see |mathfont_code.pdf|, and for a list of all symbols accessible with \textsf{mathfont}, see |mathfont_symbol_list.pdf|. Both of these documentation files are included with the \textsf{mathfont} installation and are available on \textsc{ctan}. \section{Basic Functionality} The \textsf{mathfont} package uses \textsf{fontspec} as a back end to load fonts for use in math mode, and it provides two ways to do this: (1) changing the default font for certain classes of math-mode characters; and (2) defining new commands that change the font locally for the so-called ``math-alphabet'' characters. The package can change the default math-mode font used for Latin, Greek, Cyrillic, and Hebrew letters; Arabic numerals; roughly 300 unicode math symbols; and standard unicode alphanumeric characters. The package accepts any OpenType or TrueType font, and tables~1 and 2 display the specific classes of characters that \textsf{mathfont}'s default font-change command acts on. The default math-alphabet characters are Latin letters, Arabic numerals, upper-case Greek characters, and diacritics. When \textsf{mathfont} sets the default font for any of these four character classes, it preserves their math alphabet status, and when the package sets the default font for lower-case Greek, ancient Greek, Cyrillic, or Hebrew characters, it recodes each symbol in the class as math-alphabet type. At that point, the local font-change commands will act on any characters in those classes. The package must be loaded with \XeLaTeX or Lua\LaTeX. It can be loaded with the standard |\usepackage| syntax, and it accepts one optional argument. It treats the argument as a font name and changes all main fonts to that option. Specifically, the package invokes both |\mathfont| and \textsf{fontspec}'s |\setmainfont|, and it defines the four local font-changing commands |\mathrm|, |\mathit|, |\mathbf|, and |\mathbfit| to produce text from the desired font in combinations of upright, italic, and bold styles according to the control sequences' last letters. \XeTeX\ users may run into trouble with fonts whose name contains multiple words because \LaTeX\ eats spaces during package-option parsing. In this case, you will have to load the package and separately declare |\setfont| in your preamble. The package loads \textsf{fontspec} with the |no-math| option if and only if the user has not already loaded \textsf{fontspec}. Users who want \textsf{fontspec} without |no-math| or with other options in place can manually load it before requiring \textsf{mathfont}. Regardless, I strongly recommend that \textsf{fontspec} be loaded with |no-math| because otherwise some font changes may not render properly. During loading, \textsf{mathfont} redefines three \LaTeX\ internal macros to make symbol declaration compatible with unicode fonts, and default math-font changes work only with the redefinitions in place. Because the internal changes are relatively unobtrusive, \textsf{mathfont}'s adjustments almost certainly do not affect \LaTeX\ packages loaded later, and the package does not restore the commands automatically. Instead, |\restoremathinternals| returns the internal commands to their default definitions, and users who want the previous definitions should reset the kernel manually. The corollary is that |\mathfont| and |\setfont| work before |\restoremathinternals| but not after. As of version~1.6, the package optional arguments |packages|, |operators|, and |no-operators| are depreciated. Instead, \textsf{mathfont} offers |\restoremathinternals| as the only way to interact directly with the kernel.\footnote{To be clear, as of version~1.6, \textsf{mathfont} does not restore the \LaTeX\ kernel when the user loads other packages. Given the scope and nature of the changes, I determined that the convenience factor of being able to use \vrb\mathfont\ anywhere in the preamble outweighs the incredibly small risk of interfering with another package. As far as I can tell, the biggest change is using a different primitive to code math symbols, but even that will probably never affect practical applications. The test \expandafter\vrb\csname if\endcsname\vrb\mathchar\vrb\alpha\ succeeds both before and after calling \vrb\mathfont, even though afterwards \vrb\alpha\ is defined with \vrb\Umathchar\ instead.} For changes to big operators, use the |bigops| keyword in section~2. The functionality of \textsf{mathfont} is most closely related to that of the \textsf{mathspec} package by Andrew Gilbert Moschou.\footnote{Andrew Gilbert Moschou, ``\textsf{mathspec}---Specify arbitrary fonts for mathematics in \XeTeX,''\hfil\break\texttt{https://ctan.org/pkg/mathspec}.} These two packages incorporate the use of individual unicode characters into math mode, and their symbol declaration process is similar. Both use \textsf{fontspec} as a back end, and both create font-changing commands for math-mode characters. However, the functionality differs in three crucial respects: (1) \textsf{mathfont} is compatible with Lua\LaTeX; (2) it can adjust the font of basic mathematical symbols such as those in the first half of table~2; and (3) \textsf{mathfont} lacks \textsf{mathspec}'s convenient space-adjustment character |"|.% footnote % \footnote{Compatibility with Lua\LaTeX\ comes at the expense of \textsf{mathspec}'s space-adjustment character |"|, and spacing-conscientious users can either manually add |\string\kern| or |\string\muskip| to their equations or redefine an active version of |"|. For example, the code \begin{code} % footnotes and verbatim really don't play well together \begingroup\texttt{\string\catcode`\string\"=\string\active}\par \texttt{\string\def"\expandafter\@gobble\string\#1\char"7B\relax \expandafter\string\csname ifmmode\endcsname}\par \texttt{\ \ \string\kern}\argtext{dimension}% \texttt{\string\relax\ \expandafter\@gobble\string\#1\string\kern}% \argtext{other dimension}\texttt{\string\relax}\par \texttt{\expandafter\string\csname else\endcsname}\par \texttt{\ \ \string\char`\string\"\expandafter\@gobble\string\#1\%}\par \texttt{\expandafter\string\csname fi\endcsname\char"7D\relax}\endgroup \end{code} will serve as a hack that very roughly approximates \textsf{mathspec}'s |"|. This code will redefine |"| to typeset a right double quotation mark in horizontal mode, but in math mode, the character will insert \textit{dimension} and \textit{other dimension} of white space on each side respectively of the next character. More advanced users can automate the dimensions by using \TeX's \texttt{\expandafter\string\csname if\endcsname} or \LaTeX's |\string\@ifnextchar| conditionals to test whether the following character needs a particular spacing adjustment.} % end footnote % Further, as far as I am aware, this package is the first to provide support for the unicode alphanumeric symbols listed in Table~2, even in the context of fonts without built-in math support. (Please let me know if this is incorrect!) In this way \textsf{mathfont}, like \textsf{mathspec}, is more versatile than the \textsf{unicode-math} package, although potentially less far-reaching.\footnote{Will Robertson, ``\textsf{unicode-math}---Unicode mathematics support for \XeTeX\ and Lua\TeX,''\hfil\break\texttt{https://ctan.org/pkg/unicode-math}.} Users who want to stick with pdf\LaTeX\ should consider Jean-Fran\c cois Burnol's \textsf{mathastext} as a useful alternative to \textsf{mathfont}.\footnote{Jean-Fran\c cois Burnol, ``\textsf{mathastext}---Use the text font in maths mode,''\hfil\break\texttt{https://ctan.org/pkg/mathastext}. In several previous versions of this documentation, I mistakenly stated that \textsf{mathastext} distorts \TeX's internal mathematics spacing. In fact the opposite is true: \textsf{mathastext} preserves and in some cases extends rules for space between various math-mode characters.} This package allows the user to specify the math-mode font for a large subset of the ASCII characters and is the most closely related package to \textsf{mathfont} among those packages designed specifically for pdf\LaTeX. Whereas \textsf{mathfont} works exclusively in the context of unicode fonts, \textsf{mathastext} was designed for the T1 and related encodings of Plain \TeX\ and \LaTeX. However, the \textsf{mathastext} functionality extends beyond that of \textsf{mathfont} in two notable aspects: (1) \textsf{mathastext} makes use of math versions, extra spacing, and italic corrections; and (2) \textsf{mathastext} allows users to change the font for the twenty-five non-alphanumeric characters supported by that package multiple times. After setting the default font for a class of characters, \textsf{mathfont} allows only the local font changes outlined in section~3. \section{Setting the Default Font} The |\mathfont| command sets the default font for certain classes of characters. Its structure is given by \begin{code} |\mathfont[|\argtext{optional character classes}|]{|\argtext{font name}|}|, \end{code} where the \textit{optional character classes} can be any set of keywords from Tables~1 and 2 separated by commas, and the \textit{font name} can be any OpenType or TrueType font in a directory searchable by \TeX.\footnote{When specifying the \textit{font name}, users need to input a name that \textsf{fontspec} will recognize and be able to load. Advanced users will note that \vrb\mathfont\ uses \fontspeccommand\ and therefore loads fonts in the same way as \vrb\fontspec\ and related macros from that package.} The command loops through all keywords in the optional argument, and for each keyword, it changes the math-mode font for every character in that class to the \textit{font name}.\footnote{These changes happen through \LaTeX's \vrb\DeclareMathSymbol, and \vrb\mathfont\ is basically a very elaborately wrapped version of this command.} Currently, \textsf{mathfont} does not support OpenType features in math mode. To change both math and text fonts simultaneously, the package provides the command \begin{code} |\setfont{|\argtext{font name}|}|, \end{code} which calls both |\mathfont| and \textsf{fontspec}'s |\setmainfont| using the \textit{font name} as arguments. The package's optional argument is equivalent to calling |\setfont| and three local font-change commands from section 3, and most users will find this command sufficient for most applications. Both |\mathfont| and |\setfont| should appear only in the document preamble, i.e.\ before |\begin{document}|. The user should specify any optional arguments for |\mathfont| as entries in a comma-separated list. The order is irrelevant, and spaces throughout the optional argument are permitted. The argument should contain no braces! Leaving out the optional argument will cause the command to revert to its default behavior, where it acts on keyword classes |upper|, |lower|, |diacritics|, |greekupper|, |greeklower|, |digits|, |operator|, and |symbols|. For example, if the user writes \begin{code} |\mathfont{Arial}|, \end{code} \textsf{mathfont} will change the font of all Latin characters, Greek characters, diacritics, digits, operators such as $\log$ or $\sin$, and |symbols| characters to Arial whenever they come up in math mode. The package provides control sequences to typeset many symbols that \LaTeX\ does not include by default, and users gain access to these commands when they call |\mathfont| or |\setfont| with the appropriate keyword-option. In total, the package is capable of acting on some 800 unicode characters, and for a full list of symbols and control sequences, see |mathfont_symbol_list.pdf|, which is included in the \textsf{mathfont} installation and is available on \textsc{ctan}. Users can feed |\mathfont| a control sequence as its optional argument as long as the macro eventually expands to a comma-separated list of keywords and suboptions without braces.% footnote \footnote{Technically, \vrb\mathfont\ expands its optional argument inside an \vrb\edef. When it scans an optional argument, \textsf{mathfont} temporarily converts spaces to catcode~9 and ignores them. However, if you feed \vrb\mathfont\ a macro with spaces in it, \TeX\ has already scanned and tokenized those spaces, so we use \vrb\zap@space\ from the \LaTeX\ kernel instead. Braces will wreck both this process and the \vrb\@for\ loop that comes later.} % end footnote Finally, |\mathfont| and |\setfont| will not change the default font for a class of symbols once one of them has already done so. \begin{figure}[tb] \centering Table~1: Math Alphabet Characters\par\penalty\@M\smallskip \begin{tabularx}\hsize{p{1.8in}Xp{1.3in}} \toprule Keyword & Meaning & Default shape\\ \midrule |upper| & Capital Latin Letters & Italic\\ |lower| & Minuscule Latin Letters & Italic\\ |diacritics| & Diacritics & Upright\\ |greekupper| & Capital Greek Letters & Upright\\ |greeklower| & Minuscule Greek Letters & Italic\\ |agreekupper| & Capital Ancient Greek Letters & Upright\\ |agreeklower| & Minuscule Ancient Greek Letters & Italic\\ |cyrillicupper| & Capital Cyrillic Letters & Upright\\ |cyrilliclower| & Minuscule Cyrillic Letters & Italic\\ |hebrew| & Hebrew Letters & Upright\\ |digits| & Arabic Numerals & Upright\\ |operator| & Operator Font & Upright\\ \bottomrule \end{tabularx} \end{figure} By default, \textsf{mathfont} will use one of an upright or italic shape for every character class, and users can override this setting by writing an |=| next to the keyword and either |roman| or |italic| following that. These two suboptions correspond respectively to an upright shape---normal shape in the language of the \textsc{nfss}---and an italic shape. Table~1 includes the default shape-values for each keyword, and the package declares characters for all keywords in table~2 as upright by default. For example, the command \begin{code} |\mathfont[upper=roman,lower=roman]{Times New Roman}| \end{code} changes all math-mode Latin letters to Times New Roman with upright shape. \begin{figure}[t] \centering Table~2: Letter-Like and Other Symbols\par\penalty\@M\smallskip \begin{tabularx}\hsize{p{1.8in}X} \toprule Keyword & Meaning\\ \midrule |symbols| & Basic Symbols\\ |extsymbols| & Extended Symbols\\ |delimiters| & Parentheses, Brackets, and Braces\\ |arrows| & Arrows\\ |bigops| & ``Big'' Operators (see section 4)\\ |extbigops| & Extended ``Big'' Operators\\ |bb| & Blackboard Bold (double-struck)\\ |cal| & Caligraphic\\ |frak| & Fraktur\\ |bcal| & Bold Caligraphic\\ |bfrak| & Bold Fraktur\\ \bottomrule \end{tabularx} \end{figure} The package provides access to several types of letterlike symbols that appear frequently in mathematical writing, and the last five keywords in table~2 constitute these classes. Unlike with other keywords, \textsf{mathfont} doesn't create control sequences to access the symbols directly but rather defines a new command that converts letters into the appropriate style. When the user calls |\mathfont| with any of the last five keywords from table~2, the package both declares the appropriate unicode characters as math symbols and defines the macro \begin{code} |\math|\argtext{keyword}|{|\argtext{argument}|}| \end{code} to typeset them. For example, \begin{code} |\mathfont[bcal]{STIXGeneral}| \end{code} will set STIXGeneral as the font for bold calligraphic characters and define the command |\mathbcal| to access them in math mode. For the |bb| case, the associated command acts on Latin letters and Arabic numerals, and for the other four keywords, the associated command acts just on Latin letters. \TeX\ will ignore and issue a warning in response to any other characters in the \textit{argument}. \section{Local Font Changes} With \textsf{mathfont}, users can locally change the font in math mode by creating and then using a new control sequence for each new font desired.\footnote{The five macros in this section are basically wrapped versions of \LaTeX's \vrb\DeclareMathAlphabet.} The control sequences created this way function analogously to the standard math font macros such as |\mathrm|, |\mathit|, and |\mathnormal| from the \LaTeX\ kernel, and the package provides four basic commands to produce them. Table~3 lists these commands. All four have the same argument structure: a control sequence as the first mandatory argument and a font name as the second. For example, the macro |\newmathrm| looks like \begin{code} |\newmathrm{|\argtext{control sequence}|}{|\argtext{font name}|}|. \end{code} It defines the \textit{control sequence} in its first argument to accept a string of characters that it then converts to the \textit{font name} in the second argument with upright shape and medium weight. Writing \begin{code} |\newmathrm{\matharial}{Arial}| \end{code} would create the macro \begin{code} |\matharial{|\argtext{argument}|}|, \end{code} which can be used only in math mode and which converts the math alphabet characters in its \textit{argument} into the Arial font with upright shape and medium weight. The other three commands in table~3 function in the same way except that they select different series or shape values for the font in question. Table~3 lists this information. As of version~1.6, |\newmathbold| has been renamed to |\newmathbf| to put it in line with \textsc{nfss} naming conventions. \begin{figure}[t] \centering Table 3: Font-changing Commands\par\penalty\@M\smallskip \begin{tabularx}\hsize{p{1.8in}X} \toprule Command & Font Characteristics\\ \midrule |\newmathrm| & Upright shape; medium weight\\ |\newmathit| & Italic shape; medium weight\\ |\newmathbf| & Upright shape; bold-expanded weight\\ |\newmathbfit| & Italic shape; bold-expanded weight\\ \bottomrule \end{tabularx} \end{figure} Together these four commands will provide users with the tools for almost all desired local font changes, but they inevitably will be insufficient for some particular case. Accordingly, \textsf{mathfont} provides the more general |\newmathfontcommand| macro that functions similarly to the commands from table~3 but allows for more general font characteristics.\footnote{The package defines the four commands from table~3 in terms of \vrb\newmathfontcommand, and it specifies their style characteristics according to the kernel commands \vrb\updefault, \vrb\itdefault, \vrb\mddefault, and \vrb\bfdefault. Changing these macros will implicitly change the characteristics of the commands in table~3.} Its structure is \begin{code} |\newmathfontcommand{|\argtext{control sequence}|}{|\argtext{font name}|}{|\argtext{series}|}{|\argtext{shape}|}|, \end{code} where the control sequence in the first argument again becomes the macro that allows the user to access the specified font. The font name means any OpenType or TrueType font in a directory searchable by \TeX, and the series and shape information refers to the \textsc{nfss} codes for these attributes. Like |\mathfont| and |\setfont|, these commands should appear only in the document preamble. Unlike the traditional |\mathrm| and company, \textsf{mathfont}'s local font change commands create macros that can act on Greek characters. If the user specifies the font for Greek letters using |\mathfont|, macros created with the commands from Table~3 will affect those characters; otherwise, they will not.\footnote{\LaTeXe\ defines lower-case Greek letters as \vrb\mathord\ characters, and \textsf{mathfont} changes this classification to \vrb\mathalpha\ type when it declares them as symbols. The local font change commands act only on characters of class \vrb\mathalpha, so these commands will act on lower-case Greek letters if \vrb\mathfont\ redefines them to be \vrb\mathalpha.} Similarly, the local font-change commands will act on Cyrillic and Hebrew characters after the user calls |\mathfont| for those keyword-classes. \section{Math Symbols} Choosing which unicode characters to recode is something of a delicate task because few unicode fonts contain more than the most basic math symbols. In designing this portion of \textsf{mathfont}, I attempted to find the largest set of characters that reliably appears in every or nearly every major unicode font, and I coded those characters in the |symbols| keyword. This keyword contains punctuation and common symbols such as $\pm$, $\div$, and $\infty$, and it will be sufficient for basic math typesetting. That being said, most math relies on a much broader collection of characters and arrows, and in other keywords, I coded every unicode math symbol that I could reasonably see being useful. The extended math symbols keyword |extsymbols| contains quantifiers, set and element relations, just about any binary relation you can imagine, and a few miscellaneous symbols such as |\sharp| and |\flat|. The |arrows| keyword contains a swath of hooked, curved, and bar arrows and even one lightning bolt arrow. Most standard unicode fonts don't contain many of those glyphs, and users who call |\mathfont| for a font without certain characters will see blank spaces in their final output instead of the corresponding symbols from |mathfont_symbol_list.pdf|. If this happens, check the |log| file because it will display any missing characters in your fonts. It's worth emphasizing three aspects of \textsf{mathfont}'s symbol declaration process. First, the package does not provide any symbols in and of itself but rather gives users access to symbols that already exist on their computers. This is why \textsf{mathfont} provides no additional symbols directly at loading and why some package commands can create blank spaces rather than their intended output. Second, \textsf{mathfont}'s functionality currently does not include math symbols of variable sizes.% footnote \footnote{Dynamic math-mode character sizing is a surprisingly thorny task. OpenType font designers specifically code certain characters to change size when they design the font, and Lua\TeX's \vrb\Udelimiter\ and \vrb\Umathoperatorsize\ depend on this embedded feature. Because most unicode fonts come without resizing information, \textsf{mathfont} would have to manually add these settings to the Lua\TeX\ font table. I intend to add this functionality in some future update, but I do not know what the timeframe looks like for those changes.} % end footnote Recoded delimiters do not respond to |\left| and |\right|, and \LaTeX\ replaces them with their original Latin Modern equivalents before rescaling appropriately. Thus |\mathfont| with the |delimiters| keyword will produce normally sized delimiters in the font of your choice and big delimiters in Latin Modern Roman. Similarly, big operators such as |\sum| and |\prod| appear normally sized instead of larger after setting their font with |\mathfont|. This is undesirable! I have isolated all delimiter and big operator characters in their own keywords, and I hope to address this limitation in future updates. Third, the package provides an extra comma character, similar to \LaTeX's |\colon|.% footnote \footnote{Consider $\{x:x\not=0\}$ versus $\{x\colon x\not=0\}$. The first specification uses |:| while the second uses \vrb\colon. As a rule of thumb, use |:| for ratios and \vrb\colon\ as a punctuation mark.} % end footnote \TeX\ users have likely noticed the extra space surrounding commas in math mode, e.g.\ $10,000$ versus $10\mathord,000$, and \textsf{mathfont}'s |\comma| addresses this problem. Here the first ten thousand uses a standard~|,|~while the second uses |\comma|. As a rule of thumb, use |,| as a punctuation mark and |\comma| as a character separator. \section{Handling Errors} I have tried to make \textsf{mathfont}'s error messages as clear as possible, and the help text will contain instructions for how to resolve the problem. Nevertheless, some of the possible error messages warrant additional explanation. The most salient errors are the ``Could not find \textsf{fontspec}'' and ``Missing \XeTeX\ or Lua\TeX'' fatal errors. When the user loads \textsf{mathfont}, \TeX\ must be able to find the package file |fontspec.sty|, and \TeX\ must be operating under the \XeTeX\ or Lua\TeX\ engine. If either condition fails, \TeX\ will stop reading in |mathfont.sty|.% footnote \footnote{Note that \textsf{mathfont} doesn't actually determine the typesetting engine. Rather, it checks whether the \XeTeX\ and Lua\TeX\ primitives \vrb\Umathcode, \vrb\Umathchardef, and \vrb\Umathaccent\ are defined, so if for some reason these control sequences have definitions when the user loads \textsf{mathfont} with another engine, \textsf{fontspec}'s more robust engine checks will take over and cause \TeX\ to abort. The reasoning here is straightforward: \textsf{mathfont} verifies only that the current typesetting engine provides the commands that it directly needs, so its potential functionality remains as broad as possible. If \textsf{fontspec} becomes compatible with a third engine that also provides (analogues of) these primitives, there is no reason to prevent \textsf{mathfont} from working with that engine as well.} % end footnote As of version 1.6, \textsf{mathfont}'s fatal errors prevent \TeX\ from reading in the rest of the |sty| file but do not crash the compilation process, and users who continue past one of \textsf{mathfont}'s fatal error messages will see an ``invalid command'' error if they call a user-level command in their document. I designed these errors to be unobtrusive, and users can safely ignore them. Because of how \textsf{mathfont} performs its engine check, it is theoretically possible that users with very old \XeTeX\ or Lua\TeX\ distributions may see the second fatal error even when running one of these two engines, and the solution is probably to upgrade to a more recent version of the engine in question. Unfortunately, I do not know what the exact cutoff for \XeTeX\ and Lua\TeX\ versions is.\footnote{However, the manual for a beta version of Lua\TeX, v.\ 0.70.1, includes these primitives, so they are at least as old as May 2011. See\hfill\break \texttt{https://osl.ugr.es/CTAN/obsolete/systems/luatex/base/manual/luatexref-t.pdf}} The \textsf{fontspec} package includes a ``|no-math|'' option, and \textsf{mathfont} expects \textsf{fontspec} to be loaded with this option. As mentioned previously, \textsf{mathfont} loads \textsf{fontspec} by default, but users can load \textsf{fontspec} before \textsf{mathfont} if they want to manually specify the package options. Alternatively, \LaTeX's |\PassOptionsToPackage| may be an even better way to proceed. If \textsf{mathfont} detects that \textsf{fontspec} was loaded without the |no-math| option, it will issue an error message saying so. This error is not paramount in the sense that the document will compile normally if a user ignores it, but \textsf{mathfont} will probably have trouble changing the font of certain math-mode characters in this situation. During development, Arabic numerals posed a particular challenge in this regard. The ``internal commands restored'' error arises when the user calls |\mathfont| after the package already restored the small portion of the \LaTeX\ kernel that it adjusts when loaded. Typically this happens when the user calls |\mathfont| after |\restoremathinternals|. The package will ignore any |\mathfont| commands in this situation, so while the error is technically harmless, you may not see some font changes you might have been expecting. Similarly, if the user tries to set the default font multiple times for some character class, the package will ignore any additional attempts, issue a warning, and continue the compilation process. What should you do if you can't resolve an error? First, always, always make sure that you spelled all of your commands correctly and closed all braces and brackets. Then check the \textsf{mathfont} documentation---you may be trying to do something outside the scope of the package, or you may be dealing with a special case. The internet is a great resource, and websites such as the \TeX\ StackExchange, Share\LaTeX, and Wikibooks' \LaTeX\ wiki are often invaluable when dealing with \TeX-related issues. Definitely ask another human as well! At that point you should email the author about your code---you might have identified a bug. I welcome emails about \textsf{mathfont} and will make every effort to write back to correspondence about the package, but I cannot guarantee a timely response. \end{document} % %<*heading> % package date and edition \def\packagedate{December 2019} \def\packageversion{1.6} % header and footer commands \let\@@section\section \let\@sectionname\relax \def\@tempsec#1{\penalty-1000\@@section{#1}\penalty0\gdef\@sectionname{#1}} \def\@tempsecstar#1{\@@section*{#1}\gdef\@sectionname{#1}} \def\section{\@ifstar\@tempsecstar\@tempsec} \def\@oddhead{\ifnum\count0>1\relax \rlap{\textit{\@sectionname}}\hfil \hbox to 0pt{\hss\documentname\hss}\hfil \llap{\the\count0}\fi} \def\@evenhead{\ifnum\count0>1\relax \rlap{\the\count0}\hfil \hbox to 0pt{\hss\documentname\hss}\hfil \llap{\textit{\@sectionname}}\fi} \def\@oddfoot{\hfil\ifnum\count0=1\relax1\fi\hfil} \let\@evenfoot\@empty % general macros \DeclareRobustCommand\XeTeX{X\kern-0.1em \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.15em \TeX} \DeclareRobustCommand\XeLaTeX{X\kern-0.1em \raise-0.5ex\hbox{\rotatebox[origin=c]{180}{E}}\kern-0.13em \LaTeX} \bgroup \count@\catcode`\| \catcode`\|=12\relax \gdef\indexpage#1{\index{#1|textit}} \catcode`\|\count@ \egroup \edef\fontspeccommand{\noexpand\protect\expandafter\noexpand\csname fontspeccommand \endcsname} \bgroup \catcode`\_=12 \expandafter\gdef\csname fontspeccommand \endcsname{% \texttt{\string\fontspec_set_family:Nnn}} \egroup \renewcommand\topfraction{1} \renewcommand\bottomfraction{1} \newenvironment{code} {\strut\vadjust\bgroup\medskip\parindent=4em\relax\indent\strut\ignorespaces} {\strut\par\medskip\egroup\hfill\break\strut\ignorespacesafterend} \def\argtext#1{\ensuremath{\langle$\textit{#1}$\rangle}} \def\vrb#1{\expandafter\texttt\expandafter{\string#1}} \parskip=0pt % symbol list macros \def\makechar#1{\noindent\hbox to 0.4in{$#1{}$\hfil}\vrb#1\par} \def\makeaccent#1{\noindent\hbox to 0.4in{$#1 a$\hfil}\vrb#1\par} \def\blockheader#1#2#3{\smallskip\bigskip\centerline{#2 Characters (\texttt{#1})} \penalty\@M{\noindent\hfil\fontsize{9pt}{12pt}\selectfont \strut Rendered in #3\par}\penalty\@M \smallskip\hrule height 0.5pt\penalty\@M\smallskip} \def\upperalphabet{ABCDEFGHIJKLMNOPQRSTUVWXY} \def\loweralphabet{abcdefghijklmnopqrstuvwxy} \def\digits{0123456789} \def\printchars#1{% \expandafter\@tfor\expandafter\letter\expandafter:\expandafter=#1\do{% \rlap{$\@tempstyle{\letter}$}\hfill}} \def\letterlikechars#1{\smallskip\let\@tempstyle#1 \noindent\printchars\upperalphabet\hbox to 0.6em{$\@tempstyle{Z}$\hss}\par \noindent\printchars\loweralphabet\hbox to 0.6em{$\@tempstyle{z}$\hss}\par} % title information {\large\parindent=0pt\leftskip=0pt plus 1 fil\rightskip=0pt plus 1fil\parfillskip=0pt {\strut\Large Package \textsf{mathfont} v.\ \packageversion\ \documentname\let\thefootnote\relax\footnote{Acknowledgements: Thanks to Lyric Bingham for her work checking my unicode hex values. Thanks to Herbert Voss and Andreas Zidak for pointing out bugs in previous versions of \textsf{mathfont}.}\global\advance\c@footnote\m@ne}\par {\strut Conrad Kosowsky}\par {\strut\packagedate}\par {\strut\ttfamily kosowsky.latex@gmail.com}\par} \bigskip % off-the-shelf insert \begin{figure}[h] \hrule height \p@\hbox{\vrule width \p@\kern-\p@\relax\vbox{\medskip {\leftskip=7em\rightskip=7em \noindent\strut For easy, off-the-shelf use, type the following in your document preamble and compile using \XeLaTeX\ or Lua\LaTeX:\par} \medskip \vbox{\noindent\hfil{|\usepackage[|\argtext{font name}|]{mathfont}|}\hfil} \medskip}\kern-\p@\vrule width \p@}\hrule height \p@ \end{figure} % abstract \begin{abstract} The \textsf{mathfont} package provides a flexible interface for changing the font of math-mode characters. The package allows the user to specify a default unicode font for each of six basic classes of Latin and Greek characters, and it provides additional support for unicode math and alphanumeric symbols, including punctuation. Crucially, \textsf{mathfont} is compatible with both \XeLaTeX\ and Lua\LaTeX, and it provides several font-loading commands that allow the user to change fonts locally or for individual characters within math mode. \end{abstract} \bigskip % %<*doc> % definitions and a new toks \let\?\SpecialUsageIndex \expandafter\newif\csname if@def\endcsname \newtoks\index@nomainlist \index@nomainlist{} \MacrocodeTopsep=2.5pt plus 3pt minus 1pt \def\@defname{def} \def\@edefname{edef} \def\@letname{let} \let\main\textbf % choose macros not to index by definition \def\DoNotIndexMain{\bgroup \catcode`\\=12\relax \do@not@index@main} \def\do@not@index@main#1{\egroup \index@nomainlist\expandafter{\the\index@nomainlist#1,}} % the patch \def\macro@finish{\macro@namepart \if@def \@deffalse \@expandtwoargs\in@{\macro@namepart}{\the\index@excludelist}\relax \ifin@ \else \@expandtwoargs\in@{\macro@namepart}{\the\index@nomainlist}\relax \ifin@ \edef\@tempa{\noexpand\SpecialIndex{\bslash\macro@namepart}}\relax \@tempa \else \edef\@tempa{\noexpand\SpecialMainIndex{\bslash\macro@namepart}}\relax \@tempa \fi \fi \else \ifx\macro@namepart\@defname \@deftrue \else \ifx\macro@namepart\@edefname \@deftrue \else \ifx\macro@namepart\@letname \@deftrue \fi \fi \fi \@expandtwoargs\in@{\macro@namepart}{\the\index@excludelist}\relax \ifin@ \else \edef\@tempa{\noexpand\SpecialIndex{\bslash\macro@namepart}}\relax \@tempa \fi \fi} % the other patch (just one change: \parskip\z@ to parskip 0pt plus 0.2pt) \def\macro@code{% \topsep \MacrocodeTopsep \@beginparpenalty0% \predisplaypenalty \if@inlabel\leavevmode\fi \trivlist \parskip 0pt plus 0.2pt \item[]% \macro@font \leftskip\@totalleftmargin \advance\leftskip\MacroIndent \rightskip\z@ \parindent\z@ \parfillskip\@flushglue \blank@linefalse \def\par{\ifblank@line \leavevmode\fi \blank@linetrue\@@par \penalty\interlinepenalty} \obeylines \let\do\do@noligs \verbatim@nolig@list \let\do\@makeother \dospecials \global\@newlistfalse \global\@minipagefalse \ifcodeline@index \everypar{\global\advance\c@CodelineNo\@ne \llap{\theCodelineNo\ \hskip\@totalleftmargin}% \check@module}% \else \everypar{\check@module}% \fi \init@crossref} % %<*idxwarning> \begingroup \bigskip \hrule height \p@\hbox{\vrule width \p@\kern-\p@\relax\vbox{\bigskip {\leftskip=12pt\rightskip=12pt\parindent=0pt \hfil WARNING\hfil \medskip It looks like you obtained a copy of |mathfont_code.pdf| without the index. To produce documentation with index, do the following: (1) run |mathfont_code.dtx| through \LaTeX\ to produce the |idx| file; (2) while in the directory containing |mathfont_code.dtx|, type \medskip \hfil|makeindex -s gind.ist mathfont_code.idx|\hfil \medskip in the command line; and (3) rerun |mathfont_code.dtx| through \LaTeX\ to recreate the full documentation. }\bigskip}\kern-\p@\vrule width \p@}\hrule height \p@ \bigskip \endgroup % % % \fi % % \check@checksum % \endinput