[OS X TeX] Filenames with spaces (was: Number of pages with AppleScript in TeXShop)

Maarten Sneep maarten.sneep at xs4all.nl
Wed Oct 19 15:55:34 EDT 2005


Replying to one's own messages, I'm terribly sorry- and top posting  
to boot. I have another question[1] while debugging my scripts: What  
is the official syntax when one want to input or include a file in  
tex or in latex?


[1] the rest of the discussion isn't really needed to answer this  

On 19 Oct 2005, at 20:53, Maarten Sneep wrote:

> On 19 Oct 2005, at 0:10, Peter Dyballa wrote:
>> Am 18.10.2005 um 23:23 schrieb Maarten Sneep:
>>> # find the real master file (TeXShop 2.0 Style first)
>>> sourcedoc=`awk -F= '/^%!TEX *[Rr]oot/{print $2}' < $frontdoc`
>>> # if the new method didn't give a result, try the old method:
>>> if [ "$sourcedoc" = "" ]; then
>>>     sourcedoc=`awk '/^%SourceDoc/{print $2}' < $frontdoc`
>>> fi
>>> I realise just now that this only works on files without spaces  
>>> in their names. How does TeXShop do this (does it actually work?)  
>>> I guess I should be using sed or cut to get the correct value.  
>>> OK, we'll add a statement that support for filenames with spaces  
>>> is limited.
>> Maarten, you shouldn't worry! Just try another method: sed -e 's/^% 
>> SourceDoc *//' ... $frontdoc needs double quotes.
> Actually, it works for the new syntax (because I split on =, not on  
> whitespace). The old syntax requires some work, and somehow I don't  
> think this sed snippet completely does what I need. For lines  
> starting with %SourceDoc, I need the rest of the line (not just the  
> second whitespace delimited chunk). This script will set sourcedoc  
> to the wholefile except the %SourceDoc line.

------------------------- 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