I'm writing a macro to write commands to a file. These commands are supposed to be read when building my document.
The lines I use to write to the file is :
\newwrite\outtest
\immediate\openout\outtest=\jobname.ong
\immediate\write\outtest{\unexpanded{\ShowF{#1}{#2}{#3}{#4}{#5}{#6}}\wbgroup\getpagerefnumber{\the\value{line}}\wegroup \writepercent}%
It write things like this in the file jobname.ong
:
\ShowF {1}{A}{AB}{ABI}{0}{\Trad {}{}{}{}}{5}%
\ShowF {1}{A}{AB}{ABO}{0}{\Trad {}{}{}{}}{5}%
\ShowF {1}{A}{AB}{ABR}{0}{\Trad {}{}{}{}}{5}%
I also need to use \obeyspaces
to be uses in conjonction with a mono font.
For an unknown reason, my document fail to build with \obeyspaces but work fine without. I noticed that when I remove the blank lines in jobname.ong
, my document compile fine :
\ShowF{1}{A}{AB}{ABI}{0}{\Trad{}{}{}{}}{5}%
\ShowF{1}{A}{AB}{ABO}{0}{\Trad{}{}{}{}}{5}%
\ShowF{1}{A}{AB}{ABR}{0}{\Trad{}{}{}{}}{5}%
Do you know how to remove blank lines after a command in an output file ?
Do you know why \obeyspaces
complain about these spaces ?
\obeyspaces
is in force then in\ShowF {1}{
the first argument of\ShowF
is the active space not{1}
is that your question?\immediate\write\outtest{\string\ShowF\unexpanded{{#1}{#2}{#3}{#4}{#5}{#6}}\wbgroup\getpagerefnumber{\the\value{line}}\wegroup \writepercent}%