Generalgetting emacs to recognize new commands

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
scmal
Posts: 5
Joined: Mon Aug 18, 2008 3:50 pm

getting emacs to recognize new commands

Post by scmal »

I use emacs to edit .tex files and use user defined macros like \beq instead of \begin{equation} along with various other \newcommand macros that take arguments (such as \newcommand{\figref}[1]{\figurename~#1}).

emacs knows about the standard latex commands and uses pretty colours for their arguments. For environments, it leaves them on a separate line if you use Alt-Q to neaten up the text before or after. Emacs obviously doesn't realize that \beq is an environment and it doesn't use pretty colours for the arguments of user newcommands.

Does anyone know what I would need to put in my .emacs file to make emacs treat \beq it in the same way as \begin{equation} and put the argument of \figref in pretty colours?

Many thanks in advance,

Mike

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

Post Reply