Vincent Belaïche | 1 Aug 2009 09:18
Picon
Favicon

Hooks for command on region and command on master

Dear all,

I would like to use different viewers when I view a region and when I
view the master file.

The reason is that I prefer to have GSView for region because it is
possible to ask reload with a command line option (namely -e) without
opening a new Window. However GSView is not that performant for a big
document, but it is quite fine for region.

On the other hand for the master document I would like to use
Foxit. Foxit does not allow to reload from command line. It does not
lock the file, but you have to close/reopen manually if you want the
view refressed. On the other hand Foxit is more performant than GSView
in many aspects.

So, what I had in mind is to have some kind of hook where
the variable `target' would be locally set to `master' or to `region'
when the hook is called. Then I would just have to put this kind of code
in my init file:

(add-hook TeX-view-hook
          (lambda ()
	    (let ((a (assoc "^pdf$" TeX-output-view-style)))
	      (when a 
		(cond
		 ((eq target 'region)
		  (setcdr a '("." (concat (getenv "JPE_GSVIEW")
					" -e %o"))))
		 ((eq target 'master)
(Continue reading)

Vincent Belaïche | 1 Aug 2009 10:03
Picon
Favicon

RE: Hooks for command on region and command on master

Just to say that hooks may not be the best solution. if region or master
was informed by a special keyword in the style option list, then this
could also do the job.

However using style options may cause regression to existing
configuration.

Maybe another possible and better solution would be that elements in
TeX-output-view-style would have a fourth element that would be:

* nil for both master and region
* 'master for master only
* 'region for region only

  Vincent.

> Dear all,
> 
> I would like to use different viewers when I view a region and when I
> view the master file.
> 
[ snip...]
> 
>    Vincent.
Leo | 1 Aug 2009 10:21
Picon
Gravatar

Re: Hooks for command on region and command on master

On 2009-08-01 08:18 +0100, Vincent Belaïche wrote:
> The reason is that I prefer to have GSView for region because it is
> possible to ask reload with a command line option (namely -e) without
> opening a new Window. However GSView is not that performant for a big
> document, but it is quite fine for region.

The easiest solution is to find a viewer that works in both cases. foxit
is not up to the job but there are others.

--

-- 
Leo's Emacs uptime: 9 hours, 19 minutes, 45 seconds
Vincent Belaïche | 1 Aug 2009 12:36
Picon
Favicon

RE: Hooks for command on region and command on master


Could you please tell me which one. Somebody answered to a similar post
on newsgroup fr.comp.text.tex that from Emacs 23.1 there is a PDF viewer
within Emacs. But I do not know how to configure AUCTeX to launch the
corresponding lisp command (I assume that I should use TeX-run-function
as a launcher).

Also, with GSView there is some remaining minor issue. As when you use
expansion %o AUCTeX will pass only the filename without directory, what
happen is that if I have some already open GSView window with other
current directory it will not find the file. So in this case, only the
first time I have to close/open manually.

I could not find which expansion you have to use to get the directory,
the documentation of TeX-expand-list is a bit insufficient, the only
thing that I could understood is that we have the following expansions:

   source file /mydir/foo.tex

   %s : `"foo"'
        => basename of filename without extension or directoryname

   %t : `"foo.tex"'
        => full filename without directory name

   %o : `"foo.pdf"' or `"foo.dvi"' depending on what is on directory		
        => output filename
		
   %f : `"foo.ps"'
        => poscript file
(Continue reading)

Leo | 1 Aug 2009 15:42
Picon
Gravatar

Re: Hooks for command on region and command on master

On 2009-08-01 11:36 +0100, Vincent Belaïche wrote:
> Could you please tell me which one. Somebody answered to a similar
> post on newsgroup fr.comp.text.tex that from Emacs 23.1 there is a PDF
> viewer within Emacs. But I do not know how to configure AUCTeX to
> launch the corresponding lisp command (I assume that I should use
> TeX-run-function as a launcher).

I used to use this when I use windows (for 9 months only). I have since
moved to OS X.

http://blog.kowalczyk.info/software/sumatrapdf/news.html

I used it along with foxit reader.

--

-- 
Leo's Emacs uptime: 14 hours, 39 minutes, 55 seconds
Leo | 1 Aug 2009 15:50
Picon
Gravatar

Re: Hooks for command on region and command on master

On 2009-08-01 14:42 +0100, Leo wrote:
>> Somebody answered to a similar post on newsgroup fr.comp.text.tex
>> that from Emacs 23.1 there is a PDF viewer within Emacs. But I do not
>> know how to configure AUCTeX to launch the corresponding lisp command
>> (I assume that I should use TeX-run-function as a launcher).

It is doc-view mode which uses convert from imagemagick to convert pdf
to png files and view them in Emacs. I like a proper pdfviewer better so
I have never used it.

If you use C-x C-f to open .pdf files you can see it in action.

--

-- 
Leo's Emacs uptime: 14 hours, 48 minutes, 4 seconds
Vincent Belaïche | 2 Aug 2009 00:06
Picon
Favicon

RE: Re: Hooks for command on region and command on master

Hello,

Thanks for the link to Sumatra, I have installed it, it seems that its
the good tool to work with AUCTeX under MSWindows. 

Concerning DocView, at least for me it does not work, although my Emacs
version is GNU Emacs 23.1.50.1 (i386-mingw-nt5.0.2195) of 2009-07-25.

It seems that Emacs can't find the executable (Image magick or Ghostscript). 

Probably I need to customize some doc-view-... variable to point at the
correct program. The documentation of Document View is not very
talkative about installation but the variable docstrings should be
enough...

Well, I will try to make the correct settings and also try this some day...

Thanks for all this information !

   Vincent.

> It is doc-view mode which uses convert from imagemagick to convert pdf
> to png files and view them in Emacs. I like a proper pdfviewer better so
> I have never used it.
> 
> If you use C-x C-f to open .pdf files you can see it in action.
> 
Ralf Angeli | 2 Aug 2009 19:58

Re: Re: Reftex and listings

* Damien Cassou (2009-07-31) writes:

> To be more concrete, in the following document, I can't get RefTeX
> find a proper reference to put after the word 'Please see Listing'.
> The list of references proposes by reftex-references `C-c )' is empty
> (even if I rescan and select 'any').
>
> \documentclass{article}
> \usepackage{listings}
> \begin{document}
>
> \begin{lstlisting}[language=Java, caption={Caption}, label={lst:test}]
> test
> \end{lstlisting}
>
> Please see Listing
>
> \end{document}

AFAICS only constructs like

\begin{foo}
  \label{<label>}
  ...
\end{foo}

,

\bar{... \label{<label>}}

(Continue reading)

Damien Cassou | 2 Aug 2009 20:56
Picon
Gravatar

Re: Re: Reftex and listings

On Sun, Aug 2, 2009 at 7:58 PM, Ralf Angeli<angeli <at> caeruleus.net> wrote:
> * Damien Cassou (2009-07-31) writes:
>
>> To be more concrete, in the following document, I can't get RefTeX
>> find a proper reference to put after the word 'Please see Listing'.
>> The list of references proposes by reftex-references `C-c )' is empty
>> (even if I rescan and select 'any').
>>
>> \documentclass{article}
>> \usepackage{listings}
>> \begin{document}
>>
>> \begin{lstlisting}[language=Java, caption={Caption}, label={lst:test}]
>> test
>> \end{lstlisting}
>>
>> Please see Listing
>>
>> \end{document}
>
> AFAICS only constructs like
>
> \begin{foo}
>  \label{<label>}
>  ...
> \end{foo}
>
> ,
>
> \bar{... \label{<label>}}
(Continue reading)

Peter Horst | 3 Aug 2009 13:37
Favicon

Filling - shielding areas of text from 'C-c c-q c-e'?

I'm adding blocks of text (poetry) to a LaTeX doc using the fancyvrb 
package.  Because of my particular editing style, I tend to use 'C-c - 
c-q c-e' a lot to reformat the entire document (i.e. I use it from 
within the top-level environment, and it recursively reformats 
everything within).  I've just read section 5.5 of the manual, on 
filling, but I'm not seeing how it might be possible to get AUCTeX to 
skip over the sections of text enclosed within '\begin{Verbatim}, 
\end{Verbatim}' pairs.  I tried adding "Verbatim" to the "LaTeX 
paragraph commands" variable but that didn't seem to change anything.  
Is it possible to do what I'm trying to do, that is, get universal 
reformatting to skip over Verbatim environments?

Thanks very much.

Gmane