[OS X TeX] pdfSync with Skim and Aquamacs 1.3a
Roussanka Loukanova
rloukano at stp.lingfil.uu.se
Mon Mar 17 07:50:41 EDT 2008
On Mon, 17 Mar 2008, Johannes Brauer wrote:
>
> Am 16.03.2008 um 23:26 schrieb Roussanka Loukanova:
>
>> Johannes, perhaps you didn't put the needed code in your ~/.emacs file. See
>> the topic Setting up Emacs about the bottom of the page at:
>>
>> <http://skim-app.sourceforge.net/wiki/index.php/LaTeX_and_PDFSync>
> I put the following in my Preferences.el (the Aquamacs alternative to
> ~/.emacs)
> (require 'tex-site)
> (add-hook 'TeX-mode-hook
> (lambda ()
> (add-to-list 'TeX-output-view-style
> '("^pdf$" "."
> "/Applications/Skim.app/Contents/SharedSupport/displayline %n %o
> %b")))
> )
>
This is right.
> But addtionally I have to put in:
> (setq pdf-previewer-program "open -a Skim")
>
> Without that C-c C-c Ret or C-c C-v open the Preview program.
I haven't put the later code line in .emacs. BTW, in order to get Skim
opening the pdf, you need to use pdflatex. If you use latex, then either
TeXShop or Preview opens (depending on the settings of your emacs).
> But as said before: with these settings Skim opens but does not move to the
> corresponding line.
It should go at least in the same paragraph.
Perhaps, you would like to try also Carbon Emacs and see how it would do
with Skim and PDFView:
<http://homepage.mac.com/zenitani/emacs-e.html>
BTW, I actually use most of the time PDFView, since I do not put notes on
the pdfs, and because PDFView works with simpdftex with no additional
fiddling (for Skim with simpdftex, you need to add some patches).
Let me know what you get. Here is all code that I have for the PDFView in
my .emacs. Note that I replaced the line having the & with
the do-aplescript:
;;;; PDF viewing with PDFView and Skip
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; this is from PDFView instrs:
;; Starts the Emacs server
(server-start)
;; to make Emacs auto-raise when a Cmd + click is executed in PDFView
;; Shift+Cmd+Click over a point in Skim auto-rises Emacs at the
;; corresponding tex sourse
(defun raise-emacs-on-aqua()
;; (shell-command "osascript -e 'tell application \"Emacs\" to activate' &"))
(do-applescript "tell application \"Emacs\" to activate"))
;; the option with & above splits emacs window and opens *Async Shell
;; Command*
;; Show TeX line in PDFView or Skim
(add-hook 'server-switch-hook 'raise-emacs-on-aqua)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;; With PDFView (with Skim comment out these lines):
;; Ctrl-c Ctrl-c Ret on the LaTeX source pops-up PDFView to the
;; corresponding line/spot
;; The following only works with AUCTeX loaded
(require 'tex-site)
(add-hook 'TeX-mode-hook
(lambda ()
(add-to-list 'TeX-output-view-style
'("^pdf$" "."
"/Applications/PDFView.app/Contents/MacOS/gotoline.sh %n %(OutFullPath)"))
(add-to-list 'TeX-expand-list
'("%(OutFullPath)" (lambda nil
(expand-file-name
(TeX-active-master
(TeX-output-extension) t)
(TeX-master-directory))))))
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Roussanka
>
>>
>>
>> You also need to check
>>
>> Skim -> Prefrences -> Sync -> Preset [Emacs]
> yes, that is set to Aquamacs. The Skim-->Aquamacs direction works fine
>
>
> Johannes
More information about the MacOSX-TeX
mailing list