From: Hironori Kitagawa Date: Sat, 31 Dec 2011 22:14:17 +0000 (+0900) Subject: Fix the definition of \reDeclareMathAlphabet. X-Git-Tag: 20120419.0~23 X-Git-Url: http://git.osdn.jp/view?a=commitdiff_plain;h=6d454905533da63fff29ca08cb90b9215db51b80;p=luatex-ja%2Fluatexja.git Fix the definition of \reDeclareMathAlphabet. --- diff --git a/src/patches/lltjfont.sty b/src/patches/lltjfont.sty index 9de9eb7..ea75d3e 100644 --- a/src/patches/lltjfont.sty +++ b/src/patches/lltjfont.sty @@ -230,15 +230,20 @@ \fi \endgroup } +\def\DLMfontsw@standard#1#2#3{#1{#2{#3}}} \def\reDeclareMathAlphabet#1#2#3{% \ifdefined#2 - \ifdefined#3 - \toks0\expandafter{#3}% - \@temptokena\expandafter{#2}% - \long\protected\edef#1##1{\the\@temptokena{\the\toks0{##1}}}% - \else\let#1#2\fi + \@temptokena\expandafter{#2}% \else - \ifdefined#3\let#1#3\fi\fi + \@temptokena{#2}% + \fi + \ifdefined#3 + \toks0\expandafter{#3}% + \else + \toks0{#3}% + \fi + \long\protected\edef#1{% + \noexpand\DLMfontsw@standard{\the\@temptokena}{\the\toks0}}% } \@onlypreamble\reDeclareMathAlphabet \def\all@shape{all}% diff --git a/test/test07-math-unicode.pdf b/test/test07-math-unicode.pdf index c691232..e525190 100644 Binary files a/test/test07-math-unicode.pdf and b/test/test07-math-unicode.pdf differ diff --git a/test/test07-math-unicode.tex b/test/test07-math-unicode.tex index b617db2..0b63236 100644 --- a/test/test07-math-unicode.tex +++ b/test/test07-math-unicode.tex @@ -1,16 +1,21 @@ %#!lualatex -\documentclass{article} +\documentclass{ltjsarticle} \usepackage[a4paper]{geometry} +\makeatletter\ltj@alljachar %←全部の(>=U+0080な)文字を和文文字扱いに! \usepackage{luatexja-fontspec} +\usepackage{unicode-math} -\usepackage{luatexja} -\makeatletter\ltj@alljachar %←全部の(>=U+0080な)文字を和文文字扱いに! -\usepackage{unicode-math} \setmathfont{XITSMath} \setmainjfont{IPAGothic} +\makeatletter +\reDeclareMathAlphabet{\mathtestA}{\mathrm}{\mathmc} +\reDeclareMathAlphabet{\mathtestB}{\mathrm}{\mathtestb} +\reDeclareMathAlphabet{\mathtestC}{\mathtesta}{\mathmc} +\reDeclareMathAlphabet{\mathtestD}{\mathtesta}{\mathtestb} +\reDeclareMathAlphabet{\mathtestE}{\mathtestE}{\mathmc} \begin{document}\makeatletter \[ @@ -19,16 +24,28 @@ =\frac16\cdot \pi\times\pi,\qquad a_1,\dots,a_n. \] -$ - \frac1{1^2}+\frac1{2^2}+\cdots= -\sum_{n=1}^\infty \frac1{n^s\zeta}=\zeta(2)=\frac{\pi^2}{6} -=\frac16\cdot \pi\times\pi,\qquad a_1,\dots,a_n. \hbar -$ +$\hslash$ + +○×○漢×漢\times え\ltjjachar`\“え\ltjalchar`\“え\textquotedblleft え“え←数式外では和文文字扱いのままになっている. + +\kanjifamily{mc}\selectfont +$あいうえおabcde a^\mathrm{b}$ + +mathrm: $\mathrm{\alpha あいうえおabcde}^\mathrm{b}$ + +mathbf: $\mathbf{\alpha あいうえおabcde}$ + +mathmc: $\mathmc{\alpha あいうえおabcde}$ + +mathgt: $\mathgt{\alpha あいうえおabcde}$ + +\tt\meaning\mathtestA + +\tt\meaning\mathtestB -{\tt\meaning\sum} +\tt\meaning\mathtestC +\tt\meaning\mathtestD -○×○漢\ltjjachar`\×漢\ltjalchar`\×漢\times 漢 -え\ltjjachar`\“え\ltjalchar`\“え\textquotedblleft え“え -←数式外では和文文字扱いのままになっている. +\tt\meaning\mathtestE \end{document} diff --git a/test/test07-math.pdf b/test/test07-math.pdf index dee24fc..19df1ed 100644 Binary files a/test/test07-math.pdf and b/test/test07-math.pdf differ diff --git a/test/test07-math.tex b/test/test07-math.tex index e2431db..00fc626 100644 --- a/test/test07-math.tex +++ b/test/test07-math.tex @@ -47,4 +47,17 @@ mathgt: $\mathrm{\mathmc{あa}}\mathmc{あb}\mathgt{あa}$ \s {\textstyle \s} {\scriptstyle \s} {\scriptscriptstyle \s} \] + + +\kanjifamily{mc}\selectfont +$あいうえおabcde a^\mathrm{b}$ + +mathrm: $\mathrm{あいうえおabcde}$ + +mathbf: $\mathbf{あいうえおabcde}$ + +mathmc: $\mathmc{あいうえおabcde}$ + +mathgt: $\mathgt{あいうえおabcde}$ \end{document} +