• No results found

varsfromjobname Description

N/A
N/A
Protected

Academic year: 2021

Share "varsfromjobname Description"

Copied!
4
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

varsfromjobname Description

Uwe Ziegenhagen, ziegenhagen@gmail.com May 1st 2016

Using varsfromjobname.sty one can easily extract information from the filename, if it follows a certain form. The LaTeX command \jobname returns the name of the LaTeX 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 (highlevel interface to the following commands)

• \getonefromjobname

• \gettwofromjobname

• \getthreefromjobname

• \getfourfromjobname

• \getfivefromjobname

• \getsixfromjobname

• \getsevenfromjobname

• \geteightfromjobname

• \getninefromjobname

1

(2)

For included documents the package uses the currfile package to provide the following commands:

• \getfromcurrfilename{param}, with param in the range of 1 to 9 (highlevel inter- face to the following commands)

• \getonefromcurrfilename

• \gettwofromcurrfilename

• \getthreefromcurrfilename

• \getfourfromcurrfilename

• \getfivefromcurrfilename

• \getsixfromcurrfilename

• \getsevenfromcurrfilename

• \geteightfromcurrfilename

• \getninefromcurrfilename

Example

Place the code from Listing 1 in a file a-b-c-d-e-f-g-h-i-j.tex and the code from Listing 2 in a file named z-y-x-w-v-u-t-s-r-q.tex. Then compile the first file with pdflatex.

Listing 1: a-b-c-d-e-f-g-h-i-j.tex

% t e s t f i l e s f o r v a r s f r o m j o b n a m e . s t y

\ d o c u m e n t c l a s s { a r t i c l e }

\ l i s t f i l e s

\ u s e p a c k a g e [ u t f 8 ] { i n p u t e n c }

\ u s e p a c k a g e [ T 1 ] { f o n t e n c }

\ u s e p a c k a g e { v a r s f r o m j o b n a m e }

\ b e g i n { document }

a : \ getonefromjobname % a b : \ gettwofromjobname % b c : \ g e t t h r e e f r o m j o b n a m e % c

2

(3)

d : \ g e t f o u r f r o m j o b n a m e % d e : \ g e t f i v e f r o m j o b n a m e % e

f : \ g e t s i x f r o m j o b n a m e % f g : \ g e t s e v e n f r o m j o b n a m e % g h : \ g e t e i g h t f r o m j o b n a m e %h

i −j : \ g e t n i n e f r o m j o b n a m e % i −j a : \ getfromjobname { 1 } % a

b : \ getfromjobname { 2 } % b c : \ getfromjobname { 3 } % c d : \ getfromjobname { 4 } % d e : \ getfromjobname { 5 } % e f : \ getfromjobname { 6 } % f g : \ getfromjobname { 7 } % g h : \ getfromjobname { 8 } % h

i −j : \ getfromjobname { 9 } % i −j

\ i n p u t { z−y−x−w−v−u−t−s−r−q }

\ end { document }

Listing 2: z-y-x-w-v-u-t-s-r-q.tex z : \ g e t o n e f r o m c u r r f i l e n a m e

y : \ g e t t w o f r o m c u r r f i l e n a m e x : \ g e t t h r e e f r o m c u r r f i l e n a m e w : \ g e t f o u r f r o m c u r r f i l e n a m e

3

(4)

v : \ g e t f i v e f r o m c u r r f i l e n a m e u : \ g e t s i x f r o m c u r r f i l e n a m e

t : \ g e t s e v e n f r o m c u r r f i l e n a m e s : \ g e t e i g h t f r o m c u r r f i l e n a m e r−q : \ g e t n i n e f r o m c u r r f i l e n a m e

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 infor- mation also from included documents Modified code as suggested by egreg

2017-05-01, Uwe Ziegenhagen

4

Referenties

GERELATEERDE DOCUMENTEN

Most similarities between the RiHG and the three foreign tools can be found in the first and second moment of decision about the perpetrator and the violent incident

The third hypothesis states that lean start-up capability moderates the U-shaped relationship between servitization and firm performance; the model found no significant effect on

Starting from the first token in hgtl vari, this function finds a pattern of the form htokens1i {htokens2i}, where the htokens1i contain no begin-group nor end-group characters,

If the option foot was passed to the package, you may consider numbering authors’ names so that you can use numbered footnotes for the affiliations. \author{author one$^1$ and

• You must not create a unit name that coincides with a prefix of existing (built-in or created) units or any keywords that could be used in calc expressions (such as plus, fil,

\l__unravel_setup_restore_tl This token list variable will contain code to restore category codes to their value when the package was loaded.. 20 \gdef \l__unravel_setup_restore_tl {

The package is primarily intended for use with the aeb mobile package, for format- ting document for the smartphone, but I’ve since developed other applications of a package that

An algebra task was chosen because previous efforts to model algebra tasks in the ACT-R architecture showed activity in five different modules when solving algebra problem;