OSDN Git Service

added lltjp-collcell.sty
[luatex-ja/luatexja.git] / src / ltj-latex.sty
1 %
2 % ltj-latex.sty
3 %
4
5 %! これは外から読まれない
6 %% Avoid multiple loading.
7 \csname luatexjalatexLoaded\endcsname
8 \edef\ltj@latex@AtEnd{%
9 \endlinechar=\the\endlinechar
10 \relax}
11 \endlinechar\m@ne%
12 \def\luatexjalatexLoaded{\endinput}
13
14 \NeedsTeXFormat{LaTeX2e}
15 \ProvidesPackage{ltj-latex}[2019/09/26 LaTeX support of LuaTeX-ja]
16
17 % cleanup at end of the document
18 %\let\ltj@@orig@end=\@@end
19 %\protected\def\@@end{%
20 %  \directlua{luatexja.ext_cleanup()}\ltj@@orig@end}
21
22 \endlinechar=13
23
24 %%% patch for LaTeX
25 \usepackage{lltjfont}
26 \usepackage{lltjdefs}
27 \usepackage{lltjcore}
28
29 %%% patching commands
30 \RequirePackage{filehook}
31
32 \def\ltj@pkgpatch@im#1{%
33  \@ifnextchar[{\ltj@pkgpatch@im@{#1}}{\ltj@pkgpatch@im@{#1}[lltjp-#1]}}%]
34 \def\ltj@pkgpatch@im@#1[#2]{%
35   \AtEndOfPackageFile*{#1}{%
36     \@ifpackageloaded{#2}{}{%
37           \@namedef{ver@#2.\@pkgextension}{0000/00/00}%dummy
38           \if\catcode`@=11\let\ltj@temp\relax\else
39             \edef\ltj@temp{\noexpand\catcode`@=\the\catcode`@\relax}\makeatletter
40           \fi
41           \@@input{#2.\@pkgextension}\ltj@temp
42         }%
43   }%
44 }
45
46 \def\ltj@pkgpatch#1{%
47   \@ifnextchar[{\ltj@pkgpatch@@{#1}}{\ltj@pkgpatch@@{#1}[lltjp-#1]}}%]
48 \def\ltj@pkgpatch@@#1[#2]{%
49   \gpreto\@begindocumenthook{%
50     \@ifpackageloaded{#1}{%
51           \@ifpackageloaded{#2}{}{\RequirePackage{#2}}%
52         }{}%
53   }%
54 }
55
56 %%% default parameters
57 \directlua{
58   local s = kpse.find_file('ltj-kinsoku.lua', 'tex')
59   luatexja.stack.charprop_stack_table[0] = s and dofile(s) or {}
60 }
61
62 \ltjsetparameter{kanjiskip=\z@ plus .4pt minus .5pt,
63   xkanjiskip=.25\zw plus 1pt minus 1pt,
64   autospacing, autoxspacing, jacharrange={-1},
65   yalbaselineshift=\z@, yjabaselineshift=\z@,
66   jcharwidowpenalty=500, differentjfm=paverage
67 }
68
69 \expandafter\let\csname JY3/mc/m/n/10\endcsname\relax
70
71 %%% patch for packages
72 \ltj@pkgpatch@im{listings}
73 \ltj@pkgpatch{xunicode}  %% at \begin{document}
74 \ltj@pkgpatch@im{fontspec}
75 \ltj@pkgpatch{footmisc}  %% at \begin{document}
76 \ltj@pkgpatch{tascmac}
77 \ltj@pkgpatch{ascmac}[lltjp-tascmac]
78 \ltj@pkgpatch@im{stfloats}
79 \ltj@pkgpatch{preview}  %% at \begin{document}
80   % (preview package has delayed option)
81 \ltj@pkgpatch{array}    %% at \begin{document}
82 \ltj@pkgpatch{collcell} %% at \begin{document}
83 \ltj@pkgpatch@im{unicode-math}
84 \ltj@pkgpatch@im{siunitx}
85 \ltj@pkgpatch@im{microtype}
86
87 \RequirePackage{lltjp-geometry}
88
89 %%------------------ all done
90 \ltj@latex@AtEnd
91 \endinput
92 %% EOF