OSDN Git Service

Fix a bug: Patch lltjp-unicode-math.sty may not work correctly.
authorKazuki Maeda <kmaeda@users.sourceforge.jp>
Sat, 21 Apr 2012 20:52:15 +0000 (05:52 +0900)
committerKazuki Maeda <kmaeda@users.sourceforge.jp>
Sat, 21 Apr 2012 20:52:15 +0000 (05:52 +0900)
 * Revert previous commit; this fix also fixes the previous bug.

src/ltj-latex.sty
src/patches/lltjp-xunicode.sty

index 2582dd5..3cb5238 100644 (file)
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{ltj-latex}[2012/04/21 LuaLaTeX-ja]
 
-\def\ltj@pkgpatch#1{\AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}}
+% Globally add to the head of a macro (cf. LaTeX2e's \g@addto@macro)
+\long\def\ltj@g@addto@macro#1#2{
+  \begingroup
+    \def\ltj@tmpa{#2}
+    \toks@\expandafter\expandafter\expandafter{\expandafter\ltj@tmpa#1}
+    \xdef#1{\the\toks@}
+  \endgroup}
+
+\def\ltj@AtBeginDocument{\ltj@g@addto@macro\@begindocumenthook}
+
+\def\ltj@pkgpatch#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\usepackage{lltjp-#1}}{}}}
 
 % similar to \ltj@pkgpatch, but this is used .sty which
 % can be reloaded inside the document by \input.
-\def\ltj@pkgpatchA#1{\AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}}
+\def\ltj@pkgpatchA#1{\ltj@AtBeginDocument{\@ifpackageloaded{#1}{\input{lltjp-#1.sty}}{}}}
 
 \endlinechar=13
 
index ee74848..bef3b2d 100644 (file)
 % If unicode-math is already loaded, the following error occurs:
 %    ! Undefined control sequence.
 %    \hbar ->\hslash
-%    ! Missing \endcsname inserted.
-%    <to be read again>
-%                       \Zbar
-% Therefore temporarily set \hbar=\relax and \Zbar=\relax.
+% Therefore temporarily set \hbar=\relax.
 \let\ltj@tmpa\hbar
 \let\hbar\relax
 \let\ltj@tmpb\iftipaonetoken
 \let\iftipaonetoken\relax
-\let\ltj@tmpc\Zbar
-\let\Zbar\relax
 \ReloadXunicode{EU2}
 \makeatletter
 \let\hbar\ltj@tmpa
 \let\iftipaonetoken\ltj@tmpb
 \let\ltj@tmpb\relax % no more an if-token
-\let\Zbar\ltj@tmpc
 \endinput