Hi Jim,

>>>>> Jim <[email protected]> writes:
> So based on your comments, I discovered that having "../" is not needed,
> either for compiling one file (with C-C C-b) or the entire document (with
> C-c C-c).  It would appear that ConTeXt LMTX searches for the environment
> file in ".." as well as ".".

> Therefore if I remove the "../" from all the different chapters, it seems
> my problem will nicely disappear.

That's fine for both of us.

> But I will add bit more information below, in case anyone reads this in the
> future when trying to solve a similar problem.

😆

> I can understand the logic for where _region_.tex is created (and compiled
> from) in both cases:
-> TeX-master = t                           _region_.tex in "."
-> TeX-master = "../introCTX.tex"           _region_.tex in ".."
> This is fine (I imagine) in most cases, but doesn't work so well for
> documents that have chapters in a sub-directory with
>         \environment ../file.tex

Agreed. I don't think that is a fault of `TeX-master'. _region_.tex
should be put there due to the nature of TeX itself. The origin of the
problem is localized to special behavior of \environment.

> ConTeXt does have something analogous to a preamble, but it seems to be a
> bit more complicated.  An ordinary one-file ConTeXt document looks like

>         <preamble stuff>

>         \starttext
>         ... document body
>         \stoptext

> But it gets more complicated in multi-file documents, because the preamble
> (which in this case is stored in the introCTX_env.tex file) can be "input"
> in every separate file.  (I am guessing that is different than LaTeX.)

I think so, too. I suppose that repeated appearance of the same preamble
in one document would cause trouble in most cases for LaTeX document.

> Including the preamble from every file makes it convenient to compile each
> chapter by itself, *without* needing an editor (or something else) to
> extract the preamble from the master(?) file and put it at the beginning of
> the _region_.tex file.

Hmm, then ConTeXt is more flexible than LaTeX with respect to that
aspect. LaTeX needs "standalone" package to achieve similar behavior.

> Also, the chapters in the document I am editing start like this:
>         \environment ../introCTX_env.tex

>         \startcomponent b08_Lists.tex

>         \startchapter
>           [
>             reference=cap:toc,
>             title={Table of contents, indexes, lists},
>             bookmark={Table of contents, indexes, lists},
>           ]
> so "\startcomponent" can be used instead of "\starttext" to say "the
> preamble is over, here comes the content".

> And there is also \startTEXpage to start the document body.  And others.

Maybe we should consider to add such delemiters to `TeX-header-end' in
ConTeXt mode.

> Ikumi: thanks for responding to my email, your suggestions and questions
> got me to a solution to the problem.

☺️

Ikumi Keita
#StandWithUkraine #StopWarInUkraine
#Gaza #StopGenocide #CeasefireNOW
#IProtestAgainstTrumpAndNetanyahu'sAttackOnIran,WhichViolatesInternationalLaw

Reply via email to