[NTG-context] Re: blank line and \placefigure

2024-04-06 Thread Thomas Meyer

Here is a minimal example that better describes my problem.
It seems to depend on the size of the image. 30 mm and 40 mm width 
works, 35 mm does not.
I have not tested height, although the image I want to use would be 
portrait format.


\setuplayout[grid=yes]
\setupinterlinespace[line=15pt]
\starttext
\input{knuth}
\startlinecorrection
\placefigure[left, none]
[]{}\externalfigure[cow.pdf][width=40mm]
\input{knuth}
\stoplinecorrection
\stoptext

Thomas

Am 06.04.24 um 13:43 schrieb Wolfgang Schuster:

Henning Hraban Ramm schrieb am 06.04.2024 um 12:56:

Am 06.04.24 um 12:48 schrieb Thomas Meyer:
how can I suppress a blank line between a text paragraph and 
\placefigure?

I get one there, but I don't want it.


Did you try
\setupfloat[figure][spacebefore=,]
?
or "none" or "{disable,nowhite,back}"


You can set the space only for *all* floats, e.g.

    \setupfloat[spacebefore=...,spaceafter=...]

and not for a single float type only.

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
___ 

___
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: blank line and \placefigure

2024-04-06 Thread Wolfgang Schuster

Henning Hraban Ramm schrieb am 06.04.2024 um 12:56:

Am 06.04.24 um 12:48 schrieb Thomas Meyer:
how can I suppress a blank line between a text paragraph and 
\placefigure?

I get one there, but I don't want it.


Did you try
\setupfloat[figure][spacebefore=,]
?
or "none" or "{disable,nowhite,back}"


You can set the space only for *all* floats, e.g.

    \setupfloat[spacebefore=...,spaceafter=...]

and not for a single float type only.

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
___


[NTG-context] Re: blank line and \placefigure

2024-04-06 Thread Henning Hraban Ramm

Am 06.04.24 um 12:48 schrieb Thomas Meyer:

how can I suppress a blank line between a text paragraph and \placefigure?
I get one there, but I don't want it.


Did you try
\setupfloat[figure][spacebefore=,]
?
or "none" or "{disable,nowhite,back}"

https://wiki.contextgarden.net/Command/setupfloat
https://wiki.contextgarden.net/Command/blank

HTH
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] blank line and \placefigure

2024-04-06 Thread Thomas Meyer

Hi folks,

how can I suppress a blank line between a text paragraph and \placefigure?
I get one there, but I don't want it.

Thanks and greetings on a sunny weekend
Thomas
___
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: unwanted blank page

2023-12-03 Thread Pablo Rodriguez via ntg-context
On 11/22/23 09:57, madiazm.eo...@gmail.com wrote:
> Thanks a lot Pablo for your comments, I think my bad English did not
> let me be clear.
Sorry (also for my delay in answering), but it was totally my fault (I
totally missed your point)..

Pablo
___
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: unwanted blank page

2023-11-22 Thread madiazm . eoicc
Thanks a lot Pablo for your comments, I think my bad Englisch did not let me be 
clear.

I just wanted to show my trick not to get the first page numbered, hiding the 
number with [location=] and then changing the number format to the wished 
option. I was not asking a question.
Of course, since this is all new for me, I possibly go around and aroung to get 
a little thing done. In the introductions to ConTeXt I never found the command 
startmakeup, so i had to figure out a way to do it. I will study it at weekend.
___
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: unwanted blank page

2023-11-20 Thread Pablo Rodriguez via ntg-context
On 11/19/23 23:34, madiazm.eo...@gmail.com wrote:
> sorry if i dont get your problem right understood, but i'm completely
> new to context.

Hi Miguel,

I’m afraid it isn’t entirely clear whether you intend to ask something
or not.

> I use a hack not to get the number not printed in the title page
> (though I define sectionblocks for keeping different numbering systems
> for the table of contents and the document)

Section blocks are intended for that.

Just a comment, if your cover (or title) page involves a one and only
single page, you may use makeups, such as in:

  \starttext
  \startmakeup[standard][pagestate=start]
  \dorecurse{25}{\input knuth}
  \stopmakeup
  \stoptext

My sample explicitly displays that makeups are intended for a single page.

Since actual content for that makeup would fit in six pages without the
makeup, it looks weird inside it.

> I use \setuppagenumbering[location=] for not getting the number
> printed and then I reset the page numbering for the next sections. I
> copy my code so that you know what I do.
> Sorry if it doesnt help

If you are showing your code to list members, fine.

Sorry, but if there is a question here, I’m afraid you need to be more
explicit asking your question.

Just some comments:

> %%
> %%% LOS BLOQUES %
> %%%

In a minimal sample, comments as the previous one don’t provide any clue
to understand your code or the issue you might be dealing with.

It is wiser to keep the sample to its minimal form.

>   \startsectionblock[portada]
>   \setuppagenumbering[location=]
>   \input{03_portadaEval.tex}%this is my title page

It is better to provide actual content than a file name.

BTW, if its contents cannot be in more than a single page, the approach
suggested above might be easier.


> \startfrontmatter[]

Empty brackets are not required here.

