[OS X TeX] Synchronicity with Alpha?

Joachim Kock kock at math.uqam.ca
Fri Apr 16 08:46:13 EDT 2004


In order to synchronise from the source to a pdf file diplayed in
iTeXMac, In principle, Alpha should just issue something like

  tell application "iTeXMac"
     activate
     display "/path/to/myfile.pdf" at line 45 column 1 \
       file "/path/to/myfile.tex"
  end tell

I cannot get this to work, though.  (In fact I cannot get pdfsync to 
work at all...)  

You can make experiments with something like this little AlphaTcl script

  proc syncWithItexmac {} {
      # determine position:
      foreach {line col} [pos::toRowChar [getPos]] {}
      # determine tex file:
      set source [win::Current]
      # corresponding pdf file:
      set pdf [regsub {\.tex$} $source ".pdf"]
      # Ask iTeXMac to display that pdf file at the point
      # corresponding to the position in the source file:
      tclAE::send -r 'iTMx' iTMx Dspl \
        LINE $line COLU $col kfil [tclAE::build::TEXT $source] \
        ---- [tclAE::build::TEXT $pdf]
      switchTo iTeXMac
  }
  Bind F1 <co> syncWithItexmac TeX

which is supposed to open the pdf in iTeXMac corresponding to frontmost 
tex window in Alpha and go to the pdfsync point corresponding to the
cursor position.   (Here bound to Cmd-Opt-F1.)

To use it, place it in an Alpha file, select it and load it with Cmd-L.

If somebody has any success with this I would be happy to help making
it better and more polished (more careful about file determination, 
and perhaps with Cmd-double-click...)  If the AppleScript support
seems to be in place in iTeXShop, it should be easy to call it from
Alpha.

I hesitate to send this since it is at the same time technical and
doesn't work, but I hope that within a few more messages in this
thread, everything will work, and everybody will be happy...


Cheers,
Joachim.
-----------------------------------------------------
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the MacOSX-TeX mailing list