ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* dorecurse problem
@ 2017-01-20  3:34 Rik Kabel
  2017-01-20  5:46 ` Otared Kavian
  2017-01-20  7:59 ` Aditya Mahajan
  0 siblings, 2 replies; 7+ messages in thread
From: Rik Kabel @ 2017-01-20  3:34 UTC (permalink / raw)
  To: mailing list for ConTeXt users

ConTeXters,

When \dorecurse is active in the following MWE, the lines of text are 
overprinted. At least, this is the case for me, please confirm it for 
yourself. When \dorecurse is disabled, the lines print as they should, 
separately. Please tell me what I am doing wrong with this, if anything, 
and how to fix it. (Running ConTeXt  ver: 2017.01.17 17:37 MKIV beta  
fmt: 2017.1.19 on Win10 x64. There are no errors in the log.)

    \definelayer
      [blocks]
      [width=\textwidth,
       height=\textheight]

    \setupbackgrounds
      [page]
      [background=blocks]

    \starttext
      \dorecurse{1}{          % comment to clear error
        \startstandardmakeup
          \setlayerframed
            [blocks]
            [preset=lefttop,
             frame=off,
             align=right]{
            \startlines
              Line one on the left
              Line two on the left
            \stoplines
          }
          \setlayerframed
            [blocks]
            [preset=righttop,
             frame=off,
             align=flushright]{
            \startlines
              thgir eht no eno eniL
              thgir eht no owt eniL
            \stoplines
          }
        \stopstandardmakeup
      }                       % comment to clear error
    \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
___________________________________________________________________________________

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

* Re: dorecurse problem
  2017-01-20  3:34 dorecurse problem Rik Kabel
@ 2017-01-20  5:46 ` Otared Kavian
  2017-01-20  7:59 ` Aditya Mahajan
  1 sibling, 0 replies; 7+ messages in thread
From: Otared Kavian @ 2017-01-20  5:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users


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

Hi Rik,

I can confirm the behaviour you are reporting (even without \startstandardmakeup—\stopstandardmakeup, but adding a line of text in the document in order to have an output).
It seems that \dorecurse suppresses the passage to another line, since if one says \dorecurse{10} the texts in the framed layer are typeset ten times on the same line, as if the command \startlines were not there.

Best regards: OK

> On 20 Jan 2017, at 04:34, Rik Kabel <context@rik.users.panix.com> wrote:
> 
> ConTeXters,
> 
> When \dorecurse is active in the following MWE, the lines of text are overprinted. At least, this is the case for me, please confirm it for yourself. When \dorecurse is disabled, the lines print as they should, separately. Please tell me what I am doing wrong with this, if anything, and how to fix it. (Running ConTeXt  ver: 2017.01.17 17:37 MKIV beta  fmt: 2017.1.19 on Win10 x64. There are no errors in the log.)
> 
>   \definelayer
>     [blocks]
>     [width=\textwidth,
>      height=\textheight]
> 
>   \setupbackgrounds
>     [page]
>     [background=blocks]
> 
>   \starttext
>     \dorecurse{1}{          % comment to clear error
>       \startstandardmakeup
>         \setlayerframed
>           [blocks]
>           [preset=lefttop,
>            frame=off,
>            align=right]{
>           \startlines
>             Line one on the left
>             Line two on the left
>           \stoplines
>         }
>         \setlayerframed
>           [blocks]
>           [preset=righttop,
>            frame=off,
>            align=flushright]{
>           \startlines
>             thgir eht no eno eniL
>             thgir eht no owt eniL
>           \stoplines
>         }
>       \stopstandardmakeup
>     }                       % comment to clear error
>   \stoptext
> 
> -- 
> Rik


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

