[macemacsjp-english 886] Re: auctex/pdf

Back to archive index

Kasper Daniel Hansen khans****@stat*****
Wed Feb 7 04:33:58 JST 2007


On Feb 5, 2007, at 3:03 PM, Roussanka Loukanova wrote:

> Hi Kasper,
>
> On Mon, 5 Feb 2007, Kasper Daniel Hansen wrote:
> ...
>
>>
>> In my opinion there is no discussion: the default setting should be
>> to invoke "open" on the file. The user then needs to configure his
>> system to work as he intends, eg. to associate PDFView permanently
>> with PDF files (as I have done) and do something similar with dvi
>> files. This is a default setting for an application - of course it
>> should use default settings for that file from the OS. Anything else
>> assumes quite a bit on how peoples systems are set up.
>>
>> While I prefer PDFView for pdf files I do not think it is reasonable
>> to enforce that on a user via a default setting.
>
> I agree with you that this is a rational decision. For example, I  
> prefer
> Preview, but this should not be forced on other users, and I myself  
> may
> change my mind some day.
>
>>
>> There could be however, a question on the webpage on how to configure
>> AUCTeX with a link to PDFView and similar (where I have helped
>> putting up some (currently incomplete) solutions for Carbon Emacs.
>
> Where is this information? May be you have a better solution than  
> mine.
>
> I myself have used the previous solution that I already posted: I  
> added
> up an external AUCTeX Command for viewing dvi files (by a compound  
> command
> created with sh script which converts the dvi into pdf and then  
> opens the
> pdf in Preview). By doing so, AUCTeX could not anymore, by default,  
> open
> Preview for pdf files created with pdflatex. So, I just added this by
> Customize AUCTeX, I made by INS "open -a Preview" the default View for
> files with pdf ("^pdf$") extension.
>
> How did you add PDFView?

I added the following to my .emacs:

(server-start)
(defun raise-emacs-on-aqua()
   (shell-command
    "osascript -e 'tell application \"Aquamacs Emacs\" to activate' &"))
(add-hook 'server-switch-hook 'raise-emacs-on-aqua)

The chunk above is to enable inverse search using PDFView and Emacs.  
You need to add some stuff to PDFView's preferences as well.

(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)))))
))

This one here just uses PDF view to open the file. Another way is to  
use Seiji-sans code and associated PDFView as the default application  
for PDF files (which I greatly prefer - it is a wonderful reader once  
you get used to it).

Kasper




More information about the macemacsjp-english mailing list
Back to archive index