[OS X Emacs] LaTeX-section-label customization

pacotomi pacotomi at orange.fr
Sun Oct 19 12:36:56 EDT 2008


Le 19 oct. 08 à 14:37, kbmail at free.fr a écrit :

> So, now, one more question: do you know how the way to do the same  
> thing for tab:, fig:, and eq:?
> (reftex-label-alist seems it bit complex to me...)
For me too ! So I copied a part of reftex and pasted it in my  
Preferences.el:

%%%%%%%%%%beginning%%%%%%%%%
(setq reftex-label-alist
          '(("section"   ?s "%S" "~\\ref{%s}" (nil . t)
        (regexp "parts?" "chapters?" "chap\\." "sections?" "sect?\\."
                "paragraphs?" "par\\."
                "\\\\S" "\247" "Teile?" "Kapitel" "Kap\\." "Abschnitte?"
                "appendi\\(x\\|ces\\)" "App\\."  "Anh\"?ange?" "Anh\ 
\."))

       ("enumerate" ?i "item-" "~\\ref{%s}" item
        (regexp "items?" "Punkte?"))

       ("equation"  ?e "eq-" "~(\\ref{%s})" t    <-------------------- 
HERE MY MODIFICATION : "eq-" IN PLACE OF "eq:"
        (regexp "equations?" "eqs?\\." "eqn\\." "Gleichung\\(en\\)?"   
"Gl\\."))
       ("eqnarray"  ?e "eq-" nil eqnarray-like)

       ("figure"    ?f "fig-" "~\\ref{%s}" caption  
<-----------------------------------HERE "fig-"
        (regexp "figure?[sn]?" "figs?\\." "Abbildung\\(en\\)?" "Abb\ 
\."))
       ("figure*"   ?f nil nil caption)

       ("table"     ?t "tab-" "~\\ref{%s}" caption  
<------------------- HERE "tab-"
        (regexp "tables?" "tab\\." "Tabellen?"))
       ("table*"    ?t nil nil caption)

       ("\\footnote[]{}" ?n "fn-" "~\\ref{%s}" 2 <-------------------  
HERE "fn-"
        (regexp "footnotes?" "Fussnoten?"))

       ("any"       ?\  " "   "~\\ref{%s}" nil)

       ;; The label macro is hard coded, but it *could* be defined  
like this:
       ;;("\\label{*}" nil nil nil nil)
       ))
%%%%%%%%%%%% end %%%%%%%%%%%%%%%%%%%

Perhaps some reftex guru could tell us the right way to customize  
these labels ?

frederic



More information about the MacOSX-Emacs mailing list