I want to prevent processing rest part of a package in case if it is loaded not from lualatex. For some reason I cannot load ifluatex package, so I borrowed definition of \ifluatex from that package and invented the following chunk of code:
\expandafter\ifx\csname luatexversion\endcsname\relax % = not \inluatex
%\typeout{^^J********************** not LuaTeX^^J}
\PackageError{babel}{
^^J\space\space * Option russianu is intended for LuaTeX only.
^^J\space\space * Option russian is used instead.
}
\relax
\input{russianb.ldf}
\let\@next@action\endinput
\else
%\typein{^^J********************** LuaTeX^^J}
\let\@next@action\relax
\fi
\@next@action
It seemed to work but Is there a better solution. In particular, it is desirable to avoid introduction of \@next@action because it is used the only time.
Just to explain: my goal is to hack babel with option russian to make it working painlessly with LuaLaTeX without any additional hacks (as described, eg, in \tableofcontents encoding issue with lualatex and LuaTeX cyrillic hyphenation problems)
ifluatex? – Marco Daniel Oct 08 '11 at 12:45ifluatex. LaTeX prohibits using\RequirePackagebefore processing options inbabel.sty. I got error if I put\RequirePackageinat any place ofrussian.ldfto be read bybabel.sty. – Igor Kotelnikov Oct 08 '11 at 13:12