With a single environment it seems to work, though when I expand it to multiple, it does not seem to work anymore

\starttext

SomeText \\
\environment aaa \\
SomeText \\
\environment bbb \\
SomeText \\

\startenvironment aaa
\samplefile{lorem}
\stopenvironment

\startenvironment bbb
\samplefile{tufte}
\stopenvironment

\stoptext

Op do 4 jan 2024 om 20:14 schreef Henning Hraban Ramm <texml@fiee.net>:
Am 04.01.24 um 18:00 schrieb Jeroen:
> I just would like to have a lot of mark-up for combined figures and
> tables etc moved out of the way, similar to this. I am loosing the
> general documetn flow because of all this markup. Would there be a
> construction similar to this:
>
> \starttext
>
> \environment foo
> \environment bar
>
> \startenvironment foo
> this is a lot of text
> \stopenvironment
>
> \startenvironment bar
> and this is another piece of text
> \stopenvironment
>
> \stoptext

An environment is a separate file.
\environment is like \input with a few more checks, e.g. it loads the
file only once.

e.g.

-- file "env_foo.tex" --
\startenvironment env_foo
% settings
\stopenvironment
--


-- file document.tex --
\environment env_foo

\starttext
% whatever
\stoptext
--

Instead of the call within your document, you can also call

context --environment=env_foo.tex document

(Usually that makes only sense in XML workflows.)

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

maillist : ntg-context@ntg.nl / 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
___________________________________________________________________________________