[texhax] Write18
Paul Isambert
zappathustra at free.fr
Tue Apr 24 08:07:53 CEST 2012
Vafa Khalighi <simurgh12 at gmail.com> a écrit:
>
> Hi
>
> I have implemented a preprocessor that say convert a filename.tex to
> filename.ltx (it puts LTR words, small sentences inside \LRE macro). I want
> to automate the process via \write18 so that when a user has filename.tex
> and runs pdflatex on filename.tex, then automatically via write18:
>
>
> - preprocessor is called and converts filename.tex to filename.ltx
> - pdflatex is run on filename.ltx (pdflatex filename.ltx)
> - deletes filename.ltx when PDF output is produced
>
>
> What I find impossible is the second one. I can not have a second run of
> pdflatex inside the first pdflatex run. Is there any solution to this
> problem?
If your call is "pdflatex filename.tex" I can't even see how you do the
first one automatically; could you expand on that?
Anyway, solutions include: changing your call so that it first calls
the preprocessor, then "pdflatex filename.ltx", then deletes the file;
or you can use a master file with an input file:
%%%
\documentclass{whatever}
\usepackage{preprocessor}
\begin{document}
\preprocess{filename.tex}
\end{document}
%%%
where "\preprocess" (defined e.g. in the "preprocessor" package) would
write "filename.ltx", then call "\input filename.ltx" and finally delete
the file.
You can also avoid the master/input files with a call like :
pdflatex --jobname=filename
\documentclass{whatever}
\usepackage{preprocessor}
\begin{document}
\preprocess{filename.tex}
\end{document}
If your text editor doesn't let you customize your call to TeX that way,
well, just switch to another one :)
Best,
Paul
More information about the texhax
mailing list