[texhax] Problems with \halign within a \write environment

Oleg Katsitadze olegkat at gmail.com
Fri Sep 14 21:14:16 CEST 2007


On Fri, Sep 14, 2007 at 08:27:13PM +0200, Rodolfo Medina wrote:
> And in fact, in myfile.tex there are two `##' instead of one.
> Can anybody suggest a possible solution to avoid that?

To avoid the doubled `#' in \write, define this:

  {\catcode`\#=12
  \gdef\hash{#}}

and then say

  \immediate\write\myfile{\halign{\hash&\hash\cr a&b\cr}}

(\write doubles the macro parameter character (catcode 6), which is
`#' in plain TeX).

Best,
Oleg


More information about the texhax mailing list