diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/plautopatch/plsiunitx.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/plautopatch/plsiunitx.sty | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/plautopatch/plsiunitx.sty b/Master/texmf-dist/tex/latex/plautopatch/plsiunitx.sty new file mode 100644 index 00000000000..c76efed7bca --- /dev/null +++ b/Master/texmf-dist/tex/latex/plautopatch/plsiunitx.sty @@ -0,0 +1,76 @@ +% +% plsiunitx.sty +% written by Hironobu Yamashita (@aminophen) +% +% This package is part of the plautopatch bundle. +% https://github.com/aminophen/plautopatch +% (mostly based on lltjp-siunitx.sty 2018-11-02) +% +% This package is expected to be compatible with +% * siunitx.sty +% (????/??/?? v?.?? -- 2018/05/17 v2.7s) +% * plarray.sty in platex-tools +% (2018/03/01 v0.1d -- 2018/10/27 v0.1h) +% + +%% package declaration +\NeedsTeXFormat{pLaTeX2e} +\ProvidesPackage{plsiunitx} + [2018/11/03 v0.1 siunitx package for pLaTeX/upLaTeX] +\RequirePackageWithOptions{siunitx} +\RequirePackage{plarray}% siunitx requires array + +\ExplSyntaxOn + +%% patching internal code for siunitx.sty +% +%% inhibit JFM glue around tabular cell components (pLaTeX2e 2018/03/09) +\@ifl@t@r{\pfmtversion}{2017/07/29}{\@firstofone}{\@gobble} +{% = for pLaTeX2e 2017/07/29 or newer +%% new table column: S and s +\cs_set_protected:Npn \__siunitx_table_collect_not_braced:N #1 + { + \token_if_eq_meaning:NNF #1 \relax { + \token_if_eq_meaning:NNF #1 \pltx@next@inhibitglue { + \token_if_eq_meaning:NNF #1 \removejfmglue { + \token_if_eq_meaning:NNF #1 \tex_ignorespaces:D + { + \token_if_eq_meaning:NNF #1 \tex_unskip:D + { \__siunitx_table_collect_not_braced_aux_i:N #1 } + } + }}} + \__siunitx_table_collect_next: + } +\AtBeginDocument + { + \@ifpackageloaded { mdwtab } + { + \cs_set_protected:Npn \__siunitx_table_collect_not_braced:N #1 + { + \token_if_eq_meaning:NNF #1 \relax { + \token_if_eq_meaning:NNF #1 \pltx@next@inhibitglue { + \token_if_eq_meaning:NNF #1 \removejfmglue { + \token_if_eq_meaning:NNF #1 \tex_ignorespaces:D + { + \token_if_eq_meaning:NNF #1 \tex_unskip:D + { + \token_if_eq_meaning:NNF #1 \tab@setcr + { + \token_if_eq_meaning:NNF #1 \@maybe@unskip + { \__siunitx_table_collect_not_braced_aux_i:N #1 } + } + } + } + }}} + \__siunitx_table_collect_next: + } + } + { } + } +}% = +% +%% done + +\ExplSyntaxOff + +\endinput |