[OS X TeX] Re: Some ideas LaTeX on iPad, iPhone, etc.

Herbert Schulz herbs at wideopenwest.com
Tue Mar 23 09:51:44 CET 2010


On Mar 22, 2010, at 11:41 PM, Ramón Figueroa-Centeno wrote:

> 
> Aloha,
> 
> Let me reply my own question :)
> 
> Our goal is to have a folder such that any change to the folder will trigger
> an execution of pdflatexmk on all the files within with suffix "tex" in the
> folder. In my case I want the folder to be inside my DropBox folder, So I
> assume my target folder is "~/DropBox/LaTeXMe". I assume that you have
> TeXShop installed and Herb Schultz's pdflatexmk engine enabled (that is, you
> moved ~/Library/TeXShop/Engines/Inactive/Latexmk/pdflatexmk.engine to
> ~/Library/TeXShop/Engines/)
> 
> Here are the steps:
> 
> 1. In a text editor create a bash script, which I did in ~/bin/latexme.sh,
> that will create the folder if it does not exist, cd to it, and run
> pdflatexmk on all the ".tex" files therein:
> 
> #!/bin/sh
> 
> engine="$HOME/Library/TeXShop/Engines/pdflatexmk.engine"
> LaTeXMeDir="$HOME/Dropbox/LaTeXMe"
> 
> mkdir -p $LaTeXMeDir
> cd $LaTeXMeDir
> find . -type f -name '*.tex' -execdir $engine '{}' \;
> 
> 3. Make sure the script is executable, e.g. type in the Terminal "chmod +x
> ~/bin/latexme.sh" (no quotations, of course).
> 
> 2. In a text editor create a "Launch Agent" (say
> ~/Library/LaunchAgents/com.ramonfigueroacenteno.LaTeXMe.plist) to watch our
> LaTeXMe folder for changes and trigger the script:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> <plist version="1.0">
> <dict>
> 	<key>KeepAlive</key>
> 	<false/>
> 	<key>Label</key>
> 	<string>com.ramonfigueroacenteno.LaTeXMe</string>
> 	<key>ProgramArguments</key>
> 	<array>
> 		<string>/Users/ramon/bin/latexme.sh</string>
> 	</array>
> 	<key>QueueDirectories</key>
> 	<array/>
> 	<key>WatchPaths</key>
> 	<array>
> 		<string>/Users/ramon/Dropbox/LaTeXMe</string>
> 	</array>
> </dict>
> </plist>
> 
> 4. Load your Launch Agent, e.g. "launchctl load
> ~/Library/LaunchAgents/com.ramonfigueroacenteno.LaTeXMe.plist" in the
> Terminal.
> 
> Note that give that the script is very short one could easily inbed it the
> Launch Agent, but I prefer it this way since I can more easily tweak the
> script if needed.
> 
> That's it!
> 
> Enjoy!
> 
> Ramón
> 

Howdy,

Interesting... I think that if you execute the pdflatex.engine without any argument (usually the argument is the tex file you want to compile) it will act on all of the tex files in the present working directory. Assuming that works you need not use the find command.

Good Luck,

Herb Schulz
(herbs at wideopenwest dot com)






More information about the macostex-archives mailing list