Posts tagged ‘varsfromjobname’

Neue Version des varsfromjobname Pakets

Letzten Montag habe ich die neue Version meines varsfromjobname Pakets auf CTAN hochgeladen, es gibt auch ein Github Repo dazu:

What does this package do?

Using varsfromjobname.sty one can easily extract information from the filename, if it follows a certain form.

The standard LaTeX command \jobname returns the name of the LaTeX (master) file. If the filename consists of tokens separated by hyphen we can easily extract certain tokens that can be used inside the document.

The package expects the filename to be of the form one-two-three-four-five-six-seven-eight-nine.tex and offers the following commands:

\getfromjobname{param}, with param in the range of 1 to 9 (a highlevel interface to the following commands)


Why can it be useful?

You can use this package for example to define the date of the document in the filename, personally I use it e.g. for scrlttr2 letters.

Change History

  • Version 0.5, as of January 11th 2009: Initial version published
  • Version 1.0, to be published May 2017: Added various commands which extract necessary information also from included documents. Modified code as suggested by egreg


  • \getfromjobname is not fully expandable, use one of the other commands if you need expansion
  • Version 1.0 cannot extract information from included sub-documents
  • The package cannot handle more than nine tokens, see the reference to egreg’s answer on TSX below for an updated version


Uwe Ziegenhagen has been working with LaTeX for more than a decade. Besides TeX/LaTeX he likes to work with Python, Rasberry/Arduino and his digital camera.

More Posts - Website