CTAN Comprehensive TeX Archive Network

Verzeichnis macros/latex/contrib/varsfromjobname

README.md

VarsFromJobname

Sources for my varsfromjobname package, available also from CTAN:

https://www.ctan.org/tex-archive/macros/latex/contrib/varsfromjobname

Credits

varsfromjobname.sty is based on code by supplied by Friedrich Vosberg, Enrico Gregorio and Markus Kohm, help from Rolf Niepraschk, Sven Naumann, Ulrich Schwarz and Andreas Mathias was greatly appreciated.

What does this package do?

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

The standard command \jobname returns the name of the (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 n (a highlevel

interface to the following commands)

  • \getonefromjobname
  • \gettwofromjobname
  • \getthreefromjobname
  • \getfourfromjobname
  • \getfivefromjobname
  • \getsixfromjobname
  • \getsevenfromjobname
  • \geteightfromjobname
  • \getninefromjobname

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.

References

Remark: egreg gave an improved version of the code written with expl3 which also overcomes the limitation of nine parameters.

License

Licensed under Project Public License (LPPL), as of today this is LPPL 1.3c. In case newer version of LPPL is published, those shall apply.

Change History

  • Version 0.5, as of January 11th 2009: Initial version published
  • Version 1.0, published May 2017:
    • Added various commands which extract necessary information also from included documents
    • Modified code as suggested by egreg
  • Version 1.1, published August 2025:
    • Switched to expl3 syntax, allowing more than nine tokens

2025-08-03, Uwe Ziegenhagen

Herunterladen des vollständigen Inhalts dieses Pakets in einem Zip-Archiv (216.2k).

VarsFromJobname – Extract variables from the name of the file

The package allows the user to extract information from the job name, provided that the name has been structured appropriately: the package expects the file name to consist of a set of words separated by hyphens.

PaketVarsFromJobname
Repositoryhttps://github.com/UweZiegenhagen/VarsFromJobname
Version1.1
LizenzenThe Project Public License 1.3c
BetreuerUwe Ziegenhagen
Enthalten inTeX Live als varsfromjobname
MiKTeX als varsfromjobname
ThemenDokumentmanagement
Expl3
...
Gästebuch Seiten-Struktur Impressum Autor kontaktieren