\def\getanddefine@fonts#1#2{%
\ltj@tempcnta=#1\ltj@@IsFontJapanese{\string#2}%
- \ifin@\ltj@@ja@getanddefine@fonts{#1}{#2}%
- \else \ltj@@al@getanddefine@fonts{#1}{#2}\fi
+ \ifin@\let\ltj@temp=\ltj@@ja@getanddefine@fonts%
+ \else \let\ltj@temp=\ltj@@al@getanddefine@fonts\fi
+ \ltj@temp{#1}{#2}%
}
\def\use@mathgroup#1#2{\relax\ifmmode
\math@bgroup
local s
local pt=node_type(p.id)
local base = debug_depth .. string.format('%X', has_attr(p,attr_icflag) or 0)
- .. ' ' .. pt .. ' ' .. p.subtype
+ .. ' ' .. pt .. ' ' .. tostring(p.subtype )
if pt == 'glyph' then
s = base .. ' ' .. utf.char(p.char) .. ' ' .. tostring(p.font)
.. ' (' .. print_scaled(p.height) .. '+'
\define@key[ltj]{japaram}{jascriptscriptfont}{%
\expandafter\ltj@@set@stackfont#1:{mjss}}
\def\ltj@@set@stackfont#1,#2:#3{%
- {\directlua{tex.globaldefs=0}\ltj@curjfnt=-1 #2%
- \global\ltj@tempcnta=\ltj@curjfnt}%
- \ifnum\ltj@tempcnta=-1
+ \directlua{%
+ ltj.global_temp = tex.globaldefs;
+ tex.globaldefs = 0}%
+ \ltj@tempcnta=\ltj@curjfnt\ltj@curjfnt=-1 #2%
+ \ifnum\ltj@curjfnt=-1
\@PackageError{luatexja-core}%
{\string#2 is not a control sequence that represents \MessageBreak
a Japanese font}{}%
\else
\directlua{luatexja.stack.set_stack_font(ltj.isglobal, \asluastring{#3},
- \ltj@safe@num@or\ltj@defnum{#1}, \the\ltj@tempcnta)}%
- \fi}
+ \ltj@safe@num@or\ltj@defnum{#1}, \the\ltj@curjfnt)}%
+ \fi
+ \ltj@curjfnt=\ltj@tempcnta
+ \directlua{tex.globaldefs = ltj.global_temp}%
+ }
% yalbaselineshift = <dimen>
% yjabaselineshift = <dimen>
-- \inhibitglue
function create_inhibitglue_node()
- local g=node_new(id_whatsit, sid_user)
- g.user_id=30111; g.type=100; g.value=1; node.write(g)
+ if tex.nest[tex.nest.ptr].mode == 127 or
+ tex.nest[tex.nest.ptr].mode == -127 then
+ local g=node_new(id_whatsit, sid_user)
+ g.user_id=30111; g.type=100; g.value=1; node.write(g)
+ end
end
function get_stack_level()
local i = tex.getcount('ltj@@stack')
- local j = tex.currentgrouplevel
- if j > tex.getcount('ltj@@group@level') then
- i = i+1 -- new stack level
- local gd = tex.globaldefs
- if gd>0 then tex.globaldefs = 0 end
- -- 'tex.globaldefs = 0' is local even if \globaldefs > 0.
- tex.setcount('ltj@@group@level', j)
- for k,v in pairs(charprop_stack_table) do -- clear the stack above i
- if k>=i then charprop_stack_table[k]=nil end
+ if tex.nest[tex.nest.ptr].mode == 127 or
+ tex.nest[tex.nest.ptr].mode == -127 then
+ local j = tex.currentgrouplevel
+ if j > tex.getcount('ltj@@group@level') then
+ i = i+1 -- new stack level
+ local gd = tex.globaldefs
+ if gd>0 then tex.globaldefs = 0 end
+ -- 'tex.globaldefs = 0' is local even if \globaldefs > 0.
+ tex.setcount('ltj@@group@level', j)
+ for k,v in pairs(charprop_stack_table) do -- clear the stack above i
+ if k>=i then charprop_stack_table[k]=nil end
+ end
+ charprop_stack_table[i] = table.fastcopy(charprop_stack_table[i-1])
+ tex.setcount('ltj@@stack', i)
+ if gd>0 then tex.globaldefs = gd end
+ local g = node_new(id_whatsit, sid_user)
+ g.user_id=30112; g.type=100; g.value=j; node.write(g)
end
- charprop_stack_table[i] = table.fastcopy(charprop_stack_table[i-1])
- tex.setcount('ltj@@stack', i)
- if gd>0 then tex.globaldefs = gd end
- local g = node_new(id_whatsit, sid_user)
- g.user_id=30112; g.type=100; g.value=j; node.write(g)
end
return i
end
\paragraph{Unicodeの数式領域}\
標準 $a_i=i,\ i=1, 2, \dots, n$.
-\ltjdefcharrange{2}{"10000-"1FFFF}% 第1面を欧文扱いに
-\ltjsetparameter{jacharrange={-2}}%
-第1面を欧文扱いに $a_i=i,\ i=1, 2, \dots, n$.
+\ltjsetparameter{jacharrange={-3, -8}}%
+文字範囲3, 8を欧文扱いに $a_i=i,\ i=1, 2, \dots, n$.
\paragraph{和文数式 on \LaTeX}
数式フォント関連のコマンドは一緒.e.g.\ in \verb+lltjdefs.sty+,
\end{itemize}
\bf mathversion bold: {\mathversion{bold}$aあa\mathgt{あa}$}き\\
-二つ目の「あ」は\verb+\mathgt+下だが,明朝なのは本文書の設定通り.
+二つ目の「あ」は\verb+\mathgt+下だが,明朝なのは本文書の設定通り.\\
+アルファベットがなぜか出ない(Lua\TeX-ja非読み込み時でも)が,
+私の環境だけか?
\LaTeX では数式ファミリ番号は欧文と共用→$\the\jfam$