[comp.text.tex] Emacs-Latex: A little trick

georgiou@rex.cs.tulane.edu (George Georgiou) (06/01/91)

Put in your .emacs file the line:
(set-variable (quote page-delimiter) "^%%")

%%

When a comment line starting with %% (like the ones in this message)
is put at the beginning, say, of every section/subsection, then the by
just doing C-x p (that is narrow-to-page), one can concentrate in the
section/subsection the point is in, in the narrow-to-region fashion
(but without having to position the mark). To go back to normal do
C-x w (that is widen).

I am using it and it's a woderful little trick.
%%

George Georgiou                       georgiou@rex.cs.tulane.edu
Computer Science Department           +---------------------------+
Tulane University                     |       Fiat Lux            |
New Orleans, LA 70118                 +---------------------------+

abraham@iesd.auc.dk (Per Abrahamsen) (06/02/91)

>>>>> On 1 Jun 91 07:24:07 GMT, georgiou@rex.cs.tulane.edu (George
>>>>> Georgiou) said:

George> Put in your .emacs file the line:
George> (set-variable (quote page-delimiter) "^%%")

George> I am using it and it's a woderful little trick.
George> %%

It sure sounds good.  However, you might want to try the full
generality of using outlines with your LaTeX document.  Outline mode
substitutes selected text with three dots, based on the structure of
your document.  Some example:

Get overview of the document:

	\begin{document}...
	\chapter{one}...
	\chapter{two}...
	\chapter{three}...

Examine the structure of chapter two:

	\begin{document}...
	\chapter{one}...
	\section{a}...
	\subsection{ax}...
	\subsection{ay}...
	\section{b}...
	\subsection{bx}...
	\chapter{two}...
	\chapter{three}...

Start editing section ax:

	\begin{document}...
	\chapter{one}...
	\section{a}...
	\subsection{ax}
	bla bla bla bla;
	also blah blah and blah.
	\subsection{ay}...
	\section{b}...
	\subsection{bx}...
	\chapter{two}...
	\chapter{three}...

You can open or close sections, get a list of subsections, etc.

Outline mode also allows you to navigate in a LaTeX document based on
the sections.  You can move a level up, to next or previous section,
or to next or previous section on the same level.

An outline (minor) mode witch works well with LaTeX documents is a
part of the AUC TeX distribution, and available for anonymous ftp at
the site iesd.auc.dk (130.225.48.4) in the file
/pub/emacs-lisp/auc-tex.3.0.tar.Z

georgiou@rex.cs.tulane.edu (George Georgiou) (06/03/91)

In article <ABRAHAM.91Jun2174008@galilei.iesd.auc.dk> abraham@iesd.auc.dk (Per Abrahamsen) writes:
>
>>>>>> On 1 Jun 91 07:24:07 GMT, georgiou@rex.cs.tulane.edu (George
>>>>>> Georgiou) said:
>
>George> Put in your .emacs file the line:
>George> (set-variable (quote page-delimiter) "^%%")
>
>George> I am using it and it's a woderful little trick.
>George> %%
>
>It sure sounds good.  However, you might want to try the full
>generality of using outlines with your LaTeX document.  Outline mode
>substitutes selected text with three dots, based on the structure of
>your document.  Some example:
>
>    [ Examples ...]

I am already using auc-tex's minor outline mode, and it's great.
However, it doesn't provide a mechanism to narrow-to-region by
section, subsection, or any other arbitrary grouping, which I often find
handy.

>Outline mode also allows you to navigate in a LaTeX document based on
>the sections.  You can move a level up, to next or previous section,
>or to next or previous section on the same level.

If one uses (set-variable (quote page-delimiter) "^%%"), navigation
through pages delimited by "%%" is possible using C-x ] and C-x [.  Do
"C-h a page" for more functions. I am not pretending that this is a
substitute for the auc-tex's outline mode.

>An outline (minor) mode witch works well with LaTeX documents is a
>part of the AUC TeX distribution, and available for anonymous ftp at
>the site iesd.auc.dk (130.225.48.4) in the file
>/pub/emacs-lisp/auc-tex.3.0.tar.Z

Auc-tex is highly recommended.

George Georgiou                       georgiou@rex.cs.tulane.edu
Computer Science Department           +---------------------------+
Tulane University                     |       Fiat Lux            |
New Orleans, LA 70118                 +---------------------------+