[OS X TeX] path name

Peter Dyballa Peter_Dyballa at Web.DE
Fri Nov 18 11:24:39 EST 2005


Am 18.11.2005 um 16:23 schrieb Friedrich Vosberg:

> I found, that
>
>     \immediate\write18{pwd |
>     awk '{print "\\newcommand{\\path}{" $0 "\\xspace}"}' > 
> tmpdatei.tex}
>
> works too.

Yes, you take the whole line.

>
>>> And BTW umlauts are ignored too. What can I do to get right umlauts 
>>> in \path
>>
>> No. There are no umlauts. You can put umlauts into your TeX files, 
>> but Mac OS X returns decomposed UTF-8 characters. So an umlaut 
>> usually is [aeiouyAEIOUY]¨.
>
> Ahem ... in Terminal.app umlauts were transcripted to terms like
>
>     \303\244
>     \303\266
>     \303\274

Don't write this! You can change Terminal's behaviour in how it shows 
'codes' as 'glyphs.' And Terminal itself can't display a file name. 
It's either ls or the shell's completion mechanism. You can make ls 
work right by make it an alias to 'ls -w'.

>
> and in the pdf file pathname.tex for instance an double dotted o in 
> the the path
>
>     ~/Desktop/möglich/pathname.tex
>
> looks like written as
>
>     \documentclass{ltxdoc}
>     \begin{document}
>     o\~A\`a
>     \end{document}
>
> It would be so great if I could get pathnames with directory names 
> containing umlauts!

Supposed your TeX source is always the most recent file in the 
directory, you can detect this with 'ls -w1t'. With head you catch the 
first name, with iconv you convert the UTF-8 name into ISO Latin:

	ls -1tw | head -1 | iconv -f UTF-8-MAC -t ISO-8859-15

You too can put the iconv part after or before awk:

	\immediate\write18{pwd | iconv -f UTF-8-MAC -t ISO-8859-15 | awk 
-F'\\n' '{print "\\newcommand{\\path}{" $1 "\\xspace}"}' > 
tmpdatei.tex}

	\immediate\write18{pwd | awk -F'\\n' '{print "\\newcommand{\\path}{" 
$1 "\\xspace}"}'  | iconv -f UTF-8-MAC -t ISO-8859-15 > tmpdatei.tex}

I think the first form is more promissing, since you reduce two or 
three bytes of an UTF-8 representation to only one. And I think the 
right one! Be sure to set TeX's input encoding to that of iconv's 
output encoding! iconv's knowledge of encodings is listed with 'iconv 
-l'.

--
Greetings

   Pete

There is no national science just as there is no national
multiplication table; what is national is no longer science.
          -- Anton Checov

------------------------- 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 MacOSX-TeX mailing list