%begin of varsfromjobname.sty
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{varsfromjobname}[2008/05/12 v. 0.4 extracts tokens from jobname (UZ)]
\RequirePackage{ifthen} 

% Author: Uwe Ziegenhagen
% based on code supplied by Friedrich Vosberg and Markus Kohm
% help by Rolf Niepraschk and Sven Naumann, Ulrich Schwarz 
% and Andreas Mathias was greatly appreciated
% see posting <3983639.NRU96H2Y1Y@ID-107054.user.dfncis.de>
% requires the filename to be of the following form
% itemone-itemtwo-itemthree- ... -itemnine.tex

\makeatletter

\newcommand*{\getonefromjobname}{%
  \expandafter\@getonefromfilename\jobname--------\@nil%
}

\newcommand*{\gettwofromjobname}{%
  \expandafter\@gettwofromfilename\jobname--------\@nil%
}

\newcommand*{\getthreefromjobname}{%
  \expandafter\@getthreefromfilename\jobname--------\@nil%
}

\newcommand*{\getfourfromjobname}{%
  \expandafter\@getfourfromfilename\jobname--------\@nil%
}

\newcommand*{\getfivefromjobname}{%
  \expandafter\@getfivefromfilename\jobname--------\@nil%
}

\newcommand*{\getsixfromjobname}{%
  \expandafter\@getsixfromfilename\jobname--------\@nil%
}

\newcommand*{\getsevenfromjobname}{%
  \expandafter\@getsevenfromfilename\jobname--------\@nil%
}

\newcommand*{\geteightfromjobname}{%
  \expandafter\@geteightfromfilename\jobname--------\@nil%
}

\newcommand*{\getninefromjobname}{%
  \expandafter\@getninefromfilename\jobname\@nil%
}

\newcommand*\@getonefromfilename{}
\def\@getonefromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#1%
}

\newcommand*\@gettwofromfilename{}
\def\@gettwofromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#2%
}

\newcommand*\@getthreefromfilename{}
\def\@getthreefromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#3%
}

\newcommand*\@getfourfromfilename{}
\def\@getfourfromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#4%
}

\newcommand*\@getfivefromfilename{}
\def\@getfivefromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#5%
}


\newcommand*\@getsixfromfilename{}
\def\@getsixfromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#6%
}


\newcommand*\@getsevenfromfilename{}
\def\@getsevenfromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#7%
}

\newcommand*\@geteightfromfilename{}
\def\@geteightfromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#8%
}

\newcommand*\@getninefromfilename{}
\def\@getninefromfilename#1-#2-#3-#4-#5-#6-#7-#8-#9\@nil{%
#9%
}

\newcommand{\getfromjobname}[1]{
\ifthenelse{\equal{#1}{1}}{\getonefromjobname}{}
\ifthenelse{\equal{#1}{2}}{\gettwofromjobname}{}
\ifthenelse{\equal{#1}{3}}{\getthreefromjobname}{}
\ifthenelse{\equal{#1}{4}}{\getfourfromjobname}{}
\ifthenelse{\equal{#1}{5}}{\getfivefromjobname}{}
\ifthenelse{\equal{#1}{6}}{\getsixfromjobname}{}
\ifthenelse{\equal{#1}{7}}{\getsevenfromjobname}{}
\ifthenelse{\equal{#1}{8}}{\geteightfromjobname}{}
\ifthenelse{\equal{#1}{9}}{\getninefromjobname}{}
}

\makeatother
% end of jobdate.sty
