summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-01-05 23:22:43 +0000
committerKarl Berry <karl@freefriends.org>2015-01-05 23:22:43 +0000
commit250bec34ac809e833d21a84bc496f19a8c4a216e (patch)
tree68dd0bf7b47fb4db43574aa2fe1fab4ea036f0fa /Master/texmf-dist/tex
parent1e851d05e5a6bf3a5b4b99135e5d1d7841c92076 (diff)
skmath (5jan15)
git-svn-id: svn://tug.org/texlive/trunk@35968 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r--Master/texmf-dist/tex/latex/skmath/skmath.sty124
1 files changed, 107 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/skmath/skmath.sty b/Master/texmf-dist/tex/latex/skmath/skmath.sty
index c833b397a3f..8ace6a186b0 100644
--- a/Master/texmf-dist/tex/latex/skmath/skmath.sty
+++ b/Master/texmf-dist/tex/latex/skmath/skmath.sty
@@ -1,7 +1,7 @@
%% This is file `skmath.sty', generated from `skmath.tex' (key `package').
%% skmath improved math commands
%%
-%% Copyright (C) 2012-2014 by Simon Sigurdhsson <sigurdhsson@gmail.com>
+%% Copyright (C) 2012-2015 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
@@ -20,9 +20,90 @@
\RequirePackage{expl3,l3keys2e,xparse}
\ProvidesExplPackage{skmath}
- {2014/06/13}{0.3b}{improved math commands}
+ {2015/01/05}{0.4}{improved math commands}
\PassOptionsToPackage{intlimits,sumlimits,namelimits}{amsmath}
-\RequirePackage{amssymb,mathtools,xfrac,isomath}
+\RequirePackage{amssymb,mathtools,xfrac}
+\msg_new:nnnn{skmath}{undefined-macro}{The~macro~`\token_to_str:N#1'~was~undefined!}
+ {This~is~an~error~in~the~notation~option~handling.~Please~file~an~issue\\
+ on~Github~(https://github.com/urdh/skmath/issues)~with~a~copy~of~this\\
+ message~attached~as~well~as~a~list~of~the~options~passed~to~`skmath'.}
+\cs_gset_nopar:Npn\__skmath_integral_d:{
+ \msg_critical:nnn{skmath}{undefined-macro}{\__skmath_integral_d:}
+}
+\cs_gset_nopar:Npn\__skmath_natural_log_e:{
+ \msg_critical:nnn{skmath}{undefined-macro}{\__skmath_natural_log_e:}
+}
+\cs_gset_nopar:Npn\__skmath_imaginary_unit:n#1{
+ \msg_critical:nnn{skmath}{undefined-macro}{\__skmath_imaginary_unit:n}
+}
+\keys_define:nn{skmath / internal}{
+ % More on this:
+ % * http://en.wikipedia.org/wiki/Typographical_conventions_in_mathematical_formulae
+ % * ISO 80000-2
+ % * http://www.tug.org/TUGboat/Articles/tb18-1/tb54becc.pdf
+ % * http://tex.stackexchange.com/q/14821/66
+ integral-d .choice:,
+ integral-d .value_required:,
+ integral-d / upright .code:n = { \cs_gset_nopar:Npn\__skmath_integral_d:{{\operator@font d}} },
+ integral-d / slanted .code:n = { \cs_gset_nopar:Npn\__skmath_integral_d:{{d}} },
+ isomath .bool_set:N = \g__skmath_load_isomath_bool,
+ isomath .value_required:,
+ natural-log .choice:,
+ natural-log .value_required:,
+ natural-log / upright .code:n = { \cs_gset_nopar:Npn\__skmath_natural_log_e:{{\operator@font e}} },
+ natural-log / slanted .code:n = { \cs_gset_nopar:Npn\__skmath_natural_log_e:{{e}} },
+ imaginary-unit .choice:,
+ imaginary-unit .value_required:,
+ imaginary-unit / upright .code:n = { \cs_gset_nopar:Npn\__skmath_imaginary_unit:n##1{{\operator@font ##1}} },
+ 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:,
+}
+\keys_define:nn{skmath}{
+ commonsets .bool_set:N = \g__skmath_define_common_sets_bool,
+ commonsets .default:n = true,
+ commonsets .initial:n = false,
+ % TODO: write tests for the notation option
+ notation .choice:,
+ notation / iso .meta:nn = {skmath / internal}{
+ integral-d = upright,
+ isomath = true,
+ natural-log = upright,
+ imaginary-unit = upright,
+ complex-part-symbols = false,
+ },
+ notation / german .meta:nn = {skmath / internal}{
+ integral-d = upright,
+ isomath = true,
+ natural-log = slanted, %???
+ imaginary-unit = slanted, %???
+ complex-part-symbols = true, %???
+ },
+ notation / english .meta:nn = {skmath / internal}{
+ integral-d = slanted,
+ isomath = true,
+ natural-log = slanted, %???
+ imaginary-unit = slanted, %???
+ complex-part-symbols = true, %???
+ },
+ notation / legacy .meta:nn = {skmath / internal}{
+ integral-d = upright,
+ isomath = true,
+ natural-log = slanted,
+ imaginary-unit = slanted,
+ complex-part-symbols = true,
+ },
+ % Possibly more style sets... ?
+ notation .initial:n = legacy, % Or is it? Perhaps a legacy option is required.
+ notation .value_required:,
+ % Note also that the styles should probably affect isomath and/or other packages.
+}
+\ProcessKeysOptions{skmath}
+\bool_if:NTF\g__skmath_load_isomath_bool{
+ \RequirePackage{isomath}
+}{
+ % TODO: check if there is an alternative package we should load here.
+}
\prg_new_conditional:Npnn\__skmath_if_novalue_or_empty:n#1{F}{
\IfNoValueTF{#1}{
\prg_return_true:
@@ -37,13 +118,27 @@
\cs_new_nopar:Npn\__skmath_parens:n#1{
\__skmath_if_novalue_or_empty:nF{#1}{\left(#1\right)}
}
-\cs_new:Nn\__skmath_define_common_sets:{
+\bool_if:NT\g__skmath_define_common_sets_bool{
\NewDocumentCommand\N{}{\ensuremath{\mathbb{N}}}
\NewDocumentCommand\Z{}{\ensuremath{\mathbb{Z}}}
\NewDocumentCommand\Q{}{\ensuremath{\mathbb{Q}}}
\NewDocumentCommand\R{}{\ensuremath{\mathbb{R}}}
\NewDocumentCommand\C{}{\ensuremath{\mathbb{C}}}
}
+\DeclareDocumentCommand\ii{}{\ensuremath{\__skmath_imaginary_unit:n{i}}}
+\DeclareDocumentCommand\jj{}{\ensuremath{\__skmath_imaginary_unit:n{j}}}
+\bool_if:NTF\g__skmath_iso_complex_parts_bool{
+ \cs_new_eq:NN\__skmath_Re:\Re
+ \DeclareDocumentCommand\Re{m}{\ensuremath{\__skmath_Re:\__skmath_parens:n{#1}}}
+}{
+ \DeclareDocumentCommand\Re{m}{\ensuremath{{\operator@font Re}{#1}}}
+}
+\bool_if:NTF\g__skmath_iso_complex_parts_bool{
+ \cs_new_eq:NN\__skmath_Im:\Im
+ \DeclareDocumentCommand\Im{m}{\ensuremath{\__skmath_Im:\__skmath_parens:n{#1}}}
+}{
+ \DeclareDocumentCommand\Im{m}{\ensuremath{{\operator@font Im}{#1}}}
+}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\DeclarePairedDelimiter\norm{\lVert}{\rVert}
\AtBeginDocument{
@@ -61,12 +156,12 @@
\right)%
}%
}
- \DeclareDocumentCommand\var{m}{%
- \ensuremath{\operatorname{Var}\left(#1\right)}%
- }
- \DeclareDocumentCommand\cov{mm}{%
- \ensuremath{\operatorname{Cov}\left(#1,#2\right)}%
- }
+\DeclareDocumentCommand\var{m}{%
+ \ensuremath{\operatorname{Var}\left(#1\right)}%
+}
+\DeclareDocumentCommand\cov{mm}{%
+ \ensuremath{\operatorname{Cov}\left(#1,#2\right)}%
+}
\cs_new_eq:NN\__skmath_sin:\sin
\cs_new_eq:NN\__skmath_cos:\cos
\cs_new_eq:NN\__skmath_tan:\tan
@@ -141,7 +236,7 @@
\__skmath_exp:\__skmath_parens:n{#2}
}{
\mathchoice
- {e\c_math_superscript_token{#2}}
+ {\__skmath_natural_log_e:\c_math_superscript_token{#2}}
{\__skmath_exp:\left(#2\right)}
{\__skmath_exp:\left(#2\right)}
{\__skmath_exp:\left(#2\right)}
@@ -282,14 +377,9 @@
{\__skmath_pd_fraction:nn{#2}{#3}}
}
}
-\DeclareDocumentCommand\d{m}{\ensuremath{\,{\operator@font d}#1%
+\DeclareDocumentCommand\d{m}{\ensuremath{\,\__skmath_integral_d: #1%
\peek_meaning_ignore_spaces:NT\d{\!}}}
}
\cs_set_eq:NN\vec\vectorsym
-\keys_define:nn{skmath}{
- commonsets .code:n =
- {\__skmath_define_common_sets:}
-}
-\ProcessKeysOptions{skmath}
\endinput