> \start
>   \setuplayout[re
>   \setupinterlinespace[.8ex]

I would say that this is extremely small even for an "x" to fit in.

Again, just in case it might help,

Pablo
___
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: unwanted blank page

2023-11-19 Thread madiazm . eoicc
sorry if i dont get your problem right understood, but i'm completely new to 
context.

I use a hack not to get the number not printed in the title page (though I 
define sectionblocks for keeping different numbering systems for the table of 
contents and the document)

I use \setuppagenumbering[location=] for not getting the number printed and 
then I reset the page numbering for the next sections. I copy my code so that 
you know what I do.
Sorry if it doesnt help

%%
%%% LOS BLOQUES %
%%%

\definesectionblock[portada][number=no]

\defineconversionset
[portada:pagenumber][][characters]
\defineconversionset
[frontpart:pagenumber][][romannumerals]
\defineconversionset
[bodypart:pagenumber][][numbers]
\defineconversionset
[appendixpart:pagenumber][][Characters]



%%%
%%% NUMERACIÓN DE PÁGINAS, SETUP %
%%%
\setuppagenumbering[alternative=doublesided,location={footer,inmargin}]

\setupuserpagenumber[way=byblock] 



\starttext
  
  \startsectionblock[portada]
  \setuppagenumbering[location=]
  \input{03_portadaEval.tex}%this is my title page
  
\stopsectionblock

\startfrontmatter[] 
\start
  \setuplayout[reset]
  \setupinterlinespace[.8ex]
  \completecontent
\stop
  \stopfrontmatter

  \startbodymatter[]
  
\input{50_Evaluacion.tex}%a piece of text
   
  \stopbodymatter

\stoptext
___
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: unwanted blank page

2023-11-19 Thread Wolfgang Schuster

Hans van der Meer via ntg-context schrieb am 19.11.2023 um 11:56:
I should have a first page without pagenumber and pagenumbers on the 
subsequent ones.
However the MWE here introduces an unwanted blank page from the call 
to \setuppagenumbering[state=start].

And the \setuppagenumbering has to come after the \page, of course.

Should I program otherwise?


There is nothing you can do here for the moment, the empty page is caused
by a new piece of code in page-lay.mkxl (see below) to go to the next 
odd page

when you use the \setuppagenumbering command.

page-lay.mkxl (line 1436):

\appendtoks
    \ifnum\realpageno>\plusone
    \page[\v!odd]%
    \setuplayout
    \fi
\to \everysetuppagenumbering

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
___


[NTG-context] unwanted blank page

2023-11-19 Thread Hans van der Meer via ntg-context
I should have a first page without pagenumber and pagenumbers on the subsequent ones.However the MWE here introduces an unwanted blank page from the call to \setuppagenumbering[state=start].And the \setuppagenumbering has to come after the \page, of course.Should I program otherwise?
yours sincerelydr. Hans van der Meer




% test pagenumbering start-stop\setuppapersize[A5][A5]\starttext\setuppagenumbering[state=stop]\ConTeXt\space\contextversion\blankThis is page 1 without pagenumber.\crlf\page\setuppagenumbering[state=start]This should be a page with pagenumber 2.\crlfBut the pagenumber is 3 instead after blank page 2.\stoptext

extrapage.pdf
Description: Adobe PDF document
___
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: Title pages makeup extra blank pages

2023-07-06 Thread Wolfgang Schuster

Alan Braslau schrieb am 06.07.2023 um 17:14:

On 06/07/23 06/07/23, 17:07, Wolfgang Schuster wrote:


Add "doublesided=no" to your makeup settings.

Wolfgang


Thank you.
I have doublesided=no in the makeup, but this makeup is not used by 
\startpagefigure.


The problem is with \startpagefigure that is outside of makeup, that 
is it is using the standard makeup (with doublesided=yes). Is this a 
bug, that is should \startpagefigure use the makeup of the included 
PDF document and ignore the local makeup? Or is this, rather, what is 
intended, requiring one to wrap the included pages in an explicit 
makeup (as I am now doing)?


\pagefigure[...][...] (no need for \startpagefigure .. \stoppagefigure) 
is a combination of \startTeXpage and \externalfigure and you shouldn't 
put the command in a makeup environment.


Wolfgang

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

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


[NTG-context] Re: Title pages makeup extra blank pages

2023-07-06 Thread Alan Braslau via ntg-context

On 06/07/23 06/07/23, 17:07, Wolfgang Schuster wrote:


Add "doublesided=no" to your makeup settings.

Wolfgang


Thank you.
I have doublesided=no in the makeup, but this makeup is not used by 
\startpagefigure.


The problem is with \startpagefigure that is outside of makeup, that is 
it is using the standard makeup (with doublesided=yes). Is this a bug, 
that is should \startpagefigure use the makeup of the included PDF 
document and ignore the local makeup? Or is this, rather, what is 
intended, requiring one to wrap the included pages in an explicit makeup 
(as I am now doing)?


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

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


[NTG-context] Re: Title pages makeup extra blank pages

2023-07-06 Thread Wolfgang Schuster

Alan Braslau via ntg-context schrieb am 06.07.2023 um 11:58:

On 06/07/23 06/07/23, 10:14, Henning Hraban Ramm wrote:

Am 06.07.23 um 09:34 schrieb Alan Braslau via ntg-context:
inserts a "blank" page (with header/footer) between the two 
Coverpages and a second "blank" page after the backside title page.


I don’t know if it helps, but did you set
\setupsectionblock[frontpart][page=no]
?


I had \setupsectionblock[frontpart][page=]
and setting page=no does not change anything.

I get the same behavior in my Volume 2 product, which does not have 
any \frontmatter.


I solved the problem by rather using:

 \definemakeup[cover][page][page=no,doublesided=no]
 \definelayout[cover][page]
 \startmakeup [cover]
   \filterpages[Coverpages][1]
 \stoppagemakeup
 \startmakeup [cover]
   \filterpages[Coverpages][2]
 \stoppagemakeup


\startlayout[page]
\filterpages[...]
\stoplayout

Wolfgang

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

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

[NTG-context] Re: Title pages makeup extra blank pages

2023-07-06 Thread Wolfgang Schuster

Alan Braslau via ntg-context schrieb am 06.07.2023 um 09:34:

Hello,

Trying to use:

\startdocument

\startpagefigure[Coverpages.pdf][page=1]\stoppagefigure
\startpagefigure[Coverpages.pdf][page=2]\stoppagefigure

% before

\startmakeup [titlepage]
front
\stopmakeup

\startmakeup [titlepage]
back
\stopmakeup

\startfrontmatter
...
\stopfrontmatter

...

\stopdocument


inserts a "blank" page (with header/footer) between the two Coverpages 
and a second "blank" page after the backside title page.


Not including the two \startpagefigure lines eliminates the blank page 
following the back side title page (and the other one between the two 
Coverpages, of course).



This is not a MWE as it occurs in a complicated project but not in mwe 
snippets.


I suspect that this artifact is somehow related to the page={...} 
settings later in the document. How can I turn OFF all automatic page 
generation settings for the very beginning of my document? Any ideas?

(Title page makeup has always been somewhat of a mystery to me.)


Add "doublesided=no" to your makeup settings.

Wolfgang

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

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

[NTG-context] Re: Title pages makeup extra blank pages

2023-07-06 Thread Henning Hraban Ramm

Am 06.07.23 um 11:58 schrieb Alan Braslau:

Maybe it’s also a problem of \startdocument – I always get a first 
empty page and don’t understand why.


One gets an empty first page if there is *any* text content anywhere in 
the setups or environment files before the \startdocument.


My problem actually was \startMPcode; had nothing to do with 
\startdocument or your code, sorry.


Also sorry, seems like I can’t help you.

Hraban

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

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

[NTG-context] Re: Title pages makeup extra blank pages

2023-07-06 Thread Alan Braslau via ntg-context

On 06/07/23 06/07/23, 10:14, Henning Hraban Ramm wrote:

Am 06.07.23 um 09:34 schrieb Alan Braslau via ntg-context:
inserts a "blank" page (with header/footer) between the two Coverpages 
and a second "blank" page after the backside title page.


I don’t know if it helps, but did you set
\setupsectionblock[frontpart][page=no]
?


I had \setupsectionblock[frontpart][page=]
and setting page=no does not change anything.

I get the same behavior in my Volume 2 product, which does not have any 
\frontmatter.


I solved the problem by rather using:

 \definemakeup[cover][page][page=no,doublesided=no]
 \definelayout[cover][page]
 \startmakeup [cover]
   \filterpages[Coverpages][1]
 \stoppagemakeup
 \startmakeup [cover]
   \filterpages[Coverpages][2]
 \stoppagemakeup

Thank you for your suggestion!


Maybe it’s also a problem of \startdocument – I always get a first empty 
page and don’t understand why.


One gets an empty first page if there is *any* text content anywhere in 
the setups or environment files before the \startdocument.


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

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

[NTG-context] Re: Title pages makeup extra blank pages

2023-07-06 Thread Henning Hraban Ramm

Am 06.07.23 um 09:34 schrieb Alan Braslau via ntg-context:
inserts a "blank" page (with header/footer) between the two Coverpages 
and a second "blank" page after the backside title page.


I don’t know if it helps, but did you set
\setupsectionblock[frontpart][page=no]
?

Maybe it’s also a problem of \startdocument – I always get a first empty 
page and don’t understand why.


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

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

[NTG-context] Title pages makeup extra blank pages

2023-07-06 Thread Alan Braslau via ntg-context

Hello,

Trying to use:

\startdocument

\startpagefigure[Coverpages.pdf][page=1]\stoppagefigure
\startpagefigure[Coverpages.pdf][page=2]\stoppagefigure

% before

\startmakeup [titlepage]
front
\stopmakeup

\startmakeup [titlepage]
back
\stopmakeup

\startfrontmatter
...
\stopfrontmatter

...

\stopdocument


inserts a "blank" page (with header/footer) between the two Coverpages 
and a second "blank" page after the backside title page.


Not including the two \startpagefigure lines eliminates the blank page 
following the back side title page (and the other one between the two 
Coverpages, of course).



This is not a MWE as it occurs in a complicated project but not in mwe 
snippets.


I suspect that this artifact is somehow related to the page={...} 
settings later in the document. How can I turn OFF all automatic page 
generation settings for the very beginning of my document? Any ideas?

(Title page makeup has always been somewhat of a mystery to me.)

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

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


Re: [NTG-context] setuphead page=right and blank even page.

2023-06-11 Thread Wolfgang Schuster via ntg-context

Alan Braslau schrieb am 11.06.2023 um 20:12:

On 10/06/23 10/06/23, 12:42, Wolfgang Schuster via ntg-context wrote:

Alan Braslau via ntg-context schrieb am 10.06.2023 um 12:28:

Hello,

\setuphead
  [part,chapter,title]
  [page=right]

will start a part, chapter, or title on an odd page (right), 
inserting a "blank" even page if necessary. How can I get this blank 
even page to be truely blank, that is with no headers nor footers?


I tried several thinks and must be missing something really simple 
and obvious.


\setuphead [...] [page={yes,header,footer,right}]


Wolfgang
Thank you for this hint. It works (almost) as expected:
Strangely, I had to add, explicitly,

\startfrontmatter

\component FrontMatterStuff

\page[yes,header,footer,right]

\stopfrontmatter

\startbodymatter

...

\stopbodymatter


In order to get the frontmatter end with a totally blank page before a 
right Chapter 1 header. Using just the setuphead resulted in headers 
and footers on the "blank" left page. No problems for Chapters 2, etc.


Section block force by default a page break which can produce unexpected 
headers/footers on the first chapter etc.


You can fix this by disabling the page break at the start/end of the 
section block with


    \setupsectionblock [bodypart] [page=]

Wolfgang

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

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


Re: [NTG-context] setuphead page=right and blank even page.

2023-06-11 Thread Alan Braslau via ntg-context

On 10/06/23 10/06/23, 12:42, Wolfgang Schuster via ntg-context wrote:

Alan Braslau via ntg-context schrieb am 10.06.2023 um 12:28:

Hello,

\setuphead
  [part,chapter,title]
  [page=right]

will start a part, chapter, or title on an odd page (right), inserting 
a "blank" even page if necessary. How can I get this blank even page 
to be truely blank, that is with no headers nor footers?


I tried several thinks and must be missing something really simple and 
obvious.


\setuphead [...] [page={yes,header,footer,right}]


Wolfgang
Thank you for this hint. It works (almost) as expected:
Strangely, I had to add, explicitly,

\startfrontmatter

\component FrontMatterStuff

\page[yes,header,footer,right]

\stopfrontmatter

\startbodymatter

...

\stopbodymatter


In order to get the frontmatter end with a totally blank page before a 
right Chapter 1 header. Using just the setuphead resulted in headers and 
footers on the "blank" left page. No problems for Chapters 2, etc.


--
Alan


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

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


Re: [NTG-context] setuphead page=right and blank even page.

2023-06-10 Thread Wolfgang Schuster via ntg-context

Alan Braslau via ntg-context schrieb am 10.06.2023 um 12:28:

Hello,

\setuphead
  [part,chapter,title]
  [page=right]

will start a part, chapter, or title on an odd page (right), inserting 
a "blank" even page if necessary. How can I get this blank even page 
to be truely blank, that is with no headers nor footers?


I tried several thinks and must be missing something really simple and 
obvious.


\setuphead [...] [page={yes,header,footer,right}]

Wolfgang

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

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


[NTG-context] setuphead page=right and blank even page.

2023-06-10 Thread Alan Braslau via ntg-context

Hello,

\setuphead
  [part,chapter,title]
  [page=right]

will start a part, chapter, or title on an odd page (right), inserting a 
"blank" even page if necessary. How can I get this blank even page to be 
truely blank, that is with no headers nor footers?


I tried several thinks and must be missing something really simple and 
obvious.


Thank you.

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

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


Re: [NTG-context] Unwanted blank page before page figures when using non-placed (hidden) heads

2022-07-29 Thread cryo shock via ntg-context
Of course it works, it's the order.
For me TeX wouldn't be the same without you. Thank you very much Hans.

Hans Hagen via ntg-context  schrieb am Mo., 25. Juli
2022, 09:20:

> On 7/24/2022 11:35 PM, cryo shock via ntg-context wrote:
> > Hey there,
> >
> > I am having trouble understanding some basic blank page behavior. I hope
> > that somebody of you can point me in the right direction.
> >
> > My primary goal is to create application documents consisting of various
> > .tex components and with external PDF pages inserted as well. The second
> > part of that goal is to use multiple-level bookmarking as well.
> > Bookmarking should look like this:
> >
> > - Letter
> > - Resume
> > - Testimonies
> > -- Testimony A
> > -- Testimony B
> > -- Testimony C
> >
> > In the following MWE you can see my progress along with some notes to
> > help understanding.
> >
> > There are two questions, I'd wish could be answered:
> >
> > 1. Why does TeX insert a blank page before a pagefigure I enclose within
> > a (hidden) head?
> >
> > 2. Can the \bookmark[list]{text} command be somehow used for multi-level
> > bookmarking?
> >
> > While the first question would make up for a more consistent solution,
> > the second question would do the job as well.
> >
> > I hope some of you can enlighten me.
> >
> > Cheers, k
> >
> >
> > %%% START of MWE
> >
> > \definehead[VisiSection][section]
> > \setuphead[VisiSection][number=no]
> >
> > \definehead[InvisiSection][VisiSection]
> > \setuphead[InvisiSection][placehead=no]
> >
> > \definelist[CustomBMarks]
> >
> > \setupinteraction[state=start]
> > \placebookmarks[VisiSection,InvisiSection,CustomBMarks]
> >
> > \startcomponent * % not a product, no
> >\startVisiSection[title={Custom Section A}]
> >  Text of Custom Section A
> >\stopVisiSection
> >\page
> >\startVisiSection[title={Custom Section B}]
> >  Text of Custom Section B
> >\stopVisiSection
> >\startInvisiSection[title={Hidden Custom Section A}]
> >  Text of Hidden Custom Section A
> >\stopInvisiSection
> >\page
> >\startInvisiSection[title={Hidden Custom Section B}]
> >  Text of Hidden Custom Section B
> >\stopInvisiSection
> >\page
> >TEST\bookmark[CustomBMarks]{Start of Teststack} \dorecurse{800}{TEST
> > }NEEDLE\bookmark[CustomBMarks]{Needle in the Teststack}
> > \dorecurse{400}{TEST }TEST.\bookmark[CustomBMarks]{End of Teststack}
> >%%%
> >%%% So far no problems.
> >%%% The following combination does the job, but I see no possibility
> >    %%% to arrange the "CustomBMarks"-list in multi-levels.
> >%%%
> >\page
> >\startstandardmakeup
> >  \filterpages[{test.pdf}][1]\bookmark[CustomBMarks]{Pagefigure}
> >\stopstandardmakeup
> >%%%
> >%%% So the following method would be the best choice to work with
> >%%% multi-level bookmarks. But as soon as I start working with
> >%%% (custom) heads together with pagefigures, CTX places a blank
> >%%% page before every figure...
> >%%% Note: you don't need a dummy file. The last (unnumbered) page is
> >%%% the wanted external PDF. The numbered page before is the unwanted
> > one.
> >%%%
> >\startInvisiSection[title={External Testpage A}]
> >  \startstandardmakeup
> >\filterpages[{test.pdf}][1]
> >  \stopstandardmakeup
> >\stopInvisiSection
> > \stopcomponent
> because even a hidden head is something (anchor on page), you can try this:
>
>  \startstandardmakeup
>\startInvisiSection[title={External Testpage A}]
>\filterpages[{test.pdf}][1]
>\stopInvisiSection
>  \stopstandardmakeup
>
> -
>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 /
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://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://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Unwanted blank page before page figures when using non-placed (hidden) heads

2022-07-25 Thread Hans Hagen via ntg-context

On 7/24/2022 11:35 PM, cryo shock via ntg-context wrote:

Hey there,

I am having trouble understanding some basic blank page behavior. I hope 
that somebody of you can point me in the right direction.


My primary goal is to create application documents consisting of various 
.tex components and with external PDF pages inserted as well. The second 
part of that goal is to use multiple-level bookmarking as well. 
Bookmarking should look like this:


- Letter
- Resume
- Testimonies
-- Testimony A
-- Testimony B
-- Testimony C

In the following MWE you can see my progress along with some notes to 
help understanding.


There are two questions, I'd wish could be answered:

1. Why does TeX insert a blank page before a pagefigure I enclose within 
a (hidden) head?


2. Can the \bookmark[list]{text} command be somehow used for multi-level 
bookmarking?


While the first question would make up for a more consistent solution, 
the second question would do the job as well.


I hope some of you can enlighten me.

Cheers, k


%%% START of MWE

\definehead[VisiSection][section]
\setuphead[VisiSection][number=no]

\definehead[InvisiSection][VisiSection]
\setuphead[InvisiSection][placehead=no]

\definelist[CustomBMarks]

\setupinteraction[state=start]
\placebookmarks[VisiSection,InvisiSection,CustomBMarks]

\startcomponent * % not a product, no
   \startVisiSection[title={Custom Section A}]
     Text of Custom Section A
   \stopVisiSection
   \page
   \startVisiSection[title={Custom Section B}]
     Text of Custom Section B
   \stopVisiSection
   \startInvisiSection[title={Hidden Custom Section A}]
     Text of Hidden Custom Section A
   \stopInvisiSection
   \page
   \startInvisiSection[title={Hidden Custom Section B}]
     Text of Hidden Custom Section B
   \stopInvisiSection
   \page
   TEST\bookmark[CustomBMarks]{Start of Teststack} \dorecurse{800}{TEST 
}NEEDLE\bookmark[CustomBMarks]{Needle in the Teststack} 
\dorecurse{400}{TEST }TEST.\bookmark[CustomBMarks]{End of Teststack}

   %%%
   %%% So far no problems.
   %%% The following combination does the job, but I see no possibility
   %%% to arrange the "CustomBMarks"-list in multi-levels.
   %%%
   \page
   \startstandardmakeup
     \filterpages[{test.pdf}][1]\bookmark[CustomBMarks]{Pagefigure}
   \stopstandardmakeup
   %%%
   %%% So the following method would be the best choice to work with
   %%% multi-level bookmarks. But as soon as I start working with
   %%% (custom) heads together with pagefigures, CTX places a blank
   %%% page before every figure...
   %%% Note: you don't need a dummy file. The last (unnumbered) page is
   %%% the wanted external PDF. The numbered page before is the unwanted 
one.

   %%%
   \startInvisiSection[title={External Testpage A}]
     \startstandardmakeup
       \filterpages[{test.pdf}][1]
     \stopstandardmakeup
   \stopInvisiSection
\stopcomponent

because even a hidden head is something (anchor on page), you can try this:

\startstandardmakeup
  \startInvisiSection[title={External Testpage A}]
  \filterpages[{test.pdf}][1]
  \stopInvisiSection
\stopstandardmakeup

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


[NTG-context] Unwanted blank page before page figures when using non-placed (hidden) heads

2022-07-24 Thread cryo shock via ntg-context
Hey there,

I am having trouble understanding some basic blank page behavior. I hope
that somebody of you can point me in the right direction.

My primary goal is to create application documents consisting of various
.tex components and with external PDF pages inserted as well. The second
part of that goal is to use multiple-level bookmarking as well. Bookmarking
should look like this:

- Letter
- Resume
- Testimonies
-- Testimony A
-- Testimony B
-- Testimony C

In the following MWE you can see my progress along with some notes to help
understanding.

There are two questions, I'd wish could be answered:

1. Why does TeX insert a blank page before a pagefigure I enclose within a
(hidden) head?

2. Can the \bookmark[list]{text} command be somehow used for multi-level
bookmarking?

While the first question would make up for a more consistent solution, the
second question would do the job as well.

I hope some of you can enlighten me.

Cheers, k


%%% START of MWE

\definehead[VisiSection][section]
\setuphead[VisiSection][number=no]

\definehead[InvisiSection][VisiSection]
\setuphead[InvisiSection][placehead=no]

\definelist[CustomBMarks]

\setupinteraction[state=start]
\placebookmarks[VisiSection,InvisiSection,CustomBMarks]

\startcomponent * % not a product, no
  \startVisiSection[title={Custom Section A}]
Text of Custom Section A
  \stopVisiSection
  \page
  \startVisiSection[title={Custom Section B}]
Text of Custom Section B
  \stopVisiSection
  \startInvisiSection[title={Hidden Custom Section A}]
Text of Hidden Custom Section A
  \stopInvisiSection
  \page
  \startInvisiSection[title={Hidden Custom Section B}]
Text of Hidden Custom Section B
  \stopInvisiSection
  \page
  TEST\bookmark[CustomBMarks]{Start of Teststack} \dorecurse{800}{TEST
}NEEDLE\bookmark[CustomBMarks]{Needle in the Teststack}
\dorecurse{400}{TEST }TEST.\bookmark[CustomBMarks]{End of Teststack}
  %%%
  %%% So far no problems.
  %%% The following combination does the job, but I see no possibility
  %%% to arrange the "CustomBMarks"-list in multi-levels.
  %%%
  \page
  \startstandardmakeup
\filterpages[{test.pdf}][1]\bookmark[CustomBMarks]{Pagefigure}
  \stopstandardmakeup
  %%%
  %%% So the following method would be the best choice to work with
  %%% multi-level bookmarks. But as soon as I start working with
  %%% (custom) heads together with pagefigures, CTX places a blank
  %%% page before every figure...
  %%% Note: you don't need a dummy file. The last (unnumbered) page is
  %%% the wanted external PDF. The numbered page before is the unwanted one.
  %%%
  \startInvisiSection[title={External Testpage A}]
\startstandardmakeup
  \filterpages[{test.pdf}][1]
\stopstandardmakeup
  \stopInvisiSection
\stopcomponent

%%% END of MWE
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

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


Re: [NTG-context] How to troubleshoot why my document begins with a blank page?

2022-01-17 Thread Wolfgang Schuster via ntg-context

Joel via ntg-context schrieb am 17.01.2022 um 17:11:
I created a book that strangely renders with an entirely blank page. 
There are tons and tons of macros, in dozens of files defined before the 
document starts, but the document itself starts quite simply with a 
title page set inside \startfrontmatter. How can I identify what types 
of preamble information would be causing an entire blank page to render 
before the document even begins?


This minimum working example won't show me the error, but it does show I 
simply have \starttext followed by my title and nothing is between that 
should be rendering an entire blank page.


It's possible you have something in your setups which produces text 
which isn't visible in the PDF because no font was loaded at this point, 
run my example below to see the effect.


To find the problem in your setup first create a new document where you 
use something simple like in my example as content but add you complete 
setups before \starttext. When this is done you can comment (or delete) 
parts of the setup until the empty page disappears.


 begin example
hidden text

\starttext

\startstandardmakeup
Text
\stopstandardmakeup

\stoptext
 end example

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


[NTG-context] How to troubleshoot why my document begins with a blank page?

2022-01-17 Thread Joel via ntg-context
I created a book that strangely renders with an entirely blank page. There are 
tons and tons of macros, in dozens of files defined before the document starts, 
but the document itself starts quite simply with a title page set inside 
\startfrontmatter. How can I identify what types of preamble information would 
be causing an entire blank page to render before the document even begins?

This minimum working example won't show me the error, but it does show I simply 
have \starttext followed by my title and nothing is between that should be 
rendering an entire blank page.
--Joel
My minimum working example is here:

\definemakeup[titlepage][align=middle]

\definealternativestyle[titlestyle][\ss\bfd][]
\definealternativestyle[subtitlestyle][\ss\bfb][]
\definealternativestyle[authorstyle][\ss\tfa][]

\starttext % <-- there is no code between \starttext and \startfrontmatter 
below.
    \startfrontmatter
        \startmakeup[titlepage]
            \titlestyle{My story}
            \blank[big]
            \subtitlestyle{\date}
            \blank[big]
            \authorstyle{My name}
        \stopmakeup
    \stopfrontmatter

    \input knuth

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


[NTG-context] Blank lines discarded when \typing

2021-12-03 Thread Thangalin via ntg-context
Note the presence of double-spaced blank lines in the following document
and in the attached source file:

\setuptyping[numbering=line]
\starttext

\startbuffer[javacode]
try {
  final var num = stack.pop();

  if( num != null ) {
stack.push( blah );
  }


  return true;
}
\stopbuffer

\type{\typebuffer}:
\typebuffer[javacode]

\type{\typing}:
\starttyping
try {
  final var num = stack.pop();

  if( num != null ) {
stack.push( blah );
  }


  return true;
}
\stoptyping

\type{\typefile}:
\typefile{t.java}

\stoptext

There appear to be two issues.

First, \typefile produces what I'd consider the "correct" result, where the
double-spaced lines appear on the page as a double-space. Both the
\typebuffer and \typing commands ignore double-spacing. The double-spacing
is also ignored by \xmldisplayverbatim. How would you configure to give
\typebuffer, \typing, and \xmldisplayverbatim to honour double-spaces the
same way as \typefile?

Second, of lesser importance, is that the blank lines aren't numbered. This
makes the line numbers inconsistent with respect to IDEs. How would you
label all blank lines as well?

Out of curiosity, does the second issue relate to the first?

Thank you!
try {
  final var num = stack.pop();
  
  if( num != null ) {
stack.push( blah );
  }
  
  
  return true;
}
___
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
___


[NTG-context] Blank line after \item: MkIV vs LMTX and how to properly get rid of it

2021-09-30 Thread Vladimir Lomov via ntg-context
Hello.

Consider the following small example:

 8< --
\starttext

\startitemize[n]
\item \input tufte
\item \placefigure[right,none]{}{\externalfigure[cow]}%
  \input tufte
\item \blank[overlay]%
  \placefigure[right,none]{}{\externalfigure[cow]}%
  \input tufte
\stopitemize

\startitemize[n,intext]
\item \input tufte
\item \placefigure[right,none]{}{\externalfigure[cow]}%
  \input tufte
\item \blank[overlay]%
  \placefigure[right,none]{}{\externalfigure[cow]}%
  \input tufte
\stopitemize

\stoptext
 8< --

I see a difference in MkIV and LMTX work:
- MkIV always put a blank line despite '\blank[overlay]' command;
- with \blank[overlay] and 'intext' option LMTX clutters item label (number in
  this case).

Q1: is this the expected behavior for MkIV and LMTX? I found a recipe with
  \blank[overlay] in the mailing list.
Q2: is it expected that LMTX will clutter item label when I use
  \blank[overlay]? I suspect the answer is "yes" due to the option name.
Q3: how to prevent blank line insertion in such case: an item with text
  framing a picture (on right side or on left side but the picture is below
  the item label)?

---
WBR, Vladimir Lomov

-- 
Without freedom of choice there is no creativity.
-- Kirk, "The return of the Archons", stardate 3157.4


signature.asc
Description: PGP signature
___
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
___


Re: [NTG-context] Progressively encouraging page/column breaks at \blank with penalties

2021-08-15 Thread Joey McCollum via ntg-context
That works for my purposes; thank you for letting me know about it!

Joey

On Sun, Aug 15, 2021 at 1:53 AM Aditya Mahajan via ntg-context <
ntg-context@ntg.nl> wrote:

> On Sun, 15 Aug 2021, Joey McCollum via ntg-context wrote:
>
> > Hi,
> >
> > I'm trying to implement a section break marker in a grid layout. At a
> > section break, two lines of space should separate the subsequent segments
> > of text (just plain paragraphs, in this case), and a symbol (in the
> example
> > below, "X") should be set in the middle of these two lines. For my
> > purposes, the section break symbol should never occur at the top of a
> page
> > or column, and it is more desirable to have a page or column end with the
> > section break symbol than to have a single orphaned line follow the
> symbol
> > at the end of the page or column. Based on these constraints, I thought
> > that using the "samepage" and "preference" options for the first and
> second
> > line breaks would work nicely:
> >
> > ```
> > \define\SectionBreak{%
> > \blank[halfline, samepage]% non-breaking to ensure that no column
> > begins with the section break symbol
> > \startalignment[middle]%
> > {X}% section break symbol
> > \stopalignment%
> > \blank[halfline, preference]% this can (and, if possible, should) be
> > broken across a column
> > ```
> >
> > This does successfully prevent the placement of the symbol at the top of
> a
> > page/column, but it doesn't encourage the placement of the symbol at the
> > end of a page/column as often as I would like.
>
> Depending on what you want, you can try adding \testpage[n] (where n is a
> number). This checks if the remainder of the page has enough space for n
> lines; if not, then it issues a page-break.
>
> Aditya
>
> ___
> 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
>
> ___
>
___
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
___


Re: [NTG-context] Progressively encouraging page/column breaks at \blank with penalties

2021-08-14 Thread Aditya Mahajan via ntg-context
On Sun, 15 Aug 2021, Joey McCollum via ntg-context wrote:

> Hi,
> 
> I'm trying to implement a section break marker in a grid layout. At a
> section break, two lines of space should separate the subsequent segments
> of text (just plain paragraphs, in this case), and a symbol (in the example
> below, "X") should be set in the middle of these two lines. For my
> purposes, the section break symbol should never occur at the top of a page
> or column, and it is more desirable to have a page or column end with the
> section break symbol than to have a single orphaned line follow the symbol
> at the end of the page or column. Based on these constraints, I thought
> that using the "samepage" and "preference" options for the first and second
> line breaks would work nicely:
> 
> ```
> \define\SectionBreak{%
> \blank[halfline, samepage]% non-breaking to ensure that no column
> begins with the section break symbol
> \startalignment[middle]%
> {X}% section break symbol
> \stopalignment%
> \blank[halfline, preference]% this can (and, if possible, should) be
> broken across a column
> ```
> 
> This does successfully prevent the placement of the symbol at the top of a
> page/column, but it doesn't encourage the placement of the symbol at the
> end of a page/column as often as I would like. 

Depending on what you want, you can try adding \testpage[n] (where n is a 
number). This checks if the remainder of the page has enough space for n lines; 
if not, then it issues a page-break.

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


[NTG-context] Progressively encouraging page/column breaks at \blank with penalties

2021-08-14 Thread Joey McCollum via ntg-context
Hi,

I'm trying to implement a section break marker in a grid layout. At a
section break, two lines of space should separate the subsequent segments
of text (just plain paragraphs, in this case), and a symbol (in the example
below, "X") should be set in the middle of these two lines. For my
purposes, the section break symbol should never occur at the top of a page
or column, and it is more desirable to have a page or column end with the
section break symbol than to have a single orphaned line follow the symbol
at the end of the page or column. Based on these constraints, I thought
that using the "samepage" and "preference" options for the first and second
line breaks would work nicely:

```
\define\SectionBreak{%
\blank[halfline, samepage]% non-breaking to ensure that no column
begins with the section break symbol
\startalignment[middle]%
{X}% section break symbol
\stopalignment%
\blank[halfline, preference]% this can (and, if possible, should) be
broken across a column
```

This does successfully prevent the placement of the symbol at the top of a
page/column, but it doesn't encourage the placement of the symbol at the
end of a page/column as often as I would like. I tried replacing the
"preference" option with options with better negative penalties, like
"penalty:-1000", "penalty:-2000", and even "penalty:-5000", but these
didn't make any difference. The option "penalty:-1" trivially works,
but it forces a page/column break at every section break marker, which is
far too extreme.

Is this normal behavior? I would have thought that progressively more
negative penalties would gradually encourage page/column breaks, but this
doesn't seem to happen. In the following MWE, the "preference" and
"penalty" options (apart from "penalty:-1") for the second line break
don't change the total page count or appearance of the final page at all
(which would be expected in a document of this size):

```

\setuplayout[

grid=yes %enable baseline grid

]


\setupinterlinespace[18bp] % text line spacing


%Define macro for section break:

\define\SectionBreak{%

\blank[halfline, samepage]%non-breaking to ensure that no column begins
with the section break symbol

\startalignment[middle]%

{X}% section break symbol

\stopalignment%

\blank[halfline]% a column break here is neither encouraged nor discouraged

% \blank[halfline, preference]% this should encourage a column break here,
but it doesn't seem to make a difference

% \blank[halfline, penalty:-1000]% still no difference

% \blank[halfline, penalty:-2000]% still no difference

% \blank[halfline, penalty:-5000]% still no difference

% \blank[halfline, penalty:-1]% this works, but it is too extreme!

}


%Set things up for fakewords:

\usemodule[visual]

\setupsystem[random=10]


\starttext

\dorecurse{400}{\fakewords{20}{100}\SectionBreak}

\stoptext
```

As always, any help is appreciated!

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


Re: [NTG-context] Suppressing headers and footers on blank pages before pagebreak at the end of a chapter.

2021-04-07 Thread Wolfgang Schuster

rh...@t-online.de schrieb am 07.04.2021 um 20:20:

Hi list,

I typeset my first project with ConTeXt, a small booklet with some chapters, 
frontmatter, no headers, but pagenumbers in the middle of the footers. I use 
two environment files. The text is split into component TeX-files. All is 
structured by a project and a product file.
Now I have run in some problems, I couldn’t solve with the garden and the 
archives of this and stackexchange’s list. But I’m sure that it is almost too 
simple for you experts. Let’s start with one.

As intended, a new chapter starts on a right/odd page. If the chapter before 
ends on a right page, too, there should be a blank left/even page. But in my 
case there is the pagenumber in the footer – which looks more horrible than an 
orphan line.

A. Which setting in which setup or definition gives a command like: 
suppress/skip/hide the header, footer and margin of last page of a chapter, if 
the text area is empty.

B. More elaborate, a set of commands could
– distinguish between headers, footers, an margins and
– extend the commands on those pages at the end of the chapters
   – that do not show any text within the last line of the text area, i. e. 
the very last page of a chapter (even, but whith some text)
   – or the second last page (odd, with some text, before a complete blank 
even page).

A book design according to (A) is standard. I’m sure there is a solution in 
ConTeXt.

(B) can be found often, at least in books from pre-computer times.



You have to change the argument of the page-setting for chapters.

\setuppagenumbering
  [alternative=doublesided]

\setuphead
  [chapter]
  [page={yes,header,footer,right}]

\starttext

\startchapter[title=Knuth]
\dorecurse{10}{\samplefile{knuth}}
\stopchapter

\startchapter[title=Zapf]
\dorecurse{10}{\samplefile{zapf}}
\stopchapter

\stoptext

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


[NTG-context] Suppressing headers and footers on blank pages before pagebreak at the end of a chapter.

2021-04-07 Thread rha17
Hi list,

I typeset my first project with ConTeXt, a small booklet with some chapters, 
frontmatter, no headers, but pagenumbers in the middle of the footers. I use 
two environment files. The text is split into component TeX-files. All is 
structured by a project and a product file.
Now I have run in some problems, I couldn’t solve with the garden and the 
archives of this and stackexchange’s list. But I’m sure that it is almost too 
simple for you experts. Let’s start with one.

As intended, a new chapter starts on a right/odd page. If the chapter before 
ends on a right page, too, there should be a blank left/even page. But in my 
case there is the pagenumber in the footer – which looks more horrible than an 
orphan line.

A. Which setting in which setup or definition gives a command like: 
suppress/skip/hide the header, footer and margin of last page of a chapter, if 
the text area is empty.

B. More elaborate, a set of commands could 
   – distinguish between headers, footers, an margins and 
   – extend the commands on those pages at the end of the chapters
  – that do not show any text within the last line of the text area, i. e. 
the very last page of a chapter (even, but whith some text) 
  – or the second last page (odd, with some text, before a complete blank 
even page).

A book design according to (A) is standard. I’m sure there is a solution in 
ConTeXt.

(B) can be found often, at least in books from pre-computer times.

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


Re: [NTG-context] add more blank space when using \starteffect[hidden]

2021-03-17 Thread Jeong Dal
Dear Hans,

It is very interesting example.
Thank you for a new method.

Best regards,

Dalyoung

> 
> \def\determinednoflines#1%
>  {\localcontrolled{\determinenoflines{#1}}\noflines}
> 
> \startbuffer
>\input tufte
> \stopbuffer
> 
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=fit]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=broad]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=3cm]{first}
> \fillinrules[n=\determinednoflines{\getbuffer},
>  width=3cm,distance=.5em,separator=:]{first}
> \fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}
> 
> i'll make a better hider later
> 
> -
>  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
___


