|
From: | Vincent Belaïche |
Subject: | Re: [AUCTeX] Contribution |
Date: | Fri, 16 May 2008 12:21:35 +0200 |
Ralf Angeli a écrit : > * Vincent Belaïche (2008-05-12) writes: > > >> By the way, you seem to be an AucTeX guru, and I have a minor problem >> with AucTeX which I would like to explain to you: >> >> I have added the following customization in my init file : >> >> (add-hook >> 'LaTeX-mode-hook >> (lambda () (interactive) >> (dolist (v >> '( >> (94 "\\textsuperscript{" "}") >> (95 "\\textsubscript{" "}") >> (?m "\\(" "\\)" "" "") >> (?v "\\(\\mmv {" "}\\)" "\\mmv {" "}") >> ) >> ) >> (add-to-list 'TeX-font-list v) >> ) >> ) >> ) >> >> When I open a LaTeX file that has \documentclass[11pt,a4paper]{book} on >> the first line and that is my master file, it works well (the >> customization is there). >> But when I open a LaTeX file that is not the master file, and that has >> some file local variable like this in the last line : >> >> %%% Local Variables: >> %%% mode: latex >> %%% TeX-master: "nameofthemasterfile.tex" >> %%% reftex-label-alist: '(AMSTeX) >> %%% End: >> >> >> Then the customization is not there. >> > > `TeX-font-list' gets overwritten with the value of `LaTeX-font-list' in > LaTeX mode, so you better use something like > > (eval-after-load "latex" > '(progn > (dolist (v '((94 "\\textsuperscript{" "}") > (95 "\\textsubscript{" "}") > (?m "\\(" "\\)" "" "") > (?v "\\(\\mmv {" "}\\)" "\\mmv {" "}"))) > (add-to-list 'LaTeX-font-list v)))) > > Thanks, I have replaced TeX-font-list by LaTeX-font-list and the problem disappeared. Thank you for your kind help. Note that the AucTeX info node "Font Specifiers" tells only about "TeX-font-list" and not about "LaTeX-font-list". So, there is a problem in documentation: I could never guess that the correct way of customizing was using LaTeX-font-list instead of TeX-font-list based only on documentation. There is another problem in the same info node : One can read -- Command: TeX-font ARG But then, in the explanation there appear that the arguments of the command are not ARG, but REPLACE and WHAT. Furthermore, how comes that by explicitly invoking explicitly `M-x LaTeX-mode', or `M-x normal-mode' (which accounts to the same thing as a file local variable sets mode to latex mode in my case), the customisation is activated in the non-master file. According to your explanation (TeX-font-list being overwritten by LaTeX-font-list), the customisation would never be activated at all. For the same reason, your explanation is not sufficient to explain why the customization is activated in the first place for a master-file containing the "\documentclass{}" statement. VBR, and thanks again ! Vincent. Plus de 15 millions de français utilisent Windows Live Messenger ! Téléchargez Messenger, c'est gratuit ! |
[Prev in Thread] | Current Thread | [Next in Thread] |