• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: Commit

ソースコードの管理場所


Commit MetaInfo

Revisionee92a2b5024e8df025fdfa64f9ee578d37ff83a5 (tree)
Time2018-05-20 13:21:17
AuthorHironori Kitagawa <h_kitagawa2001@yaho...>
CommiterHironori Kitagawa

Log Message

patch for siunitx

Change Summary

Incremental Difference

--- a/src/ltj-latex.sty
+++ b/src/ltj-latex.sty
@@ -89,6 +89,12 @@
8989 % \RequirePackage だと fontspec にオプション指定したときにエラー出る
9090 }
9191
92+\@ifpackageloaded{siunitx}{%
93+ \chardef\ltj@patch@siunitx@execute\z@\input{lltjp-siunitx.sty}%
94+}{%
95+ \AtBeginOfPackageFile*{siunitx}{\input{lltjp-siunitx.sty}}%
96+}
97+\AtEndOfPackageFile*{siunitx}{\csname __ltj_siunitx_patch:\endcsname}
9298
9399 %%------------------ all done
94100 \ltj@latex@AtEnd
--- /dev/null
+++ b/src/patches/lltjp-siunitx.sty
@@ -0,0 +1,34 @@
1+%
2+% lltjp-siunitx.sty
3+%
4+
5+\NeedsTeXFormat{LaTeX2e}
6+
7+\RequirePackage{luatexja}
8+\ExplSyntaxOn
9+\cs_generate_variant:Nn \tl_if_in:NnT { coT }
10+\cs_new:Nn \__ltj_siunix_patch_inner:n {
11+ \cs_if_exist:cT { #1_tl } {
12+ \tl_if_in:coT { #1_tl } { \tex_char:D } {
13+ \tl_replace_all:cnn { #1_tl } { \tex_char:D } { \ltjalchar }
14+ }
15+ }
16+}
17+\cs_new:Nn \__ltj_siunix_patch_inner_math:n {
18+ \__ltj_siunix_patch_inner:n { l__siunitx_#1_math }
19+ \__ltj_siunix_patch_inner:n { l__siunitx_#1_text }
20+}
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+ }
30+}
31+\ifdefined\ltj@patch@siunitx@executed\__ltj_siunitx_patch:\fi
32+
33+\ExplSyntaxOff
34+\endinput
--- /dev/null
+++ b/test/test26-siunitx.tex
@@ -0,0 +1,19 @@
1+\documentclass{scrbook}
2+ %\usepackage{luatexja}
3+ \usepackage{fontspec}
4+ \usepackage{luatexja-fontspec}
5+ \usepackage[
6+ mode=text,
7+ detect-all,
8+]{siunitx}
9+ %\usepackage{luatexja-fontspec}
10+\makeatletter
11+\typeout{\meaning\@begindocumenthook}
12+\begin{document}
13+ \ifdefined\gtfamily\gtfamily\fi Ω
14+ {\ExplSyntaxOn\makeatletter
15+ \ttfamily\meaning\@begindocumenthook}
16+
17+ \SI{-2.5e-10}{mol.L^{-1}}\SI{1}{\micro\metre\angstrom\arcminute\arcsecond\ohm}
18+ \vrule\SI{}{\ohm}\vrule
19+ \end{document}
\ No newline at end of file
Show on old repository browser