[-- Attachment #2: Type: text/plain, Size: 492 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
___________________________________________________________________________________

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

* Re: dorecurse problem
  2017-01-20  3:34 dorecurse problem Rik Kabel
  2017-01-20  5:46 ` Otared Kavian
@ 2017-01-20  7:59 ` Aditya Mahajan
  2017-01-20  9:08   ` Hans Hagen
  1 sibling, 1 reply; 7+ messages in thread
From: Aditya Mahajan @ 2017-01-20  7:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 19 Jan 2017, Rik Kabel wrote:

> ConTeXters,
>
> When \dorecurse is active in the following MWE, the lines of text are 
> overprinted. At least, this is the case for me, please confirm it for 
> yourself. When \dorecurse is disabled, the lines print as they should, 
> separately. Please tell me what I am doing wrong with this, if anything, 
> and how to fix it. (Running ConTeXt  ver: 2017.01.17 17:37 MKIV beta 
> fmt: 2017.1.19 on Win10 x64. There are no errors in the log.)

This has nothing to do with \dorecurse, but due to the fact that the 
argument of \dorecurse or any macro is parsed before the catcode changes 
introduced by \startlines come into effect. Here is a simpler example 
demonstrating similar behavior:

\def\test#1{#1}

\starttext
\test{Something
\startlines
Line one
Line two
\stoplines}
\stoptext

Depending on what you want to do, it should be possible to come up with a 
workaround.

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
___________________________________________________________________________________

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

* Re: dorecurse problem
  2017-01-20  7:59 ` Aditya Mahajan
@ 2017-01-20  9:08   ` Hans Hagen
  2017-01-20 16:42     ` Otared Kavian
  0 siblings, 1 reply; 7+ messages in thread
From: Hans Hagen @ 2017-01-20  9:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 1/20/2017 8:59 AM, Aditya Mahajan wrote:
> On Thu, 19 Jan 2017, Rik Kabel wrote:
>
>> ConTeXters,
>>
>> When \dorecurse is active in the following MWE, the lines of text are
>> overprinted. At least, this is the case for me, please confirm it for
>> yourself. When \dorecurse is disabled, the lines print as they should,
>> separately. Please tell me what I am doing wrong with this, if
>> anything, and how to fix it. (Running ConTeXt  ver: 2017.01.17 17:37
>> MKIV beta fmt: 2017.1.19 on Win10 x64. There are no errors in the log.)
>
> This has nothing to do with \dorecurse, but due to the fact that the
> argument of \dorecurse or any macro is parsed before the catcode changes
> introduced by \startlines come into effect. Here is a simpler example
> demonstrating similar behavior:
>
> \def\test#1{#1}
>
> \starttext
> \test{Something
> \startlines
> Line one
> Line two
> \stoplines}
> \stoptext
>
> Depending on what you want to do, it should be possible to come up with
> a workaround.

\startbuffer
   \startstandardmakeup
     \setlayerframed
       [blocks]
       [preset=lefttop,
        frame=off,
        align=right]{
       \startlines
         Line one on the left
         Line two on the left
       \stoplines
     }
     \setlayerframed
       [blocks]
       [preset=righttop,
        frame=off,
        align=flushright]{
       \startlines
         thgir eht no eno eniL
         thgir eht no owt eniL
       \stoplines
     }
   \stopstandardmakeup
\stopbuffer

     \dorecurse{1}{
         \getbuffer
     }

-----------------------------------------------------------------
                                           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] 7+ messages in thread

* Re: dorecurse problem
  2017-01-20  9:08   ` Hans Hagen
@ 2017-01-20 16:42     ` Otared Kavian
  2017-01-20 17:00       ` Rik Kabel
  0 siblings, 1 reply; 7+ messages in thread
From: Otared Kavian @ 2017-01-20 16:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Hans,

Unfortunately your workaround with \getbuffer does not produce the correct page: it gives only a blank page.

Thanks for your attention: OK

> On 20 Jan 2017, at 10:08, Hans Hagen <pragma@wxs.nl> wrote:
> 
> On 1/20/2017 8:59 AM, Aditya Mahajan wrote:
>> On Thu, 19 Jan 2017, Rik Kabel wrote:
>> 
>>> ConTeXters,
>>> 
>>> When \dorecurse is active in the following MWE, the lines of text are
>>> overprinted. At least, this is the case for me, please confirm it for
>>> yourself. When \dorecurse is disabled, the lines print as they should,
>>> separately. Please tell me what I am doing wrong with this, if
>>> anything, and how to fix it. (Running ConTeXt  ver: 2017.01.17 17:37
>>> MKIV beta fmt: 2017.1.19 on Win10 x64. There are no errors in the log.)
>> 
>> This has nothing to do with \dorecurse, but due to the fact that the
>> argument of \dorecurse or any macro is parsed before the catcode changes
>> introduced by \startlines come into effect. Here is a simpler example
>> demonstrating similar behavior:
>> 
>> \def\test#1{#1}
>> 
>> \starttext
>> \test{Something
>> \startlines
>> Line one
>> Line two
>> \stoplines}
>> \stoptext
>> 
>> Depending on what you want to do, it should be possible to come up with
>> a workaround.
> 
> \startbuffer
>  \startstandardmakeup
>    \setlayerframed
>      [blocks]
>      [preset=lefttop,
>       frame=off,
>       align=right]{
>      \startlines
>        Line one on the left
>        Line two on the left
>      \stoplines
>    }
>    \setlayerframed
>      [blocks]
>      [preset=righttop,
>       frame=off,
>       align=flushright]{
>      \startlines
>        thgir eht no eno eniL
>        thgir eht no owt eniL
>      \stoplines
>    }
>  \stopstandardmakeup
> \stopbuffer
> 
>    \dorecurse{1}{
>        \getbuffer
>    }
> 
> -----------------------------------------------------------------
>                                          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
> ___________________________________________________________________________________

___________________________________________________________________________________
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] 7+ messages in thread

* Re: dorecurse problem
  2017-01-20 16:42     ` Otared Kavian
