help-gnu-emacs
[Top][All Lists]

## Re: Hiding references when editing LaTeX?

 From: David Kastrup Subject: Re: Hiding references when editing LaTeX? Date: 28 Feb 2003 12:07:38 +0100 User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

"Felix E. Klee" <felix.klee@inka.de> writes:

> David Kastrup wrote:
> >> [...]
> >> >> But font-lock-mode can't hide he "\emph{" and the corresponding "}",
> >> >> right?
> >> > Well, you could let it use an invisible font or something, but that
> >> > would probably be not quite convenient for editing.  Perhaps in
> >> > connection with auto-reveal-mode something could be fudged.
> >> [...]
> >>
> >> Hmm, what would be the cleaner/easier solution: to add that feature to
> >> preview-latex or to the font-locking in AUCTeX?
> >
> > preview-latex would need to achieve two different things here: not
> > display \emph at all, and add text properties to the argument.  The
> > interface does not currently permit a command and its arguments to be
> > treated differently, and it might be quite a feat to implement
> > something like that consistently.
>
> Is this really neccessary? Preview-LaTeX takes for example "\emph{bla bla
> bla}" and passes it to an external tool, latex, which creates an image that
> replaces the corresponding text. Wouldn't it be possible to let the user
> specify another tool (probably a simple lisp function) instead that takes
> "\emph{bla bla bla}", processes it and creates soem text (eg. "*bla bla
> bla*", faces might be problematic) that is used to replace "\emph{bla bla
> bla}"?

That would be close to useless.  The main problem with preview-latex
is that images themselves are not editable, and the larger the unit
becomes (like a whole figure), the less convenient for editing.  When
you enter such an image, it gets replaced by its source text.  You
can already let preview-latex let an environment like \emph be
replaced by a _graphic_.  The main problem is not that it is a
graphic, but that you can't edit it because the relation between its
looks and the source text can't be reestablished, and that its line
breaks are completely different and so on.

You demand something that has all the editing disadvantages of an
image without an obvious advantage to show.

No, if this feature is supposed to be usable separately, it must have
a way to specify text properties affixed to the source text instead
of merely a replacement text.  That preview-latex would then make
sense even on text terminals would be a funny side effect.

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum