Re: Questions about \start-ing things with \environment and \project

Jim <[email protected]>
Newsgroups gmane.comp.tex.context
Message-ID <acWhEzdkU8VI/H/[email protected]>
On Thu, Mar 26, 2026 at 21:40 (+0100), Henning Hraban Ramm wrote:

> Am 25.03.26 um 23:27 schrieb Jim:
>> FWIW, *part* of what I am trying to do here is to improve how AUCTeX deals
>> with ConTeXt.  If I want to typeset a small portion of a large document,
>> AUCTeX needs to find what the LaTeX people call the "preamble", which is
>> (AIUI) the part before the "\begin{document}".  But ConTeXt is more
>> flexible, and I'm trying to hone in on how the "preamble" can be
>> automatically found.

>> If a document uses
>>          \environment ...
>>          \startcomponent ...
>>          ...
>> then one can say the "preamble" is that stuff before \startcomponent.

>> But if one uses them the other way, automatically finding the "preamble" is
>> trickier.  Or maybe in general next to impossible.

> If you document it that way, then it’s probably ok if AUCtex only recognizes
> everything before the first \start… as preamble.

That is what it should be doing.  Right now with

        % comments
        \environment(s) ...
        \startcomponent componentName

it is taking everything above (before) \startcomponent, but it is not (yet)
recognizing that "componentName" is part of the \startcomponent command.

I'm hoping fixing that only requires the small hammer.  :-)



>>> e.g. \startdocument or any other “documents” that are defined with
>>> \definedocument
>>> also \startMPpage

>> Thanks for those two.  I expect that user-defined commands to start the
>> document will be difficult to deal with, but I'll add \startdocument and
>> \startMPpage (I should have remembered that one!) to the list.

> Also remember that there can be multiple or nested \environment calls –
> in bigger projects, I split the environment into topics like colors,
> fonts, layout…

Yes, a good idea, and as long as they are above the \startXYZ, they will
get pulled in.

> An environment is only loaded once even if called multiple times, in
> opposite to \input, so it doesn’t matter if you call it from the project
> and the component.

I mentioned that on the AUCTeX list.  Someone there (who is presumably a
LaTeX person) made a comment that made me think she liked the flexibility
of ConTeXt.

                                Jim
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : [email protected] / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.