Skip to Main Content
Learning GNU Emacs, 3rd Edition
book

Learning GNU Emacs, 3rd Edition

by Debra Cameron, James Elliott, Marc Loy, Eric S. Raymond, Bill Rosenblatt
December 2004
Beginner to intermediate content levelBeginner to intermediate
536 pages
19h 28m
English
O'Reilly Media, Inc.
Content preview from Learning GNU Emacs, 3rd Edition

Marking up Text for TEX and LATEX

GNU Emacs provides excellent support for marking up TEX files. Most people today use LATEX , which is written in TEX and provides more control over formatting. As a result, we'll talk about LaTeX mode here.

Before we launch into this discussion, we assume that you have set up LATEX on your platform. On Red Hat Linux, it's set up by default. Windows and Mac OS X users must install and configure LATEX before proceeding.[12]

Emacs attempts to guess whether you're editing a TEX or LATEX file and enter the appropriate mode. You can force LaTeX mode if Emacs doesn't enter it automatically by typing M-x latex-mode Enter.

Matching Braces

LATEX commands often take the form \keyword{text}. LaTeX mode doesn't try to figure out if you're using the "right" keywords since the language is extensible and you may have defined your own keywords. It does, however, provide support for avoiding the most common error: mismatched curly braces and dollar signs.

In LATEX , curly braces ({}) and dollar signs ($$) should always appear in pairs; Emacs checks to make sure that each opening brace or dollar sign has a counterpart. When you type a closing brace or dollar sign, the cursor moves quickly to its counterpart (provided that it is on the screen; it shows the context in the minibuffer if it is not), then back again.

Emacs generates braces in matching pairs. The command C-c { inserts opening and closing braces and positions the cursor for typing between the braces.

Typing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning the vi and Vim Editors, 7th Edition

Learning the vi and Vim Editors, 7th Edition

Arnold Robbins, Elbert Hannah, Linda Lamb
Mastering Vim

Mastering Vim

Ruslan Osipov
Modern Vim

Modern Vim

Drew Neil

Publisher Resources

ISBN: 0596006489Supplemental ContentErrata Page