<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Raising this here at the suggestion of David Carlisle. Original post at <a href="http://tex.se" class="">tex.se</a>: <a href="https://tex.stackexchange.com/questions/594702/apparent-bug-in-pdflatex-xelatex-but-not-lualatex" class="">https://tex.stackexchange.com/questions/594702/apparent-bug-in-pdflatex-xelatex-but-not-lualatex</a><div class=""><br class=""></div><div class="">test.tex:</div><div class=""><br class=""></div><div class=""><pre class="lang-tex s-code-block latex hljs" style="margin: 0px 0px calc(var(--s-prose-spacing) + 0.4em); padding: 12px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; line-height: 1.30769231; font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; color: var(--highlight-color); word-wrap: normal;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-keyword);">\def</span><span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-keyword);">\zz</span><span class="hljs-params" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit;">#1</span>{<span class="hljs-params" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit;">#1</span>}
<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-keyword);">\zz</span>{<span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-keyword);">\input</span> test.l2e }</code></pre><div class=""><br class=""></div></div><div class="">text.l2e:</div><div class=""><br class=""></div><div class=""><pre class="lang-tex s-code-block latex hljs" style="margin: 0px 0px calc(var(--s-prose-spacing) + 0.4em); padding: 12px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; line-height: 1.30769231; font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; color: var(--highlight-color); word-wrap: normal;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-keyword);">\oops</span>
</code></pre></div><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-keyword);">Hit E at the error prompt and an error along the lines of:</span></code></div><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-keyword);"><br class=""></span></code></div><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><span class="hljs-keyword" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-keyword);"><pre class="lang-tex s-code-block latex hljs" style="margin: 0px 0px calc(var(--s-prose-spacing) + 0.4em); padding: 12px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; line-height: 1.30769231; font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; color: var(--highlight-color); word-wrap: normal;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class="">pdflatex:calledit: unexpected if<span class="hljs-built_in" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-literal);">_</span>ptr=5 not in range 1..2,from input<span class="hljs-built_in" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-literal);">_</span>stack[2].namefield=2378
</code></pre><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><pre class="lang-tex s-code-block latex hljs" style="margin: 0px 0px calc(var(--s-prose-spacing) + 0.4em); padding: 12px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-stretch: inherit; line-height: 1.30769231; font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; color: var(--highlight-color); word-wrap: normal;"><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class="">xelatex:calledit: unexpected if<span class="hljs-built_in" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-literal);">_</span>ptr=6 not in range 1..2,from input<span class="hljs-built_in" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; color: var(--highlight-literal);">_</span>stack[2].namefield=2230090
</code></pre><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><br class=""></code></div><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class="">will appear.</code></div><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><br class=""></code></div><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class="">I’ve not had a chance to dig into source to look for the issue. David’s diagnosis from stackexchange:</code></div><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><br class=""></code></div><div class=""><code style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; vertical-align: baseline; box-sizing: inherit; white-space: inherit;" class=""><div class="s-prose js-post-body" itemprop="text" style="margin: 0px; padding: 0px; border: 0px; font-family: var(--theme-question-body-font-family); font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: var(--s-prose-line-height); font-size: 15px; vertical-align: baseline; box-sizing: inherit; --s-prose-line-height: 1.5; --s-prose-spacing: 1.1em; --s-prose-spacing-condensed: calc(var(--s-prose-spacing) / 2); word-wrap: break-word; width: 658px;"><div style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; clear: both;" class=""></div></div><blockquote type="cite" class=""><div class="s-prose js-post-body" itemprop="text" style="margin: 0px; padding: 0px; border: 0px; font-family: var(--theme-question-body-font-family); font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: var(--s-prose-line-height); font-size: 15px; vertical-align: baseline; box-sizing: inherit; --s-prose-line-height: 1.5; --s-prose-spacing: 1.1em; --s-prose-spacing-condensed: calc(var(--s-prose-spacing) / 2); word-wrap: break-word; width: 658px;"><div style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; clear: both;" class="">Note you need the wrapping macro, if you just call <code style="margin: 0px; padding: 2px 4px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; font-size: 13px; vertical-align: baseline; box-sizing: inherit; white-space: pre-wrap; color: var(--black-800); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">\input</code> directly it works, presumably related to the <code style="margin: 0px; padding: 2px 4px; border: 0px; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: 19.5px; font-size: 13px; vertical-align: baseline; box-sizing: inherit; white-space: pre-wrap; color: var(--black-800); border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px;" class="">input_stack[2]</code> in the error when it fails.</div></div><div class="mt24" style="margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; font-size: 13px; vertical-align: baseline; box-sizing: inherit; margin-top: 24px !important;"><div class="jc-end gs8 ai-start fw-wrap grid gsy" style="margin: -4px 0px; padding: 0px; border: 0px; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; display: flex; caret-color: rgb(36, 39, 41); color: rgb(36, 39, 41); flex-wrap: wrap !important; justify-content: flex-end !important; align-items: flex-start !important;"><time itemprop="dateCreated" datetime="2021-04-27T19:28:08" style="margin: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit;" class=""></time></div></div></blockquote><div class="mt24" style="margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; font-size: 13px; vertical-align: baseline; box-sizing: inherit; margin-top: 24px !important;"><div class="jc-end gs8 ai-start fw-wrap grid gsy" style="margin: -4px 0px; padding: 0px; border: 0px; font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; display: flex; caret-color: rgb(36, 39, 41); color: rgb(36, 39, 41); flex-wrap: wrap !important; justify-content: flex-end !important; align-items: flex-start !important;"><div class="grid--cell mr16" style="margin: 4px 0px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; flex: 1 1 100px;"><div class="pt2 js-post-menu" data-post-id="594713" style="margin: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; padding-top: 2px !important;">-dh<div class="s-anchors gs8 fw-wrap d-flex grid s-anchors__muted" style="margin: -4px; padding: 0px; border: 0px; font-family: inherit; font-style: inherit; font-variant-caps: inherit; font-stretch: inherit; line-height: inherit; vertical-align: baseline; box-sizing: inherit; flex-wrap: wrap !important; display: flex !important;"></div></div></div></div></div></code></div></code></div></span></code></div></body></html>