diff options
Diffstat (limited to 'macros/latex')
-rw-r--r-- | macros/latex/contrib/easybook/README.md | 2 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.dtx | 13 | ||||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.pdf | bin | 628144 -> 628000 bytes | |||
-rw-r--r-- | macros/latex/contrib/easybook/easybook.tex | 19 | ||||
-rw-r--r-- | macros/latex/contrib/mismath/mismath.dtx | 707 | ||||
-rw-r--r-- | macros/latex/contrib/mismath/mismath.pdf | bin | 438746 -> 454706 bytes |
6 files changed, 442 insertions, 299 deletions
diff --git a/macros/latex/contrib/easybook/README.md b/macros/latex/contrib/easybook/README.md index 8fdda59027..5397fab4ce 100644 --- a/macros/latex/contrib/easybook/README.md +++ b/macros/latex/contrib/easybook/README.md @@ -1,5 +1,5 @@ # `easybook` document class -Easily typesetting Chinese theses or books (v2024cd) +Easily typesetting Chinese theses or books (v2024ce) ## Abstract `easybook` is a pure academic template created based on the `ctexbook` book document class. It also has the functions of `book` and `article` document class. Combined with the general framework design of the theses of many universities in China, providing multiple commands and interfaces allows users to easily customize the theses templates. Its basic macro package `easybase` can also be used with `ctex` and standard document classes. diff --git a/macros/latex/contrib/easybook/easybook.dtx b/macros/latex/contrib/easybook/easybook.dtx index 03d076c901..2e60e827f9 100644 --- a/macros/latex/contrib/easybook/easybook.dtx +++ b/macros/latex/contrib/easybook/easybook.dtx @@ -14,7 +14,7 @@ % This work has the LPPL maintenance status `maintained'. %<class|package>\NeedsTeXFormat{LaTeX2e}[2021/11/15] %<*class> -\ProvidesExplClass{easybook}{2024/06/14}{2024cd} +\ProvidesExplClass{easybook}{2024/06/16}{2024ce} {Easily typesetting Chinese theses or books} \bool_new:N \l__eb_compile_draft_bool @@ -300,7 +300,7 @@ %</class> %<*package> \RequirePackage{etoolbox} -\ProvidesExplPackage{easybase}{2024/06/14}{2024cd} +\ProvidesExplPackage{easybase}{2024/06/16}{2024ce} {Easily typesetting Chinese theses or books} \cs_generate_variant:Nn \dim_set:Nn { NV } @@ -1370,6 +1370,7 @@ } \cs_new:cpn { CTEX@#2@tocline } ##1##2 { \CTEXnumberline{##1}##2 } + \exp_args:Nc \providecommand { ttll@#2 }{#3} \exp_args:Nc \providecommand { toclevel@#2 }{#3} \IfValueT{#1}{\eb_title_base_set_eq:nn {#1} {#2}} } @@ -1600,6 +1601,12 @@ \group_end: } +\cs_set_eq:NN \eb@contentsuse@save \contentsuse +\RenewDocumentCommand{\contentsuse}{O{-1000}mm} + { + \eb@contentsuse@save{#2}{#3} + \tl_set:cn { ttll@#2 } {#1} + } \contentsuse{lstlisting}{lol} \seq_put_left:Nn \c__ctex_headings_seq { chapter } \seq_put_right:Nn \c__ctex_headings_seq { table } @@ -2616,7 +2623,7 @@ } %</package> %<*tcolorbox> -\ProvidesExplFile{eb-tcolorbox.cfg}{2024/06/14}{2024cd} +\ProvidesExplFile{eb-tcolorbox.cfg}{2024/06/16}{2024ce} {Customization of tcolorbox for easybook} \cs_set_protected:Npn \addtotcbstyle #1#2 diff --git a/macros/latex/contrib/easybook/easybook.pdf b/macros/latex/contrib/easybook/easybook.pdf Binary files differindex ec5a34b05e..c414414369 100644 --- a/macros/latex/contrib/easybook/easybook.pdf +++ b/macros/latex/contrib/easybook/easybook.pdf diff --git a/macros/latex/contrib/easybook/easybook.tex b/macros/latex/contrib/easybook/easybook.tex index 3fcd9cf291..3e9e341a87 100644 --- a/macros/latex/contrib/easybook/easybook.tex +++ b/macros/latex/contrib/easybook/easybook.tex @@ -23,8 +23,8 @@ name = easybook, color-scheme = blue, title = EASYBOOK使用手册, - version = v2024cd, - date = 2024/06/14, + version = v2024ce, + date = 2024/06/16, authors = 瞿毅, info = 简便地排版中文学位论文或书籍, email = toquyi@163.com, @@ -608,10 +608,10 @@ $\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-she \subsection[页面尺寸]{页面尺寸\smodule{geo}} \label{subsec:page margins} -模块 \module*{geo} 会将选项(除了前两个为附加)交给页面尺寸宏包 \pkg*{geometry} 处理,并且支持它的键值列表,预置的页面尺寸与 \textsf{Word} 的默认值接近。下面列举几种代表性选项,其它选项可查阅宏包帮助文档。当用此模块设置纸张规格时,会覆盖全局选项 \option{paper} 的设置。 +页面尺寸模块 \module*{geo} 用于设置纸张大小和各种页面边距,它将选项交给页面尺寸宏包 \pkg*{geometry} 处理,并且支持它的键值列表,预置的页面尺寸与 \textsf{Word} 的默认值接近。下面列举几种 \pkg*{geometry} 的代表性选项,前面有\hface 符号的选项为额外附加,其它选项可查阅宏包帮助文档。当用此模块设置纸张规格时,会覆盖全局选项 \option{paper} 的设置。 \begin{cnltxlist}[itemsep = 0ex] - \keyval{headruleskip}{页眉线间距}\Default*{0pt} - \keyval{footruleskip}{页脚线间距}\Default*{3.5pt} + \keyval{headruleskip}{页眉线间距}\dtag\Default*{0pt} + \keyval{footruleskip}{页脚线间距}\dtag\Default*{3.5pt} \kvsplit{hdivide}{左边距,版心文本宽度,右边距}\default{} \kvsplit{hmargin}{左边距,右边距}\default{} \keyval{textheight}{版心文本高度}\default{} @@ -848,8 +848,8 @@ $\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-she 当前级别目录条目每个标题之间的代码。 \keyval{tocend}{结束代码}\dtag\Default{\Marg{.}}\newtagv{2024as}% 当前级别目录条目最后一个标题后的代码。 - \command{contentsuse}[\marg{条目名}\marg{扩展名}] - 激活条目类型名称为 \meta{条目名} 的目录定制功能,它使用的目录文件后缀为 \meta{扩展名}。需要在激活条目后再使用命令 \cs{RegisterTocName} 注册选项。 + \command{contentsuse}[\oarg{目录层次}\marg{条目名}\marg{扩展名}]\newtagv[Changed]{2024ce}% + 激活条目类型为 \meta{条目名} 的目录定制功能,目录文件后缀为 \meta{扩展名},若 \meta{扩展名} 为 \code{toc} 则条目会自动激活。可选参数 \meta{目录层次} 为条目在目录中的层次深度,默认值为 \code{-1000},当它大于目录深度计数器 \code{tocdepth} 时不显示。图表等标题的目录条目无深度因此为默认值,章节标题 \module*{part}$\longrightarrow$\module*{subparagraph} 的深度则从 \code{-1} 到 \code{5} 依次递增。需要在激活条目后再使用命令 \cs{RegisterTocName} 注册选项。 \command{DeclareFloatList}[\marg{条目名}\marg{扩展名}] 声明一种条目类型的目录命令 \cs*{listof}\meta{条目名}\code{\textcolor{cs}{s}},并且支持\ref{subsec:directory command} 中图表目录命令的机制。使用这个命令要确保将条目加入目录的机制已经存在,例如搭配 \pkg*{newfloat} 宏包创建新的浮动环境。选项前有实心符号 \textcolor{red}{\sface}(仍包含空心符号\hface 选项的性质)表示在声明后可用。下面举一个声明算法环境和对应题注目录的例子: \begin{ctexexam} @@ -1029,7 +1029,7 @@ $\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-she \begin{ctexexam} \NewTitleCommand[chapter]{lchapter}{0} \NewTitleEntryCommand{lchapter} - \contentsuse{lchapter}{toc} + \contentsuse[0]{lchapter}{toc} \RegisterTocName{lchapter} \ctexset { @@ -1180,7 +1180,7 @@ $\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-she \subsection{盒子} \label{subsec:box} -文档类预置了两个行间盒子环境和两个行内盒子命令,需要在导言区\textbf{手动载入} \pkg*{tcolorbox} 宏包提供支持。它们 \meta{配置选项} 的键值列表可见宏包文档的Option Keys一节,可以进行边距、字体及背景颜色等各种个性化设置。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtotcbstyle} 命令设置,第一个参数为 \code{tc-}\meta{环境或命令名}。 +文档类预置了两个行间盒子环境和两个行内盒子命令,需要在导言区\textbf{手动载入} \pkg*{tcolorbox} 宏包提供支持。它们 \meta{配置选项} 的键值列表可见宏包文档的Option Keys一节,可以进行边距、字体及背景颜色等各种个性化设置。如果 \meta{配置选项} 较长且希望在原有基础上改为全局固定的样式,可以使用 \cs{addtotcbstyle} 命令设置,第一个参数为 \code{tc-}\meta{环境/命令名}。 \begin{cnltxlist} \command{deftcbstyle}[\marg{盒子风格}\marg{键值列表}] 新建或重置一个名称为 \meta{盒子风格} 的 \pkg*{tcolorbox} 宏包盒子风格,可以与 \cs{addtotcbstyle} 命令联用。 @@ -1432,5 +1432,6 @@ $\blacktriangleright$需要注意正确\textbf{编译索引}要增加 \code{-she \shortversion{v = 2024cd,date = 2024/06/14,changes = 修复全局选项 \option{class} 无法正确切换单双面排版的问题。} \end{changelog} \nocite{*} +\AddToHook{cmd/printindex/before}{\clearpage} \end{document}
\ No newline at end of file diff --git a/macros/latex/contrib/mismath/mismath.dtx b/macros/latex/contrib/mismath/mismath.dtx index f3fd2168bc..c2d10d32af 100644 --- a/macros/latex/contrib/mismath/mismath.dtx +++ b/macros/latex/contrib/mismath/mismath.dtx @@ -20,7 +20,7 @@ %<*package> \NeedsTeXFormat{LaTeX2e}[2005/12/01] \ProvidesPackage{mismath} - [2024/05/04 v3.0 .dtx Miscellaneous mathematical macros] + [2024/06/16 v3.1 .dtx Miscellaneous mathematical macros] %</package> %<*driver> \documentclass{ltxdoc} @@ -34,13 +34,16 @@ \usepackage{multicol} \usepackage{sectsty} \usepackage{xcolor} -\usepackage{spacingtricks} +\usepackage[pifont]{spacingtricks} \usepackage{array} \usepackage{metalogo} % for logos of XeLaTeX et LuaLaTeX \definecolor{darkbrown}{rgb}{0.5,0.1,0.1} \allsectionsfont{\color{darkbrown}} +% Next command is used for showing original Latin Modern \i and \j in text mode: +%\DeclareTextFontCommand{\extrafont}{\fontfamily{lmr}\selectfont} % useless with fourier + % The following commands provide several shapes for pi \DeclareFontEncoding{LGR}{}{} \def\pilmr{\text{\usefont{LGR}{lmr}{m}{n}\symbol{112}}} @@ -62,15 +65,13 @@ \def\pipx{\text{\usefont{U}{pxmia}{m}{it}\symbol{"19}}} \def\pitx{\text{\usefont{U}{txmia}{m}{it}\symbol{"19}}} -% Next command is used for showing original Latin Modern \i and \j in text mode: -%\DeclareTextFontCommand{\extrafont}{\fontfamily{lmr}\selectfont} % useless with fourier +\let\updelta\otherdelta \DisableCrossrefs %\CodelineIndex %\RecordChanges \usepackage{hyperref} -\let\C\relax % "\C already defined" with hyperref when compiling with xelatex or lualatex \hypersetup{% colorlinks, linkcolor=blue, @@ -87,7 +88,7 @@ %</driver> % \fi % -% \CheckSum{845} +% \CheckSum{854} % % \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 @@ -105,157 +106,13 @@ % Grave accent \` Left brace \{ Vertical bar \| % Right brace \} Tilde \~} % -% \changes{v0.1}{2011/12/27}{First personal version} -% -% \changes{v1.0}{2019/04/11}{ -% - Initial published version: creating dtx and ins files} -% -% \changes{v1.1}{2019/04/20}{ -% - Some forgotten french 'et' -> 'and', citecolor=blue, -% - changing the default font for pinumber Euler -> Symbol} -% -% \changes{v1.2}{2019/04/27}{ -% - Works fine with beamer now, -% - AtBeginDocument for enumber, inumber, jnumber, -% - creating general mm@operator macro, -% - using mathup instead of mathrm -% - added mathtools package, -% - font definition Roman -> up, -% - changes in documentation, -% - replacing the PEroman macro by PEupright} -% -% \changes{v1.3}{2019/05/08}{ -% - Using bslash in the internal mm@warning macro, -% - loading of mathfixs package -% - Many corrections in documentation} -% -% \changes{v1.4}{2019/05/22}{ -% - Changing font definition up -> UpSh, due to incompatibility with unicode-math} -% -% \changes{v1.5}{2019/05/30}{ -% - A solution for using mul with frac -> braces, -% - addition of paren macro} -% \changes{v1.5}{2019/06/22}{ -% - Small corrections in documentation} -% -% \changes{v1.6}{2019/09/06}{ -% - Removing mathfixs package, problems with fractions} -% -% \changes{v1.7}{2019/12/27}{ -% - Adding a table of contents to the documentation} -% -% \changes{v1.8}{2020/11/15}{ -% - Incompatibility mentioned when using `i' with accent in beamer titles -> use \^i, -% - small changes in documentation} -% -% \changes{v1.9}{2020/10/17}{ -% - UpSh replaced by "operators" font in math mode, -% - PackageWarning `command exist' replaced by PackageWarningNoLine, -% - medspace replaced by thickspace in the lfrac command, -% - changing font in documentation, lmodern -> Palatino (mathpazo)} -% -% \changes{v1.10}{2020/10/25}{\ -% - pinumber command code adapted to avoid incompatibility with the new frenchmath, -% - default option (in upgreek) changed from Symbol to Euler.} -% -% \changes{v2.0}{2022/11/11}{ -% - pinumber command has been enhanced to use other Greek letters packages, -% (and LGR encoding pi by default), it is no longer compatible with the older, -% - paren command has been removed, -% - hvect and hlbar have been slightly modified (phantom t instead of phantom h), -% - several changes in the documentation, -% - now using the Charter font in the doc (with the package mathdesign)} -% -% \changes{v2.1}{2022/12/26}{ -% - Improved management of square brackets with the ibrackets package, -% - new macros codim, sinc, var, eqdef*, -% - removing the systematic warning for paren command, -% - a small change in norm command -> bars in small size, -% - several changes in documentation} -% -% \changes{v2.2}{2023/01/06}{ -% - Loading of ibrackets package is now optional, due to an error -% when using DeclarePairedDelimiter with square brackets.} -% -% \changes{v2.3}{2023/02/09}{ -% - Introducing keyval options for enumber, inumber, jnumber, PEupright -% (corresponding old commands are maintained for now), -% - and also for ibrackets, boldvect and arrowvect -% - Documentation update} -% -% \changes{v2.4}{2023/02/18}{ -% - New powerful macros MathUp, MathIt and also MathNumbers, MathProba, MathNormal, -% - keyval options are no longer useful and have been deleted, -% - loading package ifthen has been forgotten in v2.3 (causing possible errors), -% - no more incompatibility when using `i' with accent in beamer titles} -% -% \changes{v2.5}{2023/02/23}{ -% - Unification of the code of MathUp and MathIt, -% - a powerful macro `apply' is used in MathNormal to act on a list, -% - a new `tensor' command, -% - small changes in the documentation} -% -% \changes{v2.6}{2023/03/01}{ -% - A bug correction in mm@macro -% - incompatibility of \C macro solved, when using babel with Russian -% (thanks to Murray Eisenberg for this bug report on TeX StackExchange) -% - mathrm added in macro eqdef* (useful if italicized Greek uppercase Delta) -% - Tiny changes in the documentation} -% -% \changes{v2.7}{2023/03/05}{ -% - Macros for sets of numbers (\R, \C,...) now available only in math mode -% (following remarks by David Carlisle and Enrico Gregorio) -% - special (not generic) warning when loading babel with russian -% (\C will not be defined in that case)} -% -% \changes{v2.8}{2023/07/26}{ -% - Some small changes in the documentation -% - New macro `onlymathC' designed for using '\C' when Russian language is loaded} -% -% \changes{v2.9}{2023/12/19}{ -% - New option decimalcomma -% - Some small changes in the documentation} -% -% \changes{v2.10}{2024/02/20}{ -% - Better compatibility with unicode-math: -% for the options ibrackets, decimalcomma and the commands MathUp, MathIt -% - Explicit error message when using mathcols without loading the multicol package} -% -% \changes{v2.11}{2024/02/26}{ -% - Enhancements of the pinumber macro with keyval options: -% * no necessity to load a Greek letters package -% * improvements of compatibility with unicode-math -% - Now using the Adobe Utopia font with the package fourier} -% -% \changes{v2.12}{2024/02/29}{ -% - The xparse package has been removed by mistake in v2.11, -% this may cause some compatibility problems; -% it is loaded again by mismath -% - Improvements to make pinumber work perfectly with unicode-math -% - Small corrections in the doc} -% -% \changes{v3.0}{2024/03/15}{ -% - Rewriting of the pinumber command including the pifonts macro -% - Presenting other lgrmath values for pinumber in the doc -% - The \C macro is now in AtBeginDocument -% - amsmath isn't loaded anymore because mathtools loads it -% - Bug fix with options decimalcomma and ibrackets -% - New option 'nofunction' to lighten the package loading -% - Addition of coker and Res in standard operator names -% - New option 'classicReIm' to deactivate Im and Re redefinition -% - New option 'otherReIm' to provide an alternative writing with cmsy font -% - Removal of the PEupright command -% - Additional space in the lfrac macro increased from \: (5mu) to 7mu -% - New optional parameter for adjusting the space in lfrac -% - Changing the vphantom in hvect, hvec and lbar from `t' to `A', looks better} -% % \GetFileInfo{mismath.sty} % % \title{Miscellaneous mathematical macros \\The \textsf{mismath} package\thanks{This document % corresponds to \textsf{mismath}~\fileversion, dated \filedate. % Thanks to François Bastouil for initial help in English translation.}} % \author{Antoine Missier \\ \texttt{antoine.missier@ac-toulouse.fr}} -% \date{May 04, 2024} +% \date{June 16, 2024} % % \maketitle % \tableofcontents @@ -292,8 +149,7 @@ % \item displaymath in double columns for lengthy calculations with short expressions. % \end{itemize} % -% To avoid compatibility issues, -% most of our macros will only be defined +% To avoid compatibility issues, most of our macros will only be defined % if there isn't already a command with the same name in the packages loaded % before \textsf{mismath}. If a macro is already defined, % a warning message will be displayed and the \textsf{mismath} definition @@ -302,16 +158,19 @@ % % \medskip % \DescribeEnv{\oarg{options}} -% The \textsf{mismath} package loads the \textsf{mathtools} +% The \textsf{mismath} package loads the \textsf{mleftright} +% \footnote{The \textsf{mleftright} package defines variants \texttt{\string \mleft} +% and \texttt{\string \mright} of \texttt{\string left} and \texttt{\string \right}.} +% package by Heiko Oberdiek~\cite{MLR} and also \textsf{mathtools} % \footnote{The \textsf{mathtools} package offers numerous helpful macros and improvements % of the \textsf{amsmath} package.} -% package by Morten Høgholm and Lars Madsen~\cite{TOOL} which in turn loads -% the \textsf{amsmath} package~\cite{AMS}. +% by Morten Høgholm and Lars Madsen~\cite{TOOL} which in turn loads +% the \mbox{\textsf{amsmath}} package~\cite{AMS}. % If you want to use \mbox{\textsf{amsmath}} or \textsf{mathtools} with specific options, % you can include these options as options of \mbox{\textsf{mismath}}, or % you can load \textsf{amsmath} or \textsf{mathtools} % with the desired options before loading \mbox{\textsf{mismath}}. -% When using the package \textsf{unicode-math}~\cite{UNIC}, \textsf{mismath} +% When using the package \mbox{\textsf{unicode-math}}~\cite{UNIC}, \textsf{mismath} % should be loaded before \textsf{unicode-math}, just like \textsf{amsmath}. % % \medskip @@ -364,7 +223,7 @@ % or imaginary number $\i$, with |\mathup{e}| or |\mathup{i}|, % the package provides the |\e| command for Euler's number % and |\i| or |\j| for imaginary numbers. -% Let us notice that |\i| and |\j| already exist in LaTeX. In LR (left-to-right) mode, +% Let us notice that |\i| and |\j| already exist in \LaTeX. In LR (left-to-right) mode, % they produce \mbox{`\i,\ \j'} without the dot, % allowing you to place accents on them. % However, in mathematical mode, they produce the warning @@ -376,7 +235,7 @@ % \medskip % \DescribeMacro{\MathUp} % Indeed, typing a lot of backslashes for constants like $\e$, $\i$, or $\j$ -% in a document with numerous formulas can become tiresome. +% in a document with numerous formulas using them can become tiresome. % To alleviate this, the package proposes another solution % with the macro |\MathUp|\marg{char}. % For example, when |\MathUp{e}| is called, any subsequent occurrence of $\e$ @@ -420,7 +279,7 @@ % These three commands, used until version 2.2 but only functioning within the preamble, % serve now as aliases for the commands |\MathUp{e}|, |\MathUp{i}| or |\MathUp{j}|, % so they can be used anywhere -% in the document or preamble and has an inverse switches with |\MathIt|. +% in the document or preamble and has an inverse switch with |\MathIt|. % % \medskip % \DescribeMacro{\pinumber[\meta{option}]} @@ -452,7 +311,7 @@ % which allows the use of any Greek LGR-encoded font in math mode, % an idea taken up in \textsf{mathgreeks}~\cite{MGREEK}. % Also note \textsf{newtxmath}~\cite{NTX} which has several font options. -% These packages provide commands like |\uppi| (\textsf{upgreek}), +% These packages provide commands like |\uppi| (\textsf{upgreek}, \textsf{mathgreeks}), % |\piup| (\textsf{mathdesign}, \textsf{kpfonts}, \textsf{lgrmath}), % |\otherpi| (\textsf{fourier}), etc. % \footnote{They have also options to typeset all the Greek lowercase @@ -461,7 +320,7 @@ % In this case, |\pinumber| must be called in the preamble % with an optional argument being the name of the command, \emph{without the backslash}, % giving access to the upright pi: -% piup, uppi, otherpi\ldots +% \texttt{piup}, \texttt{uppi}, \texttt{otherpi}\ldots % However, installing such a Greek letters package will modify % all the other Greek letter glyphs. % ^^A even if, except for pi, they will be in italics. @@ -482,7 +341,7 @@ % providing the same glyph. % The following table summarizes the available options. % When a key is given without a value, |\pinumber| will choose a default value -% specified in the following text (depending on the key). +% specified in the text list following the table. % % \begin{center} % \setlength{\extrarowheight}{1pt} @@ -556,18 +415,18 @@ % (based on Palatino), % \texttt{txfonts} (based on Times) % are booleans whose default value is \texttt{true} (when called). -% The \texttt{txfonts} option yields the same glyph than \texttt{lgrmath=txr}. +% The \texttt{txfonts} key yields the same glyph than \texttt{lgrmath=txr}. % % \end{itemize} % \end{enumerate} % -% The \textsf{unicode-math} package~\cite{UNIC} provides |\uppi|, and you can use +% The \textsf{unicode-math} package~\cite{UNIC} provides |\uppi|, so you can use % |\pinumber[uppi]| to produce automatic upright pi in the selected math font, -% but |\pinumber[uppi]| must be called \emph{after} \mbox{\textsf{unicode-math}}, -% and a math font must have been explicitly chosen with |\setmathfont|. -% You can also use the \texttt{fontspec} key option to obtain pi in any font -% that is supported by \mbox{\textsf{unicode-math}} \eg -% |\pinumber[fontspec=STIX Two Math]|. +% but a math font must have been explicitly chosen with |\setmathfont|. +% You can also use the \texttt{fontspec} key option, +% \eg |\pinumber[fontspec=STIX Two Math]|, +% to obtain pi in any font +% that is supported by \textsf{unicode-math}. % % For other fonts, it can be quite complicated to make Greek letters packages % work with \textsf{unicode-math}. In any case, such a package must be loaded @@ -616,7 +475,7 @@ % \DescribeMacro{\boldvect} % The |\vect| macro allows vector names to be typeset using bold italic font, % as recommended by ISO~\cite{NIST}~\cite{SI}, instead of using arrows. -% By using the |\boldvect| command, you can modify the behavior of |\vect| +% To achieve this, call the |\boldvect| command, it will modify the behavior of |\vect| % locally or globally, depending on its placement in the document (inside or outside % a group or an environment):\\[2ex] % \begin{minipage}{8cm} @@ -639,16 +498,16 @@ % \textsf{isomath} with |\mathbfit| % or \textsf{bm} with the |\bm| command; % \textsf{unicode-math} provides the |\symbfit| command. -% To use an alternative command instead of |\boldsymbol| in \textsf{mismath}, +% To use an alternative command instead of |\boldsymbol| in \mbox{\textsf{mismath}}, % redefine |\boldvectcommand|, -% for instance after loading \textsf{fixmath}: +% for instance if \textsf{fixmath} is loaded: % % \medskip % \centeredline{|\renewcommand\boldvectcommand{\mathbold}|} % % \medskip % According to ISO rules, symbols for matrices are also in bold italic. -% Therefore you can use the same |\boldvect| command or create another alias. +% Therefore you can also use |\vect| with |\boldvect| for matrices, or create another alias. % % \medskip % \DescribeMacro{\arrowvect} @@ -663,7 +522,7 @@ % When vectors with arrows are typeset side by side, % the arrows can be set up slightly higher using |\hvect| % (which places a vertical phantom box containing `$A$') -% to avoid inelegant effects. For example, writing +% to prevent inelegant effects. For example, writing % \begin{itemize} % \item $\vect{AB}=\hvect{u} + \vect{AC}$, obtained with |\hvect{u}|, % looks better than $\vect{AB}=\vect{u}+ \vect{AC}$; @@ -696,7 +555,7 @@ % for adaptive delimiters. Unfortunately, these delimiters % are always vertically centered, relatively to the mathematical center line, % whereas vectors with arrows are asymmetric objects. -% The code |$\norm{\vec{h}}$| raises a smaller double bar to produce $\norm{\vec{h}}$ +% The code |$\norm{\vec{h}}$| raises the double bar to produce $\norm{\vec{h}}$ % instead of $\Vert\vec{h}\Vert$ or $\left\Vert \vec{h} \right\Vert$. % Let's notice that the height of the bars don't adjust to content, % but however to context: main text, subscripts or exponents, @@ -745,6 +604,27 @@ % The command |\di| can also represent the \emph{distance}, hence its name: % \[\di(u, \cmmathcal{H}) = \frac{\abs{\langle u,v\rangle}}{\lVert v \rVert}.\] % +% \DescribeMacro{\opDelta} \DescribeMacro{\opdelta} +% Two other `difference' operators allow for expressing variations ($\opDelta$) +% or small variations ($\opdelta$). +% They are obtained using the |\opDelta| and |\opdelta| commands. +% \begin{align*} +% \opDelta f \approx \opDelta h = f'(x_0) \opDelta x && +% \frac{\opdelta T}{T}=\frac{1}{2}\frac{\opdelta l}{l} && +% h= \opdelta x\opdelta y +% \end{align*} +% +% Like |\di|, these operators use specific spacing and are typeset using +% the upright Greek letters given by |\updelta| and |\upDelta|. +% By default |\upDelta| is an alias for |\Delta| (which is supposed to be in upright shape); +% |\updelta| is not provided by \textsf{mismath} but can be obtained with +% other packages such as \textsf{mathgreeks}~\cite{MGREEK}, +% \mbox{\textsf{unicode-math}}~\cite{UNIC}, +% or as an alias for the upright delta provided by other fonts +% \footnote{With \textsf{fourier} (without the \texttt{upright} option) we have used +% \texttt{\string\let\string\updelta\string\otherdelta}.}. +% +% \pagebreak % \DescribeMacro{\P} \DescribeMacro{\E} % To refer to probability % \footnote{\LaTeX\ provides also \texttt{\string \Pr} which gives $\Pr$.} @@ -754,7 +634,7 @@ % % \medskip % \DescribeMacro{\Par} -% The |\P| command already existed to refer to the end of paragraph symbol \Par\ +% The |\P| command already existed to refer to the `end of paragraph' symbol (\Par) % and has been redefined, but this symbol can still be obtained with |\Par|. % % \medskip @@ -762,17 +642,16 @@ % Variance is generally denoted by $\var$ or $\Var$ (see the following table), % but some authors prefer to use $\V$, which can be produced using |\V|. % -% \pagebreak % \DescribeMacro{\MathProba}\DescribeMacro{\MathNormal} % As for $\e$, $\i$ or $\j$, you can use |\MathUp{P}|, |\MathUp{E}| % or |\MathUp{V}| to avoid typing many |\P|, |\E| or |\V|. % However you can also achieve this in a single command with |\MathProba|, % for example |\MathProba{PE}|. We get the inverse toggle with -% |\MathIt| for any individual letter or |\MathNormal| for a list. +% |\MathIt| for any individual letter or |\MathNormal| for a comma-separated list. % % \medskip % \DescribeMacro{\probastyle} -% Some authors use ``outline'' font shape to represent probability, expectation +% Some authors use double-struck font shape to represent probability, expectation % and variance: $\mathbb{P}, \mathbb{E}, \mathbb{V}$. % The |\probastyle| macro sets the appearance of |\P|, |\E| and |\V|. % For instance |\renewcommand\probastyle{\mathbb}| @@ -780,7 +659,7 @@ % in which it is used.} % brings the double-struck letters. % The |\mathbb| command is provided by \textsf{amsfonts} package -% (which needs to be called in the preamble), but also by other complete math font +% (which needs to be loaded in the preamble), but also by other complete math font % packages such as \textsf{mathdesign}, \textsf{kpfonts}, \textsf{fourier}, % \textsf{unicode-math}\ldots % \hypertarget{nofunction}{} @@ -829,8 +708,8 @@ % % \DescribeMacro{[nofunction]} % Some may find that the definition of all these operators and functions is not useful -% for their needs. So, the above definitions (on this page) -% can be disabled with the \texttt{nofunction} option. +% for their needs. So, the definitions of standard operators and functions in both +% previous tables can be disabled with the \texttt{nofunction} option. % \hypertarget{classicReIm}{} % % \medskip @@ -841,7 +720,6 @@ % Nevertheless, it is still possible to obtain the old symbols % with |\oldRe| and |\oldIm|. % -% \medskip % \DescribeMacro{[otherReIm]} % An alternative notation $\Re$, $\Im$ is provided by invoking the \texttt{otherReIm} % package option, @@ -874,9 +752,9 @@ % \DescribeMacro{\mathset} % The |\mathset| command enables you to change the behavior % of all these macros in a global way. -% By default, |\mathset| is an alias for |\mathbf|, but if you prefer outline letters, -% you can simply use |\renewcommand\mathset{\mathbb}| (with local effect when -% inside an environment or a pair of curly braces). +% By default, |\mathset| is an alias for |\mathbf|, but if you prefer double-struck letters, +% you can simply use |\renewcommand\mathset{\mathbb}| (with local effect within +% an environment or a pair of curly braces). % % \smallskip % \DescribeMacro{\onlymathC} @@ -894,7 +772,7 @@ % % \medskip % Symbols with limits behave differently for in-line formulas or for displayed equations. -% In the latter case, ``limits'' are placed under or above the symbol +% In the latter case, `limits' are placed under or above the symbol % whereas for in-line math mode, % they are placed on the right, as a subscript or exponent. Compare: % $\zeta(s)=\sum_{n=1}^{\infty }\frac{1}{n^s}$ with @@ -905,9 +783,9 @@ % With in-line math mode, displaymath can be forced with |\displaystyle| % or its alias |\ds|. However, when using these commands, all the rest of the current % mathematical environment will be set in displaymath mode -% (as shown in the previous example, where the fraction will be expanded). +% (as shown in the previous example, where the fraction is expanded). % To limit the display style effect to the affected symbol only, -% similar the the \textsf{amsmath} command |\dfrac|, +% similar to the \textsf{amsmath} command |\dfrac|, % we can use the following macros: % |\dlim|, |\dsum|, |\dprod|, |\dcup|, |\dcap|. % So @@ -969,13 +847,16 @@ % \DescribeMacro{\iif} % |\iif| is an alias for ``\iif'', to be used in text mode. % +% \medskip +% \DescribeMacro{\then} +% This macro produces the symbol $\Longrightarrow$ surrounded by large spaces, +% like the standard macro |\iff| does it with $\Longleftrightarrow$. +% It's just an alias for the \textsf{amsmath} |\implies| macro. +% % \subsection{Improved spacing in mathematical formulas} % -% \DescribeMacro{\then} -% The |\then| macro produces the symbol $\Longrightarrow$ surrounded by large spaces -% just like the standard macro |\iff| does it with $\Longleftrightarrow$. -% Similarly, the |\txt|, \DescribeMacro{\txt} -% based on the |\text| macro from the \textsf{amstext} package +% \DescribeMacro{\txt} +% The |\txt| macro, based on |\text| from the \textsf{amstext} package % (loaded by \textsf{amsmath}), % leaves em quad spaces (|\quad|) around the text. See the following example: % \begin{center} @@ -988,76 +869,82 @@ % The multiplication symbol obtained with |\times| produces the same spacing as addition % or subtraction operators, whereas division obtained with $/$ is closer to its operands. % This actually hides the priority of multiplication over $+$ and $-$. -% That's why we provide the |\mul| macro, behaving like $/$ -% (ordinary symbol) and leaving less space around than |\times|: +% That's why we provide the |\mul| macro, to avoid the large space surrounding |\times|: % \begin{center} % $\lambda+\alpha \mul b-\beta \mul c$, obtained with |\mul|, % looks better than $\lambda+\alpha \times b-\beta \times c$. % \end{center} % -% When using |\mul| before a function name or around a |\left...\right| structure, -% the space may be too large on one side of |\mul|. -% To ensure the same amount of space on both sides, -% you can use thin negative spaces |\!| -% or enclose the function or structure with braces: +% Using |\mul| before a function name works also fine (since v3.1) without the need +% of curly braces to avoid the additional space before the operator name: +% |$x\mul\sin x$| yields $x\mul{\sin x}$. +% +% \medskip +% When using a |\left| \ldots |\right| structure, +% \TeX\ sets additional surrounding space in some situations. +% The \textsf{mleftright}~\cite{MLR} package, loaded by \textsf{mismath}, +% offers the variants |\mleft| and |\mright| +% to address these spacing issues of inner formulas. +% It also provides the |\mleftright| macro that redefines |\left| as |\mleft| +% and |\right| as |\mright|. +% % \begin{center} -% $x\mul{\sin x}$, obtained with |x\mul{\sin x}|, is slightly better than $x\mul\sin x$;\\[1ex] -% |$\sin\!{\left( \frac{\pi}{3} \right)} \mul 2$|\\ -% yields $\sin\!{\left(\frac{\pi}{3}\right)}\mul 2$, which looks better than -% $\sin\left(\frac{\pi}{3}\right)\mul 2$. +% Compare $\sin\left(\frac{\pi}{3}\right)\mul 2$ with +% $\sin\mleft(\frac{\pi}{3}\mright)\mul 2$ obtained with +% |$\sin\mleft(\frac{\pi}{3}\mright)}\mul 2$|. % \end{center} -% The negative thin space after the function name is not related to |\mul|, -% but to the ``excessive'' spaces around the |\left... \right| structure. % -% \medskip % \DescribeMacro{\pow} % In the same way, when typesetting an exponent after a closing \emph{big} % parenthesis produced by |\right)|, % the exponent appears to be a little to far from the parenthesis. % To address this issue, the |\pow|\marg{expr}\marg{pow} command is provided % \footnote{This macro gives bad results with \emph{normal-sized} parenthesis.}, -% which sets the positioning of the exponent \meta{pow} +% which places \meta{expr} in a pair of parenthesis and +% sets the positioning of the exponent \meta{pow} % slightly closer to the right parenthesis. % Compare: % \[ \e^a =\lim_{n \to +\infty}\pow{1+\frac{a}{n}}{n} % \txt{obtained with \texttt{\string \pow}, rather than} % \e^a =\lim_{n \to +\infty}\left(1+\frac{a}{n}\right)^{n}.\] % -% \DescribeMacro{\abs} -% The correct typesetting of absolute value (or modular for a complex number) is achieved -% using |\lvert| \ldots |\rvert|, rather than $\mid$, as the latter doesn't maintain -% proper spacing in some situations (when a sign follows the open delimiter). -% For bars whose height has to adapt to the content, -% we can use |\left\vert| \ldots |\right\vert| or, more simply, -% the |\abs|\{\ldots\} command, which is equivalent +% \DescribeMacro{\abs} \DeleteShortVerb{\|} +% The \cs{abs} command typesets the absolute value while properly managing the spacing, +% which \texttt{|}\ldots\texttt{|} does not. Compare $\abs{-x}$, +% obtained with \cs{abs}, to $|-x|$ without. +% Using the delimiters \cs{lvert} and \cs{rvert} presents another issue when +% the absolute value follows a function name; \eg \verb@\ln\lvert x\rvert@ yields +% $\ln \lvert x\rvert$ +% instead of $\ln\abs{x}$ (with \verb@\ln\abs{x}@). +% Moreover, with \cs{abs}, the size of the delimiters adapts to the content % \footnote{We could also define \texttt{\string \abs} % using \texttt{\string \DeclarePairedDelimiter} % from the \mbox{\textsf{mathtools}} package~\cite{TOOL}.}. +% \MakeShortVerb{\|} % % \medskip % \DescribeMacro{\lfrac} % The |\lfrac| macro behaves like |\frac| -% but with thicker spaces around the arguments, -% making the corresponding fraction bar slightly longer. See the following examples: +% but with additional spacing around the arguments, +% making the corresponding fraction bar slightly longer. +% This macro has an optional parameter |\lfrac|\oarg{space}\marg{num}\marg{denom} +% to adjust the length of the fraction bar. The optional \meta{space} argument must be given +% with \emph{math units} (\texttt{mu}); +% the default value is \texttt{7mu} (equivalent to |\:\,|). +% See the following examples; +% the last one is obtained with |\lfrac[4mu]{1}{\sqrt{x}}|. % \[ \lbar{Z} = \lfrac{\lbar{z_1-z_2}}{\lbar{z_1+z_2}} \qquad % u(x)= \lfrac{\frac{1-2x}{5}}{x^2+1} \qquad % y'+xy=\lfrac[4mu]{1}{\sqrt{x}} % \] -% -% This macro has an optional parameter |\lfrac|\oarg{space}\marg{num}\marg{denom} -% to adjust the length of the fraction bar. The optional \meta{space} argument must be given -% in \emph{math units} (\texttt{mu}); -% the default value is \texttt{7mu} (equivalent to |\:\,|), -% \texttt{4mu} in the last example. % \hypertarget{ibrackets}{} % -% \medskip % \DescribeMacro{[ibrackets]} % Open intervals are commonly represented with parenthesis, \eg $(0, +\infty)$, % but sometimes square brackets are used, especially in French mathematics: $]0, +\infty[$. -% In that specific case, the space around the square brackets is often inappropriate, +% In that case, the space around the square brackets is generally inappropriate, % as in the expression $x \in \mathclose{]} 0, +\infty[$. -% To address this issue, we have redefined the brackets in the \textsf{ibrackets} +% To address this issue, we have redefined the brackets in the \mbox{\textsf{ibrackets}} % package~\cite{BRACKET}. % This one can be optionally % loaded by \textsf{mismath} using the \texttt{ibrackets} package option. @@ -1107,7 +994,7 @@ % However, in the math mode of \LaTeX, the comma is always, by default, % treated as a punctuation symbol and therefore is followed by a space. % This is appropriate in intervals: |$[a,b]$| results in $[a,b]$, -% but is not appropriate for numbers where the comma represents the decimal separator. +% but not for numbers where the comma represents the decimal separator. % For example, |$12,5$| is displayed as $12, 5$ instead of $12{,}5$. % % Two very convenient packages allow handling the decimal comma in math mode: @@ -1143,15 +1030,15 @@ % \DescribeMacro{\systemsep} % This first example could also have been achieved using the \texttt{cases} environment % from the \textsf{amsmath} package, although \texttt{cases} places mathematical expressions -% closer to the bracket. -% The |\systemsep| length allows you to adjust the gap between -% the bracket and the expressions. +% closer to the curly brace. +% The |\systemsep| length allows to adjust the gap between +% the bracket and the math expressions. % By default, the gap is set to |\medspace|. You can reduce this gap by redefining -% the command, \eg: |\renewcommand{\systemsep}{\thinspace}|. -% Alternatively you can increase the gap using |\thickspace| -% and the same spacing as of the \texttt{cases} environment -% is obtained with |\renewcommand\systemsep}{}|. -% The |\systemsep| command allows for greater flexibility in adjusting the spacing +% the command, \eg |\renewcommand{\systemsep}{\thinspace}|. +% Alternatively you can increase the gap using |\thickspace|; +% the same spacing as of the \texttt{cases} environment +% being obtained with |\renewcommand\systemsep}{}|. +% So the |\systemsep| command allows for greater flexibility in adjusting the spacing % within the \texttt{system} environment. % % \medskip @@ -1179,7 +1066,7 @@ % The default spacing between the lines of a \texttt{system} environment has been slightly % enlarged compared to the one used in \texttt{array} environments (using a factor of 1.2). % This can be adjusted by using -% |\renewcommand{\systemstretch}|\marg{stretch}, where \meta{stretch} is the desired value +% |\renewcommand{\systemstretch}|\marg{stretch}, where \meta{stretch} is the desired factor % for the spacing. You can place this command % inside the current mathematical environment for a local change, or outside % for a global change. The default value for is 1.2. @@ -1241,7 +1128,7 @@ % as shown in the following example. % However, to use this feature, the \textsf{multicol} package must be loaded in the preamble. % The \texttt{mathcols} environment activates mathematical mode -% in display style and uses an \texttt{aligned} environment. +% in display style and uses the \texttt{aligned} environment (from \textsf{amsmath}). % \begin{mathcols} % & \frac{1}{2 \mul {\pow{\frac{1}{4}}{n}} + 1} \geq 0.999 \\ % \iff\ & 1 \geq 1.998 \pow{\frac{1}{4}}{n} + 0.999 \\ @@ -1293,6 +1180,7 @@ % \end{tabular} % \end{center} % \StopEventually{} +% % \section{Implementation} % % We load certain packages conditionally to avoid 'option clash' errors in cases @@ -1314,6 +1202,7 @@ %\@ifpackageloaded{amsmath}{}{\RequirePackage{amsmath}} \@ifpackageloaded{mathtools}{}{\RequirePackage{mathtools}} \@ifpackageloaded{esvect}{}{\RequirePackage[b]{esvect}} +\RequirePackage{mleftright} \RequirePackage{ifthen} \RequirePackage{xparse} % provides \NewDocumentCommand, now in LaTeX3 \RequirePackage{xspace} % for \iif command @@ -1369,7 +1258,7 @@ % \DescribeMacro{\mm@warning} \DescribeMacro{\mm@macro} \DescribeMacro{\mm@operator} % The next three internal macros serve as meta commands for % conditionally defining macros while providing a warning message if the macro already exists. -% These macros can be useful in other packages as well. +% % \medskip % \begin{macrocode} \newcommand\mm@warning[1]{ @@ -1395,7 +1284,7 @@ % This command also works fine with other sans serif fonts like \textsf{cmbright}. % % Moreover for \textsf{beamer}, which changes the default font family (to sans serif), -% |\e|, |\i|, |\j| have no effect without |\AtBeginDocument|. +% |\e|, |\i|, |\j| have no effect without |\AtBeginDocument| and % |\AtBeginDocument| is also necessary to redefine |\i| when calling % the \textsf{hyperref} package which overwrites the |\i| definition. % \medskip @@ -1411,15 +1300,15 @@ % \end{macrocode} % % \DescribeMacro{\MathFamily} -% The following macros |\MathUp| and |\MathIt| are switches that transform +% The following macros |\MathUp| and |\MathIt| are toggles that transform % any chosen letter in math mode to roman or italic style. -% These switches can be used anywhere in the document or preamble. +% These switches can be used anywhere in the document or the preamble. % They are based on the generic macro |\MathFamily|. % To obtain a letter in roman style instead of italic, we need to change the % mathcode digit that represents the font family: 1 to 0. % % For example, except for \LuaLaTeX, mathcode of the `e' letter is: -% `e="7165 (decimal 29029), with the second digit `1' indicating ``italic'' style. +% e="7165 (decimal 29029), with the second digit `1' indicating ``italic'' style. % To get a roman `e', we need to change its mathcode to "7065. % % When used in the preamble, we call |\MathFamily| by |\AtBeginDocument| @@ -1531,7 +1420,7 @@ % Let its author, Petr Ol\v{s}ák, be thanked. % This macro allows to accomplish tasks that % usual loop instructions like |\@for| or |\foreach| cannot achieve due to -% errors like ``!~Improper alphabetic constant''. +% errors like ``\texttt{!~Improper alphabetic constant}''. % For instance, if you try |\def\letter{A} \MathUp{\letter}| it will fail % because the control sequence |\letter| is not strictly % equivalent here to the single character `A'. @@ -1549,11 +1438,11 @@ % \end{macrocode} % -% The following commands were used until version 2.2 but still work. -% They were intended to set some letters in upright shape -% in math mode, but only worked in the preamble. -% This is now managed by the more powerful |\MathUp| command, and -% the old commands are maintained but as alias for |\MathUp|. +% The following commands were used originally (until version 2.2) +% to set the math letters e, i or j in upright shape, +% but only worked in the preamble. +% This is now managed by the more powerful |\MathUp| command, but +% the old commands are maintained as alias for |\MathUp|. % \medskip % % \begin{macrocode} @@ -1564,7 +1453,7 @@ % \end{macrocode} % % Obtaining an upright Greek letter $\pi$ must be handled differently. -% The switches are called |\pinumber| and |\pinormal| +% The toggles are called |\pinumber| and |\pinormal| % and can be used anywhere in the document. % % But |\pinumber| must be called first in the preamble with an optional argument. @@ -1573,11 +1462,11 @@ % Compatibility with \textsf{unicode-math} is a bit tricky! % When given without an argument in the preamble, % |\pinumber| uses an LGR font encoding called \texttt{lmr}. -% A new feature (v2.11) is to use |\pinumber| with a keyval option to +% A new feature (v2.11) for |\pinumber| is provided with keyval options to % use many other Greek pi letters without loading % a whole package, thus without altering the other (italic) Greek letters. % We achieve this with |\DeclareSymbolFont| and |\DeclareMathSymbol|. -% We just have to know the ``name'' of the desired symbol font. +% We just have to know the `name' of the desired symbol font. % % \medskip % \begin{macrocode} @@ -1722,28 +1611,28 @@ % \end{macrocode} % When |\pinumber|\oarg{keyval} has been called, you can also get -% some other mathematical constants using Greek letters, +% some other mathematical constants using Greek letters in the same font (\texttt{mmupgr}) % \eg $\othergamma$, the Euler-Mascheroni constant: % \begin{verbatim} % \let\gamma\relax % \DeclareMathSymbol{\gamma}{\mathord}{mmupgr}{"0D} % \end{verbatim} % \vspace{-2ex} -% If \textsf{unicode-math} is used, you must put these commands in +% If \textsf{unicode-math} is used, you must put these commands inside % |\AtBeginDocument|. % The hexadecimal code |"0D| depends on the option passed to |\pinumber| -% in the preamble (see the command |\pifonts| above and search in package docs). \\ +% in the preamble (see the command |\pifonts| above and search in package docs). % And to get the golden ratio $\othervarphi$: % \begin{verbatim} -% \let\phi\relax +% \let\varphi\relax % \DeclareMathSymbol{\varphi}{\mathord}{mmupgr}{"27} % \end{verbatim} % \vspace{-2ex} -% To preserve the original $\gamma$ or $\varphi$, +% I you want to preserve the original $\gamma$ or $\varphi$, % you can define |\upgamma| or |\upvarphi| instead. % % \medskip -% And now the commands for vectors and tensors. +% Commands for vectors and tensors follow. % \medskip % \begin{macrocode} \newboolean{arrowvect} @@ -1774,9 +1663,48 @@ \newcommand{\tensor}{\mathbfsfit} % isomath uses \mathsfbfit % \end{macrocode} +% +% `Operators', as for example common function names, are generally defined +% using the |\DeclareMathOperator| command or |\operatorname| for occasional use. +% Operators are then typeset in roman (upright) shape and with appropriate thin space +% before and after the operator name. +% However, for the `differential' operator d, no space should be left after it +% to obtain, for example, `$\di x$' instead of `$\operatorname{d} x$'. +% +% \medskip +% Two other operators, suggested by `quark67', representing differences +% or variations are defined by the macros |\opDelta| and |\opdelta|. +% They use the Greek letters $\upDelta$ and $\updelta$ with appropriate spacing, +% similar to |\di|. +% By default |\upDelta| will be an alias for |\Delta|. +% Generally, the uppercase Delta is upright +% unless a package is loaded to change this, but the lowercase delta +% is italic by default. +% +% To use the |\opdelta| macro, it is therefore necessary +% to load a package that provides the lowercase delta in upright shape, +% such as \textsf{mathgreeks} or \textsf{unicode-math}, +% or you can use the same symbol font \texttt{mmupgr} as seen above for the upright pi +% (if |\pinumber|\oarg{keyval} has been called previously). +% So you could get the upright delta with: +% \begin{verbatim} +% \DeclareMathSymbol{\updelta}{\mathord}{mmupgr}{"0E} +% \end{verbatim} \vspace{-2ex} +% The hexadecimal code |"0E| depends on the option passed to |\pinumber|. +% If you have loaded a package that provides upright shapes of Delta and delta, +% it may be necessary to create new aliases for |\upDelta| or |\updelta|, +% \eg |\let\updelta\|\meta{mydelta}. +% \begin{macrocode} +\mm@macro{di}{\operatorname{d}\mathopen{}} +\mm@macro{upDelta}{\Delta} +\mm@macro{opDelta}{\operatorname{\upDelta}\mathopen{}} +\mm@macro{opdelta}{\operatorname{\updelta}\mathopen{}} +% \end{macrocode} +% For the field of probability, we provide the macros |\P|, |\E|, and |\V|, +% which are defined as operators. They are typeset in normal roman font, +% but can be changed to double-struck style (or another style) if desired. % \begin{macrocode} -\mm@macro{di}{\mathop{}\!\mathup{d}} \newcommand\probastyle{} \let\Par\P % end of paragraph symbol \renewcommand{\P}{\operatorname{\probastyle{P}}} @@ -1790,7 +1718,7 @@ } % \end{macrocode} -% Classic identifiers are presented below. They will be defined only +% Classic operators or function identifiers are presented below. They will be defined only % if the option \texttt{nofunction} has not been activated. % \medskip % \begin{macrocode} @@ -1840,13 +1768,13 @@ % % The |\mathcal| alphabet, from the original Computer Modern font family, % is used here to produce $\Re$, $\Im$ and $\bigO$. -% Several font packages redefines this alphabet producing glyphs that may seem less +% Several font packages redefine this alphabet producing glyphs that may seem less % suitable for the commands below. % We have therefore retained the original |\cmmathcal| math alphabet, % which can be used for other letters. % If \textsf{unicode-math} is called, it will redefine the commands |\Re| and |\Im| -% in |\AtBeginDocument|, hence the use of `|\AtEndPreamble{\AtBeginDocument{|' -% to ensure that the \textsf{mismath} redefinition occur after the actions +% in |\AtBeginDocument|, hence the use of |\AtEndPreamble{\AtBeginDocument{|\ldots +% to ensure that the \textsf{mismath} redefinitions occur after the actions % of \textsf{unicode-math}. % % \begin{macrocode} @@ -1880,24 +1808,23 @@ % \end{macrocode} % And finally we present the remaining macros. % -% With Cyrillic languages, the command |\C| may already be defined but only for text mode. -% Thus, it will not be redefined by \textsf{mismath}. However, when activating -% |\onlymathC|, you can to use our |\C| macro only for math mode, +% With Cyrillic languages, the command |\C| may already be defined +% but works only in text mode. +% Then, it will not be redefined by \textsf{mismath}. However, the command +% |\onlymathC| allows to use our |\C| macro in math mode, % without interfering the definition of the text |\C| that is already defined. % % When using \XeTeX\ or \LuaTeX\ engines with the \textsf{hyperref} package, % |\C| will be already defined and -% you get the message "\texttt{Command \string\C\space unavailable in encoding TU}". +% you get the message ``\texttt{Command \string\C\space unavailable in encoding TU}''. % Therefore |\onlymathC| is automatically called in that case. % \medskip % \begin{macrocode} \mm@macro{mathset}{\mathbf} \mm@macro{R}{\mathset{R}} -\AtBeginDocument{ - \@ifpackageloaded{hyperref}% - {\iftutex\onlymathC\fi}% LuaTex or XeTeX engines - {\mm@macro{C}{\mathset{C}}} -} +\mm@macro{C}{\mathset{C}} +\AtBeginDocument{% \iftutex = LuaTex or XeTeX engines + \@ifpackageloaded{hyperref}{\iftutex\onlymathC\fi}{} } \providecommand\onlymathC{\let\oldC\C \renewcommand{\C}{\TextOrMath{\oldC}{\mathset{C}}} } \mm@macro{N}{\mathset{N}} @@ -1918,29 +1845,27 @@ \providecommand*{\hlbar}[1]{\overline{\vphantom{A}#1}}}{ \mm@warning{hlbar} } \newcommand\@eqdef{\stackrel{\mathup{def}}{=}} -\newcommand\@@eqdef{\stackrel{\mathrm{\Delta}}{=}} +\newcommand\@@eqdef{\stackrel{\upDelta}{=}} \mm@macro{eqdef}{\@ifstar{\@@eqdef}{\@eqdef}} \mm@macro{unbr}{\underbrace} \mm@macro{iif}{if and only if\xspace} +\mm@macro{then}{\implies} -% \end{macrocode} -% Above, we have used |\mathrm| before |\Delta| in case of defining capital Greek letters -% in italics (for example with the \textsf{fixmath} package). -% -% The use of |\mbox{}| ensures that the space produced by |\| in the |\then| macro -% is not suppressed in tables. -% \medskip -% \begin{macrocode} -\mm@macro{then}{\ \Longrightarrow \ \mbox{} } \@ifundefined{txt}{ \providecommand*{\txt}[1]{\quad\text{#1}\quad} }{ \mm@warning{txt} } -\mm@macro{mul}{\mathord{\times}} +\mm@macro{mul}{\mathclose{}\mathord{\times}\mathopen{}} \@ifundefined{pow}{ \providecommand*{\pow}[2]{\left( #1 \right)^{\!#2}} }{ \mm@warning{pow} } +% \end{macrocode} +% For |\abs|, the |\left...\right| structure is inserted within a pair of curly braces +% to prevent incorrect spacing before the first delimiter when it follows a function name, +% in cases where the package \textsf{mleftright} is used and activated. +% This issue was pointed out by `quark67'. +% \begin{macrocode} \@ifundefined{abs}{ - \providecommand*{\abs}[1]{\left\vert#1\right\vert} }{ + \providecommand*{\abs}[1]{{\left\vert#1\right\vert}} }{ \mm@warning{abs} } \@ifundefined{lfrac}{ \providecommand*{\lfrac}[3][7mu]{% @@ -1981,7 +1906,216 @@ } % \end{macrocode} % -% \begin{thebibliography}{34} +% \pagebreak +% \section*{Change History} +% +% \begin{multicols}{2}\begin{raggedright} +% \renewcommand\changes[3]{\item[#1 \ (#2)] \mbox{}\\ #3} +% \setlength{\compactlistindent}{-1em} +% \begin{list}{}{\setlength\labelwidth{1.4em}\setlength{\leftmargin}{2em} +% \setlength{\parsep}{0pt}} +% +% \changes{v0.1}{2011/12/27}{First personal version.} +% +% \changes{v1.0}{2019/04/11}{Initial published version.} +% +% \changes{v1.1}{2019/04/20}{ +% Changing the default font for \cs{pinumber} from Euler to Symbol.} +% +% \changes{v1.2}{2019/04/27}{ +% \begin{compactlist} +% \item commands \cs{enumber}, \cs{inumber}, \cs{jnumber} in \cs{AtBeginDocument}\\ +% \hand works fine with \textsf{beamer} now, +% \item new general \cs{mm@operator} macro, +% \item using \cs{mathup} instead of \cs{mathrm}, +% \item including \textsf{mathtools}, +% \item in \cs{DeclareSymbolFont} 'Roman' changed to 'up', +% \item changes in the documentation, +% \item replacing \cs{PEroman} by \cs{PEupright}. +% \end{compactlist}} +% +% \changes{v1.3}{2019/05/08}{ +% \begin{compactlist} +% \item using \cs{bslash} in the internal \cs{mm@warning} macro +% to type out a control sequence whose name is given as parameter, +% \item including the \textsf{mathfixs} package, +% \item many corrections in the documentation. +% \end{compactlist}} +% +% \changes{v1.4}{2019/05/22}{ +% In \cs{DeclareSymbolFont} 'up' chan\-ged to 'UpSh' +% to prevent incompatibility with \textsf{unicode-math}.} +% +% \changes{v1.5}{2019/05/30}{ +% \begin{compactlist} +% \item a solution for using \cs{mul} with \cs{frac} \hand use braces, +% \item addition of the \cs{paren} macro. +% \end{compactlist}} +% +% \changes{v1.6}{2019/09/06}{ +% Removing the \textsf{mathfixs} package because of problems with fractions.} +% +% \changes{v1.7}{2019/12/27}{ +% Adding a table of contents to the documentation.} +% +% \changes{v1.8}{2020/11/15}{ +% Small changes in the documentation, in particular +% an incompatibility is mentioned when using `i' with accent in \textsf{beamer} titles: +% (use \texttt{\textbackslash\textasciicircum i} instead of î).} +% +% \changes{v1.9}{2020/10/17}{ +% \begin{compactlist} +% \item in \cs{DeclareSymbolFont} 'UpSh' replaced by 'operators' +% \item\cs{PackageWarning} replaced by \cs{PackageWarningNoLine} for existing macros, +% \item \cs{thickspace} replaces \cs{medspace} in \cs{lfrac}, +% \item changing the documentation font: from lmodern to Palatino (\textsf{mathpazo}). +% \end{compactlist}} +% +% \changes{v1.10}{2020/10/25}{ +% \cs{pinumber} code updated to prevent incompatibility +% with the new version of the \textsf{frenchmath} package +% (in which the default 'upgreek' option has been changed from Symbol to Euler).} +% +% \changes{v2.0}{2022/11/11}{ +% \begin{compactlist} +% \item enhancing \cs{pinumber} to use other Greek letters packages +% (it is no longer compatible with the older), +% \item \cs{paren} has been removed (useless), +% \item \cs{hvect} and \cs{hlbar} have been slightly modified (\cs{phantom}\texttt{\{t\}} +% instead of \cs{phantom}\texttt{\{h\}}), +% \item several changes in the documentation +% (now the Charter font is used, with the \textsf{mathdesign} package). +% \end{compactlist}} +% +% \changes{v2.1}{2022/12/26}{ +% \begin{compactlist} +% \item including the \textsf{ibrackets} package to improve +% the management of square brackets, +% \item new macros \cs{codim}, \cs{sinc}, \cs{var}, \cs{eqdef*}, +% \item removing the warning for the obsolete \cs{paren} command, +% \item a small change in the \cs{norm} command (bars in small size), +% \item several changes in documentation. +% \end{compactlist}} +% +% \changes{v2.2}{2023/01/06}{ +% New option \texttt{ibrackets} to load the \textsf{ibrackets} package +% \emph{optionally} because of errors +% when using \cs{DeclarePairedDelimiter} with square brackets.} +% +% \changes{v2.3}{2023/02/09}{ +% Introducing keyval options as an alternative to \cs{enumber}, +% \cs{inumber}, \cs{jnumber}, \cs{PEupright}, +% and also for using ibrackets, \cs{boldvect} and \cs{arrowvect}.} +% +% \changes{v2.4}{2023/02/18}{ +% \begin{compactlist} +% \item new powerful macros \cs{MathUp}, \cs{MathIt}, +% (and \cs{MathNumbers}, \cs{MathProba}, \cs{MathNormal}), +% \item keyval options are no longer useful and have been removed, +% \item loading the package \textsf{ifthen} has been forgotten in v2.3 +% (causing possible issues), +% \item no more incompatibility when using `i' with accent in \textsf{beamer} titles. +% \end{compactlist}} +% +% \changes{v2.5}{2023/02/23}{ +% \begin{compactlist} +% \item unification of the code of \cs{MathUp} and \cs{MathIt}, +% \item a new powerful macro \cs{apply} is used in \cs{MathNormal} to act on a list, +% \item new \cs{tensor} command. +% \end{compactlist}} +% +% \changes{v2.6}{2023/03/01}{ +% \begin{compactlist} +% \item bug fix in \cs{mm@macro}, +% \item solving incompatibility of the \cs{C} macro when using \textsf{babel} with Russian +% (thanks to Murray Eisenberg for this bug report on TeX StackExchange), +% \item \cs{mathrm} added in the macro \cs{eqdef*}. +% \end{compactlist}} +% +% \columnbreak +% \changes{v2.7}{2023/03/05}{ +% \begin{compactlist} +% \item macros for sets of numbers (\cs{R}, \cs{C}\ldots) now available only in math mode +% (following remarks by David Carlisle and Enrico Gregorio), +% \item special warning when loading \textsf{babel} with Russian +% (\cs{C} will not be defined in that case). +% \end{compactlist}} +% +% \changes{v2.8}{2023/07/26}{ +% New macro \cs{onlymathC} designed for using \cs{C} in pmath mode +% when Russian language is loaded.} +% +% \changes{v2.9}{2023/12/19}{ +% New option \texttt{decimalcomma}.} +% +% \changes{v2.10}{2024/02/20}{ +% \begin{compactlist} +% \item better compatibility with \textsf{unicode-math}: +% for the options \texttt{ibrackets}, \texttt{decimalcomma} +% and the commands \cs{MathUp}, \cs{MathIt}, +% \item Explicit error message when using \texttt{mathcols} +% without loading the \textsf{multicol} package. +% \end{compactlist}} +% +% \changes{v2.11}{2024/02/26}{ +% \begin{compactlist}\setlength\compactlistindent{-0.5em} +% \item enhancements of the \cs{pinumber} macro with keyval options: +% \begin{compactlist}[\dash] +% \item no necessity to load a Greek letters package, +% \item improvements of compatibility with \textsf{unicode-math}; +% \end{compactlist} +% \item changing the font to Adobe Utopia with the package \textsf{fourier}. +% \end{compactlist}} +% +% \changes{v2.12}{2024/02/29}{ +% \begin{compactlist} +% \item the \textsf{xparse} package has been removed by mistake in v2.11, +% causing some compatibility issues, it is loaded again by \textsf{mismath}, +% \item improvements to make \cs{pinumber} work better with \textsf{unicode-math}. +% \end{compactlist}} +% +% \changes{v3.0}{2024/03/15}{ +% \begin{compactlist} +% \item rewriting the \cs{pinumber} command with a new \cs{pifonts} macro, +% \item presenting other \texttt{lgrmath} values for \cs{pinumber} in the doc, +% \item The \cs{C} macro is now inside \cs{AtBeginDocument}, +% \item \textsf{amsmath} isn't loaded explicitly because \textsf{mathtools} loads it, +% \item bug fix with options \texttt{decimalcomma} and \texttt{ibrackets}, +% \item new option \texttt{nofunction} to lighten the package loading, +% \item addition of macros \cs{coker} and \cs{Res} as standard operator names, +% \item new option \texttt{classicReIm} to deactivate \cs{Im} and \cs{Re} redefinition, +% \item new option \texttt{otherReIm} to provide an alternative writing +% with \texttt{cmsy} font, +% \item removing the \cs{PEupright} command, +% \item additional space in the \cs{lfrac} macro increased from \texttt{\textbackslash:} +% (5mu) to 7mu, +% \item new optional parameter for adjusting the space in \cs{lfrac}, +% \item changing the \cs{vphantom} argument in \cs{hvect}, \cs{hvec} and \cs{lbar} +% from `t' to `A', looks better. +% \end{compactlist}} +% +% \changes{v3.1}{2024/06/16}{ +% \begin{compactlist}\setlength\compactlistindent{-0.5em} +% \item adding a change history, +% \item bug fix with the \cs{C} macro when using \textsf{hyperref} with +% \LuaTeX{} or \XeTeX{} engines, +% \item the $\upDelta$ produced in \cs{eqdef*} is now obtained with \cs{upDelta} +% (\cs{mathrm}, used before, doesn't work generally), +% \item several relevant suggestions and remarks by `quark67': +% \begin{compactlist}[\dash] +% \item new macros for variations \cs{opDelta} and small variations \cs{opdelta}, +% \item redefinition of \cs{then} as an alias for \cs{implies}, +% \item improvement of the \cs{abs} macro, +% \item including the \textsf{mleftright} package; +% \end{compactlist} +% \item new implementation of \cs{di}, +% \item improvement of the \cs{mul} macro. +% \end{compactlist}} +% +% \end{list}\end{raggedright} +% \end{multicols} +% +% \begin{thebibliography}{35} % \begin{raggedright} % \bibitem{TYPMA} \emph{Typesetting mathematics for science and technology according % to ISO 31/XI}, Claudio Beccari, TUGboat Volume 18 (1997), No.~1. @@ -1997,6 +2131,7 @@ % \url{https://old.iupac.org/standing/idcns/italic-roman_dec99.pdf}. % \bibitem{VECT} \emph{\textsf{esvect} -- Typesetting vectors with beautiful % arrow with \LaTeXe}, Eddie Saudrais, CTAN, v1.3 2013/07/11. +% \bibitem{MLR} \emph{The \textsf{mleftright} package}, Heiko Oberdiek, CTAN, v1.2 2019/12/03. % \bibitem{TOOL} \emph{The \textsf{mathtools} package}, Morten Høgholm, Lars Madsen, CTAN, % v1.29 2022/06/29. % \bibitem{AMS} \emph{\textsf{amsmath} -- \AmS\ mathmatical facilities for \LaTeX}, diff --git a/macros/latex/contrib/mismath/mismath.pdf b/macros/latex/contrib/mismath/mismath.pdf Binary files differindex fd41e6702c..79dc76ec46 100644 --- a/macros/latex/contrib/mismath/mismath.pdf +++ b/macros/latex/contrib/mismath/mismath.pdf |