• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: Commit

ソースコードの管理場所


Commit MetaInfo

Revision43ce654cd7265acfa4840e2417e84516204db1aa (tree)
Time2018-08-23 22:55:35
AuthorHironori Kitagawa <h_kitagawa2001@yaho...>
CommiterHironori Kitagawa

Log Message

ltj-latex.sty etc.: reworked patching

Change Summary

Incremental Difference

--- a/src/ltj-latex.sty
+++ b/src/ltj-latex.sty
@@ -31,10 +31,6 @@
3131
3232 \def\ltj@pkgpatch#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}}
3333
34-% similar to \ltj@pkgpatch, but this is used .sty which
35-% can be reloaded inside the document by \input.
36-\def\ltj@pkgpatchA#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}}
37-
3834 \endlinechar=13
3935
4036 %%% patch for LaTeX
@@ -42,6 +38,11 @@
4238 \usepackage{lltjdefs}
4339 \usepackage{lltjcore}
4440
41+\RequirePackage{filehook}
42+\def\ltj@pkgpatch@im#1{%
43+ \@ifnextchar[{\ltj@pkgpatch@im@{#1}}{\ltj@pkgpatch@im@{#1}[lltjp-#1]}}%]
44+\def\ltj@pkgpatch@im@#1[#2]{\AtEndOfPackageFile*{#1}{\input{#2.sty}}}
45+
4546 %%% default parameters
4647 \directlua{
4748 local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
@@ -58,36 +59,25 @@
5859 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
5960
6061 %%% patch for packages
61-\ltj@pkgpatch{listings}
62-\ltj@pkgpatch{xunicode}
63-\ltj@pkgpatch{fontspec}
64-\ltj@pkgpatch{footmisc}
62+\ltj@pkgpatch@im{listings}
63+\ltj@pkgpatch{xunicode} %% at \begin{document}
64+\ltj@pkgpatch{fontspec} %% at \begin{document}
65+\ltj@pkgpatch@im{fontspec}[lltjp-fontspec-immediate]
66+\ltj@pkgpatch{footmisc} %% at \begin{document}
6567 \ltj@pkgpatch{tascmac}
6668 \ltj@AtBeginDocument{\@ifpackageloaded{ascmac}{%
6769 \edef\ltj@asc@temp{\noexpand\catcode`\noexpand\@=\the\catcode`\@}%
6870 \makeatletter\input{lltjp-tascmac.sty}%
6971 \ltj@asc@temp\let\ltj@asc@temp=\relax
7072 }{}}% ascmac
71-\ltj@pkgpatch{stfloats}
72-\ltj@pkgpatch{preview}
73-\ltj@pkgpatch{array}
73+\ltj@pkgpatch@im{stfloats}
74+\ltj@pkgpatch{preview} %% at \begin{document}
75+ % (preview package has delayed option)
76+\ltj@pkgpatch{array} %% at \begin{document}
77+\ltj@pkgpatch@im{unicode-math}
78+\ltj@pkgpatch@im{siunitx}
7479
7580 \RequirePackage{lltjp-geometry}
76-\RequirePackage{filehook}
77-\AtEndOfPackageFile*{fontspec}{%
78- \input{lltjp-fontspec-immediate.sty}
79- % \RequirePackage だと fontspec にオプション指定したときにエラー出る
80-}
81-\AtEndOfPackageFile*{unicode-math}{%
82- \input{lltjp-unicode-math-immediate.sty}
83-}
84-
85-\@ifpackageloaded{siunitx}{%
86- \chardef\ltj@patch@siunitx@execute\z@\input{lltjp-siunitx.sty}%
87-}{%
88- \AtBeginOfPackageFile*{siunitx}{\input{lltjp-siunitx.sty}}%
89-}
90-\AtEndOfPackageFile*{siunitx}{\csname __ltj_siunitx_patch:\endcsname}
9181
9282 %%------------------ all done
9383 \ltj@latex@AtEnd
--- a/src/patches/lltjp-siunitx.sty
+++ b/src/patches/lltjp-siunitx.sty
@@ -18,17 +18,13 @@
1818 \__ltj_siunix_patch_inner:n { l__siunitx_#1_math }
1919 \__ltj_siunix_patch_inner:n { l__siunitx_#1_text }
2020 }
21-\cs_new:Nn \__ltj_siunitx_patch: {
22- \AtBeginDocument {
23- \__ltj_siunix_patch_inner:n { c__siunitx_minus }
24- \__ltj_siunix_patch_inner:n { c__siunitx_mu }
25- \__ltj_siunix_patch_inner_math:n { angstrom }
26- \__ltj_siunix_patch_inner_math:n { arcminute }
27- \__ltj_siunix_patch_inner_math:n { arcsecond }
28- \__ltj_siunix_patch_inner_math:n { ohm }
29- }
21+\AtBeginDocument {
22+ \__ltj_siunix_patch_inner:n { c__siunitx_minus }
23+ \__ltj_siunix_patch_inner:n { c__siunitx_mu }
24+ \__ltj_siunix_patch_inner_math:n { angstrom }
25+ \__ltj_siunix_patch_inner_math:n { arcminute }
26+ \__ltj_siunix_patch_inner_math:n { arcsecond }
27+ \__ltj_siunix_patch_inner_math:n { ohm }
3028 }
31-\ifdefined\ltj@patch@siunitx@executed\__ltj_siunitx_patch:\fi
32-
3329 \ExplSyntaxOff
3430 \endinput
Binary files a/test/test07-math-unicode.pdf and b/test/test07-math-unicode.pdf differ
--- a/test/test07-math-unicode.tex
+++ b/test/test07-math-unicode.tex
@@ -1,23 +1,23 @@
11 %#!lualatex
2-\documentclass{ltjsarticle}
2+\documentclass{article}
33 \usepackage[a4paper]{geometry}
4-\makeatletter\ltj@alljachar %←全部の(>=U+0080な)文字を和文文字扱いに!
4+\makeatletter
55
6-\usepackage{luatexja-fontspec}
76 \usepackage{unicode-math}
87
9-
10-\setmathfont{XITSMath}
8+\usepackage{luatexja-fontspec}
119 \setmainjfont{IPAGothic}
10+\setmathfont{XITSMath}
11+
12+\ltj@alljachar %←全部の(>=U+0080な)文字を和文文字扱いに!
13+\setmainfont{TexGyreTermes}
1214
13-\makeatletter
1415 \reDeclareMathAlphabet{\mathtestA}{\mathrm}{\mathmc}
1516 \reDeclareMathAlphabet{\mathtestB}{\mathrm}{\mathtestb}
1617 \reDeclareMathAlphabet{\mathtestC}{\mathtesta}{\mathmc}
1718 \reDeclareMathAlphabet{\mathtestD}{\mathtesta}{\mathtestb}
1819 \reDeclareMathAlphabet{\mathtestE}{\mathtestE}{\mathmc}
1920 \begin{document}\makeatletter
20-
2121 \[
2222 \frac1{1^2}+\frac1{2^2}+\cdots=
2323 \sum_{n=1}^\infty \frac1{n^s}=\zeta(2)=\frac{\pi^2}{6}
@@ -48,4 +48,9 @@ mathgt: $\mathgt{\alpha あいうえおabcde}$
4848 \tt\meaning\mathtestD
4949
5050 \tt\meaning\mathtestE
51+
52+\meaning\lfloor
53+\[
54+\lceil x\rceil + \lfloor x\rfloor +\hat a-\sqrt{a} - [\hbar]
55+\]
5156 \end{document}
Binary files a/test/test09-fontspec.pdf and b/test/test09-fontspec.pdf differ
--- a/test/test09-fontspec.tex
+++ b/test/test09-fontspec.tex
@@ -11,7 +11,8 @@
1111
1212
1313 \usepackage{luatexja}
14-\usepackage{luatexja-fontspec,booktabs,array,lltjext}
14+\usepackage{luatexja-fontspec}
15+\usepackage{booktabs,array,lltjext}
1516
1617 \defaultfontfeatures{Numbers=OldStyle}
1718 \setmainfont{TeXGyreTermes}
@@ -21,7 +22,7 @@
2122 \setmainjfont[BoldFont=IPAexGothic]{IPAexMincho} % default: JFM=ujis
2223 \setsansjfont{IPAexGothic}
2324
24-\newjfontfamily\ipajisninety[CJKShape=JIS1990]{IPAexMincho}
25+\setjfontfamily\ipajisninety[CJKShape=JIS1990]{IPAexMincho}
2526
2627 \normalsize
2728 \usepackage[margin=25mm,a4paper]{geometry}
@@ -65,12 +66,11 @@
6566 \vbox{\hsize=7\zw\tate\parindent1\zw\R}}
6667
6768 \subsection{Kerning}
68-{\jfontspec[NoEmbed]{Ryumin-Light}
69-
69+{\jfontspec{KozMinPr6N-Regular}
7070 アノ ← Kerning=Off
7171
7272 \noindent{\addjfontfeatures{Kerning=On} アノ ← Kerning=On}
73-}
73+\par}
7474
7575 \subsection{unicode}
7676
@@ -96,7 +96,7 @@
9696
9797 \newpage
9898 \section{fontspecによる非埋め込みフォント}
99-\newjfontfamily\test[BoldFont=GothicBBB-Medium, NoEmbed]{Ryumin-Light}
99+\setjfontfamily\test[BoldFont=GothicBBB-Medium, NoEmbed]{Ryumin-Light}
100100
101101 %{\test
102102 %\begin{tabular}<y>{ll>{\itshape}l>{\slshape}l}
@@ -109,7 +109,7 @@
109109 %\end{tabular}}
110110
111111 \section{JFMの違い}
112-\newjfontfamily\test[ TateFont=KozGoPr6N-Light ]{KozMinPr6N-Bold}
112+\setjfontfamily\test[ TateFont=KozGoPr6N-Light ]{KozMinPr6N-Bold}
113113
114114 \def\yttest{\leavevmode%
115115 \parbox<y>{20\zw}{%
@@ -130,4 +130,9 @@
130130 \yttest
131131
132132
133+\section{match}
134+
135+\normalfont
136+\sffamily aiuあいう\rmfamily aiuあいう \ttfamily aiuあいう
137+
133138 \end{document}
\ No newline at end of file
Show on old repository browser