# [texhax] Re: [tex-k] Help

Mohamed HOUSSNI houssni at e-press.co.ma
Tue Jul 6 17:00:05 CEST 2004

Robin Fairbairns a écrit :

>tex-k is not the list for discussing tex programming: try texhax (see
>
>
>
>>I am trying to develop my class file to how do multiple write in the
>>same output file after having to compile several various files with that
>>class. But I did not managed to do it.
>>
>>
>
>actually, i don't really understand what you are asking.  perhaps it
>would be good to try expanding the description of what you want to do.
>
>
I have several various files which compile successfully. For example:
file1.tex, file2.tex, etc. and I would like to generate a special
contents file at the base of title and authors of each file but in the
same  output "contents file". I did for that:
-------------------------------------------
\newwrite\@cfile
\newif\if at cfileopen \global\@cfileopenfalse

\def\@opencfile{\immediate\openout\@cfile=contents.f\relax
\global\@cfileopentrue}

\long\def\titlecontents#1{%
\if at cfileopen \else \@opencfile \fi
\begingroup
\let\protect\string
\immediate\write\@cfile{Title: #1 \thepage}%
\endgroup}
%
\long\def\authorcontents#1{%
\if at cfileopen \else \@opencfile \fi
\begingroup
\let\protect\string
\immediate\write\@cfile{Authors: #1}%
\endgroup}
--------------------------------------------------------
But when I compiled the first file "file1.tex" I successed to have in my
contents file "contents.f" the two entries title and authors of file1.tex.
And when I compiled the second file, the two first entries of file1.tex
have been erased and replaced by those of file2.tex.
My hope is how to add the other entries in the same contents file when I
compile the differents file one by one.

Thank you

>Robin Fairbairns
>
>UK TeX FAQ maintainer
>
>
>
>
>

--
Dr. Mohamed Houssni
Assistant d'Edition
e-Press,
Casablanca Technopark
20100 Casablanca - Maroc
Phone : 212 (0)22 52 58 00
Fax   : 212 (0)22 21 42 21