Re: [NTG-context] add more blank space when using \starteffect[hidden]

2021-03-17 Thread Hans Hagen

On 3/16/2021 8:08 PM, Jeong Dal wrote:

Dear Hans,

I found a command \determinenoflines by googling.
I made a MWE as following. It is working well.

But I have to write the paragraph twice for couning.
Is there a better way?

Thank you again.
Best regards,

Dalyoung

%%%
\def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}
\def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[\the\noflines*line 
+ \the\noflines*halfline]}}


\enablemode[hideSolution]

\starttext

The first line.

\hrule
\StartHide
\samplefile{knuth}
\determinenoflines{\samplefile{knuth}}
\StopHide
\hrule

The second line.

\hrule

\StartHide
\samplefile{ward}
\determinenoflines{\samplefile{ward}}
\StopHide

\hrule

The last line.
\stoptext

Let me show you some magic ...

\def\determinednoflines#1%
  {\localcontrolled{\determinenoflines{#1}}\noflines}

\startbuffer
\input tufte
\stopbuffer

\fillinrules[n=\determinednoflines{\getbuffer},
  width=fit]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
  width=broad]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
  width=3cm]{first}
\fillinrules[n=\determinednoflines{\getbuffer},
  width=3cm,distance=.5em,separator=:]{first}
\fillinrules[n=\determinednoflines{\getbuffer}]{first}{last}

i'll make a better hider later

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


Re: [NTG-context] add more blank space when using \starteffect[hidden]

2021-03-16 Thread Jeong Dal
Dear Hans,

I found a command \determinenoflines by googling.
I made a MWE as following. It is working well.

But I have to write the paragraph twice for couning.
Is there a better way?

Thank you again.
Best regards,

Dalyoung

%%%
\def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}   
\def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[\the\noflines*line + 
\the\noflines*halfline]}}   

\enablemode[hideSolution]

\starttext

The first line.

\hrule
\StartHide
\samplefile{knuth}
\determinenoflines{\samplefile{knuth}}
\StopHide
\hrule

The second line.

\hrule

\StartHide
\samplefile{ward}
\determinenoflines{\samplefile{ward}}
\StopHide

\hrule

The last line.
\stoptext

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


Re: [NTG-context] add more blank space when using \starteffect[hidden]

2021-03-14 Thread Jeong Dal
Dear Hans,

Thank you for your answer.

> 
> \framedtext[empty=yes]
> 

Yes, it clears everything in the frame.
But the frame is also clean when I disable \hideSolution. In that case, texts 
should be appeared.
What I want is the following:

If \hideSolution then
hide text and add more blank spaces
else
show full text and no more space.
endif

The full text  for the students another for the lecture.

Is there a way not using \framedtext?

Thank you again.
Best regards,

Dalyoung

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


Re: [NTG-context] add more blank space when using \starteffect[hidden]

2021-03-13 Thread Hans Hagen

On 3/12/2021 10:08 PM, Jeong Dal wrote:

Hi,

Sometimes, I need to hide the solution of a problem.
So I use \doifmode{} and \starteffect[hidden] as in the following sample 
file.
Since I want to set more blank space if it is hidden, I add \blank[5cm] 
when it is in the \enablemode[hideSolution].
It works well except the figures and bars are not hidden. Only texts, 
even  in the mp part, are hidden.

It is OK for me.

However, it would be much better to set the height of blank space 
depends on the height of hidden texts.
Is there a way to set the variable height  using “overlay” stuff instead 
of \blank[5cm]?


Thank for reading.

Best regards,

Dalyoung


\startbuffer[circles]
draw fullcircle scaled 1cm;
draw fullcircle scaled 1cm shifted (2cm,0);
dotlabel.top(“O”,origin);
\stopbuffer

\def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}
\def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[5cm]}}

%\enablemode[hideSolution]

\starttext
\framed[]{This is what I want:}
\framedtext[]{
\StartHide
\samplefile{knuth}
Overbar is not \overbar{hidden}.
{\processMPbuffer[circles]}
\StopHide
}
\stoptext

In your case it's easier than you mightt think:

\framedtext[empty=yes]


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


[NTG-context] add more blank space when using \starteffect[hidden]

2021-03-12 Thread Jeong Dal
Hi,

Sometimes, I need to hide the solution of a problem.
So I use \doifmode{} and \starteffect[hidden] as in the following sample file.
Since I want to set more blank space if it is hidden, I add \blank[5cm] when it 
is in the \enablemode[hideSolution].
It works well except the figures and bars are not hidden. Only texts, even  in 
the mp part, are hidden.
It is OK for me.

However, it would be much better to set the height of blank space depends on 
the height of hidden texts.
Is there a way to set the variable height  using “overlay” stuff instead of 
\blank[5cm]?

Thank for reading.

Best regards,

Dalyoung


\startbuffer[circles]
draw fullcircle scaled 1cm;
draw fullcircle scaled 1cm shifted (2cm,0);
dotlabel.top(“O”,origin);
\stopbuffer

\def\StartHide{\doifmode{hideSolution}{\starteffect[hidden]}}   
\def\StopHide{\doifmode{hideSolution}{\stopeffect\blank[5cm]}}   

%\enablemode[hideSolution]

\starttext
\framed[]{This is what I want:}
\framedtext[]{
  \StartHide
  \samplefile{knuth}
 
 Overbar is not \overbar{hidden}.
  {\processMPbuffer[circles]}
  
  \StopHide
}
\stoptext

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


[NTG-context] blank pages bug [pagecolumns]

2021-01-01 Thread Johann Birnick
Hi there,

I noticed a bug when using pagecolumns. If there is a title on the right column,
a blank page gets added at the end of the document. For example

\starttext
\startpagecolumns[n=2]
   
\title{lorem}
\title{ipsum}

\stoppagecolumns
\stoptext

gives an additional blank page. If you remove the second title (ipsum) then not.

Best regards,
Johann

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


Re: [NTG-context] \blank[] doesn't work when nothing precedes it

2020-11-05 Thread Sylvain Hubert
On Thu, 5 Nov 2020 at 14:21, mf  wrote:

> \blank[.25\paperheight,force]
>
> A blank at the top of a page is ignored, because usually you use a blank
> as a separator, that is useless at the top of a page, because the page
> break is enough to separate two texts.
>
> Sometimes you need a blank on top anyway, i.e. at the start of a chapter.
> In that case use "force".
>

Thanks Massi, this is exactly what I was looking for.

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


Re: [NTG-context] \blank[] doesn't work when nothing precedes it

2020-11-05 Thread Sylvain Hubert
Hi Thomas,

Thanks for sharing the trick, it did help me!

Sylvain

On Thu, 5 Nov 2020 at 13:55, Tomas Hala  wrote:

> Hi Sylvain,
>
> on my computer (TL2020) I am not able to compile \blank with any command
> defining the dimension (2\paperheight, 0.25\paperheight, .25\paperheight).
> I do not know why...
>
> But if I use another dimension, eg. 5*big or 20cc, it works with
> \dontleavehmode:
>
> \starttext
> \dontleavehmode
> \blank[5*big]
> %\blank[20cc]
> foo
> \stoptext
>
> Maybe it will help you.
>
> The best,
>
> Tomáš
>
>
> Thu, Nov 05, 2020 ve 01:26:02PM +0100 Sylvain Hubert napsal(a):
> #Dear List,
> #I'm trying to put the document title at around .25\paperheight by
> #inserting a \blank:
> #    \setuplayout[topspace=0cm, header=0cm, height=\paperheight]
> #\starttext \blank[.25\paperheight] foo \stoptext
> #But the "foo" still appears at the very top.
> #Does anyone know why it behaves like that, or whether there is a more
> #authentic way to put the first word at .25\paperwidth than inserting a
> #tiny invisible space before the \blank?
> #Thanks!
> #Best,
> #Sylvain
>
> #
> ___
> # 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
> #
> ___
>
>
> ___
> 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
>
> ___
>
___
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
___


Re: [NTG-context] \blank[] doesn't work when nothing precedes it

2020-11-05 Thread mf

Il 05/11/20 13:26, Sylvain Hubert ha scritto:

