リビジョン | 03b1187135bacf873e3376e49b589b4524ee5f5e (tree) |
---|---|
日時 | 2011-09-26 18:21:50 |
作者 | Hironori Kitagawa <h_kitagawa2001@yaho...> |
コミッター | Hironori Kitagawa |
Fixed ticket #26398, and whatsits from LuaTeX-ja stack system and \inhibitglue are now appended only in (restricted) horizontal mode.
@@ -654,8 +654,9 @@ | ||
654 | 654 | |
655 | 655 | \def\getanddefine@fonts#1#2{% |
656 | 656 | \ltj@tempcnta=#1\ltj@@IsFontJapanese{\string#2}% |
657 | - \ifin@\ltj@@ja@getanddefine@fonts{#1}{#2}% | |
658 | - \else \ltj@@al@getanddefine@fonts{#1}{#2}\fi | |
657 | + \ifin@\let\ltj@temp=\ltj@@ja@getanddefine@fonts% | |
658 | + \else \let\ltj@temp=\ltj@@al@getanddefine@fonts\fi | |
659 | + \ltj@temp{#1}{#2}% | |
659 | 660 | } |
660 | 661 | \def\use@mathgroup#1#2{\relax\ifmmode |
661 | 662 | \math@bgroup |
@@ -216,7 +216,7 @@ function debug_show_node_X(p,print_fn) | ||
216 | 216 | local s |
217 | 217 | local pt=node_type(p.id) |
218 | 218 | local base = debug_depth .. string.format('%X', has_attr(p,attr_icflag) or 0) |
219 | - .. ' ' .. pt .. ' ' .. p.subtype | |
219 | + .. ' ' .. pt .. ' ' .. tostring(p.subtype ) | |
220 | 220 | if pt == 'glyph' then |
221 | 221 | s = base .. ' ' .. utf.char(p.char) .. ' ' .. tostring(p.font) |
222 | 222 | .. ' (' .. print_scaled(p.height) .. '+' |
@@ -253,16 +253,21 @@ | ||
253 | 253 | \define@key[ltj]{japaram}{jascriptscriptfont}{% |
254 | 254 | \expandafter\ltj@@set@stackfont#1:{mjss}} |
255 | 255 | \def\ltj@@set@stackfont#1,#2:#3{% |
256 | - {\directlua{tex.globaldefs=0}\ltj@curjfnt=-1 #2% | |
257 | - \global\ltj@tempcnta=\ltj@curjfnt}% | |
258 | - \ifnum\ltj@tempcnta=-1 | |
256 | + \directlua{% | |
257 | + ltj.global_temp = tex.globaldefs; | |
258 | + tex.globaldefs = 0}% | |
259 | + \ltj@tempcnta=\ltj@curjfnt\ltj@curjfnt=-1 #2% | |
260 | + \ifnum\ltj@curjfnt=-1 | |
259 | 261 | \@PackageError{luatexja-core}% |
260 | 262 | {\string#2 is not a control sequence that represents \MessageBreak |
261 | 263 | a Japanese font}{}% |
262 | 264 | \else |
263 | 265 | \directlua{luatexja.stack.set_stack_font(ltj.isglobal, \asluastring{#3}, |
264 | - \ltj@safe@num@or\ltj@defnum{#1}, \the\ltj@tempcnta)}% | |
265 | - \fi} | |
266 | + \ltj@safe@num@or\ltj@defnum{#1}, \the\ltj@curjfnt)}% | |
267 | + \fi | |
268 | + \ltj@curjfnt=\ltj@tempcnta | |
269 | + \directlua{tex.globaldefs = ltj.global_temp}% | |
270 | + } | |
266 | 271 | |
267 | 272 | % yalbaselineshift = <dimen> |
268 | 273 | % yjabaselineshift = <dimen> |
@@ -821,6 +821,9 @@ end | ||
821 | 821 | |
822 | 822 | -- \inhibitglue |
823 | 823 | function create_inhibitglue_node() |
824 | - local g=node_new(id_whatsit, sid_user) | |
825 | - g.user_id=30111; g.type=100; g.value=1; node.write(g) | |
824 | + if tex.nest[tex.nest.ptr].mode == 127 or | |
825 | + tex.nest[tex.nest.ptr].mode == -127 then | |
826 | + local g=node_new(id_whatsit, sid_user) | |
827 | + g.user_id=30111; g.type=100; g.value=1; node.write(g) | |
828 | + end | |
826 | 829 | end |
@@ -20,21 +20,24 @@ local charprop_stack_table={}; charprop_stack_table[0]={} | ||
20 | 20 | |
21 | 21 | function get_stack_level() |
22 | 22 | local i = tex.getcount('ltj@@stack') |
23 | - local j = tex.currentgrouplevel | |
24 | - if j > tex.getcount('ltj@@group@level') then | |
25 | - i = i+1 -- new stack level | |
26 | - local gd = tex.globaldefs | |
27 | - if gd>0 then tex.globaldefs = 0 end | |
28 | - -- 'tex.globaldefs = 0' is local even if \globaldefs > 0. | |
29 | - tex.setcount('ltj@@group@level', j) | |
30 | - for k,v in pairs(charprop_stack_table) do -- clear the stack above i | |
31 | - if k>=i then charprop_stack_table[k]=nil end | |
23 | + if tex.nest[tex.nest.ptr].mode == 127 or | |
24 | + tex.nest[tex.nest.ptr].mode == -127 then | |
25 | + local j = tex.currentgrouplevel | |
26 | + if j > tex.getcount('ltj@@group@level') then | |
27 | + i = i+1 -- new stack level | |
28 | + local gd = tex.globaldefs | |
29 | + if gd>0 then tex.globaldefs = 0 end | |
30 | + -- 'tex.globaldefs = 0' is local even if \globaldefs > 0. | |
31 | + tex.setcount('ltj@@group@level', j) | |
32 | + for k,v in pairs(charprop_stack_table) do -- clear the stack above i | |
33 | + if k>=i then charprop_stack_table[k]=nil end | |
34 | + end | |
35 | + charprop_stack_table[i] = table.fastcopy(charprop_stack_table[i-1]) | |
36 | + tex.setcount('ltj@@stack', i) | |
37 | + if gd>0 then tex.globaldefs = gd end | |
38 | + local g = node_new(id_whatsit, sid_user) | |
39 | + g.user_id=30112; g.type=100; g.value=j; node.write(g) | |
32 | 40 | end |
33 | - charprop_stack_table[i] = table.fastcopy(charprop_stack_table[i-1]) | |
34 | - tex.setcount('ltj@@stack', i) | |
35 | - if gd>0 then tex.globaldefs = gd end | |
36 | - local g = node_new(id_whatsit, sid_user) | |
37 | - g.user_id=30112; g.type=100; g.value=j; node.write(g) | |
38 | 41 | end |
39 | 42 | return i |
40 | 43 | end |
@@ -12,9 +12,8 @@ | ||
12 | 12 | \paragraph{Unicodeの数式領域}\ |
13 | 13 | |
14 | 14 | 標準 $a_i=i,\ i=1, 2, \dots, n$. |
15 | -\ltjdefcharrange{2}{"10000-"1FFFF}% 第1面を欧文扱いに | |
16 | -\ltjsetparameter{jacharrange={-2}}% | |
17 | -第1面を欧文扱いに $a_i=i,\ i=1, 2, \dots, n$. | |
15 | +\ltjsetparameter{jacharrange={-3, -8}}% | |
16 | +文字範囲3, 8を欧文扱いに $a_i=i,\ i=1, 2, \dots, n$. | |
18 | 17 | |
19 | 18 | \paragraph{和文数式 on \LaTeX} |
20 | 19 | 数式フォント関連のコマンドは一緒.e.g.\ in \verb+lltjdefs.sty+, |
@@ -37,7 +36,9 @@ mathgt: $\mathrm{\mathmc{あa}}\mathmc{あb}\mathgt{あa}$ | ||
37 | 36 | \end{itemize} |
38 | 37 | |
39 | 38 | \bf mathversion bold: {\mathversion{bold}$aあa\mathgt{あa}$}き\\ |
40 | -二つ目の「あ」は\verb+\mathgt+下だが,明朝なのは本文書の設定通り. | |
39 | +二つ目の「あ」は\verb+\mathgt+下だが,明朝なのは本文書の設定通り.\\ | |
40 | +アルファベットがなぜか出ない(Lua\TeX-ja非読み込み時でも)が, | |
41 | +私の環境だけか? | |
41 | 42 | |
42 | 43 | \LaTeX では数式ファミリ番号は欧文と共用→$\the\jfam$ |
43 | 44 |