auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX] Re: View command with forward/inverse search


From: Ralf Angeli
Subject: [AUCTeX] Re: View command with forward/inverse search
Date: Thu, 12 Jan 2006 00:22:49 +0100

* Bjørn Haagensen (2006-01-11) writes:

> As far as I understand the view-command launed by auctex depends on
> the parsed file-information. So if using the pstricks-package in the
> document, the view-command will be something like 'dvips file.dvi -o
> && gv file.ps'. Of course this is not what I want for
> forward/inverse search in which case I want the proper
> xdvi-command. The only way I know to get around this is either to:
>
> -remove '\usepackage{pstricks}' (and all its uses) from the source-files, or
> -remove regexp involving 'pstricks' from 'Tex-output-view-style'.
>
> Neither of these solutions are optimal for me as I would like to
> retain convenient access to 'normal' view mode. I was thinking that
> there perhaps was a way of overriding 'Tex-output-view-style' when
> in tex-source-specials mode, but I haven't been able to locate a
> setting for this.

Unfortunately there isn't an option for achieving what you want.  As a
brute-force workaround you could hook into the function checking for
style options before the viewer is called and temporarily remove all
PSTricks-related styles.  This could be done with the following piece
of advice:

(defadvice TeX-output-style-check (around TeX-output-style-check-advice
                                          activate)
  "Temporarily remove PSTricks-related options in TeX Source Specials mode."
  (let (removed-styles)
    (when TeX-source-specials-mode
      (dolist (elt TeX-active-styles)
        (when (string-match "\\`pst\\(ricks\\|-.+\\)\\'" elt)
          (push elt removed-styles)
          (setq TeX-active-styles (delete elt TeX-active-styles)))))
    ad-do-it
    (nconc TeX-active-styles removed-styles)))

Please note that this involves fiddling with internals of AUCTeX's
style system and is not guaranteed to work in all future versions of
AUCTeX.  Maybe not even in current versions.  But I am confident that
it does. (c;

-- 
Ralf





reply via email to

[Prev in Thread] Current Thread [Next in Thread]