auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Set automatically TeX-PDF-from-DVI variable if documentclas


From: Ikumi Keita
Subject: Re: [AUCTeX] Set automatically TeX-PDF-from-DVI variable if documentclass receives option dvipdfmx or dvipdfm
Date: Tue, 20 Nov 2018 16:03:27 +0900

Hi Arash,

>>>>> Arash Esbati <address@hidden> writes:

> One thing occured to me: You use the following code (which was there
> before):

>     (apply #'TeX-run-style-hooks
>            (apply #'append
>                   (mapcar #'cdr LaTeX-provided-class-options)))

> Assuming that `LaTeX-provided-class-options' usually has only one entry
> (unlike `LaTeX-provided-package-options'), wouldn't be sufficient to do:

>     (apply #'TeX-run-style-hooks
>            (cdar LaTeX-provided-class-options))

That's the point I'd like to know.  I think that the code would usually
suffice, too.  I wonder why `LaTeX-provided-class-options' has a
structure which allows more than one class.  Under what situation can it
have more than one entry?

> Maybe you could also mention `:classopt' in AUCTeX manual under
> `TeX-add-style-hook' [1].

Thanks for suggestion, I'll try another day.

> I did't like this implementation as I wrote it.  I took it mainly since
> `mathtools' does the same thing -- and that is the only style doing this
> AFAIR (off the top of my head, though).

It seems that you are right.  Then I'll take the previous method.

> I think it is cleaner to set this variable outside the style hook and
> write something like this:

>     (defvar LaTeX-empheq-package-options
>       (progn
>         (TeX-load-style "mathtools")
>         (append LaTeX-mathtools-package-options
>                 '("overload" "overload2"
>                   "ntheorem" "newmultline"
>                   "oldmultline")))
>       "Package options for the empheq package.")

> WDYT?

With this code, if the user sets the variable in init file, the expected
code isn't evaluated so the addtional entries are not appended.  Thus I
think it's better to put `TeX-load-style' and `append' outside the
`defvar'.

Best,
Ikumi Keita



reply via email to

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