Ralf Angeli | 1 Sep 2008 21:35

Re: Re: auto-load \include-files when opening master-file.

* inu (2008-08-31) writes:

> Is there a way to make reftex read this 'master.rel' when starting
> emacs? Or instead automatically reftex-parsing of a document when it
> is opened?

Try this:

(eval-after-load "latex"
 '(define-key LaTeX-mode-map (kbd "<f6>")
    (lambda ()
      (interactive)
      (reftex-access-scan-info)
      (mapcar 'find-file-noselect (reftex-all-document-files)))))

--

-- 
Ralf
inu | 4 Sep 2008 21:53

Re: Re: auto-load \include-files when opening master-file.

That works fine. Thank you!

2008/9/1 Ralf Angeli <angeli <at> caeruleus.net>:
> * inu (2008-08-31) writes:
>
>> Is there a way to make reftex read this 'master.rel' when starting
>> emacs? Or instead automatically reftex-parsing of a document when it
>> is opened?
>
> Try this:
>
> (eval-after-load "latex"
>  '(define-key LaTeX-mode-map (kbd "<f6>")
>    (lambda ()
>      (interactive)
>      (reftex-access-scan-info)
>      (mapcar 'find-file-noselect (reftex-all-document-files)))))
>
> --
> Ralf
>
Angelo Graziosi | 7 Sep 2008 00:09
Picon

Strange things with AUCTeX-CVS toolbar

I want to flag the following strange things I have observed with current
AUCTeX CVS on Cygwin with Emacs 23, current trunk. (But I think it
happens also on other systems).

The following steps should reproduce the things.

Suppose I load a simple foo.tex file. Then the toolbar shows, besides
the other icons, also

a) Run LaTeX (DVI)
b) Run Viewer (XDVI)
c) Generate PS file
d) Run BibTeX
etc.

Now I type: C-c C-t C-p, and

a) --> Run LaTeX (PDF)
b) --> Run Viewer (XPDF)

c) goes away and d) remains. The menu: 'Command/Texing Options/Generate
PDF files' is selected. All this seems OK.

If, now, I close Emacs (C-x C-c) with save desktop enabled and then
restart Emacs, the file foo.tex is reloaded, the toolbar shows only the
icon a) b) d) for DVI files _BUT_ 'Command/Texing Options/Generate PDF
files' is still selected and cliking 'a) Run LaTeX (DVI)' generates PDF
file not DVI. 'b) Run Viewer (XDVI)' runs xpdf not xdvi!

In my opinion, when I restart Emacs and 'Command/Texing Options/Generate
(Continue reading)

Jin Choi | 7 Sep 2008 08:23
Picon
Favicon

LaTeX-command-style ignored for certain document filenames

I came across an annoying behavior trying to use LaTeX-command-style  
to specify the use of xelatex properly. I have it set to
'(("\\`fontspec\\'" "xelatex") ("" "%(PDF)%(latex) %S%(PDFout)"))
which should specify that xelatex be used whenever  
"\usepackage{fontspec}" occurs. This works... usually. For certain  
files, it decides it just wants to use plain latex.

I tracked down the problem to line 1896 of tex.el:

     (if (and TeX-parse-self
	     (null (cdr-safe (assoc (TeX-strip-extension nil nil t)
				    TeX-style-hook-list))))
	(TeX-auto-apply))

This only parses the current file if the name of the file does not  
appear in TeX-style-hook-list. This caused problems for me when I  
named my document files things like "article.tex" or "letter.tex",  
where the base filenames existed in TeX-style-hook-list.

I don't see why this is helpful. I think the current file should  
always be parsed if TeX-parse-self is true. If you are actually  
editing the article.sty or letter.sty style files, I don't think it  
would be useful to have the hooks for those styles run since they are  
presumably intended to set things up for documents written using those  
styles.

I think this should be just (if TeX-parse-self (TeX-auto-apply)).  
Please let me know if I'm mistaken.

-Jin
(Continue reading)

Pierre Lorenzon | 7 Sep 2008 12:07

Re: LaTeX-command-style ignored for certain document filenames


Hi,

I think that everybody agrees with the fact that present
implementation of the style handling in auctex is not
completely satisfying. Tell me if I am wrong ! I already posted
several  remarks similar to yours. Anyway the test you mention
is in my opinion a point to be improved in the code. 

Personally I decided to completely rewrite this part of the
code and I am doing this job at the moment. I hope being a ble
to summit a test version soon ...

Regards

Pierre

From: Jin Choi <jsc <at> alum.mit.edu>
Subject: [AUCTeX] LaTeX-command-style ignored for certain document filenames
Date: Sun, 7 Sep 2008 02:23:40 -0400

> I came across an annoying behavior trying to use LaTeX-command-style  
> to specify the use of xelatex properly. I have it set to
> '(("\\`fontspec\\'" "xelatex") ("" "%(PDF)%(latex) %S%(PDFout)"))
> which should specify that xelatex be used whenever  
> "\usepackage{fontspec}" occurs. This works... usually. For certain  
> files, it decides it just wants to use plain latex.
> 
> I tracked down the problem to line 1896 of tex.el:
> 
(Continue reading)

