[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] autocompletion for \newcommand and LaTeX-math-list simple e
Re: [AUCTeX] autocompletion for \newcommand and LaTeX-math-list simple example
Tue, 13 Mar 2012 22:33:15 +0100
On Tue, 13 Mar 2012 21:02:01 +0100
Ivan Andrus <address@hidden> wrote:
> On Mar 10, 2012, at 12:23 PM, Renato wrote:
> > Hello, I'm very new to auctex and wasn't able to find an answer to
> > these, so I'm asking for help here.
> > 1) I have some \newcommand in the preamble of my file; is it
> > possible to have them appear as suggestions in the autocompletion
> > (C-c RET) list?
> I think that should happen automatically, but I never use that
> feature so someone else will have to help there.
> > 2) I have several particular symbols I'll be using a lot in math
> > environment, and I'd like to have them as shortcuts in the math
> > mode. I read how to customize LaTeX-math-list , however I'm at a
> > loss as to what the second argument ("a string representing the
> > name of the macro") should be. Could someone give a me simple
> > example for how to bind ` f to \iff ? That BTW would include
> > overriding the default ` f which is \phi
> I think the easiest way is to do the following
> M-x customize-variable RET LaTeX-math-list RET
> Then click INS, and for "key:" click on the value menu and select
> "Choice". This will bring up another value menu which should
> already be selecting "Character". Then delete this character (namely
> ^@ or the null character) and type "f" since that's what you want to
> press. The next value menu should be on "Macro", so just type
> "iff" (notice the lack of "\"). The last two are optional having to
> do with where it appears in the menu, but I would make the first "if
> and only if" and leave the second as none. Then just click on "Save
> for future session" and restart emacs (I couldn't figure out how to
> get it to work without restarting).
> In case you don't like Customize, this should translate to the lisp
> '(?f "iff" "if and only if" nil)
> So something like (untested)
> (add-to-list 'LaTeX-math-list '(?f "iff" "if and only if" nil))
> in your .emacs should be sufficient, but you will have to ensure that
> latex.el is loaded first.
Ivan, thank you so much, you're explanation cleared things up for me
and works perfect.
It's a pity having to restart emacs though, it will be quite cumbersome
to tweak my auctex configuration this way... does somebody know why does
this happen only with auctex and not other modes? Is there a workaround?