[texworks] Programmatic access to subsidiary file name

Philip TAYLOR P.Taylor at rhul.ac.uk
Wed Aug 22 12:32:06 CEST 2012

Suppose that I am experimenting with setting a genealogical tree in
a number of fonts; the main tree code lives in Genealogy.tex, whilst
each font library lives in a file named from the font (e.g., Calibri,
Garamond, ...).  Calibri.tex, Garamond.tex, etc., all start with two
pragmats :

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

but my main file (Genealogy.tex) contains an explicit \input statement :

	\input  Calibri % Garamond % CMR % etc.

Is there any mechanism within TeXworks for interpolating the name of
the dependent file into the main file, using a syntax such as :

	\input	$Initiating-file

where "Launch-file" is the file from which the "Typeset" process
was initiated.

Obviously this would require that the primary file be fed not directly
into the compiler but rather via a pre-processor, but that does not
seem excessively onerous in terms of the benefits thereby gained.

Philip Taylor

More information about the texworks mailing list