ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Questions about \starttext
@ 2018-03-20 11:43 Tomas Hala
  2018-04-02 18:39 ` Wolfgang Schuster
  0 siblings, 1 reply; 6+ messages in thread
From: Tomas Hala @ 2018-03-20 11:43 UTC (permalink / raw)
  To: Mailing list ConTeXt

Hi all,

doing some tests I discovered two interesting facts.

The first is that commands \starttext and \stoptext do not behave as a group.

Minimal example (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

\starttext
text
  \starttext
  \bf text 
  \stoptext
text  % this text is in bold, too.
\stoptext

Is this the expected behaviour, or not? 

The second interesting thing is that the unbalanced document is compiled without protests:

Minimal example #1 (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

\starttext
text			% in this case, the "text" is shipped out

Minimal example #2 (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

text			% in this case, the "text" is not shipped out
\stoptext

If this is ok, it does not correspond to our garden wiki
(http://wiki.contextgarden.net/Command/starttext):

"The first command takes care of a number of initializations, and the last
command tells TEX that processing can stop. When this command is left out
TEX will display a * (a star) on the command line at the end of the job. TEX
will expect a command, for example \end."


Wishes,

Tomáš




                                         Tomáš Hála
------------------------------------------------------------------------
Mendel's University of Agriculture and Forestry,
Faculty of Business and Economics, Department of Informatics
------------------------------------------------------------------------
Mendelova zemědělská a lesnická univerzita, Provozně ekonomická fakulta,
Ústav informatiky, Zemědělská 5, CZ-613 00 Brno,  tel. +420 545 13 22 28
------------------------------------------------------------------------
http://www.mendelu.cz/~thala


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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about \starttext
  2018-03-20 11:43 Questions about \starttext Tomas Hala
@ 2018-04-02 18:39 ` Wolfgang Schuster
  2018-04-02 22:02   ` John Culleton
  2018-04-02 22:03   ` John Culleton
  0 siblings, 2 replies; 6+ messages in thread
From: Wolfgang Schuster @ 2018-04-02 18:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1972 bytes --]



> Tomas Hala <mailto:tomas.hala@mendelu.cz>
> 20. März 2018 um 12:43
> Hi all,
>
> doing some tests I discovered two interesting facts.
>
> The first is that commands \starttext and \stoptext do not behave as a 
> group.
>
> Minimal example (tested on TL2015, TL2016, TL2017, current CTX from 
> the Garden):
>
> \starttext
> text
> \starttext
> \bf text
> \stoptext
> text % this text is in bold, too.
> \stoptext
>
> Is this the expected behaviour, or not?

Opening a group with \starttext makes no sense because there is nothing 
after \stoptext.

The possibility to nest \starttext is necessary when you \startproduct 
etc. where components
can be be documents on its own and this means \startcomponent includes 
\starttext in its
definition.

> The second interesting thing is that the unbalanced document is 
> compiled without protests:
>
> Minimal example #1 (tested on TL2015, TL2016, TL2017, current CTX from 
> the Garden):
>
> \starttext
> text % in this case, the "text" is shipped out

Take a look at the command line when you process a file and you should 
see something like this:

mtx-context     | run 1: luatex --fmt="[...]/cont-en" --jobname="test" 
[...] --c:input="./test.tex" [...] "cont-yes.mkiv"


As you can see the luatex engine processes the file cont-yes.mkiv and 
not your document
which put as argument to context. Your document is just read by 
cont-yes.mkiv and at the
end of the document ConTeXt inserts an extra \stoptext which is ignored 
when your document
is valid (equal number of \starttext and \stoptext).

> Minimal example #2 (tested on TL2015, TL2016, TL2017, current CTX from 
> the Garden):
>
> text % in this case, the "text" is not shipped out
> \stoptext

The reason why no text appears is that ConTeXt doesn’t load the default 
fonts
untill \starttext. The reason for this is to is a gain in speed and you 
save resources.