@ 2017-01-20 17:00       ` Rik Kabel
  2017-01-20 17:06         ` Otared Kavian
  0 siblings, 1 reply; 7+ messages in thread
From: Rik Kabel @ 2017-01-20 17:00 UTC (permalink / raw)
  To: ntg-context

On 2017-01-20 11:42, Otared Kavian wrote:
> Hi Hans,
>
> Unfortunately your workaround with \getbuffer does not produce the correct page: it gives only a blank page.
>
> Thanks for your attention: OK
>
>> On 20 Jan 2017, at 10:08, Hans Hagen <pragma@wxs.nl> wrote:
>>
>> On 1/20/2017 8:59 AM, Aditya Mahajan wrote:
>>> On Thu, 19 Jan 2017, Rik Kabel wrote:
>>>
>>>> ConTeXters,
>>>>
>>>> When \dorecurse is active in the following MWE, the lines of text are
>>>> overprinted. At least, this is the case for me, please confirm it for
>>>> yourself. When \dorecurse is disabled, the lines print as they should,
>>>> separately. Please tell me what I am doing wrong with this, if
>>>> anything, and how to fix it. (Running ConTeXt  ver: 2017.01.17 17:37
>>>> MKIV beta fmt: 2017.1.19 on Win10 x64. There are no errors in the log.)
>>> This has nothing to do with \dorecurse, but due to the fact that the
>>> argument of \dorecurse or any macro is parsed before the catcode changes
>>> introduced by \startlines come into effect. Here is a simpler example
>>> demonstrating similar behavior:
>>>
>>> \def\test#1{#1}
>>>
>>> \starttext
>>> \test{Something
>>> \startlines
>>> Line one
>>> Line two
>>> \stoplines}
>>> \stoptext
>>>
>>> Depending on what you want to do, it should be possible to come up with
>>> a workaround.
>> \startbuffer
>>   \startstandardmakeup
>>     \setlayerframed
>>       [blocks]
>>       [preset=lefttop,
>>        frame=off,
>>        align=right]{
>>       \startlines
>>         Line one on the left
>>         Line two on the left
>>       \stoplines
>>     }
>>     \setlayerframed
>>       [blocks]
>>       [preset=righttop,
>>        frame=off,
>>        align=flushright]{
>>       \startlines
>>         thgir eht no eno eniL
>>         thgir eht no owt eniL
>>       \stoplines
>>     }
>>   \stopstandardmakeup
>> \stopbuffer
>>
>>     \dorecurse{1}{
>>         \getbuffer
>>     }
>>
>>
>> ___________________________________________________________________________________

Hans and Aditya,

Thank you for the explanation and the workaround.

Otared,

I am not sure what you are doing, but if you are using only the code 
snippet that Hans posted, you will get a blank page. You have to define 
the layer and page background in addition to Hans' snippet.

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

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

* Re: dorecurse problem
  2017-01-20 17:00       ` Rik Kabel
@ 2017-01-20 17:06         ` Otared Kavian
  0 siblings, 0 replies; 7+ messages in thread
From: Otared Kavian @ 2017-01-20 17:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


> On 20 Jan 2017, at 18:00, Rik Kabel <context@rik.users.panix.com> wrote:
> […]
> 
> Otared,
> 
> I am not sure what you are doing, but if you are using only the code snippet that Hans posted, you will get a blank page. You have to define the layer and page background in addition to Hans' snippet.

Oh yes… sorry, I am ashamed :-(
I just put the code sent by Hans below your’s, and then commented out your code, including the definition of layers and backgounds…

Indeed everything works as expected with a buffer.

Best regards: OK
___________________________________________________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2017-01-20 17:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20  3:34 dorecurse problem Rik Kabel
2017-01-20  5:46 ` Otared Kavian
2017-01-20  7:59 ` Aditya Mahajan
2017-01-20  9:08   ` Hans Hagen
2017-01-20 16:42     ` Otared Kavian
2017-01-20 17:00       ` Rik Kabel
2017-01-20 17:06         ` Otared Kavian

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