ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Philipp Gesang <gesang@stud.uni-heidelberg.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: [beta] anch-pos.lua
Date: Thu, 16 Feb 2012 19:01:42 +0100	[thread overview]
Message-ID: <20120216180142.GA16002@phlegethon> (raw)
In-Reply-To: <4F3CC994.1090509@wxs.nl>


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

On 2012-02-16 10:17, Hans Hagen wrote:
> Hi,
> 
> I uploaded a beta. Apart from some fixes, the biggest change is in
> dealing with positional info and text backgrounds (first stage
> cleanup).  As I have no clue to what extend users mess around with
> background graphics themselves, it's hard to predict side effects,
> but the biggest impact is speed. The adventurous might want to try
> out

Hi Hans,

there seems to be a typo in anch-pos.lua, line 100:

·································································
-            local r = collected[region]
+            local r = collected[tag]
·································································

(“region” references a boolean.)

Here’s an example that triggers the bug and works after the
patch is applied. I have no idea as to why this exact series of
macros causes the issue. Please have a look at it anyways because
the text background looks weird even after.

·································································
\definetextbackground[tb]
\setuptyping[
  after={\stoptextbackground},
  before={\starttextbackground[tb]},
]

\starttext

foo
\starttyping
bar
\stoptyping
baz

\starttabulate[|r|l|]
  \NC  foo \NC bar \AR
\stoptabulate%

\stoptext
·································································

Regards
Philipp




> 
> \setuptextbackground
>   [mp=mpos:par:region,
>    method=mpos:par:region]
> 
> or with some more visual tracing
> 
> \setuptextbackground
>   [mp=mpos:par:region:kind,
>    method=mpos:par:region]
> 
> A simple test with some 200 backgrounds brings down runtime with one
> second on my machine (not the fastest anyway).
> 
> Apart from a performance gain, backgrounds are now also supported in
> regular multicolumns as well as in some specific mechanisms like
> tabulate and xtables. In xtables one needs to set region=yes in
> order to get the desired results. Actually, the region key is a new
> one in framed so anything that can be framed can also have fancy
> text  backgrounds.
> 
> Yet another improvement is that (although rather untested) you can
> do things like
> 
>     \starttextbackground[r] START
>     \dorecurse{10}{
>         \dorecurse{1}{\input ward }
>         \placefigure[right]{}{}
>         some text before BEGIN \dorecurse{2}{\input ward } END some after
>         \placefigure[left]{}{}
>         some text before BEGIN \dorecurse{2}{\input ward } END some after
>         \placefigure[right]{}{}
>         some text before BEGIN \dorecurse{2}{\input ward } END some after
>     }
>     STOP \stoptextbackground
>     \dorecurse{1}{\input ward }
> 
> and get more or less expected results. Keep in mind that it can
> never get perfect due to all kind of possible interference. Also,
> keep away from internals as they will quite certainly change.
> 
> Hans
> 
> 
> 
> -----------------------------------------------------------------
>                                           Hans Hagen | PRAGMA ADE
>               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                              | 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

[-- Attachment #1.2: Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2012-02-16 18:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-16  9:17 beta Hans Hagen
2012-02-16 13:53 ` beta Otared Kavian
2012-02-16 17:32   ` beta Hans Hagen
2012-02-16 16:44 ` beta Otared Kavian
2012-02-16 18:30   ` beta Wolfgang Schuster
2012-02-16 20:23     ` beta Otared Kavian
2012-02-16 22:10     ` beta Hans Hagen
2012-02-16 18:01 ` Philipp Gesang [this message]
2012-02-16 21:44   ` [beta] anch-pos.lua Hans Hagen
2012-02-17  1:05     ` Philipp Gesang
2012-02-17  8:50       ` Hans Hagen

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=20120216180142.GA16002@phlegethon \
    --to=gesang@stud.uni-heidelberg.de \
    --cc=ntg-context@ntg.nl \
    /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).