# Avoid quotation marks when using \jobname or \currfilename

When typesetting a file (using TeXworks on a Windows machine) which includes white spaces, then the jobname will contain the file name enclosed with double quotes. pdflatex Local\ Guide.tex will set jobname to "Local Guide" and currfilename to "Local Guide".tex.

This is somewhat undesirable for me. Is there any way to eliminate the quotation marks? My corporate design requires the file name to appear in the page footer -- including the file extension .tex but excluding the quotes.

The quotes are (or should be) balanced 'behind the scenes'. Thus we can just strip off a set, for example

\documentclass{article}
\newcommand*{\myjobname}{}
\newcommand*{\setmyjobname}{%
\edef\myjobname{\jobname}%
\expandafter\expandafter\expandafter\setmyjobnameaux
\expandafter\myjobname\expandafter"\myjobname"\relax
}
\newcommand*{\setmyjobnameaux}{}
\def\setmyjobnameaux#1"#2"#3\relax{\def\myjobname{#2}}
\setmyjobname
\begin{document}
[\jobname][\myjobname]
\end{document}


The idea here is that "#2" will match the 'real' name whether or not there were any quotes around the original name. We can't change \jobname (or rather we can't change the internal data which it uses), so I've called the 'simplified' value a different name. That also avoids the case where something else uses \jobname and does need the quotes.