You can test this by adding \setupbodyfont[modern] at the begin of your 
example.


Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 3641 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about \starttext
  2018-04-02 18:39 ` Wolfgang Schuster
@ 2018-04-02 22:02   ` John Culleton
  2018-04-03  7:12     ` Hans Hagen
  2018-04-02 22:03   ` John Culleton
  1 sibling, 1 reply; 6+ messages in thread
From: John Culleton @ 2018-04-02 22:02 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3139 bytes --]

A reasonable approach to a Context file includes preliminary information before the first printed page. My basic master file looks like this :



  \input variables.tex\relax
\input layout.tex\relax
\input macros.tex\relax
\input fonts.tex\relax
\starttext\relax
%\showlayout
\startfrontmatter
\input half.tex\relax
\startstandardmakeup
\null
\stopstandardmakeup
\input title.tex\relax
\input copy.tex\relax
\input ded.tex\relax
\input contents.tex\relax
 \input preface.tex\relax
%\startstandardmakeup \relax
%\null                 \relax
%\stopstandardmakeup  \relax
\stopfrontmatter
\startbodymatter
\input body3.tex\relax
\stopbodymatter\relax
\startbackmatter\relax
\input bib.tex\relax
\input notes.tex
 \input index.tex
\stopbackmatter
\stoptext\relax


 By loading my usual macros in the macros file, standard items like author's name in a variables file and so on I save much time,
 typing and errors.





----------------------------------------
 From: "Wolfgang Schuster" <schuster.wolfgang@gmail.com>
Sent: Monday, April 2, 2018 2:41 PM
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: [NTG-context] Questions about \starttext
      Tomas Hala
 20. März 2018 um 12:43

  Hi all,

doing some tests I discovered two interesting facts.

The first is that commands \starttext and \stoptext do not behave as a group.

