%% %% jpnedumathsymbols.sty %% for making handouts in Japanese Education %% %% Copyright (C) 2022 Yukoh KUSAKABE (screen-name) %% https://www.metaphysica.info/ %% https://twitter.com/metaphysicainfo %% %% This package released under %% [the MIT license](https://ctan.org/license/mit). %% % \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{jpnedumathsymbols}[2022/07/10 v1.1] % %% [nofrac] \newif\if@jpnedu@symbol@nofrac \@jpnedu@symbol@nofracfalse \DeclareOption{nofrac}{\@jpnedu@symbol@nofractrue}% % %% [nosqrt] \newif\if@jpnedu@symbol@nosqrt \@jpnedu@symbol@nosqrtfalse \DeclareOption{nosqrt}{\@jpnedu@symbol@nosqrttrue}% % %% [nolim] \newif\if@jpnedu@symbol@nolim \@jpnedu@symbol@nolimfalse \DeclareOption{nolim}{\@jpnedu@symbol@nolimtrue}% % %% [novec] \newif\if@jpnedu@symbol@novec \@jpnedu@symbol@novecfalse \DeclareOption{novec}{\@jpnedu@symbol@novectrue}% % %% [nopointroman] \newif\if@jpnedu@symbol@nopointroman \@jpnedu@symbol@nopointromanfalse \DeclareOption{nopointroman}{\@jpnedu@symbol@nopointromantrue}% % %% [curriculum][nocurriculum] \newif\if@jpnedu@symbol@nocurriculum \@jpnedu@symbol@nocurriculumtrue \DeclareOption{nocurriculum}{\@jpnedu@symbol@nocurriculumtrue}% \DeclareOption{curriculum}{\@jpnedu@symbol@nocurriculumfalse}% % %% [mathbb] \newif\if@jpnedu@symbol@mathbb \@jpnedu@symbol@mathbbfalse \DeclareOption{mathbb}{\@jpnedu@symbol@mathbbtrue} % %% [setcolon] \newif\if@jpnedu@symbol@setcolon \@jpnedu@symbol@setcolonfalse \DeclareOption{setcolon}{\@jpnedu@symbol@setcolontrue} % %% [rvecbracket] \newif\if@jpnedu@symbol@rvecbracket% \@jpnedu@symbol@rvecbracketfalse \DeclareOption{rvecbracket}{\@jpnedu@symbol@rvecbrackettrue} %% [cvecbracket] \newif\if@jpnedu@symbol@cvecbracket% \@jpnedu@symbol@cvecbracketfalse \DeclareOption{cvecbracket}{\@jpnedu@symbol@cvecbrackettrue} %% [innerproductbracket] \newif\if@jpnedu@symbol@innerproductbracket% \@jpnedu@symbol@innerproductbracketfalse \DeclareOption{innerproductbracket}{\@jpnedu@symbol@innerproductbrackettrue} % %% [lua] \newif\if@jpnedu@symbol@lua \@jpnedu@symbol@luafalse \DeclareOption{lua}{\@jpnedu@symbol@luatrue}% % \ExecuteOptions{} \ProcessOptions\relax % % for \begin{bmatrix} % \begin{cmatrix} \RequirePackage{amsmath} \RequirePackage{amssymb} % % for \NewDocumentEnvironment \RequirePackage{xparse} % % for \begin{empheq} \RequirePackage{empheq} % %%% %% FRAC %%% % \if@jpnedu@symbol@nofrac \else % %% \originalfrac \let\originalfrac\frac % %% \frac \renewcommand{\frac}[2]{\mathchoice% {{\displaystyle\originalfrac{\raisebox{-0.42ex}{$\,#1\,$}}{\raisebox{0.1ex}{$\,#2\,$}}}}% {{\displaystyle\originalfrac{\raisebox{-0.42ex}{$\,#1\,$}}{\raisebox{0.1ex}{$\,#2\,$}}}}% {\originalfrac{#1}{#2}}% {\originalfrac{#1}{#2}}% }% % \fi % %%% %% SQRT %%% % \if@jpnedu@symbol@nosqrt \else % %% \originalsqrt \let\originalsqrt\sqrt % %% \sqrt \renewcommand{\sqrt}[2][\phantom{1}]{\mathchoice% {\!\originalsqrt[\leftroot{-1}\uproot{0}#1]{\vphantom{(}#2\hspace{1pt}}}% {\!\originalsqrt[\leftroot{-1}\uproot{0}#1]{\vphantom{(}#2\hspace{1pt}}}% {\originalsqrt[#1]{#2}}% {\originalsqrt[#1]{#2}}} % \fi % %%% %% LIM %%% % \if@jpnedu@symbol@nolim \else % %% \originallim \let\originallim\lim % %% \lim \renewcommand{\lim}{\originallim\limits} % \fi % %%% %% VEC %%% % \if@jpnedu@symbol@novec \else % %% \originalvec \let\originalvec\vec % %% \vec \DeclareRobustCommand{\vec}[1]% {\hspace{-1pt}\overrightarrow{\hspace{1pt}\vphantom{T}#1\hspace{1pt}}\hspace{-1pt}} %{\overrightarrow{\hspace{1pt}\vphantom{T}#1\hspace{1pt}}} % \fi % %%% %% POINTROMAN %%% % \if@jpnedu@symbol@nopointroman \else % %% \angstrom \let\angstrom\AA % %% \capitaleszett \let\capitaleszett\SS % %% \AA -- \ZZ \DeclareRobustCommand\AA{\mathrm{A}} \DeclareRobustCommand\BB{\mathrm{B}} \DeclareRobustCommand\CC{\mathrm{C}} \DeclareRobustCommand\DD{\mathrm{D}} \DeclareRobustCommand\EE{\mathrm{E}} \DeclareRobustCommand\FF{\mathrm{F}} \DeclareRobustCommand\GG{\mathrm{G}} \DeclareRobustCommand\HH{\mathrm{H}} \DeclareRobustCommand\II{\mathrm{I}} \DeclareRobustCommand\JJ{\mathrm{J}} \DeclareRobustCommand\KK{\mathrm{K}} \DeclareRobustCommand\LL{\mathrm{L}} \DeclareRobustCommand\MM{\mathrm{M}} \DeclareRobustCommand\NN{\mathrm{N}} \DeclareRobustCommand\OO{\mathrm{O}} \DeclareRobustCommand\PP{\mathrm{P}} \DeclareRobustCommand\QQ{\mathrm{Q}} \DeclareRobustCommand\RR{\mathrm{R}} \DeclareRobustCommand\SS{\mathrm{S}} \DeclareRobustCommand\TT{\mathrm{T}} \DeclareRobustCommand\UU{\mathrm{U}} \DeclareRobustCommand\VV{\mathrm{V}} \DeclareRobustCommand\WW{\mathrm{W}} \DeclareRobustCommand\XX{\mathrm{X}} \DeclareRobustCommand\YY{\mathrm{Y}} \DeclareRobustCommand\ZZ{\mathrm{Z}} % \fi % %%% %% CURRICULUM %%% % \if@jpnedu@symbol@nocurriculum \else % % for \ajroman \if@jpnedu@symbol@lua \RequirePackage{luatexja-otf} \else \RequirePackage{otf} \fi % %% \mathI \mathA \mathIA etc. \DeclareRobustCommand{\currI}{\ajRoman{1}} \DeclareRobustCommand{\currII}{\ajRoman{2}} \DeclareRobustCommand{\currIII}{\ajRoman{3}} \DeclareRobustCommand{\currA}{A} \DeclareRobustCommand{\currB}{B} \DeclareRobustCommand{\currC}{C} \DeclareRobustCommand{\currD}{D} \DeclareRobustCommand{\currE}{E} \DeclareRobustCommand{\currF}{F} \DeclareRobustCommand{\currG}{G} \DeclareRobustCommand{\currH}{H} \DeclareRobustCommand{\currI}{I} \DeclareRobustCommand{\currJ}{J} \DeclareRobustCommand{\currK}{K} \DeclareRobustCommand{\currL}{L} \DeclareRobustCommand{\currM}{M} \DeclareRobustCommand{\currN}{N} \DeclareRobustCommand{\currO}{O} \DeclareRobustCommand{\currP}{P} \DeclareRobustCommand{\currQ}{Q} \DeclareRobustCommand{\currR}{R} \DeclareRobustCommand{\currS}{S} \DeclareRobustCommand{\currT}{T} \DeclareRobustCommand{\currU}{U} \DeclareRobustCommand{\currV}{V} \DeclareRobustCommand{\currW}{W} \DeclareRobustCommand{\currX}{X} \DeclareRobustCommand{\currY}{Y} \DeclareRobustCommand{\currZ}{Z} \DeclareRobustCommand{\curra}{a} \DeclareRobustCommand{\currb}{b} \DeclareRobustCommand{\currc}{c} \DeclareRobustCommand{\currd}{d} \DeclareRobustCommand{\curre}{e} \DeclareRobustCommand{\currf}{f} \DeclareRobustCommand{\currg}{g} \DeclareRobustCommand{\currh}{h} \DeclareRobustCommand{\curri}{i} \DeclareRobustCommand{\currj}{j} \DeclareRobustCommand{\currk}{k} \DeclareRobustCommand{\currl}{l} \DeclareRobustCommand{\currm}{m} \DeclareRobustCommand{\currn}{n} \DeclareRobustCommand{\curro}{o} \DeclareRobustCommand{\currp}{p} \DeclareRobustCommand{\currq}{q} \DeclareRobustCommand{\currr}{r} \DeclareRobustCommand{\currs}{s} \DeclareRobustCommand{\currt}{t} \DeclareRobustCommand{\curru}{u} \DeclareRobustCommand{\currv}{v} \DeclareRobustCommand{\currw}{w} \DeclareRobustCommand{\currx}{x} \DeclareRobustCommand{\curry}{y} \DeclareRobustCommand{\currz}{z} \DeclareRobustCommand{\curralpha}{α} \DeclareRobustCommand{\currbeta}{β} \DeclareRobustCommand{\currgamma}{γ} \DeclareRobustCommand{\currdelta}{δ} \DeclareRobustCommand{\currepsilon}{ε} \DeclareRobustCommand{\currzeta}{ζ} \DeclareRobustCommand{\curreta}{η} \DeclareRobustCommand{\currtheta}{θ} \DeclareRobustCommand{\curriota}{ι} \DeclareRobustCommand{\currkappa}{κ} \DeclareRobustCommand{\currlambda}{λ} \DeclareRobustCommand{\currmu}{μ} \DeclareRobustCommand{\currnu}{ν} \DeclareRobustCommand{\currxi}{ξ} \DeclareRobustCommand{\curromicron}{ο} \DeclareRobustCommand{\currpai}{π} \DeclareRobustCommand{\currrho}{ρ} \DeclareRobustCommand{\currsigma}{σ} \DeclareRobustCommand{\currtau}{τ} \DeclareRobustCommand{\currupsilon}{υ} \DeclareRobustCommand{\currphi}{φ} \DeclareRobustCommand{\currchi}{χ} \DeclareRobustCommand{\currpsi}{ψ} \DeclareRobustCommand{\curromega}{ω} \DeclareRobustCommand{\currIA}{\@ifstar{\@jpnedu@symbol@currIA@star}{\@jpnedu@symbol@currIA@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@currIA@star}{\ajRoman{1}+A} \DeclareRobustCommand{\@jpnedu@symbol@currIA@nostar}{\ajRoman{1}A} \DeclareRobustCommand{\currIIB}{\@ifstar{\@jpnedu@symbol@currIIB@star}{\@jpnedu@symbol@currIIB@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@currIIB@star}{\ajRoman{2}+B} \DeclareRobustCommand{\@jpnedu@symbol@currIIB@nostar}{\ajRoman{2}B} \DeclareRobustCommand{\currIIBC}{\@ifstar{\@jpnedu@symbol@currIIBC@star}{\@jpnedu@symbol@currIIBC@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@currIIBC@star}{\ajRoman{2}+B+C} \DeclareRobustCommand{\@jpnedu@symbol@currIIBC@nostar}{\ajRoman{2}BC} \DeclareRobustCommand{\currIIIC}{\@ifstar{\@jpnedu@symbol@currIIIC@star}{\@jpnedu@symbol@currIIIC@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@currIIIC@star}{\ajRoman{3}+C} \DeclareRobustCommand{\@jpnedu@symbol@currIIIC@nostar}{\ajRoman{3}C} \fi % %% \phantomheight \DeclareRobustCommand{\phantomheight}[1][\frac{1}{2}]{\vphantom{\raisebox{4pt}{\ensuremath{#1}}}\vphantom{\raisebox{-3pt}{\ensuremath{#1}}}} % %% \comma \DeclareRobustCommand{\comma}{\@ifstar{\@jpnedu@symbol@comma@star}{\@jpnedu@symbol@comma@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@comma@nostar}{,\,} \DeclareRobustCommand{\@jpnedu@symbol@comma@star}{\,,\,} %% \period \DeclareRobustCommand{\period}{\@ifstar{\@jpnedu@symbol@period@star}{\@jpnedu@symbol@period@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@period@nostar}{\text{。}\quad} \DeclareRobustCommand{\@jpnedu@symbol@period@star}{\,\text{。}\quad} % %% \pair{}{} \pair*{}{} %% \triplet{}{}{} \triplet*{}{} %% \quadruplet{}{}{}{} \quadruplet*{}{}{} \DeclareRobustCommand{\pair} {\@ifstar{\@jpnedu@symbol@pair@star}{\@jpnedu@symbol@pair@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@pair@star}[2]{(#1,\,#2)} \DeclareRobustCommand{\@jpnedu@symbol@pair@nostar}[2]{\left(#1,\,#2\right)} \DeclareRobustCommand{\triplet} {\@ifstar{\@jpnedu@symbol@triplet@star}{\@jpnedu@symbol@triplet@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@triplet@star}[3]{(#1,\,#2,\,#3)} \DeclareRobustCommand{\@jpnedu@symbol@triplet@nostar}[3]{\left(#1,\,#2,\,#3\right)} \DeclareRobustCommand{\quadruplet} {\@ifstar{\@jpnedu@symbol@quadruplet@star}{\@jpnedu@symbol@quadruplet@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@quadruplet@star}[4]{(#1,\,#2,\,#3,\,#4)} \DeclareRobustCommand{\@jpnedu@symbol@quadruplet@nostar}[4]{\left(#1,\,#2,\,#3,\,#4\right)} % %% \intersection %% \union \DeclareRobustCommand{\intersection}{\cap} \DeclareRobustCommand{\union}{\cup} % %% \complement{} \let\originalcmpl\cmpl \DeclareRobustCommand{\complement}[1]{\overline{\vphantom{T}#1}} \let\cmpl\complement % %% \tand %% \tor \DeclareRobustCommand{\tand}{\ensuremath{\mathbin{\text{かつ}}}} \DeclareRobustCommand{\tor}{\ensuremath{\mathbin{\text{または}}}} %% \eand %% \eor \DeclareRobustCommand{\eand}{\ensuremath{\mathbin{\text{and}}}} \DeclareRobustCommand{\eor}{\ensuremath{\mathbin{\text{or}}}} % %% \lto %% \lfrom %% \iff %% \plto %% \plfrom %% \piff \let\originaliff\iff \DeclareRobustCommand{\lto}{\ensuremath{\mathrel{\Longrightarrow}}} \DeclareRobustCommand{\lfrom}{\ensuremath{\mathrel{\Longleftarrow}}} \DeclareRobustCommand{\iff}{\ensuremath{\mathrel{\Longleftrightarrow}}} \DeclareRobustCommand{\plto}{\ensuremath{\mathrel{\phantom{\Longrightarrow}}}} \DeclareRobustCommand{\plfrom}{\ensuremath{\mathrel{\phantom{\Longlrftarrow}}}} \DeclareRobustCommand{\piff}{\ensuremath{\mathrel{\phantom{\Longleftrightarrow}}}} % %% \peq \DeclareRobustCommand{\peq}{\mathrel{\phantom{=}}} % %% \set{}{} %% ([setcolon]) \if@jpnedu@symbol@setcolon \DeclareRobustCommand{\set}[2]{\left\{\,#1\;;\;#2\,\right\}} \else \DeclareRobustCommand{\set}[2]{\left\{\,#1\;\middle|\;#2\,\right\}} \fi % %% \N \NZ \NP \Z \Q \R \C %% ([mathbb]) \if@jpnedu@symbol@mathbb \DeclareRobustCommand{\N}{\ensuremath{\mathbb{N}}} \DeclareRobustCommand{\NZ}{\ensuremath{\mathbb{N}_{0}}} \DeclareRobustCommand{\NP}{\ensuremath{\mathbb{N}_{+}}} \DeclareRobustCommand{\Z}{\ensuremath{\mathbb{Z}}} \DeclareRobustCommand{\Q}{\ensuremath{\mathbb{Q}}} \DeclareRobustCommand{\R}{\ensuremath{\mathbb{R}}} \DeclareRobustCommand{\C}{\ensuremath{\mathbb{C}}} \else \DeclareRobustCommand{\N}{\ensuremath{\mathbf{N}}} \DeclareRobustCommand{\NZ}{\ensuremath{\mathbf{N}_{0}}} \DeclareRobustCommand{\NP}{\ensuremath{\mathbf{N}_{+}}} \DeclareRobustCommand{\Z}{\ensuremath{\mathbf{Z}}} \DeclareRobustCommand{\Q}{\ensuremath{\mathbf{Q}}} \DeclareRobustCommand{\R}{\ensuremath{\mathbf{R}}} \DeclareRobustCommand{\C}{\ensuremath{\mathbf{C}}} \fi % %% \inverse{} \DeclareRobustCommand{\inverse}[1]{#1^{-1}} % %% \abs{} \abs*{} \let\originalabs\abs \DeclareRobustCommand{\abs} {\@ifstar{\@jpnedu@symbol@abs@star}{\@jpnedu@symbol@abs@nostar}} \DeclareRobustCommand{\@jpnedu@symbol@abs@star}[1]{\lvert#1\rvert} \DeclareRobustCommand{\@jpnedu@symbol@abs@nostar}[1]{\left\lvert#1\right\rvert} % %% \begin{cases} \DeclareDocumentEnvironment{ecases}{O{align*} m b}% {\vspace{0.25\baselineskip}\begin{empheq}[left={#2=\empheqlbrace\,}]{#1}{#3}\end{empheq}}% {\par\vspace{0.25\baselineskip}\noindent} % %% \begin{simul}{