Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iftex.sty: incomplete \ifx #12

Closed
olsak opened this issue Mar 6, 2020 · 2 comments
Closed

iftex.sty: incomplete \ifx #12

olsak opened this issue Mar 6, 2020 · 2 comments

Comments

@olsak
Copy link

olsak commented Mar 6, 2020

Minimal example:

\newif \ifpdftex
\input iftex.sty
\end

Process it by "pdftex test" (no LaTeX).
The rerror: ! Incomplete \ifx; all text was ignored after line 243.
Version of iftex.sty: the last from TeXlive 2019, begins with:

%% iftex TeX engine tests
%% LaTeX3 Project
...
\ProvidesPackage{iftex}[2019/11/07 v1.0c TeX engine tests]

Why I need to use this file when I am using plain TeX only: Tikz for plain TeX uses it, unfortunately.
The reason of this bug:
The line 112 does \let\ifIFTEX@savedpdftex=\ifpdftex.
The lines 243--246 includes the control sequence \ifIFTEX@savedpdftex in nested \ifx...\fi. The meaning of this control sequence is \ifpdftex=\iffalse (or \iftrue) and skipping over nested \if..\fi fails.

@davidcarlisle
Copy link
Member

@olsak er yes,

I think this works correctly but I may see if I can re-organise it to avoid so many \expandafter and \csname

% special compat for scrbase
\ifx\scr@ifpdftex\@undefined\else\expandafter\ifx\csname ifIFTEX@savedpdftex\endcsname\relax\else
\relax
\IFTEX@let{pdftex}{IFTEX@savedpdftex}
\IFTEX@protected\edef\RequirePDFTeX{\noexpand\IFTEX@Require\expandafter\noexpand\csname ifPDFTeX\endcsname{pdfTeX}\expandafter\noexpand\csname fi\endcsname}
\fi\fi
\ifx\scr@ifVTeX\@undefined\else\expandafter\ifx\csname ifIFTEX@savedVTeX\endcsname\relax\else
 \IFTEX@let{VTeX}{IFTEX@savedVTeX}
\fi\fi

The whole block could possibly be deleted as the koma-script package code changed to avoid the issue that this is protecting against, but I'd like to keep it for compatibility with older releases for a while. It is supposed to work in plain though......

@davidcarlisle davidcarlisle transferred this issue from latex3/latex2e Mar 6, 2020
davidcarlisle added a commit that referenced this issue Mar 6, 2020
@davidcarlisle
Copy link
Member

1.0d gone to CTAN thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants