[tex-k] \[if]pdfprimitive and control symbol

Hironori KITAGAWA h_kitagawa2001 at yahoo.co.jp
Sun Sep 24 01:31:41 CEST 2017


Hello,

H. Yamashita found that a control word "\ " does not recognized as a primitive
by \if[pdf]primitive, in e-[u]pTeX, pdfTeX, and XeTeX.

More test is the following source:
------
% control words (ex_space, ital_corr)
\catcode`\[=13
\def[#1]{\message{#1}}
\count255=\ifx\primitive\undefined`\X\else`\P\fi
\catcode\count255=14

P\ifpdfprimitive\ [1T]\else[1F]\fi
P\ifpdfprimitive\/[2T]\else[2F]\fi
P\ifpdfprimitive\-[3T]\else[3F]\fi
X\ifprimitive\ [1T]\else[1F]\fi
X\ifprimitive\/[2T]\else[2F]\fi
X\ifprimitive\-[3T]\else[3F]\fi
\end
------

Since "\ ", "\/", "\-" are all primitives, so the output should be "1T 2T 3T".
However, every engine except luatex produce wrong output:
  eptex:  1F 2T 3T
  euptex: 1F 2T 3T
  pdftex: 1F 2T 3T
  xetex:  1F 2F 3F
  luatex: 1T 2T 3T
It seems that prim_lookup() produces the same hash between \  and 
another multi-letter primitive (\vrule in e[u]ptex and pdftex). 

Today's commit r45386 resolves this issue in e-[u]pTeX.
I think that this change is also applicable to pdfTeX and XeTeX (attached).

Regards, 
Hironori KITAGAWA 
<h_kitagawa2001 at yahoo.co.jp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20170924-pdftex-pdfprimitive.diff
Type: text/x-diff
Size: 4291 bytes
Desc: not available
URL: <http://tug.org/pipermail/tex-k/attachments/20170924/b82330fa/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20170924-xetex-pdfprimitive.diff
Type: text/x-diff
Size: 3874 bytes
Desc: not available
URL: <http://tug.org/pipermail/tex-k/attachments/20170924/b82330fa/attachment-0001.bin>


More information about the tex-k mailing list