In a function I have in a package I'm working on I'm trying to add the following line:
\expandafter\newif\csname ifgre@scale@#1\endcsname%
Now, this works fine under LuaLaTeX, but the package is supposed to be compatible under both LuaLaTeX and LuaTeX and when I try to compile a document in LuaTeX, I get the following error:
! Forbidden control sequence found while scanning definition of \grechangedim.
<inserted text>
}
<to be read again>
\newif
l.828 \expandafter\newif
\csname ifgre@scale@#1\endcsname%
?
Is there a PlainTeX compatible way to create a new conditional within a function?
LuaLaTeX MWE:
\documentclass[11pt]{article}
\usepackage{testing}
\begin{document}
\grechangedim{test}
Hello.
\end{document}
LuaTeX MWE:
\pdfpagewidth210mm
\pdfpageheight297mm
\input testing-input.tex
\grechangedim{test}
Hello.
\bye
testing.sty:
% ------IDENTIFICATION------
\NeedsTeXFormat{LaTeX2e}[2005/12/01]
\ProvidesPackage{testing}
% For testing package code.
% ------INITIAL CODE------
% ------DECLARATION OF OPTIONS------
% ------EXECUTION OF OPTIONS------
\ProcessOptions
% ------PACKAGE LOADING------
% ------MAIN CODE------
\AtBeginDocument{}
\AtEndDocument{}
\input testing-input.tex
testing-input.tex:
\def\grechangedim#1{%
\expandafter\newif\csname ifgre@scale@#1\endcsname%
}
luatex
content here?