Hi,

I've just completely wiped out Skim and installed a fresh copy. I'm having a 
weird issue:

I used to use Skim with TeX and auto-refresh. If something during pdflatex 
screwed up I
used to just revert the file. So far so good.

A few weeks ago I started to give pandoc a try as a Markdown preprocessor for 
LaTeX.
Currently I use the xetex engine from pandoc to compile the markdown file to 
tex and from 
there to pdf. 

Skim seems not to pick up the change in the .pdf file and thus does not auto 
refresh. But 
it even has the "revert" menu item grayed out. No matter if I have the "Check 
for file changes"
option in the Sync settings enabled or not. I have to quit Skim and reopen it. 
There seems no
/simple/ way around right now.

Using AppleScript I was able to create some replacement using a script provided 
on the web[1]
as basis:

=== skim ===
#!/bin/bash
pdf_home=$(dirname $(./getlink $0))
exec osascript \
-e "tell application \"Skim\"" \
-e "activate" \
-e "open ((POSIX file \"$pdf_home/$*\") as string)" \
-e "revert front document" \
-e "end tell";


which needs the following helper script I found on SO [2]:

=== getlink ===
#!/bin/sh

TARGET_FILE=$1

cd `dirname $TARGET_FILE`
TARGET_FILE=`basename $TARGET_FILE`

# Iterate down a (possible) chain of symlinks
while [ -L "$TARGET_FILE" ]
do
    TARGET_FILE=`readlink $TARGET_FILE`
    cd `dirname $TARGET_FILE`
    TARGET_FILE=`basename $TARGET_FILE`
done

# Compute the canonicalized name by finding the physical path 
# for the directory we're in and appending the target file.
PHYS_DIR=`pwd -P`
RESULT=$PHYS_DIR/$TARGET_FILE
echo $RESULT


To glue it all together I currently use a Makefile that call's pandoc and skim 
in succession.

kindest regards,
 Moritz Angermann


[1] 
http://phaseportrait.blogspot.com/2007/07/script-to-open-file-in-skim-from.html
[2] 
http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Skim-app-users mailing list
Skim-app-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-users

Reply via email to