[Mac OS X TeX] Script for creating .texshop files in a tree
Maarten Sneep
sneep at nat.vu.nl
Mon Nov 19 09:08:45 EST 2001
Hello,
Sometime last week we had a discussion about absolute paths in .texshop files.
The script I give away here, will create the .texshop files for you (for all
tex files found beneath the current directory, all pointing to the argument of
the script.
Usage:
TeXShopRootRefs project-root-file.tex
There are no checks on the arguments, please use with care!
The script starts after this line.
#!/bin/sh
# A small script that will create ".texshop" files for a given tree
# usage: TeXShopRootRefs rootfile.tex
# from the directory you want your tree to start.
# It assumes that you have a tree with tex documents which are
# all included by a single master doc.
#
# Written By Maarten Sneep.
# I do not assume any responsibility for damage cause by this script,
# Use at your own risk (try it out on a fake tree if you want to).
# I only know it works for me.
# Happy TeXing...
# variables
dir=`pwd`
root_file="$1"
contents="$dir/$root_file"
temporary_script_file="$dir/temporary_script.$$.sh"
# create an auxiliary script that creates the files from a bsic name
# This should be possible from find directly, but I have yet to figure
# out how...
cat >$temporary_script_file <<EOF
#!/bin/sh
echo -n "$contents" > "\$1shop"
EOF
# Make temp script executable
chmod 700 $temporary_script_file
# run find to find all "*.tex" files, starting in the current dir and
# creating the "*.texshop" file with each tex file found.
find $dir -name "*.tex" -exec $temporary_script_file {} \;
# remove temp script
rm $temporary_script_file
# End of script
# Save the above, starting from the line with "#!/bin/sh" in a text file
# and make it executable ("chmod a+x TeXShopRootRefs" should suffice, where
# TeXShopRootRefs is the name of the script-file
#Maarten Sneep
#
#>>>-----------------------------------------------------------------------
#Murphy's Law, supplemental:
#A short cut is the longest distance between two points.
#>>>-----------------------------------------------------------------------
#Maarten Sneep
#Atomic- and Laser Physics group
#vrije Universiteit, amsterdam
#The Netherlands
-----------------------------------------------------------------
To UNSUBSCRIBE, send email to <info at email.esm.psu.edu> with
"unsubscribe macosx-tex" (no quotes) in the body.
For additional HELP, send email to <info at email.esm.psu.edu> with
"help" (no quotes) in the body.
This list is not moderated, and I am not responsible for
messages posted by third parties.
-----------------------------------------------------------------
More information about the MacOSX-TeX
mailing list