auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [AUCTeX] Preview of non-math macros


From: David Kastrup
Subject: Re: [AUCTeX] Preview of non-math macros
Date: Wed, 01 Nov 2006 22:46:02 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Christian Stork <address@hidden> writes:

> On Wed, Nov 01, 2006 at 06:45:50PM +0100, David Kastrup wrote:
>> Christian Stork <address@hidden> writes:
>
>> > On Wed, Nov 01, 2006 at 05:28:12PM +0100, David Kastrup wrote:
>> > ...
>> >> > Just an idea: Many of my macros have an enclosing
>> >> > \ensuremath{..}.  I often use these macros then in my text
>> >> > outside of $..$.  It seems like a great feature if
>> >> > preview-latex could offer an option to automatically register
>> >> > these macros for preview.
>
>> >> You can try \PreviewMacro[!]\ensuremath and see where this takes
>> >> you.
>
>> > Only satisfactory for the argumentless macros.  But thanks
>> > anyway.
>
>> > Generating them automatically seems like the best solution and
>> > might even be feasible...
>
>> For macros with arguments that happen to call \ensuremath?
>
> No, less general, for the once of the form
>
> \newcommand{\xyz}[N]{\ensuremath{....}}
>
>> Not really.  How should \ensuremath figure out just where its
>> caller chose to have an argument and where not?
>
> "Just" compile it as $\xyz...$.

Uh, you are confused.  preview-latex does not change the source text
at all.  It does not "compile" anything.  It just loads preview.sty
and the customizations, then runs the unmodified source code through
LaTeX.

If it has to catch \xyz, it has to be attached to \xyz.  By the time
\ensuremath is executed, the context from the source code has already
been replaced by the macro.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

[Prev in Thread] Current Thread [Next in Thread]