ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Joey McCollum <jmccollum20140511@gmail.com>
To: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Blank page added after pagecolumns
Date: Sat, 16 May 2020 09:31:38 -0400	[thread overview]
Message-ID: <CAGxRUG_iQ84d+4T-ru-CAUpwwa3b2=Mt-PnfxB8MBODGqLnfaA@mail.gmail.com> (raw)
In-Reply-To: <e01f3dcc-5586-8501-d7ce-73efe371c0a2@gmail.com>


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

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.lists@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
>

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

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

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

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

      reply	other threads:[~2020-05-16 13:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 17:40 Joey McCollum
2020-05-02 15:46 ` Joey McCollum
2020-05-04 18:45   ` Joey McCollum
2020-05-11  0:34     ` Thangalin
2020-05-14 21:03       ` Joey McCollum
2020-05-16  3:45         ` Joey McCollum
2020-05-16  8:12           ` Wolfgang Schuster
2020-05-16 13:31             ` Joey McCollum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGxRUG_iQ84d+4T-ru-CAUpwwa3b2=Mt-PnfxB8MBODGqLnfaA@mail.gmail.com' \
    --to=jmccollum20140511@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=wolfgang.schuster.lists@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).