Ralf Angeli | 7 Sep 2008 18:26

Re: Strange things with AUCTeX-CVS toolbar

* Angelo Graziosi (2008-09-07) writes:

> If, now, I close Emacs (C-x C-c) with save desktop enabled and then
> restart Emacs, the file foo.tex is reloaded, the toolbar shows only the
> icon a) b) d) for DVI files _BUT_ 'Command/Texing Options/Generate PDF
> files' is still selected and cliking 'a) Run LaTeX (DVI)' generates PDF
> file not DVI. 'b) Run Viewer (XDVI)' runs xpdf not xdvi!

It looks like the minor mode variable value of TeX PDF mode is restored
but the minor mode function is not called.  The latter runs
`toolbarx-refresh' through the minor mode hook.

What do people think about adding `TeX-PDF-mode' to `minor-mode-alist'
which will make `desktop-save' recognize TeX PDF mode as a minor mode to
be restored and remove the additions to `desktop-locals-to-save' we do
at the end of tex.el?  I dunno why we deal with `desktop-locals-to-save'
at all.

Mail-Followup-To: auctex-devel <at> gnu.org

--

-- 
Ralf
Jin Choi | 7 Sep 2008 19:21
Picon
Favicon

Re: LaTeX-command-style ignored for certain document filenames

At Sun, 07 Sep 2008 12:07:47 +0200 (CEST),
Pierre Lorenzon wrote:
> 
> Personally I decided to completely rewrite this part of the
> code and I am doing this job at the moment. I hope being a ble
> to summit a test version soon ...

Pierre, that sounds great. I'm pleased to learn someone is addressing
the style handling. I hope your changes make it in.

-Jin
Ritesh Sood | 8 Sep 2008 00:53
Picon

Customizing equation/figure label strings per document

Hi all,

I want to change the equation/figure label strings in the following manner:

Environment                   Current (default)                       Desired 
equation                          eq:1                                        & nbsp;       eq:P1-1
figure                                fig:1                                                fig:P1-1

 P1- stands for Part1-, and I'd like to have P2-, P3-, etc for different documents.  So the thing to do would be to write an AUCTeX style file and drop it in style/ subdir of the document directory. Only, I don't know elisp, and  couldn't make out what to do even after reading the AUCT eX and RefTeX documentation.

As an experiment, I changed

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% End:

to

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% LaTeX-equation-label: "eq:P1-"
%%% LaTeX-figure-label: "fig:P1-"
%%% End:

but that doesn't help either. As in C-( stil generates labels of the form eq:10, and there's an unsafe variable warning that pops up on starting emacs.

Can someone please give me an elisp code snippet that i can drop in style/ ?

Many thanks,
Ritesh

_______________________________________________
auctex mailing list
auctex <at> gnu.org
http://lists.gnu.org/mailman/listinfo/auctex
Ralf Angeli | 8 Sep 2008 21:52

Re: Customizing equation/figure label strings per document

* Ritesh Sood (2008-09-08) writes:

> I want to change the equation/figure label strings in the following manner:
>
> Environment                   Current (default)
> Desired
> equation                          eq:1
>                                                eq:P1-1
> figure                                fig:1
>                                                fig:P1-1
>
>  P1- stands for Part1-, and I'd like to have P2-, P3-, etc for different
> documents.  So the thing to do would be to write an AUCTeX style file and
> drop it in style/ subdir of the document directory. Only, I don't know
> elisp, and  couldn't make out what to do even after reading the AUCTeX and
> RefTeX documentation.

AFAICS this is not so easy since the label prefixes are usually defined
per label in `reftex-label-alist{-builtin}'.  Perhaps you could define
your own function for `reftex-format-label-function' which inserts a
string of your liking into the already computed label.  If you want to
stick that into the local variables stanza you could e.g. use this:

%%% reftex-format-label-function: (lambda (label format) (let* ((parts (split-string label ":"))
(label (concat (car parts) ":P1-" (cadr parts)))) (format format label)))

The function makes the assumption that each label contains a single
colon, so I am quite sure that it will eventually fail.  One would have
to add precautions for dealing with labels not following this
assumption.

> Can someone please give me an elisp code snippet that i can drop in style/ ?

I don't think a style file would be the right place because styles
depend on properties of the document, like LaTeX classes or packages.

Perhaps it would be better to define the format function in your init
file as a named function and set it in the local variables stanza.  You
could also set a variable which defines the string to be inserted by the
function.

By the way, please don't send HTML mails to this mailing list.

--

-- 
Ralf
Jun Yang | 9 Sep 2008 11:50
Picon
Picon
Favicon

C-c ? lag

Hi,

I am using AucTex 11.85 with MikTex 2.7 and GNU Emacs 22.2.1 on a Windows
machine. Each time I press C-c ?, it takes about 5 seconds for the prompt
"Package, command, or document:" to appear in the minibuffer. Does anyone
have the same problem? What could have caused the lag?

Thanks a lot.

Best Regards,

Jun Yang

Gmane