OSDN Git Service

Fix the definition of \reDeclareMathAlphabet.
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 31 Dec 2011 22:14:17 +0000 (07:14 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 31 Dec 2011 22:14:17 +0000 (07:14 +0900)
src/patches/lltjfont.sty
test/test07-math-unicode.pdf
test/test07-math-unicode.tex
test/test07-math.pdf
test/test07-math.tex

index 9de9eb7..ea75d3e 100644 (file)
       \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}%
index c691232..e525190 100644 (file)
Binary files a/test/test07-math-unicode.pdf and b/test/test07-math-unicode.pdf differ
index b617db2..0b63236 100644 (file)
@@ -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
 
 \[
 =\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}
index dee24fc..19df1ed 100644 (file)
Binary files a/test/test07-math.pdf and b/test/test07-math.pdf differ
index e2431db..00fc626 100644 (file)
@@ -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}
+