diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/skmath')
-rw-r--r-- | Master/texmf-dist/source/latex/skmath/skmath.tex | 75 |
1 files changed, 69 insertions, 6 deletions
diff --git a/Master/texmf-dist/source/latex/skmath/skmath.tex b/Master/texmf-dist/source/latex/skmath/skmath.tex index 83fe206908a..424e795f6b6 100644 --- a/Master/texmf-dist/source/latex/skmath/skmath.tex +++ b/Master/texmf-dist/source/latex/skmath/skmath.tex @@ -1,6 +1,6 @@ %% skmath improved math commands %% -%% Copyright (C) 2012-2016 by Simon Sigurdhsson <sigurdhsson@gmail.com> +%% Copyright (C) 2012-2019 by Simon Sigurdhsson <sigurdhsson@gmail.com> %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -22,6 +22,7 @@ \usepackage{csquotes} \ProvideDocumentCommand\d{m}{#1} \ProvideDocumentCommand\pd{smm}{#2#3} +\ProvideDocumentCommand\td{mm}{#1#2} \ProvideDocumentCommand\abs{m}{#1} \ProvideDocumentCommand\norm{m}{#1} \ProvideDocumentCommand\abs{m}{#1} @@ -37,6 +38,7 @@ \ProvideDocumentCommand\C{}{} \ProvideDocumentCommand\ii{}{i} \ProvideDocumentCommand\jj{}{j} +\ProvideDocumentCommand\ee{}{e} \ProvideDocumentCommand\sfrac{mm}{#1#2} \ProvideDocumentCommand\argmin{om}{#1} \ProvideDocumentCommand\argmax{om}{#1} @@ -56,7 +58,7 @@ % This is where the documentation begins \begin{document} % Change & version info - \version{0.4b} + \version{0.5} \changes{0.1}{Initial version} \changes{0.1c}{Moved package from \pkg{docstrip} to \pkg{skdoc}} \changes{0.1d}{Fixed fatal documentation and package errors} @@ -69,6 +71,7 @@ \changes{0.4}{Added \opt{notation} option, macros for complex numbers} \changes{0.4a}{Replaced deprecated/removed \pkg{expl3} constructs} \changes{0.4b}{Track \pkg{expl3} changes (thanks to Joseph Wright)} + \changes{0.5}{Added \cs{td} and \cs{ee}} % Don't forget to update the version number and release date of % the package declaration in the implementation! @@ -131,6 +134,10 @@ of the package simply results in italic characters, setting the \opt{notation} option to \texttt{iso} will set these upright. + \DescribeMacro\ee + This command typesets Euler's number \(\ee = \sum_{n=0}^\infty\frac{1}{n!}\). + The style is affected by the \opt{notation} option in the same way as \Macro\exp. + \DescribeMacro\norm{<expression>} \DescribeMacro\abs{<expression>} The commands \Macro\norm and \Macro\abs, quite expectedly, typeset @@ -169,6 +176,15 @@ supports superscripts to denote the number of derivatives, and the sum of the variables is automatically calculated. + \DescribeMacro\td{<function>}{<var>} + This macro typesets a total derivative. Unlike \Macro\pd, this macro does + not have a starred variant, and only typesets full fractions: +\begin{example} +\begin{equation*} + \td{f}{x^m} +\end{equation*} +\end{example} + \DescribeMacro\E{<expression>} The command \Macro\E typesets the expectation of a random variable. \begin{example} @@ -232,7 +248,7 @@ \DescribeMacro\exp*{<expression>} The exponential, \Macro\exp, is redefined to typeset its argument as a - superscript of \(e\) in some display styles, and as an argument of + superscript of \(\ee\) in some display styles, and as an argument of \(\mathrm{exp}\) otherwise: \begin{equation*} \exp{\sqrt{2}\exp{x}} @@ -303,7 +319,7 @@ \begin{MacroCode}{package} \RequirePackage{expl3,l3keys2e,xparse} \ProvidesExplPackage{skmath} - {2017/01/08}{0.4b}{improved math commands} + {2018/12/29}{0.5}{improved math commands} \PassOptionsToPackage{intlimits,sumlimits,namelimits}{amsmath} \RequirePackage{amssymb,mathtools,xfrac} \end{MacroCode} @@ -324,6 +340,9 @@ First, some placeholders to detect failures. \cs_gset_nopar:Npn\__skmath_imaginary_unit:n#1{ \msg_critical:nnn{skmath}{undefined-macro}{\__skmath_imaginary_unit:n} } +\cs_gset_nopar:Npn\__skmath_total_derivative_d:{ + \msg_critical:nnn{skmath}{undefined-macro}{\__skmath_total_derivative_d:n} +} \end{MacroCode} Then, the key-value options. \begin{MacroCode}{package} @@ -349,6 +368,10 @@ Then, the key-value options. imaginary-unit / slanted .code:n = { \cs_gset_nopar:Npn\__skmath_imaginary_unit:n##1{{##1}} }, complex-part-symbols .bool_set_inverse:N = \g__skmath_iso_complex_parts_bool, complex-part-symbols .value_required:n = true, + total-derivative-d .choice:, + total-derivative-d .value_required:n = true, + total-derivative-d / upright .code:n = { \cs_gset_nopar:Npn\__skmath_total_derivative_d:{{\operator@font d}} }, + total-derivative-d / slanted .code:n = { \cs_gset_nopar:Npn\__skmath_total_derivative_d:{{d}} }, } \end{MacroCode} @@ -366,6 +389,7 @@ We also declare the \enquote{public} options. natural-log = upright, imaginary-unit = upright, complex-part-symbols = false, + total-derivative-d = upright, }, notation / german .meta:nn = {skmath / internal}{ integral-d = upright, @@ -373,6 +397,7 @@ We also declare the \enquote{public} options. natural-log = slanted, %??? imaginary-unit = slanted, %??? complex-part-symbols = true, %??? + total-derivative-d = upright, %??? }, notation / english .meta:nn = {skmath / internal}{ integral-d = slanted, @@ -380,6 +405,7 @@ We also declare the \enquote{public} options. natural-log = slanted, %??? imaginary-unit = slanted, %??? complex-part-symbols = true, %??? + total-derivative-d = slanted, %??? }, notation / legacy .meta:nn = {skmath / internal}{ integral-d = upright, @@ -387,6 +413,7 @@ We also declare the \enquote{public} options. natural-log = slanted, imaginary-unit = slanted, complex-part-symbols = true, + total-derivative-d = slanted, }, % Possibly more style sets... ? notation .initial:n = legacy, % Or is it? Perhaps a legacy option is required. @@ -696,6 +723,11 @@ We optionally load \pkg{isomath}, depending on notation style. } \end{MacroCode} \end{macro} + \begin{macro}{\ee} + \begin{MacroCode}{package} + \DeclareDocumentCommand\ee{}{\ensuremath{\__skmath_natural_log_e:}} + \end{MacroCode} + \end{macro} \begin{macro}{\exp} \changes{0.1b}{Moved to \textsf{xparse} command definition} \changes{0.3a}{Added starred variant} @@ -778,7 +810,7 @@ We optionally load \pkg{isomath}, depending on notation style. \end{MacroCode} \end{macro} - We introduce a couple of helper macros for the \cs{pd} macro backend. + We introduce a couple of helper macros for \cs{pd} and \cs{td}. \begin{macro*}{\__skmath_if_numerical_p:n} \begin{macro*}{\__skmath_if_numerical:nT} \begin{macro*}{\__skmath_if_numerical:nF} @@ -926,8 +958,26 @@ We optionally load \pkg{isomath}, depending on notation style. } \end{MacroCode} \end{macro*} + \begin{macro*}{\__skmath_td_fraction:nn}[2] + {Tokens representing a mathematical function} + {A single variable, possibly with a superscript} +\begin{MacroCode}{package} +\cs_new_nopar:Npn\__skmath_td_fraction:nn#1#2{ + \frac{ + \__skmath_total_derivative_d: + \__skmath_pd_if_vars_sum_above_one:nT{#2}{ + \c_math_superscript_token{\__skmath_pd_vars_sum:n{#2}} + } + {#1} + }{ + \__skmath_total_derivative_d: + #2 + } +} +\end{MacroCode} + \end{macro*} - Definition of \cs{bar}, \cs{pd} and \cs{d} is deferred until after all + Definition of \cs{bar}, \cs{pd}, \cs{td} and \cs{d} is deferred until after all packages are loaded to avoid collisions with other packages. \begin{MacroCode}{package} \AtBeginDocument{% @@ -959,6 +1009,19 @@ We optionally load \pkg{isomath}, depending on notation style. \end{MacroCode} \end{macro} + We also have the total derivative macro, + \begin{macro}{\td}[2] + {Tokens representing a mathematical function} + {A single variable, possibly with a superscript} +\begin{MacroCode}{package} +\DeclareDocumentCommand\td{mm}{ + \ensuremath{ + \__skmath_td_fraction:nn{#1}{#2} + } +} +\end{MacroCode} + \end{macro} + We introduce a command to typeset the differential part of integrals, shamefully stolen from an answer on \TeX.SE. \begin{macro}{\d} |