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

[NTG-context] Custom list layout with PDF bookmarks

2020-05-15 Thread Bruce Horrocks
When I customise the table of contents layout I lose the automatic hyperlinks. 
Is there a simple configuration option that I have missed or do I need to 
create my own links somehow?

Example:

\setupinteraction[state=start]
\setupinteractionscreen[option=bookmark] 

\define[3]\SectionListEntry
  {\par \leftaligned\bgroup
 \hbox to 2em{#3}%
 \hskip   1em
 \vtop{\hsize\dimexpr\textwidth-3em\relax#2}
  \egroup \par}

% Comment out this next line to regain section hyperlinks in the ToC
\setuplist[section][alternative=command,command=\SectionListEntry]

\starttext
Table of Contents
\placecontent[criterium=all]
\placebookmarks[chapter,subject]

\chapter{Tufte}
\section{Section 1}
\input tufte
\page
\section{Section 2}
\input tufte
\page
\section{Section 3}
\input tufte
\page
\stoptext


Thanks in advance.
--
Bruce Horrocks
Hampshire, UK

___
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] --nodates not working

2020-05-15 Thread Pablo Rodriguez
Dear list,

the “LuaMeTaTeX Reference Manual” describes that the command line
argument "--nodates" removes time dependent information in the output file.

I’m afraid it doesn’t work. "\enabledirectives[backend.date=no]" doesn’t
work either.

This is really useful to be able to generate the exact PDF output (from
a hashing point of view).

Am I missing something or have I hit a bug?

Many thanks for your help,

Pablo
--
http://www.ousia.tk
___
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
___