[texworks] Programmatic access to subsidiary file name

Philip TAYLOR P.Taylor at rhul.ac.uk
Thu Aug 23 07:23:58 CEST 2012

Philip TAYLOR wrote:

>> Since you're in control over \inputting the file, I'd just set the
>> filename in a macro, use it load the sub-file, then call it in the
>> input files.
> Excellent suggestion : I had completely overlooked that.
> Thank you, William.

Hang on, hang on, how is this going to work ?!

	% Garamond.tex
	% !TeX Program = XeTeX,
	% !TeX root = Genealogy.tex
	\define \fontfile {Garamond}

	% Calibri.tex
	% !TeX Program = XeTeX,
	% !TeX root = Genealogy.tex
	\define \fontfile {Calibri}

	% Genealogy.tex
	% !TeX Program = XeTeX,
	\input \fontfile

I launch Garamond.TeX; Garamond's leading pragmats tell TeXworks
to launch XeTeX with sourcefile = Genealogy.tex; XeTeX processes
Genealogy.tex and hits \input \fontfile

But as Garamond has not yet been processed, \fontfile is undefined.
And if I provide a default value, that default value will be used
regardless, since the would-be-included file has not yet been
include and executed ...

** Phil.

More information about the texworks mailing list