[tex-eplain] Putting two \definexref together

Karl Berry karl at freefriends.org
Fri Sep 7 15:51:56 CEST 2007


    I don't know if it's possible to avoid the local "definition" of a
    \csname...\endcsname macro.  

I don't think it's possible.  See section from tex.web below (this is
what gets executed for \csname aka cs_name).  The only condition on
whether the definition is done is whether the control sequence is
already defined.

I saw one query about it back in 1996, but no answer.
http://www.ctan.org/tex-archive/info/digests/texhax/96/texhax.14

    Except maybe if we avoid the group altogether, by saving the catcode
    of `@' and the value of \endlinechar and then restoring them after
    we read the .aux file --

Hmm.  I don't recall any deeper reason for reading the .aux in a group
than those two settings.  Let's try it.  It somehow seems cleaner to
read it without a group anyway; then we wouldn't have to use global
definitions in \@definelabel at nocheck.

Thanks,
Karl


@ @<Manufacture a control...@>=
begin r:=get_avail; p:=r; {head of the list of characters}
repeat get_x_token;
if cur_cs=0 then store_new_token(cur_tok);
until cur_cs<>0;
if cur_cmd<>end_cs_name then @<Complain about missing \.{\\endcsname}@>;
@<Look up the characters of list |r| in the hash table, and set |cur_cs|@>;
flush_list(r);
if eq_type(cur_cs)=undefined_cs then
  begin eq_define(cur_cs,relax,256); {N.B.: The |save_stack| might change}
  end; {the control sequence will now match `\.{\\relax}'}
cur_tok:=cur_cs+cs_token_flag; back_input;
end



More information about the tex-eplain mailing list