# [OS X TeX] Customizing Emacs.

Frederick Hoyt fmhoyt at mail.utexas.edu
Mon Nov 29 10:57:36 EST 2004

I should add that if you define a macro, Emacs will not save it
automatically. If you want to save your macro, you must open your
.emacs file and insert the macro definition into the file with the
command alt+x insert-kbd-macro. I have a section at the end of my
.emacs file just for macro definitions. Once you save the macro in this
file, Emacs will reload the definition each time you start up.

Fred

On Nov 29, 2004, at 9:33 AM, Andrea Riciputi wrote:

> Thanks, your suggestions have been usefull. I'll try to put them at
> work.
>
> Andrea.
>
> On 29 Nov 2004, at 16:09, Frederick Hoyt wrote:
>
>> I have found abbreviations to be very helpful for the kinds of
>> functions you describe. For example, I use \emph, \textbf, \textsc,
>> and a bunch of other environment commands all the time, so I have
>> abbreviations defined for these. If I type "emph" followed by a "{",
>> the "emph" is changed to "\emph" automatically.
>>
>> To set up abbreviations, add these lines to your .emacs file:
>>
>> (setq-default abbrev-mode t)
>> (setq save-abbrevs t)
>>
>> To define an abbreviation, type the abbreviation string, and then
>> ctrl+x+a+i+g. A prompt will appear in the command buffer asking you
>> for an expansion. For example, type "emph", and then ctrl+x+a+i+g,
>> and you see "Global expansion for "emph":" Type "\emph" and you're
>> done.
>>
>> I have also defined a macro that allows me to select a word and
>> enclose it in an \emph{} command. To do this, select the word, then
>> type ctrl+x+shift+9 to start defining a macro. Then cut the word,
>> type \emph{, paste the word, close the brackets, and type
>> ctrl+x+shift+0 to close the macro. Then type alt+x
>> name-last-kbd-macro to name the macro - I call it just emph. Having
>> done that, I can just select a word, type alt+x emph and the word has
>> the \emph{} command wrapped around it.
>>
>> I'm sure that you could also bind this macro to a keystroke, but I
>> haven't done that and can't tell you how.
>>
>> Fred Hoyt
>>
>>
>>
>> \On Nov 29, 2004, at 8:45 AM, Andrea Riciputi wrote:
>>
>>> I'm speaking of having keyboard shorcuts bounded to some frequently
>>> used LaTeX commands, such as \emph{}, \mbox{}, \frac{}{}, ^{}, _{}
>>> and other, like Alpha did in past times. (Actually I know Alpha is
>>> still there, but for several reason I prefer to stay with emacs
>>> now). Furthermore I'd be very very happy to make AucTeX AMSLaTeX
>>> aware, it should sound strange but I've not ever been able to get it
>>> working. :-(
>>>
>>> And yes, I've read the f***ing manual but it's so terse that was of
>>> no help (at least for me). I've also asked for help on AucTeX list,
>>> but it seems that my questions were too basic for those guys. :-(
>>>
>>> Just a little example. If I try to type '\em' and then hit M-tab or
>>> C-c C-m I can't get the expected (and desired) completion '\emph{}'
>>>
>>> Another example. When I want to type in an equation with, let say,
>>> the integral symbol it should be nice to have a dialog that asks for
>>> lower and upper bounds of integration and return the right LaTeX
>>> input.
>>>
>>> Anyone here has ever managed things like these?
>>>
>>>   Andrea.
>>>
>>> On 29 Nov 2004, at 15:14, Frederick Hoyt wrote:
>>>
>>>> I'm not sure which functionalities you're speaking of, but I used
>>>> to use TexShop (and still do, sometimes), and have been able to
>>>> reproduce some if its features in Emacs by defining macros and
>>>> abbreviations. I find these extremely useful.
>>>>
>>>
>>> --------------------- Info ---------------------
>>> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>>>           & FAQ: http://latex.yauh.de/faq/
>>> TeX FAQ: http://www.tex.ac.uk/faq
>>> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>>>
>>>
>>>
>> ________________________________
>>
>> "Hell is other people at breakfast." - Sartre
>>
>> Frederick M. Hoyt
>> Linguistics Department
>> University of Texas at Austin
>>
>>
>> --------------------- Info ---------------------
>> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>>           & FAQ: http://latex.yauh.de/faq/
>> TeX FAQ: http://www.tex.ac.uk/faq
>> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>>
>>
>
> --------------------- Info ---------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>           & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>
>
>
+++++++++++++++++++++++++++

"Email is a wonderful thing for people whose role in life is to be on
top of things. But not for me; my role is to be on the bottom of
things. What I do takes long hours of studying and uninterruptible
concentration."

-Donald Knuth

Frederick M. Hoyt
Linguistics Department
University of Texas at Austin

--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>