[texhax] Writing verbatim to file

Heiko Oberdiek heiko.oberdiek at googlemail.com
Mon Mar 7 10:20:15 CET 2011


On Sun, Mar 06, 2011 at 05:28:12PM -0800, Mike B. wrote:

> I'm trying achieve the following sequence:
> 1. a variable l is assigned some length.
> 2. if some condition is true then the following line should be written to a file
> \setlength{x}{<length of l>}
> 
> A psuedo-code for this seems to be:
> \ifthenelse{ condition is true }{
> write to file as verbatim: \setlength{x}{ 
> write to file the value of l: \the\l
> write to file as verbatim (close braces): }
> }{}
> 
> The newfile package allows to output to a file but:
> - not inside an argument to another command (I need this inside an \ifthenelse structure) 
> - verbatim text must have balanced curly braces

  \string\setlength{\the\l}

No special treatment of curly braces are necessary if they
are properly nested.

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list