Minimal example (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

\starttext
text
\starttext
\bf text
\stoptext
text % this text is in bold, too.
\stoptext

Is this the expected behaviour, or not?

Opening a group with \starttext makes no sense because there is nothing after \stoptext.

The possibility to nest \starttext is necessary when you \startproduct etc. where components
can be be documents on its own and this means \startcomponent includes \starttext in its
definition.
    The second interesting thing is that the unbalanced document is compiled without protests:

Minimal example #1 (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

\starttext
text % in this case, the "text" is shipped out

Take a look at the command line when you process a file and you should see something like this:

mtx-context     | run 1: luatex --fmt="[...]/cont-en" --jobname="test" [...] --c:input="./test.tex" [...] "cont-yes.mkiv"

As you can see the luatex engine processes the file cont-yes.mkiv and not your document
which put as argument to context. Your document is just read by cont-yes.mkiv and at the
end of the document ConTeXt inserts an extra \stoptext which is ignored when your document
is valid (equal number of \starttext and \stoptext).
    Minimal example #2 (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

text % in this case, the "text" is not shipped out
\stoptext

The reason why no text appears is that ConTeXt doesn't load the default fonts
untill \starttext. The reason for this is to is a gain in speed and you save resources.

You can test this by adding \setupbodyfont[modern] at the begin of your example.

Wolfgang



[-- Attachment #1.2: Type: text/html, Size: 5822 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about \starttext
  2018-04-02 18:39 ` Wolfgang Schuster
  2018-04-02 22:02   ` John Culleton
@ 2018-04-02 22:03   ` John Culleton
  1 sibling, 0 replies; 6+ messages in thread
From: John Culleton @ 2018-04-02 22:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2191 bytes --]






----------------------------------------
 From: "Wolfgang Schuster" <schuster.wolfgang@gmail.com>
Sent: Monday, April 2, 2018 2:41 PM
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: [NTG-context] Questions about \starttext
      Tomas Hala
 20. März 2018 um 12:43

  Hi all,

doing some tests I discovered two interesting facts.

The first is that commands \starttext and \stoptext do not behave as a group.

Minimal example (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

\starttext
text
\starttext
\bf text
\stoptext
text % this text is in bold, too.
\stoptext

Is this the expected behaviour, or not?

Opening a group with \starttext makes no sense because there is nothing after \stoptext.

The possibility to nest \starttext is necessary when you \startproduct etc. where components
can be be documents on its own and this means \startcomponent includes \starttext in its
definition.
    The second interesting thing is that the unbalanced document is compiled without protests:

Minimal example #1 (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

\starttext
text % in this case, the "text" is shipped out

Take a look at the command line when you process a file and you should see something like this:

mtx-context     | run 1: luatex --fmt="[...]/cont-en" --jobname="test" [...] --c:input="./test.tex" [...] "cont-yes.mkiv"

As you can see the luatex engine processes the file cont-yes.mkiv and not your document
which put as argument to context. Your document is just read by cont-yes.mkiv and at the
end of the document ConTeXt inserts an extra \stoptext which is ignored when your document
is valid (equal number of \starttext and \stoptext).
    Minimal example #2 (tested on TL2015, TL2016, TL2017, current CTX from the Garden):

text % in this case, the "text" is not shipped out
\stoptext

The reason why no text appears is that ConTeXt doesn't load the default fonts
untill \starttext. The reason for this is to is a gain in speed and you save resources.

You can test this by adding \setupbodyfont[modern] at the begin of your example.

Wolfgang



[-- Attachment #1.2: Type: text/html, Size: 4458 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about \starttext
  2018-04-02 22:02   ` John Culleton
@ 2018-04-03  7:12     ` Hans Hagen
  2018-04-15  8:54       ` Tomas Hala
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2018-04-03  7:12 UTC (permalink / raw)
  To: ntg-context

On 4/3/2018 12:02 AM, John Culleton wrote:
> A reasonable approach to a Context file includes preliminary information 
> before the first printed page. My basic master file looks like this :
 >
 > ...

in the distribution there are a lot of manuals of which the setup 
demonstrates ways to organize ... one probably not known to all is

\startdocument[settings] ... \stopdocument

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 : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Questions about \starttext
  2018-04-03  7:12     ` Hans Hagen
@ 2018-04-15  8:54       ` Tomas Hala
  0 siblings, 0 replies; 6+ messages in thread
From: Tomas Hala @ 2018-04-15  8:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Tue, Apr 03, 2018 ve 09:12:31AM +0200 Hans Hagen napsal(a):
# On 4/3/2018 12:02 AM, John Culleton wrote:
# >A reasonable approach to a Context file includes preliminary
# >information before the first printed page. My basic master file
# >looks like this :
# >
# > ...
# 
# in the distribution there are a lot of manuals of which the setup
# demonstrates ways to organize ... one probably not known to all is
# 
# \startdocument[settings] ... \stopdocument

ok, where can I find it? 

The thing I am a bit confused and which was the main reason of my question,
is why the compiler does not report the unbalanced pair of start/stop in
this case.

Tomáš 

 
# 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 : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
# webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
# archive  : https://bitbucket.org/phg/context-mirror/commits/
# wiki     : http://contextgarden.net
# ___________________________________________________________________________________

                                         Tomáš Hála
--------------------------------------------------------------------
Mendelova univerzita, Provozně ekonomická fakulta, ústav informatiky
Zemědělská 1, CZ-613 00 Brno,  tel. +420 545 13 22 28
--------------------------------------------------------------------
http://akela.mendelu.cz/~thala
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-04-15  8:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 11:43 Questions about \starttext Tomas Hala
2018-04-02 18:39 ` Wolfgang Schuster
2018-04-02 22:02   ` John Culleton
2018-04-03  7:12     ` Hans Hagen
2018-04-15  8:54       ` Tomas Hala
2018-04-02 22:03   ` John Culleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).