Reputation
2,464
Top tag
Next privilege 2,500 Rep.
Create tag synonyms
Badges
2 16 43
Impact
~106k people reached

Jun
25
revised How to redefine commands and environments, and make them acceptable for `\write`
added 1456 characters in body
Jun
25
comment how to redefine the `\\` in a tabular environment?
Yes, you're right. Actually, i needed to redefine \\, not only in tabular, but generally speaking. The point is, i did not know i can do it simply with \def\\{new def}...
Jun
24
comment How to redefine commands and environments, and make them acceptable for `\write`
my guesses : (1) the name of the command is \mwx\temp, and therefore not accessible by a direct call. (2) without the \string, TeX will try to expand \temp inside the \csname and produce an error, since it does not exists. Am i right ?
Jun
24
comment How to redefine commands and environments, and make them acceptable for `\write`
I try to understand your construction \def\mywritedef#1{\expandafter\def\csname mwx\string#1\endcsname}. Could you tell me what is the name of the macro constructed by e.g. \mywritedef\temp. I expected \mwxtemp, but i think i'm wrong. Can I access this command directly ? And why do you put a \string ? What would it be without ? (sorry for the stupid questions, but i'm not used to \csname...
Jun
24
comment How to redefine commands and environments, and make them acceptable for `\write`
I think I understand : through your definitions of \begin, you remove the \begingroup which is in the usual definition of \begin and which is not expandable. Am I right ?
Jun
24
comment how to create a fully-expandable environment
Ok, thanks. Other question : i don't think \def\tabular#1#2\end{tabular}{<tabular=#1>#2</tabular>} can work because you can't use \end{tabular} as delimiter since it contains {}, can you ?
Jun
24
comment how to create a fully-expandable environment
@egreg: I don't understand the need of \def\begin#1{\csname #1\endcsname} ; I though \begin{env} does precisely \env. What did i miss ?
Jun
24
comment How to redefine commands and environments, and make them acceptable for `\write`
@DavidCarlisle: in order to be able to adapt your code to my needs... i would need to understand it !;) I want to understand, how you made it possible to \write an environment, which otherwise does not work directly.
Jun
24
comment how to redefine the `\\` in a tabular environment?
ok, now i understand your code. Actually, you let the old tabular act. I would prefer to completely rewrite (and simplify) the definition of tabular. At the end I want to be able to pass it into a \edef and a \write, but maybe it is a different question (see tex.stackexchange.com/q/60851/10157)
Jun
24
comment how to create a fully-expandable environment
@egreg: please see my edit.
Jun
24
revised how to create a fully-expandable environment
added 680 characters in body
Jun
23
comment how to redefine the `\\` in a tabular environment?
Could you please explain more about "...\let to a normal catcode token..." ?
Jun
23
asked how to redefine the `\\` in a tabular environment?
Jun
22
comment How to redefine commands and environments, and make them acceptable for `\write`
Your solution is very interesting (one can always learn a lot from your solutions...) but i think it is not suitable for my situation : i need to consider commands with optional arguments, and different number of arguments. On the other hand, i don't want these commands/environments to have the same effect. Some will write something like <bold>...</bold>, but some should do other things. This is why i would prefer to redefine them separately. For the moment, my solution works except for environments (i need in particular itemize)
Jun
22
asked How to redefine commands and environments, and make them acceptable for `\write`
Jun
22
asked how to create a fully-expandable environment
Jun
19
asked Long version of \edef, \xdef, \protected@edef
Jun
18
comment a “… doesn't match its definition” problem, that I don't understand
is there a similar issue with environment with optional arguments ? Is there an equivalent of \newrobustcmd for environments ?
Jun
18
accepted a “… doesn't match its definition” problem, that I don't understand
Jun
18
comment a “… doesn't match its definition” problem, that I don't understand
Thanks a lot for the hints. Nevertheless, I don't understand your solution 1 : i thought that \protected@xdef would have a special effect (preventing expansion) on macro which are preceded by \protected in the edef, or defined with \protected. Did i miss something ?