[texworks] Scripting root file behaviour

Vladimir Lomov lomov.vl at gmail.com
Wed Apr 11 08:12:31 CEST 2012

** Thomas Fehige [2012-04-09 23:36:43 +0200]:

> Hello,

> I'm trying to get the behaviour in TeXWorks that WinEdt offers with
> their application-wide "main file" setting. There, the root file is
> set (or un-set) once by the user and then, no matter which file you
> are working on, the typesetting command will either run the "main
> file" or, if none is set, the file in the present window.

> I've managed to set a global variable to contain the present file
> name and to retrieve that file name. I guess I'd also manage to save
> it when TW closes and load it again at the next start. But I have no
> clue how I can access/change the file name that is sent to the
> typesetting program. Any hints?

Of course, you are familiar with concept of 'root file', see

(This may be sub-optimal but works good.)

Let's me restate you question (if I'm right): you want to set 'root
file' by means of some function in TeXworks interface, for example by a

WBR, Vladimir Lomov

For those of you who have been unfortunate enough to never have tasted the
'Great Chieftain O' the Pudden Race' (i.e. haggis) here is an easy to follow
recipe which results in a dish remarkably similar to the above mentioned
protected species.
	  1 Sheep's Pluck (heart, lungs, liver) and bag
	  2 teacupsful toasted oatmeal
	  1 teaspoonful salt
	  8 oz. shredded suet
	  2 small onions
	1/2 teaspoonful black pepper
	Scrape and clean bag in cold, then warm, water.  Soak in salt water
overnight.  Wash pluck, then boil for 2 hours with windpipe draining over
the side of pot.  Retain 1 pint of stock.  Cut off windpipe, remove surplus
gristle, chop or mince heart and lungs, and grate best part of liver (about
half only).  Parboil and chop onions, mix all together with oatmeal, suet,
salt, pepper and stock to moisten.  Pack the mixture into bag, allowing for
swelling.  Boil for three hours, pricking regularly all over.  If bag not
available, steam in greased basin covered by greaseproof paper and cloth for
four to five hours.

More information about the texworks mailing list