[texhax] [texworks] Programmatic access to subsidiary file name

William Adams will.adams at frycomm.com
Thu Aug 23 18:31:33 CEST 2012


On Aug 23, 2012, at 1:23 AM, Philip TAYLOR wrote:

> 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 ...

The name commands have to be in Genealogy.tex:

> 	% Genealogy.tex
> 	% !TeX Program = XeTeX,

> 	\define \fontfile {Garamond}
> 	\define \fontfile {Calibri}

> 	\input \fontfile


Just comment out the one you don't want.

I don't know of a way to do this w/o touching Genealogy.tex, unless you had:

\input fontfile.tex

and then you made fontfile.tex a file which included the \define \fontfile lines, and you edited that.

Though if you're fiddling at that level, perhaps you could just make fontfile.tex a link to Garamond.tex and change the link to Calibri.tex or some other file at need.

William

PS - glad you enjoyed Counterpunch --- I agree it's a fabulous and informative book, which is unique in its coverage and perspective.
-- 
William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.




More information about the texhax mailing list