[OS X TeX] Synchronicity with Alpha?

Joachim Kock kock at math.uqam.ca
Fri Apr 16 11:37:46 EDT 2004


>The correct syntax is
>
>  tell application "iTeXMac"
>     activate
>     display "/path/to/myfile.pdf" at line 45 column 1 in source "/path/to/myfile.tex"
>  end tell

I tried this too, with no difference.  I am sure there is something
fundamental I haven't understood about pdfsync.  As I said I can't
get it to work inside iTeXMac either...  Aren't there supposed to
be small red dots in the display window?  Cmd-= doesn't change anything.

With your correction, the 'kfil' just has to be replaced by 'SRCE'
in the script, which then reads:

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 SRCE [tclAE::build::TEXT $source] \
      ---- [tclAE::build::TEXT $pdf]
    switchTo iTeXMac
}
Bind F1 <co> syncWithItexmac TeX

>I paste this into an alpha window, select it and pressed cmd-L,
>nothing special happens.
> unbound
>
>What was wrong?

I don't know what could be wrong with this.  What happens if
after Cmd-L you do describe binding (just to see if this has
been loaded or not).  Open a TeX document and do

   F6 followed by cmd-opt-F1

Ideally this should give a message saying that cmd-opt-F1 is
bound to syncWithItexmac.  If it does not work you can try to put
it in your prefs.tcl file and restart Alpha...

The precise instruction to test the script is: in a tex document
which has been compiled with pdfsync, move the cursor to the
position you want to see in the pdf file, and then press cmd-opt-F1.

It strikes me that the F-keys are sometimes dominated by the
system for some system-wide actions.  Perhaps it is better to
try another key-combination, like for example

Bind 's' <coz> syncWithItexmac TeX

which is Cmd-opt-ctrl-s.


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