[OS X TeX] path name

Friedrich Vosberg vatolin at mac.com
Mon Jan 16 12:03:34 CET 2006


Morning.

Sorry for the ressurection of a dead ;-) but unfortunately this  
command ...

> Am 18.11.2005 um 17:24 schrieb Peter Dyballa:
>
>> \immediate\write18{pwd | iconv -f UTF-8-MAC -t ISO-8859-15 | awk - 
>> F'\\n' '{print "\\newcommand{\\path}{" $1 "\\xspace}"}' >  
>> tmpdatei.tex}

... does not absolut exactly work as I thougt. Because if I have to  
save a file into a directory containing an ampersand in its name  
(Procter & Gamble), the command produces an error.

How must the command be modified to avoid this behaviour?

===== 8>< =====
\documentclass{minimal}
\usepackage{xspace}
\begingroup
\let\\\relax
\immediate\write18{pwd | iconv -f UTF-8-MAC -t MacRoman | awk -F'\\n'  
'{print "\\newcommand{\\fvpath}{" $1 "\\xspace}"}' > tmppath.tex}
\immediate\write18{echo "\jobname" | iconv -f UTF-8-MAC -t MacRoman |  
awk -F'\\n' '{print "\\newcommand{\\fvfile}{" $1 "\\xspace}"}' >  
tmpfile.tex}
\endgroup
\input{tmppath.tex}
\input{tmpfile.tex}
\def\pathfile{\fvpath/\fvfile{}.tex}
\begin{document}
\pathfile
\end{document}
===== ><8 =====

TIA and kind regards. Friedrich


--
Windows, c'est un peu comme le beaujolais nouveau: a chaque nouvelle  
cuvee on sait que ce sera degueulasse, mais on en prend quand meme,  
par masochisme.


------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list