[texworks] Programmatic access to subsidiary file name

William Adams will.adams at frycomm.com
Wed Aug 22 15:32:44 CEST 2012

On Aug 22, 2012, at 6:32 AM, Philip TAYLOR wrote:

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

AFAIK, there's only \jobname, which would get you Genealogy.tex.

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.


William Adams
senior graphic designer
Fry Communications
Sphinx of black quartz, judge my vow.

More information about the texworks mailing list