ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Space before/after combinations + centring
@ 2021-11-17 15:54 Marco Patzer via ntg-context
  2021-11-17 19:17 ` Wolfgang Schuster via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Marco Patzer via ntg-context @ 2021-11-17 15:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco Patzer

Hi!

I'm in the process of converting some projects to LMTX. Combinations
lacking “”before” and “after” keys (that place content before/after
the *entire* combination, rather than the individual cell pairs), I
came up with the following ugliness – which worked for longer than
it deserved:

\unprotect

\unexpanded\def\startcombination
  {\blank[halfline]%%
   \startalignment[middle]%%
   \dontleavehmode
   \bgroup
   \pack_combinations_push
   \dodoubleempty\pack_combinations_start}

\unexpanded\def\stopcombination
  {\bgroup\normalexpanded{\egroup{}\ntimes{{}{}}\c_pack_combinations_y}% brr
   \dostoptagged
   \egroup
   \pack_combinations_pop
   \egroup
   \stopalignment
   \goodbreak\blank[halfline]}

\protect

\starttext
  \startcombination [2*2]
    \startcontent foo \stopcontent \startcaption 1 \stopcaption
    \startcontent bar \stopcontent \startcaption 2 \stopcaption
  \stopcombination
\stoptext

I added vertical spacing and mid-aligned the content without having
to change the sources, that was the idea. However, this fails in
LMTX:

  Undefined control sequence \pack_combinations_start

Does LMTX offer finer control over the combinations or do I have to
rewrite the sources files (to either use floats or surround the
combinations with the required commands)?

Marco

LMTX: current version: 2021.11.16 22:36
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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

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

* Re: Space before/after combinations + centring
  2021-11-17 15:54 Space before/after combinations + centring Marco Patzer via ntg-context
@ 2021-11-17 19:17 ` Wolfgang Schuster via ntg-context
  2021-11-17 22:50   ` Marco Patzer via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2021-11-17 19:17 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Marco Patzer via ntg-context
  Cc: Wolfgang Schuster

Marco Patzer via ntg-context schrieb am 17.11.2021 um 16:54:
> Hi!
>
> I'm in the process of converting some projects to LMTX. Combinations
> lacking “”before” and “after” keys (that place content before/after
> the *entire* combination, rather than the individual cell pairs), I
> came up with the following ugliness – which worked for longer than
> it deserved:
>
> [...]
>
> I added vertical spacing and mid-aligned the content without having
> to change the sources, that was the idea. However, this fails in
> LMTX:
>
>    Undefined control sequence \pack_combinations_start
>
> Does LMTX offer finer control over the combinations or do I have to
> rewrite the sources files (to either use floats or surround the
> combinations with the required commands)?

1. Your changes don't work anymore because LMTX handles optional 
arguments in a different way than MkIV. As a result of this change a few 
commands have disappeared.

2. There are no changes to adjust the vertical before and after a 
combination environment. Local patches can also be tricky because 
ConTeXt tries to freeze the definitions of many user level commands 
which means they can't be redefined when you use a strict overload mode 
(look at the lowlevel security manual for this feature).

The most reliable way to center you combination blocks is to put them 
either in a float or put a framedtext environment around 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
___________________________________________________________________________________

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

* Re: Space before/after combinations + centring
  2021-11-17 19:17 ` Wolfgang Schuster via ntg-context
@ 2021-11-17 22:50   ` Marco Patzer via ntg-context
  2021-11-18  7:57     ` Hans Hagen via ntg-context
  0 siblings, 1 reply; 4+ messages in thread
From: Marco Patzer via ntg-context @ 2021-11-17 22:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Marco Patzer

On Wed, 17 Nov 2021 20:17:52 +0100
Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:

> 2. There are no changes to adjust the vertical before and after a
> combination environment.

That's unfortunate.

> Local patches can also be tricky because ConTeXt tries to freeze
> the definitions of many user level commands which means they can't
> be redefined when you use a strict overload mode (look at the
> lowlevel security manual for this feature).

An overload like mine is probably exactly what the strict overload
mode is supposed to protect against.

> The most reliable way to center you combination blocks is to put
> them either in a float or put a framedtext environment around it.

The project comprises several hundred source files. That's why I
stayed away from rewriting the sources in the first place. I'll try
to bulk-change the sources.

Thanks for your explanations.

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

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

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

* Re: Space before/after combinations + centring
  2021-11-17 22:50   ` Marco Patzer via ntg-context
@ 2021-11-18  7:57     ` Hans Hagen via ntg-context
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen via ntg-context @ 2021-11-18  7:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Hans Hagen

On 11/17/2021 11:50 PM, Marco Patzer via ntg-context wrote:
> On Wed, 17 Nov 2021 20:17:52 +0100
> Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
> 
>> 2. There are no changes to adjust the vertical before and after a
>> combination environment.
> 
> That's unfortunate.
> 
>> Local patches can also be tricky because ConTeXt tries to freeze
>> the definitions of many user level commands which means they can't
>> be redefined when you use a strict overload mode (look at the
>> lowlevel security manual for this feature).
> 
> An overload like mine is probably exactly what the strict overload
> mode is supposed to protect against.
> 
>> The most reliable way to center you combination blocks is to put
>> them either in a float or put a framedtext environment around it.
> 
> The project comprises several hundred source files. That's why I
> stayed away from rewriting the sources in the first place. I'll try
> to bulk-change the sources.
combinations are really just a way to package things, not meant for 
direct usage in the page flow

\startlinecorrection[blank]
...
\stoplinecorrection

is one way to use them, or in floats; the same is true for natural tables

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

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

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

end of thread, other threads:[~2021-11-18  7:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 15:54 Space before/after combinations + centring Marco Patzer via ntg-context
2021-11-17 19:17 ` Wolfgang Schuster via ntg-context
2021-11-17 22:50   ` Marco Patzer via ntg-context
2021-11-18  7:57     ` Hans Hagen via ntg-context

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