[comp.emacs] TeX mode in GNU-Emacs

slj@mtung.ATT.COM (S. Luke Jones) (10/10/89)

I just started using LaTeX, and I really like the LaTeX mode on
GNU-Emacs.  (How does it know whether I'm using LaTeX or plain
TeX, anyhow?)

I have a slight minor neglible problem, though, which is that when
I auto-fill in either TeX or LaTeX mode, the \ (space) that I use
in places like "Learning \LaTeX\ is neat" is not protected if it
ends a line.  Is there a simple hack to LaTeX mode to make that
terminal \ (space) construct safe from being auto-filled away?

Yes, I realize this is precisely what you don't want in 95% of the
times a UNIX user has a \ at the end of a line.  But in TeX it
appears to be what I want.

Luke Jones

-- 
S. Luke Jones  | slj@mtung.att.com    | "System Test? That's for idiots!"
AT&T Bell Labs | ...!att!mtung!slj    | -- me, misquoting Insp. H. Calahan
Room MT 2E-337 | 200 Laurel Ave.      | Disclaimer:  the opinions presented
(201) 957-2733 | Middletown, NJ 07748 | herein are soley my own, NOT AT&T's.

weening@Gang-of-Four.Stanford.EDU (Joe Weening) (10/15/89)

TeX already does what you want.  From plain.tex (or lplain.tex for
LaTeX):

\def\^^M{\ } % control <return> = control <space>
\def\^^I{\ } % same for <tab>

So "\" followed by a newline or tab is the same as "\" followed by
space.  (Also don't worry that newline is ^J on Unix; it is translated
to ^M before the rest of TeX sees it, so that TeX behaves the same on
all systems.)

--
Joe Weening                                Computer Science Dept.
weening@Gang-of-Four.Stanford.EDU          Stanford University

lupton@uhccux.uhcc.hawaii.edu (Robert Lupton) (10/15/89)

Another (better?) solution is to write "\TeX{}", instead of writing "\TeX\ "
as you haven't put an absolute, unstretchable, piece of white space into
your document.

			Robert
			

des@yatton.inmos.co.uk (David Shepherd) (10/16/89)

In article <1109@inmos.co.uk (S. Luke Jones) writes:
>I just started using LaTeX, and I really like the LaTeX mode on
>GNU-Emacs.  (How does it know whether I'm using LaTeX or plain
>TeX, anyhow?)

I think it assumes the file is TeX unless it sees a \documentstyle
(or perhaps a \begin{document}) at which it asssumes its LateX

>I have a slight minor neglible problem, though, which is that when
>I auto-fill in either TeX or LaTeX mode, the \ (space) that I use
>in places like "Learning \LaTeX\ is neat" is not protected if it
>ends a line.  Is there a simple hack to LaTeX mode to make that
>terminal \ (space) construct safe from being auto-filled away?

There's actually no problem -- TeX translates <NL> into <SPACE>
so to the innards of TeX

	Learning \LaTeX\
	is neat

appears as

	Learning<SPACE>\LaTeX<SPACE>is<neat>

The real pain comes if the auto-fill routine splits on `-`s on the
assumtion that they're hyphens -- but Emacs LaTeX mode doesn't do
this so you're ok.


david shepherd
INMOS ltd