Dear List,

I'm trying to put the document title at around .25\paperheight by 
inserting a \blank:


     \setuplayout[topspace=0cm, header=0cm, height=\paperheight]
     \starttext \blank[.25\paperheight] foo \stoptext



\blank[.25\paperheight,force]

A blank at the top of a page is ignored, because usually you use a blank 
as a separator, that is useless at the top of a page, because the page 
break is enough to separate two texts.


Sometimes you need a blank on top anyway, i.e. at the start of a chapter.
In that case use "force".

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


Re: [NTG-context] \blank[] doesn't work when nothing precedes it

2020-11-05 Thread Tomas Hala
Hi Sylvain,

on my computer (TL2020) I am not able to compile \blank with any command
defining the dimension (2\paperheight, 0.25\paperheight, .25\paperheight).
I do not know why...

But if I use another dimension, eg. 5*big or 20cc, it works with 
\dontleavehmode:

\starttext 
\dontleavehmode
\blank[5*big] 
%\blank[20cc]
foo 
\stoptext

Maybe it will help you.

The best,

Tomáš


Thu, Nov 05, 2020 ve 01:26:02PM +0100 Sylvain Hubert napsal(a):
#Dear List,
#I'm trying to put the document title at around .25\paperheight by
#inserting a \blank:
#    \setuplayout[topspace=0cm, header=0cm, height=\paperheight]
#    \starttext \blank[.25\paperheight] foo \stoptext
#But the "foo" still appears at the very top.
#Does anyone know why it behaves like that, or whether there is a more
#authentic way to put the first word at .25\paperwidth than inserting a
#tiny invisible space before the \blank?
#Thanks!
#Best,
#Sylvain

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

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


[NTG-context] \blank[] doesn't work when nothing precedes it

2020-11-05 Thread Sylvain Hubert
Dear List,

I'm trying to put the document title at around .25\paperheight by inserting
a \blank:

\setuplayout[topspace=0cm, header=0cm, height=\paperheight]
\starttext \blank[.25\paperheight] foo \stoptext

But the "foo" still appears at the very top.

Does anyone know why it behaves like that, or whether there is a more
authentic way to put the first word at .25\paperwidth than inserting a tiny
invisible space before the \blank?

Thanks!

Best,
Sylvain
___
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
___


Re: [NTG-context] Asymmetrical Column layout leads to an extra blank page (Solved!)

2020-10-30 Thread Ramkumar KB
Hello,

I managed to resolve the issue - which turns out bcos I had 2 back2back
columnset definitions. So instead, I combined them into 1 and the result
was ok.

*Before (leads to blank page or page with symmetrical columns):*

\definecolumnset[2col][n=2, distance=3.5mm, page=no]
\setupcolumnset[2col:1][width=.65\makeupwidth]
\setupcolumnset[2col:2][width=.35\makeupwidth]

\definecolumnset[3col][n=3, page=yes]
\setupcolumnset[3col:1][width=.25\makeupwidth]
\setupcolumnset[3col:2][width=.30\makeupwidth]
\setupcolumnset[3col:3][width=.45\makeupwidth]

\startcolumnset[2col]
...
\stopcolummnset

\startcolumnset[3col]
...
\stopcolummnset

*After (gets the desired result):*

\definecolumnset[summary][nleft=2, nright=3, distance=3.5mm, page=no]
\setupcolumnset[summary:1][width=.65\makeupwidth]
\setupcolumnset[summary:2][width=.35\makeupwidth]
\setupcolumnset[summary:3][width=.25\makeupwidth]
\setupcolumnset[summary:4][width=.30\makeupwidth]
\setupcolumnset[summary:5][width=.45\makeupwidth]

\startcolumnset[summary]
...
\stopcolummnset

Best,

On Thu, Oct 29, 2020 at 7:47 PM Ramkumar KB  wrote:

> Hello All,
>
> I am new to this community and am really excited about the possibilities
> with ConTeXt.
>
> My question is related to the thread -
> https://www.mail-archive.com/ntg-context@ntg.nl/msg92767.html (the
> suggested solution did not work, unfortunately)
>
> After trying out various options, I am faced with these 2 (sub-optimal)
> choices -
>
>1. Extra Blank page with Asymmetric Columns in the next page (with the
>    \subject{} uncommented)
>2. No Blank page with Symmetric Columns (with the \subject{} commented)
>3. page=yes / no - does not work (same outcome as above)
>
> I am not sure the role of \section or \subject in this matter (seems to be
> somehow interfering with asymmetrical columnset).
>
> \usemodule[newcolumnsets]
> ...
>
> % \subject{} \definecolumnset[soi1][n=3, distance=3mm, page=yes]
> % \definecolumnset[currency][n=3, page=yes]
> \setupcolumnset[soi1:1][width=.25\makeupwidth]
> \setupcolumnset[soi1:2][width=.30\makeupwidth]
> \setupcolumnset[soi1:3][width=.45\makeupwidth]
>
> Any tips, help or pointers would be greatly appreciated. If not for
> columnset, is there any other way to get this type of layout?
>
> Thank you,
>
___
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
___


[NTG-context] Asymmetrical Column layout leads to an extra blank page

2020-10-29 Thread Ramkumar KB
Hello All,

I am new to this community and am really excited about the possibilities
with ConTeXt.

My question is related to the thread -
https://www.mail-archive.com/ntg-context@ntg.nl/msg92767.html (the
suggested solution did not work, unfortunately)

After trying out various options, I am faced with these 2 (sub-optimal)
choices -

   1. Extra Blank page with Asymmetric Columns in the next page (with the
   \subject{} uncommented)
   2. No Blank page with Symmetric Columns (with the \subject{} commented)
   3. page=yes / no - does not work (same outcome as above)

I am not sure the role of \section or \subject in this matter (seems to be
somehow interfering with asymmetrical columnset).

\usemodule[newcolumnsets]
...

% \subject{} \definecolumnset[soi1][n=3, distance=3mm, page=yes]
% \definecolumnset[currency][n=3, page=yes]
\setupcolumnset[soi1:1][width=.25\makeupwidth]
\setupcolumnset[soi1:2][width=.30\makeupwidth]
\setupcolumnset[soi1:3][width=.45\makeupwidth]

Any tips, help or pointers would be greatly appreciated. If not for
columnset, is there any other way to get this type of layout?

Thank you,
___
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
___


Re: [NTG-context] \blank space at the top of a page

2020-06-18 Thread James Withers
Many thanks Wolfgang

I tried using force but that caused a problem with aligning to the
grid, not included in my original example, but included below.

I think I have seen \mbox used in this way in Latex, so was trying to
find a quick solution.

James


\setuplayout[grid=yes]
\showgrid

\setuphead[chapter][before={\blank[4*big]}]

\starttext

\startchapter[title={No space above this chapter}]

chapter text etc

\stopchapter

\setuphead[chapter][before={\blank[4*big,force]}]

\startchapter[title={Chapter with spacing but out of line with grid}]

chapter text etc

\stopchapter

\setuphead[chapter][before={\blank[4*line,force]}]

\startchapter[title={Chapter with spacing but out of line with grid}]

chapter text etc

\stopchapter

\stoptext

On Thu, 18 Jun 2020 at 16:44, Wolfgang Schuster
 wrote:
>
> James Withers schrieb am 18.06.2020 um 17:35:
> > Hello list
> >
> > I have been trying to find a solution to how to insert blank lines
> > before a chapter heading at the start of a page. In the following
> > example the \blank[4*big] is ignored. The solution I've found is to
> > add an empty box using \mbox{} before the \blank command.
>
> I'm curious where the use of \mbox is documented.
>
> > Is this the right way to do it or is there a more elegant way that I
> > am missing?
> >
> > Many thanks
> >
> > James
> >
> >
> > \setuphead[chapter][before={\blank[4*big]}]
>
> You have to add the "force" keyword to \blank because TeX ignores by
> default vertical space at the begin of a page.
>
> \setuphead[chapter][before={\blank[force,4*big]}]
>
> Wolfgang
>
___
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
___


Re: [NTG-context] \blank space at the top of a page

2020-06-18 Thread Wolfgang Schuster

James Withers schrieb am 18.06.2020 um 17:35:

Hello list

I have been trying to find a solution to how to insert blank lines
before a chapter heading at the start of a page. In the following
example the \blank[4*big] is ignored. The solution I've found is to
add an empty box using \mbox{} before the \blank command.


I'm curious where the use of \mbox is documented.


Is this the right way to do it or is there a more elegant way that I
am missing?

Many thanks

James


\setuphead[chapter][before={\blank[4*big]}]


You have to add the "force" keyword to \blank because TeX ignores by 
default vertical space at the begin of a page.


\setuphead[chapter][before={\blank[force,4*big]}]

Wolfgang

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


[NTG-context] \blank space at the top of a page

2020-06-18 Thread James Withers
Hello list

I have been trying to find a solution to how to insert blank lines
before a chapter heading at the start of a page. In the following
example the \blank[4*big] is ignored. The solution I've found is to
add an empty box using \mbox{} before the \blank command.

Is this the right way to do it or is there a more elegant way that I
am missing?

Many thanks

James


\setuphead[chapter][before={\blank[4*big]}]

\starttext

\startchapter[title={No space above this chapter}]

chapter text etc

\stopchapter

\setuphead[chapter][before={\mbox{}\blank[4*big]}]

\startchapter[title={Chapter with the right spacing}]

chapter text etc

\stopchapter

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


Re: [NTG-context] Blank page added after pagecolumns

2020-05-16 Thread Joey McCollum
I thought that the "yes" and "nop" suffixes were related to "page=yes" and
"page=no" for a few reasons. First, because I thought "nop" could be
shorthand for "no page." More importantly, however, I thought they might be
related because setting page=no in \definepagecolumns does not appear to
have any effect, and patching \page_col_stop_yes to do what
\page_col_stop_nop does had the desired effect. But as you have shown,
doing this causes problems with the transition back to a single-column
layout, so I suppose that the \page_col_stop_yes and \page_col_stop_nop
macros are meant to implement behavior dependent on the number of columns.
Your suggestion to add a column if the column at the end of the environment
is not the last one is elegant and works on different variations of the
MWE, including cases with more than two columns.

Joey

On Sat, May 16, 2020 at 4:12 AM Wolfgang Schuster <
wolfgang.schuster.li...@gmail.com> wrote:

> Joey McCollum schrieb am 16.05.2020 um 05:45:
> > All right, I've found a tentative solution that appears to work in all
> > cases, but I'd like to know more about why the code I'm patching was
> > implemented in the first place, because I don't want to break anything
> > else. According to the code in page-pcl.mkiv, the \stoppagecolumns macro
> > has two implementations, \page_col_stop_yes and \page_col_stop_nop. The
> > choice of which implementation is used is determined by which of two
> > implementations of \startpagecolumns (\page_col_start_yes
> > and \page_col_start_nop) is used. That choice, in turn, is made in
> > the \page_col_start macro, in the following lines:
> >
> > ```
> > \c_page_col_n_of_columns\pagecolumnsparameter\c!n\relax
> > \ifnum\c_page_col_n_of_columns>\plusone
> >   \expandafter\page_col_start_yes
> > \else
> >   \expandafter\page_col_start_nop
> > \fi
> > ```
> >
> > so if the number of columns (i.e., the n option for the
> > pagecolumns environment) is more than one, the "yes" implementation of
> > the start and stop commands is used.
> >
> > But this seems wrong. The naming convention for the two implementations
> > ("yes" and "nop") suggests that they should be related the parameters
> > "page=yes" and "page=no" (hence, no page, which is what I think "nop"
> > abbreviates), but the choice of which implementation to use is
> > determined not by the page parameter, but by the n parameter. Is this an
> > error in the code, or am I just understanding this incorrectly? Is there
> > some reason why a layout with more than one column would need special
> > instructions to add a blank page after stopping the environment?
>
> Why do you think "yes" and "nop" are related to the page-key?
>
> > In any event, I was able to solve the problem by patching the
> > \page_col_start_yes macro to invoke the \page_col_start_nop macro as
> > follows:
> >
> > ```
> >
> > \unprotect
> >
> > \def\page_col_stop_yes
> > {\page_col_stop_nop}
> >
> > \protect
> >
> > ```
> >
> > With this fix, the MWE I provided works regardless of which column the
> > text ends in. I'm content to consider the problem solved, but I would
> > certainly appreciate any feedback on my thoughts and questions about
> > page-pcl.mkiv.
>
> You broke now now normal single columns text after the pagecolumns
> environment. A better fix is to add a check for the \column command at
> the end of the environment and add it only when we aren't in the last
> column.
>
> \unexpanded\def\page_col_stop_yes
>{%\column % \page_otr_eject_page
> \ifnum\c_page_col_current<\c_page_col_n_of_columns
>   \column
> \fi
> \page
> \endgroup
>   % \setupoutputroutine[\s!singlecolumn]%
> \page_otr_command_set_vsize
> \page_otr_command_set_hsize
> \page
> \endgroup}
>
> Wolfgang
>
___
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
___


Re: [NTG-context] Blank page added after pagecolumns

2020-05-16 Thread Wolfgang Schuster

Joey McCollum schrieb am 16.05.2020 um 05:45:
All right, I've found a tentative solution that appears to work in all 
cases, but I'd like to know more about why the code I'm patching was 
implemented in the first place, because I don't want to break anything 
else. According to the code in page-pcl.mkiv, the \stoppagecolumns macro 
has two implementations, \page_col_stop_yes and \page_col_stop_nop. The 
choice of which implementation is used is determined by which of two 
implementations of \startpagecolumns (\page_col_start_yes 
and \page_col_start_nop) is used. That choice, in turn, is made in 
the \page_col_start macro, in the following lines:


```
\c_page_col_n_of_columns\pagecolumnsparameter\c!n\relax
    \ifnum\c_page_col_n_of_columns>\plusone
      \expandafter\page_col_start_yes
    \else
      \expandafter\page_col_start_nop
    \fi
```

so if the number of columns (i.e., the n option for the 
pagecolumns environment) is more than one, the "yes" implementation of 
the start and stop commands is used.


But this seems wrong. The naming convention for the two implementations 
("yes" and "nop") suggests that they should be related the parameters 
"page=yes" and "page=no" (hence, no page, which is what I think "nop" 
abbreviates), but the choice of which implementation to use is 
determined not by the page parameter, but by the n parameter. Is this an 
error in the code, or am I just understanding this incorrectly? Is there 
some reason why a layout with more than one column would need special 
instructions to add a blank page after stopping the environment?


Why do you think "yes" and "nop" are related to the page-key?

In any event, I was able to solve the problem by patching the 
\page_col_start_yes macro to invoke the \page_col_start_nop macro as 
follows:


```

\unprotect

\def\page_col_stop_yes
{\page_col_stop_nop}

\protect

```

With this fix, the MWE I provided works regardless of which column the 
text ends in. I'm content to consider the problem solved, but I would 
certainly appreciate any feedback on my thoughts and questions about 
page-pcl.mkiv.


You broke now now normal single columns text after the pagecolumns 
environment. A better fix is to add a check for the \column command at 
the end of the environment and add it only when we aren't in the last 
column.


\unexpanded\def\page_col_stop_yes
  {%\column % \page_otr_eject_page
   \ifnum\c_page_col_current<\c_page_col_n_of_columns
 \column
   \fi
   \page
   \endgroup
 % \setupoutputroutine[\s!singlecolumn]%
   \page_otr_command_set_vsize
   \page_otr_command_set_hsize
   \page
   \endgroup}

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


Re: [NTG-context] Blank page added after pagecolumns

2020-05-15 Thread Joey McCollum
All right, I've found a tentative solution that appears to work in all
cases, but I'd like to know more about why the code I'm patching was
implemented in the first place, because I don't want to break anything
else. According to the code in page-pcl.mkiv, the \stoppagecolumns macro
has two implementations, \page_col_stop_yes and \page_col_stop_nop. The
choice of which implementation is used is determined by which of two
implementations of \startpagecolumns (\page_col_start_yes
and \page_col_start_nop) is used. That choice, in turn, is made in
the \page_col_start macro, in the following lines:

```
\c_page_col_n_of_columns\pagecolumnsparameter\c!n\relax
   \ifnum\c_page_col_n_of_columns>\plusone
 \expandafter\page_col_start_yes
   \else
 \expandafter\page_col_start_nop
   \fi
```

so if the number of columns (i.e., the n option for the
pagecolumns environment) is more than one, the "yes" implementation of the
start and stop commands is used.

But this seems wrong. The naming convention for the two implementations
("yes" and "nop") suggests that they should be related the parameters
"page=yes" and "page=no" (hence, no page, which is what I think "nop"
abbreviates), but the choice of which implementation to use is determined
not by the page parameter, but by the n parameter. Is this an error in the
code, or am I just understanding this incorrectly? Is there some reason why
a layout with more than one column would need special instructions to add a
blank page after stopping the environment?

In any event, I was able to solve the problem by patching the
\page_col_start_yes macro to invoke the \page_col_start_nop macro as
follows:

```

\unprotect

\def\page_col_stop_yes

{\page_col_stop_nop}

\protect
```

