[OS X TeX] "Insert File Path..." TeXShop Script

Ramón M. Figueroa-Centeno ramonf at hawaii.edu
Sun Mar 15 07:59:15 CET 2009


Aloha,

I have uploaded to my site
<http://www2.hawaii.edu/~ramonf/TeXShop/index.html> a script for TeXShop,
called "Insert File Path...", that inserts \input{€}, \include{€} or
\includegraphics[]{€}, where € is either a relative or an absolute path to a
file the user chooses. It tries to be smart about spaces in file paths (most
likely an impossible task, so this feature can be turned off; see below).
Beware that that for \include{€} the path € can only be to the directory of
the target document or a subdirectory thereof. Therefore, if an \include{€}
is impossible, no choice will be presented, and an \input{€} will be
automatically entered. This might be confusing to a user that does not know
of this limitation.

It is customizable by setting the values of "properties" at the beginning of
the script:

1. To forbid spaces in paths set no_spaces to "true".
2. To also be given the choice, when possible, to use absolute paths set
absolute to "true".
3. To set the suffixes that \include and \input can handle (as far as I know
only "tex") modify the "Texts" list property.
4. To limit the suffixes that \includegraphics can handle modify the
property "Graphics". Add to this list to teach the macro new formats, or
have it disregard this list altogether (see next).
5. Now, what \includegraphics can handle depends on the platform, driver,
etc. So you can switch off file type checking by setting ignore_suffix to
true. If you do so any file whose suffix is not in the "Texts" list will be
considered a graphics file.

Suffixes for graphics files which do not work with \includegraphics if their
paths have spaces in them are in the list property GraphicsWithoutSpaces. As
of this writing I know that TIFFs (tif) and JPEGs (jpg) fall in this
category.

Now, I like to have the possibility of spaces in file names (no_spaces:
false), no absolute paths (absolute:false), and I like to limit the kinds of
graphic files it can handle (ignore_suffix:false).

The script is complex so your mileage may vary. Please let me know if you
find any bugs.

Enjoy!

Ramón

-- 

Ramón M. Figueroa-Centeno, Ph.D.
Associate Professor

Mathematics Department
University of Hawaii at Hilo
College Hall 4-A
200 W. Kawili St.
Hilo, HI 96720-4091

(808) 974-7387 (office)
(808) 933-3473 (fax)

http://www2.hawaii.edu/~ramonf/





More information about the macostex-archives mailing list