Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

pdfTeX version 1.40.0 introduced the primitive \pdfprimitive which the manual describes as follows.

This command executes the primitive meaning of the following control sequence, if it has been redefined or made undefined. If the following control sequence is undefined and never was a primitive, nothing happens and no error is raised. If the control sequence was initially expandable, \pdfprimitive expands either. Otherwise \pdfprimitive doesn’t expand.

(I think “either” should be “too.”)

Is there a way to \let a control sequence to the primitive version? Something like

\let\input\relax
\pdfletprimitive\input\input

The idea being that \input could be restored to its original meaning (at least locally). Obviously

\let\input\pdfprimitive\input

is not going to work just as

\expandafter\let\expandafter\input\pdfprimitive\input

is not going to work.

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

No, I'm afraid not. When you \let or \def the original definition of primitive to something, the original meaning is no longer available as an accessible token. \pdfprimitive can be used to access the internal definition of the primitive, but that is not the same as 'regenerating' the accessible token. The nearest you can get is

\def\<primitive>{\pdfprimitive\<primitive>}

for expandable primitives or

\protected\def\<primitive>{\pdfprimitive\<primitive>}

for non-expandable ones.

share|improve this answer
    
And it would seem that that doesn't work for \endcsname. My use case was fairly ridiculous anyway, so it's not like this is a show stopper. =) Thanks. –  TH. Mar 18 '11 at 11:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.