[NTG-context] Re: Local alternative to \input

2024-03-05 Thread Henning Hraban Ramm

Am 04.03.24 um 10:43 schrieb Denis Maier via ntg-context:

Hi,

Aren’t environments used for setups (and not for textual content). Maybe 
a buffer may be what you want ?


https://wiki.contextgarden.net/Command/startbuffer 


Yes, buffers are the way to go for (textual) contents, while setups or 
environments are for settings – they handle whitespace differently.


Apparently I misunderstood the intention when I gave the answer about 
environments, sorry!


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
___


[NTG-context] Re: Local alternative to \input

2024-03-04 Thread Denis Maier via ntg-context
Hi,

Aren’t environments used for setups (and not for textual content). Maybe a 
buffer may be what you want ?

https://wiki.contextgarden.net/Command/startbuffer

 

Best,

Denis

 

 

Von: Jeroen  
Gesendet: Montag, 4. März 2024 06:15
An: mailing list for ConTeXt users 
Betreff: [NTG-context] Re: Local alternative to \input

 

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 mailto:te...@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 <mailto: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
___

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


[NTG-context] Re: Local alternative to \input

2024-03-03 Thread Jeroen
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 :

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


[NTG-context] Re: Local alternative to \input

2024-01-04 Thread Henning Hraban Ramm

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
___


[NTG-context] Re: Local alternative to \input

2024-01-04 Thread Henning Hraban Ramm

Am 04.01.24 um 17:12 schrieb Jeroen:
I have a document that is getting a lot of mark-up instructions for 
creating tables and placing figures. I would like to move this out of 
the main text flow. The easiest way would be using \input, but i rather 
place all this at the bottom of the file and just refer to it with 
something like \localinput or so to a textblock at the bottom of the 
same file. What would be the easiest way to implement this?


Usually, the best way to load setups is using \environment at the top of 
your file.


I don’t understand the sense in placing this in the bottom, and since 
it’s against the flow of instructions it would at least involve a second 
pass, and I don’t see how anything would work without loading it on top.


You could load an environment with a command line option, if you must 
avoid it in your file.


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
___


[NTG-context] Re: Local alternative to \input

2024-01-04 Thread Wolfgang Schuster

eroen schrieb am 04.01.2024 um 17:12:
I have a document that is getting a lot of mark-up instructions for 
creating tables and placing figures. I would like to move this out of 
the main text flow. The easiest way would be using \input, but i 
rather place all this at the bottom of the file and just refer to it 
with something like \localinput or so to a textblock at the bottom of 
the same file. What would be the easiest way to implement this?


Can you provide a minimal example, natural tables provide a mechanism to 
separate layout and content but we can't know what you use in your document.


Wolfgang

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