OSDN Git Service

error message when not used in Lua*TeX
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 14 May 2023 07:31:23 +0000 (16:31 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 14 May 2023 07:31:23 +0000 (16:31 +0900)
src/luatexja-core.sty
src/luatexja.sty

index b0c5c80..12a7a09 100644 (file)
 \expandafter\ifx\csname RequirePackage\endcsname\relax %<*!LaTeX>
   \expandafter\let\csname ifltj@in@latex\expandafter\endcsname
     \csname iffalse\endcsname
+  \endlinechar=13 %
+  \input infwarerr.sty
+  \endlinechar=-1 %
 \else                           %<*LaTeX>
   \expandafter\let\csname ifltj@in@latex\expandafter\endcsname
     \csname iftrue\endcsname
   \NeedsTeXFormat{LaTeX2e}
   \ProvidesPackage{luatexja-core}[2023-04-06 Core of LuaTeX-ja]
+  \endlinechar=13 %
+  \RequirePackage{infwarerr}
+  \endlinechar=-1 %
 \fi                             %</LaTeX>
 
+%% Check if LuaTeX is used
+\expandafter\ifx\csname directlua\endcsname\relax
+  \@PackageError{luatexja-core}{This package requires Lua(HB)(La)TeX}{}
+\expandafter\endinput\fi\relax
+
 %% Load prerequisite packages.
 \endlinechar=13 %
 \newif\ifltj@everyhook@avail\ltj@everyhook@availfalse
 \fi                             %</LaTeX>
 \endlinechar=-1 %
 
-%% Check if LuaTeX is used
-\ltx@LocalExpandAfter\ifx\csname directlua\endcsname\relax
-  % Loading is silently aborted, since the notice of the wrong
-  % engine is already shown in luaotfload.
-  \ltj@core@AtEnd
-\expandafter\endinput\fi\relax
+\directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs
 
 %% Check LuaTeX version.
 \ifnum\luatexversion<110
index 5d04d1d..bbdff92 100644 (file)
@@ -50,8 +50,6 @@
   \ProcessOptions\relax
 \fi                             %</LaTeX>
 
-\directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs
-
 %% Load all sub-packages.
 \ifltj@in@latex                 %<*LaTeX>
   %% \RequirePackage{expl3} needed if the version of l3kernel is v6111