[NTG-context] Re: Questions about \start-ing things with \environment and \project

2026-03-27 Thread Jim
On Thu, Mar 26, 2026 at 23:08 (+0100), Hans Hagen via ntg-context wrote:

> On 3/26/2026 10:11 PM, Jim wrote:

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

> definitely not a midnight one

I had to look that up.  (With so many violations of other country's
sovereignty by those with manifest destiny, I've lost track of all these
names.)

I was thinking a claw hammer, but I have a rarely used club hammer that
is patiently waiting for its turn.

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
___


[NTG-context] Re: Questions about \start-ing things with \environment and \project

2026-03-26 Thread Jim
Thanks Max.

As you might have seen, HHR beat you to it, but thanks anyway.

Also, interesting article in your link below.  That probably deserves a
spot somewhere in the wiki (if it isn't already there).

Jim

On Thu, Mar 26, 2026 at 16:46 (-0600), Max Chernoff via ntg-context wrote:

> Hi Jim,

> On Wed, 2026-03-25 at 17:17 -0300, Jim wrote:
>> Q5: In addition to \starttext, \startTEXpage, \startcomponent and
>> \startproduct, are there any other \start commands which
>> signify the start of the text to be typeset?

> There's also \startdocument (that I personally use all the time) and
> \startMPpage, but that's all that I can find in the list that I
> previously compiled:

> https://tex.meta.stackexchange.com/a/10161/270600

> Thanks,
> -- Max
___
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
___


[NTG-context] Re: Questions about \start-ing things with \environment and \project

2026-03-26 Thread Max Chernoff via ntg-context
Hi Jim,

On Wed, 2026-03-25 at 17:17 -0300, Jim wrote:
> Q5: In addition to \starttext, \startTEXpage, \startcomponent and
> \startproduct, are there any other \start commands which
> signify the start of the text to be typeset?

There's also \startdocument (that I personally use all the time) and
\startMPpage, but that's all that I can find in the list that I
previously compiled:

https://tex.meta.stackexchange.com/a/10161/270600

Thanks,
-- Max
___
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
___


[NTG-context] Re: Questions about \start-ing things with \environment and \project

2026-03-26 Thread Hans Hagen via ntg-context

On 3/26/2026 10:11 PM, Jim wrote:


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


definitely not a midnight one

Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
   tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-
___
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
___


[NTG-context] Re: Questions about \start-ing things with \environment and \project

2026-03-26 Thread Jim
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
___


[NTG-context] Re: Questions about \start-ing things with \environment and \project

2026-03-26 Thread Henning Hraban Ramm

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.



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…


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.


Hraban
___
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
___


[NTG-context] Re: Questions about \start-ing things with \environment and \project

2026-03-25 Thread Jim
On Wed, Mar 25, 2026 at 22:38 (+0100), Henning Hraban Ramm wrote:

Hraban,

thanks very much for your answers.   Just some small follow-ups...

> Am 25.03.26 um 21:17 schrieb Jim:


>> Q2: Is it "accidental" that \startcomponent and \startproduct work for me
>> right now, or is it part of ConTeXt's design that they work like this?

> You should be able to typeset a single component, but (in my older
> experience, not recently checked) you must include the \environment, and
> it can matter if your components are in subdirectories (paths of
> environment, images etc.).

That makes sense.

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.


>> Q3: When one uses \startproduct, does it matter if any \environment
>> commands go before or after?  That is, are both of these equally valid,
>> or is one The Right Way and one The Wrong Way?
>>  (a)
>>  \environment myenv
>>  \startproduct mydoc
>>  ...
>>  (b)
>>  \startproduct mydoc
>>  \environment myenv
>>  ...




>> Q4: When one uses \startproduct, does it matter if any \project
>> commands go before or after?  That is, are both of these equally valid,
>> or is one The Right Way and one The Wrong Way?
>>  (a)
>>  \project myproject
>>  \startproduct mydoc
>>  ...
>>  (b)
>>  \startproduct mydoc
>>  \project myproject
>>  ...

> Not sure. I have \environment, \project etc. after \startcomponent /
> \startproduct

Good to know that your way works.  ANSS does it the other way around
(\environment before \start{product,component}), perhaps because JAL is an
emacs user and that made it work for him.


>> Q5: In addition to \starttext, \startTEXpage, \startcomponent and
>>  \startproduct, are there any other \start commands which
>> signify the start of the text to be typeset?

> 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.

Cheers.

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
___


[NTG-context] Re: Questions about \start-ing things with \environment and \project

2026-03-25 Thread Henning Hraban Ramm

Am 25.03.26 um 21:17 schrieb Jim:

Using LMTX, if instead of \starttext and \stoptext, I have either
   (a) \startcomponent[aaa] Hello \stopcomponent
or
   (b) \startproduct[aaa] Hello \stopproduct
then running context on such a file gives me a PDF with "Hello" in it.

Contrariwise, if I use
   (c) \startproject[aaa] Hello \startproject
I get a PDF with a page number, but no "Hello".


That’s expected. The project is not meant to be typeset.



AIUI, when LMTX sees \starttext it does some initialization,
as well as signalling that actual textual content follows.

Q1: Do \startcomponent and \startproduct do the same initialization
 as \starttext, so that I will see the same output, or will things be
 different in some situations?


It should be the same.


Q2: Is it "accidental" that \startcomponent and \startproduct work for me
 right now, or is it part of ConTeXt's design that they work like this?


You should be able to typeset a single component, but (in my older 
experience, not recently checked) you must include the \environment, and 
it can matter if your components are in subdirectories (paths of 
environment, images etc.).




Q3: When one uses \startproduct, does it matter if any \environment
 commands go before or after?  That is, are both of these equally valid,
 or is one The Right Way and one The Wrong Way?
 (a)
 \environment myenv
 \startproduct mydoc
 ...
 (b)
 \startproduct mydoc
 \environment myenv
 ...



Q4: When one uses \startproduct, does it matter if any \project
 commands go before or after?  That is, are both of these equally valid,
 or is one The Right Way and one The Wrong Way?
 (a)
 \project myproject
 \startproduct mydoc
 ...
 (b)
 \startproduct mydoc
 \project myproject
 ...


Not sure. I have \environment, \project etc. after \startcomponent / 
\startproduct




Q5: In addition to \starttext, \startTEXpage, \startcomponent and
 \startproduct, are there any other \start commands which
 signify the start of the text to be typeset?


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

also \startMPpage

Hraban



___
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
___