With this fix, the MWE I provided works regardless of which column the text
ends in. I'm content to consider the problem solved, but I would certainly
appreciate any feedback on my thoughts and questions about page-pcl.mkiv.

Joey

On Thu, May 14, 2020 at 5:03 PM Joey McCollum 
wrote:

> Okay, I think I'm getting close, but I'm not quite there yet. The
> pagecolumns source code is found in page-pcl.mkiv (
> source.contextgarden.net/tex/context/base/mkiv/page-pcl.mkiv), and in
> that code, the \page_col_stop_yes macro seems to have something to do with
> the issue:
>
> ```
> \unexpanded\def\page_col_stop_yes
>   {\column % \page_otr_eject_page
>\page
>\endgroup
>  % \setupoutputroutine[\s!singlecolumn]%
>\page_otr_command_set_vsize
>\page_otr_command_set_hsize
>\page
>\endgroup}
> ```
>
> If I redefine this macro in my MWE as follows, I can remove the extra page
> that is added when the last page ends with text in the last column:
>
> ```
>
> \unprotect
>
> \def\page_col_stop_yes
>
> {\column %\page_otr_eject_page
>
> %\page
>
> \endgroup
>
> % \setupoutputroutine[\s!singlecolumn]%
>
> \page_otr_command_set_vsize
>
> \page_otr_command_set_hsize
>
> %\page
>
> \endgroup}
>
> \protect
> ```
>
> Commenting out the \page calls does the trick in this case, but now, if
> the last page ends with its text in a column before the last one, then the
> last page is not typeset at all, and a blank page takes its place.
>
> On Sun, May 10, 2020 at 8:34 PM Thangalin  wrote:
>
>> Bump.
>>
>> See also: https://tex.stackexchange.com/q/542993/2148
>>
>> On Mon, May 4, 2020 at 11:46 AM Joey McCollum
>>  wrote:
>> >
>> > After continuing to look into this a bit, I noticed that a similar
>> issue involving the insertion of a blank page after a columnset environment
>> has been discussed on the mailing list in the thread "Blank page inserted
>> when text reaches column's end" (dated 08 Dec 2019). In that thread, a
>> proposed solution was to redefine the \page_grd_stop macro found in
>> page-cst.mkiv as follows:
>> >
>> > ```
>> > \unprotect
>> > \def\page_grd_stop{%
>> >   \endgraf % needed, else wrong vsize in one par case
>> >   \vfill % otherwise weird \placenotes[endnotes]
>> >   \page_grd_command_set_vsize % needed
>> >   \penalty\c_page_otr_eject_penalty
>> >   %\page_grd_command_flush_page
>> >   \page_otr_fill_and_eject_page
>> >   \page_grd_command_set_vsize % why here
>> >   \egroup
>> >   \page_otr_command_set_vsize
>> >   \page_otr_command_set_hsize
>> > }
>> > \protect
>> > ```
>> >
>> > Unfortunately, this approach was found to have potential issues in that
>> thread, and it does not fix the problem with pagecolumns in my MWE. Are
>> pagecolumns commands aliased to pagegrid commands like c

Re: [NTG-context] Blank page added after pagecolumns

2020-05-14 Thread Joey McCollum
Okay, I think I'm getting close, but I'm not quite there yet. The
pagecolumns source code is found in page-pcl.mkiv (
source.contextgarden.net/tex/context/base/mkiv/page-pcl.mkiv), and in that
code, the \page_col_stop_yes macro seems to have something to do with the
issue:

```
\unexpanded\def\page_col_stop_yes
  {\column % \page_otr_eject_page
   \page
   \endgroup
 % \setupoutputroutine[\s!singlecolumn]%
   \page_otr_command_set_vsize
   \page_otr_command_set_hsize
   \page
   \endgroup}
```

If I redefine this macro in my MWE as follows, I can remove the extra page
that is added when the last page ends with text in the last column:

```

\unprotect

\def\page_col_stop_yes

{\column %\page_otr_eject_page

%\page

\endgroup

% \setupoutputroutine[\s!singlecolumn]%

\page_otr_command_set_vsize

\page_otr_command_set_hsize

%\page

\endgroup}

\protect
```

Commenting out the \page calls does the trick in this case, but now, if the
last page ends with its text in a column before the last one, then the last
page is not typeset at all, and a blank page takes its place.

On Sun, May 10, 2020 at 8:34 PM Thangalin  wrote:

> Bump.
>
> See also: https://tex.stackexchange.com/q/542993/2148
>
> On Mon, May 4, 2020 at 11:46 AM Joey McCollum
>  wrote:
> >
> > After continuing to look into this a bit, I noticed that a similar issue
> involving the insertion of a blank page after a columnset environment has
> been discussed on the mailing list in the thread "Blank page inserted when
> text reaches column's end" (dated 08 Dec 2019). In that thread, a proposed
> solution was to redefine the \page_grd_stop macro found in page-cst.mkiv as
> follows:
> >
> > ```
> > \unprotect
> > \def\page_grd_stop{%
> >   \endgraf % needed, else wrong vsize in one par case
> >   \vfill % otherwise weird \placenotes[endnotes]
> >   \page_grd_command_set_vsize % needed
> >   \penalty\c_page_otr_eject_penalty
> >   %\page_grd_command_flush_page
> >   \page_otr_fill_and_eject_page
> >   \page_grd_command_set_vsize % why here
> >   \egroup
> >   \page_otr_command_set_vsize
> >   \page_otr_command_set_hsize
> > }
> > \protect
> > ```
> >
> > Unfortunately, this approach was found to have potential issues in that
> thread, and it does not fix the problem with pagecolumns in my MWE. Are
> pagecolumns commands aliased to pagegrid commands like columnset commands
> are, or are they defined somewhere else? I checked page-col.mkiv, but it
> seems to be too short to be the file that defines pagecolumns behavior.
> >
> > Joey
> >
> > On Sat, May 2, 2020 at 11:46 AM Joey McCollum <
> jmccollum20140...@gmail.com> wrote:
> >>
> >> I recently found the pagecolumns manual (
> http://www.pragma-ade.com/general/manuals/pagecolumns.pdf), and in
> several of the examples (including those for side floats and footnotes),
> the addition of a blank page after the end of the pagecolumns environment
> also seems to occur. So when the manual says, "We always start at a new
> page and end on a new one," does it mean that this is a feature of
> pagecolumns? And if so, is there any way to disable it? I have no problem
> with a page break after the end of the pagecolumns environment, but an
> empty page added after the break seems unnecessary. I checked for a wiki
> page on the \definepagecolumns command to get more information on its
> accepted inputs, but there doesn't appear to be a page for this command.
> >>
> >> Joey
> >>
> >> On Tue, Apr 28, 2020 at 1:40 PM Joey McCollum <
> jmccollum20140...@gmail.com> wrote:
> >>>
> >>> I am typesetting a document using pagecolumns to ensure that my
> footnotes are set ragged-bottom in columns. I have observed some unexpected
> behavior whenever the last column on a page is left incomplete: a blank
> page is added at the end of the document. A minimal working example follows:
> >>>
> >>> ```
> >>>
> >>> \starttext
> >>>
> >>> \startpagecolumns[n=2]
> >>>
> >>> \dorecurse{3}{\par\input zapf}
> >>>
> >>> \stoppagecolumns
> >>>
> >>> \stoptext
> >>>
> >>> ```
> >>>
> >>> I typeset this using ConTeXt version 2020.03.10, as released with
> TeXLive 2020. Notably, if \dorecurse{3} is changed to \dorecurse{2} or
> \dorecurse{6} (so that the text ends in the first column of a page), then
> there is no problem. I have tried to fix this by specifying page=no in the
> \startpagecolumns arguments, but

Re: [NTG-context] Blank page added after pagecolumns

2020-05-10 Thread Thangalin
Bump.

See also: https://tex.stackexchange.com/q/542993/2148

On Mon, May 4, 2020 at 11:46 AM Joey McCollum
 wrote:
>
> After continuing to look into this a bit, I noticed that a similar issue 
> involving the insertion of a blank page after a columnset environment has 
> been discussed on the mailing list in the thread "Blank page inserted when 
> text reaches column's end" (dated 08 Dec 2019). In that thread, a proposed 
> solution was to redefine the \page_grd_stop macro found in page-cst.mkiv as 
> follows:
>
> ```
> \unprotect
> \def\page_grd_stop{%
>   \endgraf % needed, else wrong vsize in one par case
>   \vfill % otherwise weird \placenotes[endnotes]
>   \page_grd_command_set_vsize % needed
>   \penalty\c_page_otr_eject_penalty
>   %\page_grd_command_flush_page
>   \page_otr_fill_and_eject_page
>   \page_grd_command_set_vsize % why here
>   \egroup
>   \page_otr_command_set_vsize
>   \page_otr_command_set_hsize
> }
> \protect
> ```
>
> Unfortunately, this approach was found to have potential issues in that 
> thread, and it does not fix the problem with pagecolumns in my MWE. Are 
> pagecolumns commands aliased to pagegrid commands like columnset commands 
> are, or are they defined somewhere else? I checked page-col.mkiv, but it 
> seems to be too short to be the file that defines pagecolumns behavior.
>
> Joey
>
> On Sat, May 2, 2020 at 11:46 AM Joey McCollum  
> wrote:
>>
>> I recently found the pagecolumns manual 
>> (http://www.pragma-ade.com/general/manuals/pagecolumns.pdf), and in several 
>> of the examples (including those for side floats and footnotes), the 
>> addition of a blank page after the end of the pagecolumns environment also 
>> seems to occur. So when the manual says, "We always start at a new page and 
>> end on a new one," does it mean that this is a feature of pagecolumns? And 
>> if so, is there any way to disable it? I have no problem with a page break 
>> after the end of the pagecolumns environment, but an empty page added after 
>> the break seems unnecessary. I checked for a wiki page on the 
>> \definepagecolumns command to get more information on its accepted inputs, 
>> but there doesn't appear to be a page for this command.
>>
>> Joey
>>
>> On Tue, Apr 28, 2020 at 1:40 PM Joey McCollum  
>> wrote:
>>>
>>> I am typesetting a document using pagecolumns to ensure that my footnotes 
>>> are set ragged-bottom in columns. I have observed some unexpected behavior 
>>> whenever the last column on a page is left incomplete: a blank page is 
>>> added at the end of the document. A minimal working example follows:
>>>
>>> ```
>>>
>>> \starttext
>>>
>>> \startpagecolumns[n=2]
>>>
>>> \dorecurse{3}{\par\input zapf}
>>>
>>> \stoppagecolumns
>>>
>>> \stoptext
>>>
>>> ```
>>>
>>> I typeset this using ConTeXt version 2020.03.10, as released with TeXLive 
>>> 2020. Notably, if \dorecurse{3} is changed to \dorecurse{2} or 
>>> \dorecurse{6} (so that the text ends in the first column of a page), then 
>>> there is no problem. I have tried to fix this by specifying page=no in the 
>>> \startpagecolumns arguments, but it did not change anything. Is there 
>>> something else I am missing?
>>>
>>> Thank you,
>>>
>>> Joey
>
> ___
> 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
> ___
___
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
___


Re: [NTG-context] Blank page added after pagecolumns

2020-05-04 Thread Joey McCollum
After continuing to look into this a bit, I noticed that a similar issue
involving the insertion of a blank page after a columnset environment has
been discussed on the mailing list in the thread "Blank page inserted when
text reaches column's end" (dated 08 Dec 2019). In that thread, a proposed
solution was to redefine the \page_grd_stop macro found in page-cst.mkiv as
follows:

```
\unprotect
\def\page_grd_stop{%
  \endgraf % needed, else wrong vsize in one par case
  \vfill % otherwise weird \placenotes[endnotes]
  \page_grd_command_set_vsize % needed
  \penalty\c_page_otr_eject_penalty
  %\page_grd_command_flush_page
  \page_otr_fill_and_eject_page
  \page_grd_command_set_vsize % why here
  \egroup
  \page_otr_command_set_vsize
  \page_otr_command_set_hsize
}
\protect
```

Unfortunately, this approach was found to have potential issues in that
thread, and it does not fix the problem with pagecolumns in my MWE. Are
pagecolumns commands aliased to pagegrid commands like columnset commands
are, or are they defined somewhere else? I checked page-col.mkiv, but it
seems to be too short to be the file that defines pagecolumns behavior.

Joey

On Sat, May 2, 2020 at 11:46 AM Joey McCollum 
wrote:

> I recently found the pagecolumns manual (
> http://www.pragma-ade.com/general/manuals/pagecolumns.pdf), and in
> several of the examples (including those for side floats and footnotes),
> the addition of a blank page after the end of the pagecolumns environment
> also seems to occur. So when the manual says, "We always start at a new
> page and end on a new one," does it mean that this is a feature of
> pagecolumns? And if so, is there any way to disable it? I have no problem
> with a page break after the end of the pagecolumns environment, but an
> empty page added after the break seems unnecessary. I checked for a wiki
> page on the \definepagecolumns command to get more information on its
> accepted inputs, but there doesn't appear to be a page for this command.
>
> Joey
>
> On Tue, Apr 28, 2020 at 1:40 PM Joey McCollum 
> wrote:
>
>> I am typesetting a document using pagecolumns to ensure that my footnotes
>> are set ragged-bottom in columns. I have observed some unexpected behavior
>> whenever the last column on a page is left incomplete: a blank page is
>> added at the end of the document. A minimal working example follows:
>>
>> ```
>>
>> \starttext
>>
>> \startpagecolumns[n=2]
>>
>> \dorecurse{3}{\par\input zapf}
>>
>> \stoppagecolumns
>>
>> \stoptext
>> ```
>>
>> I typeset this using ConTeXt version 2020.03.10, as released with TeXLive
>> 2020. Notably, if \dorecurse{3} is changed to \dorecurse{2} or
>> \dorecurse{6} (so that the text ends in the first column of a page), then
>> there is no problem. I have tried to fix this by specifying page=no in the
>> \startpagecolumns arguments, but it did not change anything. Is there
>> something else I am missing?
>>
>> Thank you,
>>
>> Joey
>>
>
___
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
___


Re: [NTG-context] Blank page added after pagecolumns

2020-05-02 Thread Joey McCollum
I recently found the pagecolumns manual (
http://www.pragma-ade.com/general/manuals/pagecolumns.pdf), and in several
of the examples (including those for side floats and footnotes), the
addition of a blank page after the end of the pagecolumns environment also
seems to occur. So when the manual says, "We always start at a new page and
end on a new one," does it mean that this is a feature of pagecolumns? And
if so, is there any way to disable it? I have no problem with a page break
after the end of the pagecolumns environment, but an empty page added after
the break seems unnecessary. I checked for a wiki page on the
\definepagecolumns command to get more information on its accepted inputs,
but there doesn't appear to be a page for this command.

Joey

On Tue, Apr 28, 2020 at 1:40 PM Joey McCollum 
wrote:

> I am typesetting a document using pagecolumns to ensure that my footnotes
> are set ragged-bottom in columns. I have observed some unexpected behavior
> whenever the last column on a page is left incomplete: a blank page is
> added at the end of the document. A minimal working example follows:
>
> ```
>
> \starttext
>
> \startpagecolumns[n=2]
>
> \dorecurse{3}{\par\input zapf}
>
> \stoppagecolumns
>
> \stoptext
> ```
>
> I typeset this using ConTeXt version 2020.03.10, as released with TeXLive
> 2020. Notably, if \dorecurse{3} is changed to \dorecurse{2} or
> \dorecurse{6} (so that the text ends in the first column of a page), then
> there is no problem. I have tried to fix this by specifying page=no in the
> \startpagecolumns arguments, but it did not change anything. Is there
> something else I am missing?
>
> Thank you,
>
> Joey
>
___
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
___


[NTG-context] Blank page added after pagecolumns

2020-04-28 Thread Joey McCollum
I am typesetting a document using pagecolumns to ensure that my footnotes
are set ragged-bottom in columns. I have observed some unexpected behavior
whenever the last column on a page is left incomplete: a blank page is
added at the end of the document. A minimal working example follows:

```

\starttext

\startpagecolumns[n=2]

\dorecurse{3}{\par\input zapf}

\stoppagecolumns

\stoptext
```

I typeset this using ConTeXt version 2020.03.10, as released with TeXLive
2020. Notably, if \dorecurse{3} is changed to \dorecurse{2} or
\dorecurse{6} (so that the text ends in the first column of a page), then
there is no problem. I have tried to fix this by specifying page=no in the
\startpagecolumns arguments, but it did not change anything. Is there
something else I am missing?

Thank you,

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


Re: [NTG-context] blank[\lineheight] works with LMTX, fails with MkIV

2019-12-21 Thread Wolfgang Schuster

mf schrieb am 21.12.2019 um 11:07:

Il 20/12/19 20:04, Rik Kabel ha scritto:


MkIV fails with

tex error   > tex error on line 3 in file 
c://Users/micro/Desktop/fail.tex: ! Missing \endcsname inserted

given the following mwe:

\starttext
a
    \blank[\lineheight]
z
\stoptext

Not critical as there are lots of ways to do this, but it seems 
strange that it should work in one and not the other.




\starttext
a
\blank[\the\lineheight]
z
\stoptext


To understand the differenecs between MkIV adn LMTX you should know how 
\blank handles the arguments.



1. MkII

ConTeXt processes the argument list in TeX and checks first if the 
argument is a valid name (e.g. big) which is then expanded, when the 
argument isn't a valid name it is handled as a dimension which is added 
to the skip value. Since everything happens in TeX length registers 
(e.g. \lineheight) are allowed in the argument.



2. MkIV

ConTeXt passes the complete list with all arguments to Lua where a loop 
iterates over all entries. The problem here is that Lua can't deal with 
\lineheight because it expects the value of the register and you have to 
pass the length as \the\lineheight which delivers the current value for 
the line height.



3. LMTX

The same things as MkIV but there is a additional check on the TeX end 
before the arguments are passed to Lua where ConTeXt checks if the 
argument is a dimension. The reason why this is only done for LMTX is 
that a new command (\ifchkdim) in the engine was needed for this and 
many of these new helpers exist only here.


Be aware that this check works only when a length register is the 
*first* argument in the list because every other case the check fails.



\starttext

line 1

\blank[line]

line 2

\blank[\lineheight] % works

line 3

\blank[preference,line]

line 4

\blank[preference,\lineheight] % fails

line 5

\stoptext


Wolfgang

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


Re: [NTG-context] blank[\lineheight] works with LMTX, fails with MkIV

2019-12-21 Thread mf

Il 20/12/19 20:04, Rik Kabel ha scritto:


MkIV fails with

tex error   > tex error on line 3 in file 
c://Users/micro/Desktop/fail.tex: ! Missing \endcsname inserted

given the following mwe:

\starttext
a
    \blank[\lineheight]
z
\stoptext

Not critical as there are lots of ways to do this, but it seems 
strange that it should work in one and not the other.




\starttext
a
\blank[\the\lineheight]
z
\stoptext

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


[NTG-context] blank[\lineheight] works with LMTX, fails with MkIV

2019-12-20 Thread Rik Kabel

MkIV fails with

   tex error   > tex error on line 3 in file 
c://Users/micro/Desktop/fail.tex: ! Missing \endcsname inserted

given the following mwe:

   \starttext
   a
   \blank[\lineheight]
   z
   \stoptext

Not critical as there are lots of ways to do this, but it seems strange 
that it should work in one and not the other.


--
Rik

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


Re: [NTG-context] Blank page inserted when text reaches column's end

2019-12-10 Thread Wolfgang Schuster

Thangalin schrieb am 11.12.2019 um 02:51:

Commenting out the \page_grd_command_flush_page macro seems to have
reversed the effect. Any pages having columnar text that does not
extend to the last line are now suppressed. How would I go about
adding a conditional that checks to see whether the column is filled
before deciding if a page break is necessary?

\unprotect
\def\page_grd_stop{%
   \endgraf % needed, else wrong vsize in one par case
   \vfill % otherwise weird \placenotes[endnotes]
   \page_grd_command_set_vsize % needed
   \penalty\c_page_otr_eject_penalty
   %\page_grd_command_flush_page
   \page_otr_fill_and_eject_page
   \page_grd_command_set_vsize % why here
   \egroup
   \page_otr_command_set_vsize
   \page_otr_command_set_hsize}
\protect


Fails for the next example (the first page appears twice in the PDF and 
the second page is missing):


\setuplayout[grid=yes]

\starttext
  \startcolumnset[n=2]
    \dorecurse{100}{Line #1\par}
  \stopcolumnset
\stoptext

Wolfgang

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


Re: [NTG-context] Blank page inserted when text reaches column's end

2019-12-10 Thread Thangalin
Commenting out the \page_grd_command_flush_page macro seems to have
reversed the effect. Any pages having columnar text that does not
extend to the last line are now suppressed. How would I go about
adding a conditional that checks to see whether the column is filled
before deciding if a page break is necessary?

\unprotect
\def\page_grd_stop{%
  \endgraf % needed, else wrong vsize in one par case
  \vfill % otherwise weird \placenotes[endnotes]
  \page_grd_command_set_vsize % needed
  \penalty\c_page_otr_eject_penalty
  %\page_grd_command_flush_page
  \page_otr_fill_and_eject_page
  \page_grd_command_set_vsize % why here
  \egroup
  \page_otr_command_set_vsize
  \page_otr_command_set_hsize}
\protect

Thank you!
___
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
___


Re: [NTG-context] Blank page inserted when text reaches column's end

2019-12-09 Thread Thangalin
Thank you both. Neither approach removes the blank page with either
version 2019.06.11 or 2019.12.06 on Linux. Is there a specific version
of ConTeXt required? The code to generate the document resembles:

\setuppagenumbering[alternative=doublesided,page=no]
\installpagebreakhandler{last}{}

\setuplayout[grid=yes]

\starttext
  \startcolumnset[n=2]
\input knuth \input lorem \input lorem \input knuth
\dorecurse{3}{No TV and no beer make Homer something something.}
  \stopcolumnset
\stoptext

The second page remains, regardless of doublesided/singlesided or
pagebreakhandler.

Henri Menke pointed out that "page-cst.mkiv" contains an explicit line
break associated with stoppagegrid:

https://github.com/contextgarden/context-mirror/blob/f74c4055713ab52a11d12435eb04040ec6553129/tex/context/base/mkiv/page-cst.mkiv#L199-L201

Could this be grid itself be problematic?

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


Re: [NTG-context] Blank page inserted when text reaches column's end

2019-12-09 Thread Wolfgang Schuster

Denis Maier schrieb am 09.12.2019 um 09:41:

Am 09.12.2019 um 00:44 schrieb Thangalin:

When text reaches the end of a column, it appears to trigger inserting
a blank page. In the following code, \dorecurse{3} causes a blank page
to appear but \dorecurse{2} does not. The only difference is that when
set to 3, the additional text is written on the last line of the last
column. This scenario results in a blank page.

Any ideas how the blank page can be suppressed?

\showgrid
\setuplayout[grid=yes]

\starttext
   \startcolumnset[n=2]
 \input knuth \input lorem \input lorem \input knuth
 \dorecurse{3}{No TV and no beer make Homer something something.}
   \stopcolumnset
\stoptext

Version:

$ context --version
mtx-context | ConTeXt Process Management 1.03
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2019.06.11 19:20

Thank you!


What about:
\installpagebreakhandler{last}{}

(I have this in most of my documents, but I'm not sure it works with 
columnsets.)


Better use this setup to get rid of the extra page in a doublesided 
document.


\setuppagenumbering[page=no]

Wolfgang

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


Re: [NTG-context] Blank page inserted when text reaches column's end

2019-12-09 Thread Denis Maier

Am 09.12.2019 um 00:44 schrieb Thangalin:

When text reaches the end of a column, it appears to trigger inserting
a blank page. In the following code, \dorecurse{3} causes a blank page
to appear but \dorecurse{2} does not. The only difference is that when
set to 3, the additional text is written on the last line of the last
column. This scenario results in a blank page.

Any ideas how the blank page can be suppressed?

\showgrid
\setuplayout[grid=yes]

\starttext
   \startcolumnset[n=2]
 \input knuth \input lorem \input lorem \input knuth
 \dorecurse{3}{No TV and no beer make Homer something something.}
   \stopcolumnset
\stoptext

Version:

$ context --version
mtx-context | ConTeXt Process Management 1.03
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2019.06.11 19:20

Thank you!


What about:
\installpagebreakhandler{last}{}

(I have this in most of my documents, but I'm not sure it works with 
columnsets.)


Best,
Denis
___
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
___


[NTG-context] Blank page inserted when text reaches column's end

2019-12-08 Thread Thangalin
When text reaches the end of a column, it appears to trigger inserting
a blank page. In the following code, \dorecurse{3} causes a blank page
to appear but \dorecurse{2} does not. The only difference is that when
set to 3, the additional text is written on the last line of the last
column. This scenario results in a blank page.

Any ideas how the blank page can be suppressed?

\showgrid
\setuplayout[grid=yes]

\starttext
  \startcolumnset[n=2]
\input knuth \input lorem \input lorem \input knuth
\dorecurse{3}{No TV and no beer make Homer something something.}
  \stopcolumnset
\stoptext

Version:

$ context --version
mtx-context | ConTeXt Process Management 1.03
mtx-context |
mtx-context | main context file:
/opt/context/tex/texmf-context/tex/context/base/mkiv/context.mkiv
mtx-context | current version: 2019.06.11 19:20

Thank you!
___
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
___


Re: [NTG-context] Suppress blank page in asymmetrical multicolumn layout

2019-12-06 Thread Wolfgang Schuster

Thangalin schrieb am 06.12.2019 um 17:17:

Hi there,

How do I suppress the blank page in the following document while
maintaining the asymmetrical multicolumn layout? The problem centres
around "page=yes," whereby removing it eliminates the blank page, but
then wreaks havoc on the document layout.

\definepapersize[BookPaperSize][width=24in, height=12in,]
\setuppapersize[BookPaperSize]

\definelayout[BookTextLayout][
   topspace=.5in,
   backspace=.5in,
   header=\zeropoint,
   footer=\zeropoint,
   grid=yes,
]
\setuplayout[BookTextLayout]

\definecolumnset[BookColumns][n=4,distance=.25in]


Add "page=yes" to start each new columnset environment with a page break.

\definecolumnset [BookColumns] [n=4,distance=.25in,page=yes]


\setupcolumnset[BookColumns:1][width=11.75in]
\setupcolumnset[BookColumns:2][width=3.46in]
\setupcolumnset[BookColumns:3][width=3.46in]
\setupcolumnset[BookColumns:4][width=3.46in]

\setuphead[section][
   page=yes,


Remove the page break at the begin of each section because the break
happens after you start the columnset environment. The value of the
beforesection key is inserted before the values from other keys are used.

page=,


   beforesection={\startcolumnset[BookColumns]},
   aftersection={\stopcolumnset},
]


Wolfgang

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


[NTG-context] Suppress blank page in asymmetrical multicolumn layout

2019-12-06 Thread Thangalin
Hi there,

How do I suppress the blank page in the following document while
maintaining the asymmetrical multicolumn layout? The problem centres
around "page=yes," whereby removing it eliminates the blank page, but
then wreaks havoc on the document layout.

\definepapersize[BookPaperSize][width=24in, height=12in,]
\setuppapersize[BookPaperSize]

\definelayout[BookTextLayout][
  topspace=.5in,
  backspace=.5in,
  header=\zeropoint,
  footer=\zeropoint,
  grid=yes,
]
\setuplayout[BookTextLayout]

\definecolumnset[BookColumns][n=4,distance=.25in]
\setupcolumnset[BookColumns:1][width=11.75in]
\setupcolumnset[BookColumns:2][width=3.46in]
\setupcolumnset[BookColumns:3][width=3.46in]
\setupcolumnset[BookColumns:4][width=3.46in]

\setuphead[section][
  page=yes,
  beforesection={\startcolumnset[BookColumns]},
  aftersection={\stopcolumnset},
]

\setuphead[subsection][
  after={\column},
]

\setuphead[subsubsection][
  after={\blank[small]},
]

\starttext
\startsection[title={Section Title}]
\startsubsection[title={Subtitle}]
\dorecurse{2}{\input knuth}

\dorecurse{2}{%
  \startsubsubsection[title={Subsubtitle}]
\dorecurse{1}{\input ward}
\dorecurse{2}{\input lorem}
\dorecurse{1}{\input bryson}
  \stopsubsubsection
}

\stopsubsection
\stopsection
\stoptext

Thank you!
___
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
___


Re: [NTG-context] \setuppagenumbering doublesided generates blank pages

2019-10-30 Thread Kerry Sainsbury
Thank you both for your replies.That has helped immensely.

On Thu, 31 Oct 2019 at 09:17, Henning Hraban Ramm  wrote:

>
> > Am 2019-10-30 um 19:58 schrieb Kerry Sainsbury :
> >
> > Hi there,
> >
> > I am a newbie, and have seem to have discovered that
> > \setuppagenumbering [alternative=doublesided] generates a blank page
> between chapters.
> >
> > Am I doing something wrong, or is this just a bug?
>
> What Wolfgang said, and you probably want
>
> \setuphead[chapter][page=yes] % or "no", but not "right"
>
> see https://wiki.contextgarden.net/Command/setuphead
> and https://wiki.contextgarden.net/Command/page
>
>
> Greetlings, Hraban
> ---
> https://www.fiee.net
> http://wiki.contextgarden.net
> https://www.dreiviertelhaus.de
> GPG Key ID 1C9B22FD
>
>
> ___
> 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
>
> ___
>
___
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
___


Re: [NTG-context] \setuppagenumbering doublesided generates blank pages

2019-10-30 Thread Henning Hraban Ramm

> Am 2019-10-30 um 19:58 schrieb Kerry Sainsbury :
> 
> Hi there,
> 
> I am a newbie, and have seem to have discovered that
> \setuppagenumbering [alternative=doublesided] generates a blank page between 
> chapters. 
> 
> Am I doing something wrong, or is this just a bug?

What Wolfgang said, and you probably want

\setuphead[chapter][page=yes] % or "no", but not "right"

see https://wiki.contextgarden.net/Command/setuphead
and https://wiki.contextgarden.net/Command/page


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD

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


Re: [NTG-context] \setuppagenumbering doublesided generates blank pages

2019-10-30 Thread Wolfgang Schuster

Kerry Sainsbury schrieb am 30.10.2019 um 19:58:

Hi there,

I am a newbie, and have /seem/ to have discovered that

\setuppagenumbering [alternative=doublesided] generates a blank page 
between chapters.


\setupheadertexts[chapter]

\setuppagenumbering [alternative=doublesided,location={header,inmargin}]

\starttext

\startchapter[title={October 2000}]

Blah One

\stopchapter

\startchapter[title={November 2000}]

Blah Two

\stopchapter

\stoptext


This produces a PDF in TeXworks containing 4 pages:

  * Page 1 with a header an 'October 2000' header and 'Blah One' content
  * Page 2 with a header an 'October 2000' header only.
  * Page 3 with a header an 'November 2000' header and 'Blah Two' content
  * Page 4 which is completely blank

If I remove the \setuppagenumbering line the PDF contains just two 
pages, with the expected content.


I'm using "ConTeXt ver: 2019.10.11 15:47 MKIV beta fmt: 2019.10.25 
int: english/english"


Am I doing something wrong, or is this just a bug?


With \setuppagenumbering[alternative=doublesided] you get a doublesided 
document
with left and right pages. The default setting for chapters is to start 
always on a right page

which can lead to empty left pages.

The normal layout are single sided document 
(\setuppagenumbering[alternative=singlesided])
with right pages only which can't lead to empty pages unless you add an 
extra check at the

begin of each chapter.

There is also a third mode which creates the same layout on each page 
but you can

checl for left and right pages, this mode is enabled with
\setuppagenumber[alternative={singlesided,doublesided}].

Wolfgang

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


[NTG-context] \setuppagenumbering doublesided generates blank pages

2019-10-30 Thread Kerry Sainsbury
Hi there,

I am a newbie, and have *seem* to have discovered that

\setuppagenumbering [alternative=doublesided] generates a blank page
between chapters.


\setupheadertexts[chapter]

\setuppagenumbering [alternative=doublesided,location={header,inmargin}]

\starttext

\startchapter[title={October 2000}]

Blah One

\stopchapter


\startchapter[title={November 2000}]

Blah Two

\stopchapter

\stoptext

This produces a PDF in TeXworks containing 4 pages:

   - Page 1 with a header an 'October 2000' header and 'Blah One' content
   - Page 2 with a header an 'October 2000' header only.
   - Page 3 with a header an 'November 2000' header and 'Blah Two' content
   - Page 4 which is completely blank

If I remove the \setuppagenumbering line the PDF contains just two pages,
with the expected content.

I'm using "ConTeXt ver: 2019.10.11 15:47 MKIV beta fmt: 2019.10.25 int:
english/english"

Am I doing something wrong, or is this just a bug?

Thanks for your help. ConTeXt is making my life *much* easier right now!

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


Re: [NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-17 Thread Taco Hoekwater
Hi,

> On 17 Jan 2019, at 12:27, Jan U. Hasecke  wrote:
> 
> Am 14.01.19 um 19:25 schrieb Wolfgang Schuster:
> 
>> 
>>> I'll try to wikify this later this week.
> 
> I wikified it here:
> https://wiki.contextgarden.net/Command/setuphead
> 
> Is there a way to suppress the context output?
> The output does not show the effect.

I patched your example a little so that it now does show the effect.

Best wishes,
Taco





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

Re: [NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-17 Thread Jan U. Hasecke
Am 14.01.19 um 19:25 schrieb Wolfgang Schuster:

> 
>> I'll try to wikify this later this week.

I wikified it here:
https://wiki.contextgarden.net/Command/setuphead

Is there a way to suppress the context output?
The output does not show the effect.

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

Re: [NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-14 Thread Wolfgang Schuster

Jan U. Hasecke schrieb am 14.01.19 um 08:39:


Am 13.01.19 um 16:56 schrieb Wolfgang Schuster:


Here is a example which shows how you can change the background color
of a empty page before the chapter title.

\setuppagenumbering
   [alternative=doublesided]

\startsetups [chapter:before]
   \doifoddpageelse
     {}
     {\pushbackground[page]
  \setupbackgrounds[page][background=color,backgroundcolor=black]
  \page[empty,right]
  \popbackground}
\stopsetups

\setuphead
   [chapter]
   [page=yes,
    before=\directsetup{chapter:before}]

\starttext

\startchapter[title={Knuth}]
\dorecurse{10}{\samplefile{knuth}}
\stopchapter

\startchapter[title={Zapf}]
\dorecurse{10}{\samplefile{zapf}}
\stopchapter

\startchapter[title={Ward}]
\dorecurse{10}{\samplefile{ward}}
\stopchapter

\stoptext


Thanks a lot Wolfgang!

This was just the thing I was looking for. These setups seems to be the
golden bullet in ConTeXt but I often have difficulties to understand the
mechanism.


If you mean the setups-environment with setups you’re wrong because this 
is only a alternative way to a command (e.g. \define\mycommand{...}).


The main point is that you finish the page before the section title and 
check on the new page whether you’re on a odd or even numbered page.


When the test tells you that you’re on a even numbered page you know 
there is a empty left page before the chapter which can be used to add 
something special.


Below is a simplified example for the method.

\starttext

\dorecurse{10}{\samplefile{knuth}}

\page

\doifoddpageelse
  {}
  {\pushbackground[page]
   \setupbackgrounds[page][background=color,backgroundcolor=red]
   \page[empty]
   \popbackground}

\dorecurse{10}{\samplefile{zapf}}

\stoptext


I'll try to wikify this later this week.

The push-pop-background pair is mentionend in x-setups-overview together
with some other push-pop-pairs or push single commands. Are they
documented somewhere?


Most of these push/pop commands are used for internal stuff (or 
sometimes in styles) which means there is no documentation for them.


The purpose of them is to store the state of a command (e.g. the page 
background) before you change its values, afterwards you can just revert 
back to the previously saved state.


As these commands are no real environments they are listed as separate 
commands but it’s possible I will change this.


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

Re: [NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-13 Thread Jan U. Hasecke

Am 13.01.19 um 16:56 schrieb Wolfgang Schuster:

> Here is a example which shows how you can change the background color
> of a empty page before the chapter title.
> 
> \setuppagenumbering
>   [alternative=doublesided]
> 
> \startsetups [chapter:before]
>   \doifoddpageelse
>     {}
>     {\pushbackground[page]
>  \setupbackgrounds[page][background=color,backgroundcolor=black]
>  \page[empty,right]
>  \popbackground}
> \stopsetups
> 
> \setuphead
>   [chapter]
>   [page=yes,
>    before=\directsetup{chapter:before}]
> 
> \starttext
> 
> \startchapter[title={Knuth}]
> \dorecurse{10}{\samplefile{knuth}}
> \stopchapter
> 
> \startchapter[title={Zapf}]
> \dorecurse{10}{\samplefile{zapf}}
> \stopchapter
> 
> \startchapter[title={Ward}]
> \dorecurse{10}{\samplefile{ward}}
> \stopchapter
> 
> \stoptext

Thanks a lot Wolfgang!

This was just the thing I was looking for. These setups seems to be the
golden bullet in ConTeXt but I often have difficulties to understand the
mechanism.

I'll try to wikify this later this week.

The push-pop-background pair is mentionend in x-setups-overview together
with some other push-pop-pairs or push single commands. Are they
documented somewhere?

juh

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

Re: [NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-13 Thread Wolfgang Schuster

Jan U. Hasecke schrieb am 12.01.19 um 22:08:

Hi Aditya,

Am 12.01.19 um 20:11 schrieb Aditya Mahajan:

On Sat, 12 Jan 2019, Jan U. Hasecke wrote:


Hi all,

in my document \startchapter and \starttitle starts a new chapter on the
right (odd) page. So sometimes, there is a blank even page just before a
new chapter.

I would like to manipulate this blank even page.

There are several things I would like to do, eg. having no headers and
footers, setting the background color to a named color, placing an image
or some graphics on the page.

Is there a way to define such a page, name it and call it in
\startchapter so that it is placed on the left side.

See https://tex.stackexchange.com/q/457428/323

Thanks a lot, but I wasn't looking for a way to just delete page numbers
but to style the empty page in arbitrary ways.

Maybe it is better to do this manually.

I would let chapter open on even pages too and just insert a styled page
by hand.


Here is a example which shows how you can change the background color
of a empty page before the chapter title.

\setuppagenumbering
  [alternative=doublesided]

\startsetups [chapter:before]
  \doifoddpageelse
    {}
    {\pushbackground[page]
 \setupbackgrounds[page][background=color,backgroundcolor=black]
 \page[empty,right]
 \popbackground}
\stopsetups

\setuphead
  [chapter]
  [page=yes,
   before=\directsetup{chapter:before}]

\starttext

\startchapter[title={Knuth}]
\dorecurse{10}{\samplefile{knuth}}
\stopchapter

\startchapter[title={Zapf}]
\dorecurse{10}{\samplefile{zapf}}
\stopchapter

\startchapter[title={Ward}]
\dorecurse{10}{\samplefile{ward}}
\stopchapter

\stoptext

Wolfgang

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

Re: [NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-12 Thread Rik Kabel

On 1/12/2019 16:08, Jan U. Hasecke wrote:

Hi Aditya,

Am 12.01.19 um 20:11 schrieb Aditya Mahajan:

On Sat, 12 Jan 2019, Jan U. Hasecke wrote:


Hi all,

in my document \startchapter and \starttitle starts a new chapter on the
right (odd) page. So sometimes, there is a blank even page just before a
new chapter.

I would like to manipulate this blank even page.

There are several things I would like to do, eg. having no headers and
footers, setting the background color to a named color, placing an image
or some graphics on the page.

Is there a way to define such a page, name it and call it in
\startchapter so that it is placed on the left side.

See https://tex.stackexchange.com/q/457428/323

Thanks a lot, but I wasn't looking for a way to just delete page numbers
but to style the empty page in arbitrary ways.

Maybe it is better to do this manually.

I would let chapter open on even pages too and just insert a styled page
by hand.

juh



I place an epigraph on verso page before a few chapters with the following:

   \definehead[ChapterEpigraph][title]
   \setuphead [ChapterEpigraph][
  page={yes,left},
  insidesection=\vfill,
  aftersection={\vfill\vfill},
  header=empty,
  placehead=no,
 ]

   %% The following always creates a verso page if there is an
   %%   epigraph to set or not.

   \startsetups chapter:epigraph
\doifelsebuffer{ChapterEpigraph}
{\page[yes,header,footer,left]
 \dontleavehmode
 \vfill
 \getbuffer   [ChapterEpigraph]
 \resetbuffer [ChapterEpigraph]
 \vfill
 \vfill
}
{\page[yes,header,footer,left]}
\page[yes,header,footer,right]
   \stopsetups

   <...>

   \stopchapter%   end previous chapter

   \startChapterEpigraph% no epigraph on next

   \stopChapterEpigraph

   \startchapter[reference={cha:no-epigraph-chapter},
  title={Chapter with no epigraph}]
   <...>

   \stopchapter%

   \startChapterEpigraph

   

   \stopChapterEpigraph

   \startchapter[reference={cha:next-chapter},
  title={Chapter with epigraph}]

   <...>

I am not sure where I got the hints for this. I haven't revisited it for 
a while, and it does look like there is some redundant use of \vfill, 
but it worked for me. You may be able to build on it.


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

Re: [NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-12 Thread Jan U. Hasecke
Hi Aditya,

Am 12.01.19 um 20:11 schrieb Aditya Mahajan:
> On Sat, 12 Jan 2019, Jan U. Hasecke wrote:
> 
>> Hi all,
>>
>> in my document \startchapter and \starttitle starts a new chapter on the
>> right (odd) page. So sometimes, there is a blank even page just before a
>> new chapter.
>>
>> I would like to manipulate this blank even page.
>>
>> There are several things I would like to do, eg. having no headers and
>> footers, setting the background color to a named color, placing an image
>> or some graphics on the page.
>>
>> Is there a way to define such a page, name it and call it in
>> \startchapter so that it is placed on the left side.
> 
> See https://tex.stackexchange.com/q/457428/323

Thanks a lot, but I wasn't looking for a way to just delete page numbers
but to style the empty page in arbitrary ways.

Maybe it is better to do this manually.

I would let chapter open on even pages too and just insert a styled page
by hand.

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

Re: [NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-12 Thread Aditya Mahajan

On Sat, 12 Jan 2019, Jan U. Hasecke wrote:


Hi all,

in my document \startchapter and \starttitle starts a new chapter on the
right (odd) page. So sometimes, there is a blank even page just before a
new chapter.

I would like to manipulate this blank even page.

There are several things I would like to do, eg. having no headers and
footers, setting the background color to a named color, placing an image
or some graphics on the page.

Is there a way to define such a page, name it and call it in
\startchapter so that it is placed on the left side.


See https://tex.stackexchange.com/q/457428/323

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

[NTG-context] Manipulating the left blank page when chapter starts on the right page

2019-01-12 Thread Jan U. Hasecke
Hi all,

in my document \startchapter and \starttitle starts a new chapter on the
right (odd) page. So sometimes, there is a blank even page just before a
new chapter.

I would like to manipulate this blank even page.

There are several things I would like to do, eg. having no headers and
footers, setting the background color to a named color, placing an image
or some graphics on the page.

Is there a way to define such a page, name it and call it in
\startchapter so that it is placed on the left side.

I would like to use the blank pages in an attractive way. Imagine eg. a
title image on the left page while the headline of the chapter is on the
right page.

TIA
juh

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

[NTG-context] Spurious breaks in export when blank line ends paragraph

2018-08-21 Thread Rik Kabel

List,

My understanding of start/stop macros such as 
\startparagraph...\stopparagraph has been that blank lines are allowed 
between the block of text and the macros, as


   \startparagraph

   This is the text of the paragraph

   \stopparagraph

However, in xml exports the blank line before \stopparagraph leads to 
spurious break elements in some circumstances, as shown in the following:


   \setupbackend [export=yes,xhtml=yes]
   \starttext
   \startsection[title=trailing blank line]
   \startparagraph
  Xxx xxx xx x xx xxx  xx xx
  xx. Xxx  x, \inleft{z} x  xx x
  xx  x xx xxx  xx x, xxx   xx
  xxx xxx xxx xx  xxx  xx Xxxx , xxx
    x xx  x xx . Xxx x
  xxx xxx xxx xx xx   xxx,x
  xx x xx,  xxx xxx xxx x . Xxxx xxx
  xx xx xxx xxx ,    xxx x xx
  x x, xxx xxx x xxx xxx xx xx xx
  \inleft{zz}. Xxxx  x xx   (x, xxx,
  xx xxx xx).

   \stopparagraph

   \stopsection

   \startsection[title=no blank line]

   \startparagraph
  Xxx xxx xx x xx xxx  xx xx
  xx. Xxx  x, \inleft{z} x  xx x
  xx  x xx xxx  xx x, xxx   xx
  xxx xxx xxx xx  xxx  xx Xxxx , xxx
    x xx  x xx . Xxx x
  xxx xxx xxx xx xx   xxx,x
  xx x xx,  xxx xxx xxx x . Xxxx xxx
  xx xx xxx xxx ,    xxx x xx
  x x, xxx xxx x xxx xxx xx xx xx
  \inleft{zz}. Xxxx  x xx   (x, xxx,
  xx xxx xx).
   \stopparagraph

   \stopsection

   \startsection[title=Another section]

   \startparagraph

  This is here to show the bottom of the previous section.

   \stopparagraph

   \stopsection

   \stoptext

Note that the pdf output does not display the problem, but the pdf 
output is not why one runs an export. The breaks disappear in shorter 
paragraphs, and disappear when the margintext is not present, but appear 
when margintext is present and the paragraph exceeds some length which I 
have not worked to determine.


Is my understanding of the space rules incorrect, or is this a bug?

Since some breaks perhaps should be present, it is difficult to remove 
these with CSS, or XSLT. One thing that might help is to add a class 
identifier to breaks indicating what lead to their creation. Of course, 
not generating these would be better still.


--

Rik

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-16 Thread Rik

On 8/16/2018 10:55, Aditya Mahajan wrote:

On Wed, 15 Aug 2018, Rik Kabel wrote:

I suspect that the issue in the larger project has to do with quoting 
for the RE ("^\\relax") since compilation fails with:


  %% \stopAttribution ...getcontent("Attribution"),"^\\
  %% relax","")))}\stopparagrap...

Any pointers on such quoting would be appreciated.


Please create a MWE.

Aditya 


I cannot at this point, and may well have misinterpreted what I saw.

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-16 Thread Aditya Mahajan

On Wed, 15 Aug 2018, Rik Kabel wrote:


On 8/15/2018 03:07, Hans Hagen wrote:

On 8/15/2018 5:31 AM, Aditya Mahajan wrote:

On Tue, 14 Aug 2018, Rik Kabel wrote:

I really think, though, that a buffers.strip function would be the way to 
go, instead of futzing after the damage is done.


In lua, buffers.getcontent('name') gives the contents of the buffer 
labelled 'name'. You can post-process this in whatever way you want. For 
example, you could write a lua function userdata.strip that strips the 
leading and ending black spaces from a string, and then call


context(userdata.strip(buffers.getcontent('name)))

local s = [[

foo

bar


bar

]]

print(string.fullstrip(s))


So, it looks likethe following is closer to working for me in a simple test 
harness, but not in my full-blown work:


  
\dontleavehmode{\llap{StripA~}}\ctxlua{context(utilities.strings.striplines(string.gsub(buffers.getcontent("TestBuffer"),"^\\relax",""),"prune"))}

(or similar with string.fullstrip).

However, it fails when the buffer starts with an unescaped left square 
bracket. That is probably why the \relax is inserted, and I can see that it 
is not a simple job to handle this. So, I will accept that I must either 
append [] or get rid of the open layout for these cases.


I suspect that the issue in the larger project has to do with quoting for the 
RE ("^\\relax") since compilation fails with:


  %% \stopAttribution ...getcontent("Attribution"),"^\\
  %% relax","")))}\stopparagrap...

Any pointers on such quoting would be appreciated.


Please create a MWE.

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-15 Thread Rik Kabel

On 8/15/2018 03:07, Hans Hagen wrote:

On 8/15/2018 5:31 AM, Aditya Mahajan wrote:

On Tue, 14 Aug 2018, Rik Kabel wrote:

I really think, though, that a buffers.strip function would be the 
way to go, instead of futzing after the damage is done.


In lua, buffers.getcontent('name') gives the contents of the buffer 
labelled 'name'. You can post-process this in whatever way you want. 
For example, you could write a lua function userdata.strip that 
strips the leading and ending black spaces from a string, and then call


context(userdata.strip(buffers.getcontent('name)))

local s = [[

foo

bar


bar

]]

print(string.fullstrip(s))


So, it looks likethe following is closer to working for me in a simple 
test harness, but not in my full-blown work:


   
\dontleavehmode{\llap{StripA~}}\ctxlua{context(utilities.strings.striplines(string.gsub(buffers.getcontent("TestBuffer"),"^\\relax",""),"prune"))}

(or similar with string.fullstrip).

However, it fails when the buffer starts with an unescaped left square 
bracket. That is probably why the \relax is inserted, and I can see that 
it is not a simple job to handle this. So, I will accept that I must 
either append [] or get rid of the open layout for these cases.


I suspect that the issue in the larger project has to do with quoting 
for the RE ("^\\relax") since compilation fails with:


   %% \stopAttribution ...getcontent("Attribution"),"^\\
   %% relax","")))}\stopparagrap...

Any pointers on such quoting would be appreciated.

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-15 Thread Hans Hagen

On 8/15/2018 5:31 AM, Aditya Mahajan wrote:

On Tue, 14 Aug 2018, Rik Kabel wrote:

I really think, though, that a buffers.strip function would be the way 
to go, instead of futzing after the damage is done.


In lua, buffers.getcontent('name') gives the contents of the buffer 
labelled 'name'. You can post-process this in whatever way you want. For 
example, you could write a lua function userdata.strip that strips the 
leading and ending black spaces from a string, and then call


context(userdata.strip(buffers.getcontent('name)))

local s = [[

foo

bar


bar

]]

print(string.fullstrip(s))



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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-14 Thread Aditya Mahajan

On Tue, 14 Aug 2018, Rik Kabel wrote:

I really think, though, that a buffers.strip function would be the way to go, 
instead of futzing after the damage is done.


In lua, buffers.getcontent('name') gives the contents of the buffer 
labelled 'name'. You can post-process this in whatever way you want. For 
example, you could write a lua function userdata.strip that strips the 
leading and ending black spaces from a string, and then call


context(userdata.strip(buffers.getcontent('name)))

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-14 Thread Rik Kabel

On 8/13/2018 18:43, Rik Kabel wrote:

On 8/13/2018 15:52, Wolfgang Schuster wrote:



Rik Kabel schrieb am 13.08.18 um 20:27:

On 8/13/2018 13:46, Wolfgang Schuster wrote:


\starttext

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\startnarrower

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\stopnarrower

\stoptext

Wolfgang


I am applying it incorrectly, or it does not work with the buffers 
created by \grabbufferdata:


\setupwhitespace[none]
\setupindenting[none]
\starttexdefinition unexpanded startBufTest
  \bgroup
  \dosingleempty\dostartBufTest
\stoptexdefinition
\starttexdefinition dostartBufTest [#SETUPS]
  \getrawparameters[BufTest][xx=yy,#SETUPS]
  \grabbufferdata[TestBuffer][startBufTest][stopBufTest]
\stoptexdefinition
\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \BeforePar{\dontleavehmode\llap{? }}\GotoPar
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition



\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \dontleavehmode\llap{? }%
    \blank[overlay]
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition


Wolfgang


Thank you, Wolfgang. That does it. Note that the % escaping the line 
end is not needed (    although it might be needed outside a 
\starttexdefinition environment) – the following works as well:



\starttexdefinition stopBufTest

  \startnarrower[left,right]

  \startparagraph

    \dontleavehmode{\llap{? }}

    \blank[overlay]

    \inlinebuffer[TestBuffer]

  \stopparagraph

  \stopnarrower

  \egroup

\stoptexdefinition




Alas, this is not yet a workable solution. It does not work with a 
layout of grid=tolerant, which I am currently using (although it does 
work with some other grid settings). For now I will just add empty [] to 
the startBufTest invocations.


I really think, though, that a buffers.strip function would be the way 
to go, instead of futzing after the damage is done.


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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel

On 8/13/2018 15:52, Wolfgang Schuster wrote:



Rik Kabel schrieb am 13.08.18 um 20:27:

On 8/13/2018 13:46, Wolfgang Schuster wrote:


\starttext

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\startnarrower

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\stopnarrower

\stoptext

Wolfgang


I am applying it incorrectly, or it does not work with the buffers 
created by \grabbufferdata:


\setupwhitespace[none]
\setupindenting[none]
\starttexdefinition unexpanded startBufTest
  \bgroup
  \dosingleempty\dostartBufTest
\stoptexdefinition
\starttexdefinition dostartBufTest [#SETUPS]
  \getrawparameters[BufTest][xx=yy,#SETUPS]
  \grabbufferdata[TestBuffer][startBufTest][stopBufTest]
\stoptexdefinition
\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \BeforePar{\dontleavehmode\llap{? }}\GotoPar
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition



\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \dontleavehmode\llap{? }%
    \blank[overlay]
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition


Wolfgang


Thank you, Wolfgang. That does it. Note that the % escaping the line end 
is not needed (    although it might be needed outside a 
\starttexdefinition environment) – the following works as well:



   \starttexdefinition stopBufTest

  \startnarrower[left,right]

  \startparagraph

    \dontleavehmode{\llap{? }}

    \blank[overlay]

    \inlinebuffer[TestBuffer]

  \stopparagraph

  \stopnarrower

  \egroup

   \stoptexdefinition


--
Rik

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Wolfgang Schuster



Rik Kabel schrieb am 13.08.18 um 20:27:

On 8/13/2018 13:46, Wolfgang Schuster wrote:


\starttext

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\startnarrower

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\stopnarrower

\stoptext

Wolfgang


I am applying it incorrectly, or it does not work with the buffers 
created by \grabbufferdata:


\setupwhitespace[none]
\setupindenting[none]
\starttexdefinition unexpanded startBufTest
  \bgroup
  \dosingleempty\dostartBufTest
\stoptexdefinition
\starttexdefinition dostartBufTest [#SETUPS]
  \getrawparameters[BufTest][xx=yy,#SETUPS]
  \grabbufferdata[TestBuffer][startBufTest][stopBufTest]
\stoptexdefinition
\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
\BeforePar{\dontleavehmode\llap{? }}\GotoPar
\inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition



\starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
\dontleavehmode\llap{? }%
\blank[overlay]
\inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition


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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel

On 8/13/2018 13:46, Wolfgang Schuster wrote:


\starttext

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\startnarrower

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\stopnarrower

\stoptext

Wolfgang


I am applying it incorrectly, or it does not work with the buffers 
created by \grabbufferdata:


   \setupwhitespace[none]
   \setupindenting[none]
   \starttexdefinition unexpanded startBufTest
  \bgroup
  \dosingleempty\dostartBufTest
   \stoptexdefinition
   \starttexdefinition dostartBufTest [#SETUPS]
  \getrawparameters[BufTest][xx=yy,#SETUPS]
  \grabbufferdata[TestBuffer][startBufTest][stopBufTest]
   \stoptexdefinition
   \starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \BeforePar{\dontleavehmode\llap{? }}\GotoPar
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
   \stoptexdefinition

   \starttext

   \startBufTest
  Buffer without blank lines.
   \stopBufTest

   \startBufTest

  Buffer with blank lines.

   \stopBufTest

   \startBufTest[key=value]

  Buffer with \type{[key=value]}.

   \stopBufTest

   \stoptext

--

Rik

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel

On 8/13/2018 10:28, Rik Kabel wrote:
That works for the over-simplified case here, but fails in practice. 
For a \startnarrower[left] paragraph, the mark is still in the main 
margin, not the 'margin' of the narrowed paragraph. Also, the 
placement of the text in the margin is wrong and not easily controlled 
as with \llap and \rlap. The code started out more like:




Correcting the record: I misspoke in part above; margintext does follow 
the narrowed paragraph shape.


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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Wolfgang Schuster



Rik Kabel schrieb am 13.08.18 um 19:09:

On 8/13/2018 12:04, Wolfgang Schuster wrote:


Hi Rik,

what do you want to achieve and why do you need a buffer for it?

Wolfgang


Fair question.

I have a document with many (400+) block quotations. Each consists of 
a text extract, which may be prose or poetry, and additional optional 
components (alternate versions or transliterations, translations, 
attribution). The optional components are distinguished 
typographically – enlarged square brackets around alternate versions, 
enlarged parentheses around translations, leading en-dash and hanging 
indent for attributions. Each component is in a buffer. The structure 
looks like:


\startBlockQuotation[label=abc,authors={...},precis={short
extract},translators={...},tprecis={{short extract},{short
extract}}...]

\startExtract[language=agr,align=yes,font=abc,tolerance=...,...]

  text of extract

\stopExtract

\startTransliteration[language=en,align=yes,font=abc,...]

  text of transliteration

\stopTransliteration

\startTranslation[...]

  text of translation

\stopTranslation

\startAttribution[tolerance=,...]

  attribution of quotation

\stopAttribution

\stopBlockQuotation

and the code to handle it generates author index entries, a quotation 
precis index, and so on from the attributes of the envelope, and 
typesets each component based on the provided settings or defaults, 
placing the appropriate decorations around those components that call 
for them. The components are nestable, so one extract may contain 
another, and components can be used separately without the envelope 
(\startBlockQuotation or \startEpigraph) as well.


(I have written it this way to ease the move to an XML-based format 
for storing the quotations. I realize I am combining presentation 
elements, like label, tolerance, and precis, and content elements, 
like language, and some that may be either, like align and font, in 
the attributes, but will deal with that later.)


I prefer to leave blank lines around blocks of text and around macro 
commands, so:


\startparagraph

  some text

\stopparagraph

but when this is done with, for example, \startAttribution, and no 
optional arguments are provided, I run into the problem I have described.


Try to avoid blank lines at the begin/end of environments.

I realize that I can simply not include the blank line after 
\startAttribution. I would prefer, however, to see consistent parallel 
structures without having to distinguish them at the time it is 
written. Perhaps I am being too picky, but that is what I am attempting.


At this point, the \setupparagraphintro hack handles my needs, so I 
will proceed with that.


\starttext

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\startnarrower

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\stopnarrower

\stoptext

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel

On 8/13/2018 12:04, Wolfgang Schuster wrote:


Hi Rik,

what do you want to achieve and why do you need a buffer for it?

Wolfgang


Fair question.

I have a document with many (400+) block quotations. Each consists of a 
text extract, which may be prose or poetry, and additional optional 
components (alternate versions or transliterations, translations, 
attribution). The optional components are distinguished typographically 
– enlarged square brackets around alternate versions, enlarged 
parentheses around translations, leading en-dash and hanging indent for 
attributions. Each component is in a buffer. The structure looks like:


   \startBlockQuotation[label=abc,authors={...},precis={short
   extract},translators={...},tprecis={{short extract},{short extract}}...]

   \startExtract[language=agr,align=yes,font=abc,tolerance=...,...]

  text of extract

   \stopExtract

   \startTransliteration[language=en,align=yes,font=abc,...]

  text of transliteration

   \stopTransliteration

   \startTranslation[...]

  text of translation

   \stopTranslation

   \startAttribution[tolerance=,...]

  attribution of quotation

   \stopAttribution

   \stopBlockQuotation

and the code to handle it generates author index entries, a quotation 
precis index, and so on from the attributes of the envelope, and 
typesets each component based on the provided settings or defaults, 
placing the appropriate decorations around those components that call 
for them. The components are nestable, so one extract may contain 
another, and components can be used separately without the envelope 
(\startBlockQuotation or \startEpigraph) as well.


(I have written it this way to ease the move to an XML-based format for 
storing the quotations. I realize I am combining presentation elements, 
like label, tolerance, and precis, and content elements, like language, 
and some that may be either, like align and font, in the attributes, but 
will deal with that later.)


I prefer to leave blank lines around blocks of text and around macro 
commands, so:


   \startparagraph

  some text

   \stopparagraph

but when this is done with, for example, \startAttribution, and no 
optional arguments are provided, I run into the problem I have described.


I realize that I can simply not include the blank line after 
\startAttribution. I would prefer, however, to see consistent parallel 
structures without having to distinguish them at the time it is written. 
Perhaps I am being too picky, but that is what I am attempting.


At this point, the \setupparagraphintro hack handles my needs, so I will 
proceed with that.


--
Rik

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel

On 8/13/2018 10:28, Rik Kabel wrote:

On 8/13/2018 03:01, Hans Hagen wrote:

On 8/13/2018 5:18 AM, Rik Kabel wrote:

  \startparagraph

% \dontleavehmode\llap{\Mark}\inlinebuffer[TestBuffer]
% \ (first: \First, arg: \Arg)

    \margintext{\Mark}

    \setupparagraphintro[first][(first: \First, arg: \Arg)]
   %\setupparagraphintro[next][(first: \First, arg: \Arg)]

    \getbuffer[TestBuffer]

  \stopparagraph 


Hans,

That works for the over-simplified case here, but fails in practice. 
For a \startnarrower[left] paragraph, the mark is still in the main 
margin, not the 'margin' of the narrowed paragraph. Also, the 
placement of the text in the margin is wrong and not easily controlled 
as with \llap and \rlap. The code started out more like:


\define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }}
\setwidthof{\Mark}\to\MarkWidth
...
\starttexdefinition stopBufTest
  \startluacode
buffers.prepend("TestBuffer","\\dontleavehmode\\llap{\\Mark}")
  \stopluacode
  \setupnarrower[left=\MarkWidth]
  \startnarrower[left,right]
  \startparagraph
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition


So I am still looking for a way to do this. Meanwhile I am trying to 
understand Aditya's examples.


Turns out another answer was hidden in Hans's reply. The following seems 
to meet my needs, but it may complicate other use of 
\setupparagraphintro (which I don't recall seeing before), so it may not 
be a generic solution.


An empty string works fine instead of the llaped marking shown here.

This is a less dangerous hack than redefining \par, but still may fail 
in more complex documents when \setupparagraphintro is used elsewhere.


   \starttexdefinition stopBufTest
  \startnarrower[left,right]
  \startparagraph
    \setupparagraphintro[first][\llap{\Mark}]
    \inlinebuffer[TestBuffer] \ (first: \First, arg: \Arg)
  \stopparagraph
  \stopnarrower
  \egroup
   \stoptexdefinition


Thank you, Hans.

(For a non-hack generic solution that does not interfere with other use 
of \setupparagraphintro, surely there must be an easy way to apply 
string.strip to the buffer.)


--
Rik

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Wolfgang Schuster



Rik Kabel schrieb am 13.08.18 um 16:28:

Hans,

That works for the over-simplified case here, but fails in practice. 
For a \startnarrower[left] paragraph, the mark is still in the main 
margin, not the 'margin' of the narrowed paragraph. Also, the 
placement of the text in the margin is wrong and not easily controlled 
as with \llap and \rlap. The code started out more like:


\define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }}
\setwidthof{\Mark}\to\MarkWidth
...
\starttexdefinition stopBufTest
  \startluacode
buffers.prepend("TestBuffer","\\dontleavehmode\\llap{\\Mark}")
  \stopluacode
  \setupnarrower[left=\MarkWidth]
  \startnarrower[left,right]
  \startparagraph
\inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition



Hi Rik,

what do you want to achieve and why do you need a buffer for it?

Wolfgang

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Rik Kabel

On 8/13/2018 03:01, Hans Hagen wrote:

On 8/13/2018 5:18 AM, Rik Kabel wrote:

%% How can one remove blank lines at the start of a buffer so that
%%   commands that grab a buffer can be used in the same way as, for
%%   example, \startparagraph...\stopparagraph, which allow blank
%%   lines around the content?
%%
%% The problem appears when an optional argument is allowed but none
%%   is provided. Adding \relax does not help; adding empty brackets
%%   does. I see no way to distinguish between a buffer without
%%   leading blank lines and a buffer that was created when brackets
%%   are provided.
%%
%% \inlinebuffer handles the leading blank lines when there is
%%   nothing prepended, but I need to prepend. (It also handles the
%%   unwanted trailing line, but that is not an issue here).
%%
%% How can I unpack the buffer, apply the equivalent functions of
%%   ignorespaspaces and removeunwantedspaces to it, and repack it?
%%   The buffer may contain internal blank lines and macros, and
%%   those should be retained. Or, is there already a function to
%%   strip a buffer in the manner that string.strip does a string?

\setupwhitespace[none]
\setupindenting[none]
\define\Mark{\color[middlegray]{\itb¿\ }}
\define\First{nothing yet}
\define\Arg{nothing yet}
\setuplanguage[en][spacing=packed]

\starttexdefinition unexpanded startBufTest
   \bgroup
   \dosingleempty\dostartBufTest
\stoptexdefinition

\starttexdefinition dostartBufTest [#SETUPS]
   \doifsomethingelse{#{SETUPS}}
 {\define\Arg{yes}}
 {\define\Arg{no}}
   \iffirstargument
 \define\First{yes}
   \else
 \define\First{no}
   \fi
   \relax
   \getrawparameters[BufTest][xx=yy,#SETUPS]
   \grabbufferdata[TestBuffer][startBufTest][stopBufTest]
\stoptexdefinition

\starttexdefinition stopBufTest

   \startparagraph

 \dontleavehmode\llap{\Mark}\inlinebuffer[TestBuffer]
 \ (first: \First, arg: \Arg)

   \stopparagraph

   \egroup
\stoptexdefinition

\starttext

\startparagraph

   A starting paragraph.

\stopparagraph

\startBufTest
   Buffer without blank lines.
\stopBufTest

\startparagraph

   An intervening paragraph.

\stopparagraph

\startBufTest

   Buffer with blank lines.

\stopBufTest

\startparagraph

   An intervening paragraph.

\stopparagraph

\startBufTest\relax

   Buffer with \tex{relax}.

\stopBufTest

\startparagraph

   An intervening paragraph.

\stopparagraph

\startBufTest[]

   Buffer with \type{[]}.

\stopBufTest

\startparagraph

   An intervening paragraph.

\stopparagraph

\startBufTest[key=value]

   Buffer with \type{[key=value]}.

\stopBufTest

\startparagraph

   A closing paragraph.

\stopparagraph

\stoptext


  \startparagraph

% \dontleavehmode\llap{\Mark}\inlinebuffer[TestBuffer]
% \ (first: \First, arg: \Arg)

    \margintext{\Mark}

    \setupparagraphintro[first][(first: \First, arg: \Arg)]
   %\setupparagraphintro[next][(first: \First, arg: \Arg)]

    \getbuffer[TestBuffer]

  \stopparagraph 


Hans,

That works for the over-simplified case here, but fails in practice. For 
a \startnarrower[left] paragraph, the mark is still in the main margin, 
not the 'margin' of the narrowed paragraph. Also, the placement of the 
text in the margin is wrong and not easily controlled as with \llap and 
\rlap. The code started out more like:


   \define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }}
   \setwidthof{\Mark}\to\MarkWidth
   ...
   \starttexdefinition stopBufTest
  \startluacode
   buffers.prepend("TestBuffer","\\dontleavehmode\\llap{\\Mark}")
  \stopluacode
  \setupnarrower[left=\MarkWidth]
  \startnarrower[left,right]
  \startparagraph
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
   \stoptexdefinition


So I am still looking for a way to do this. Meanwhile I am trying to 
understand Aditya's examples.


--
Rik

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

Re: [NTG-context] How can I remove a blank leading line from a buffer

2018-08-13 Thread Hans Hagen

On 8/13/2018 5:46 AM, Henri Menke wrote:


% Ignore first \par
\def\par{\let\par\normalpar}
Sort of dangerous ... redefining such core commands or primitives can 
have side effects as one never knows what explicit \par's are issued.


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
___

  1   2   3   4   >