ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Rik Kabel <context@rik.users.panix.com>
To: ntg-context@ntg.nl
Subject: Re: How can I remove a blank leading line from a buffer
Date: Tue, 14 Aug 2018 10:46:44 -0400	[thread overview]
Message-ID: <e3a3d5e8-26c1-a025-000c-1602e5c8ef40@rik.users.panix.com> (raw)
In-Reply-To: <6b29bc65-feca-a29a-8300-c9b447076985@rik.users.panix.com>


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

On 8/13/2018 18:43, Rik Kabel wrote:
> On 8/13/2018 15:52, Wolfgang Schuster wrote:
>>
>>
>> Rik Kabel schrieb am 13.08.18 um 20:27:
>>> On 8/13/2018 13:46, Wolfgang Schuster wrote:
>>>>
>>>> \starttext
>>>>
>>>> \BeforePar{\dontleavehmode\llap{? }}\GotoPar
>>>>
>>>> \input knuth
>>>>
>>>> \startnarrower
>>>>
>>>> \BeforePar{\dontleavehmode\llap{? }}\GotoPar
>>>>
>>>> \input knuth
>>>>
>>>> \stopnarrower
>>>>
>>>> \stoptext
>>>>
>>>> Wolfgang
>>>
>>> I am applying it incorrectly, or it does not work with the buffers 
>>> created by \grabbufferdata:
>>>
>>>     \setupwhitespace[none]
>>>     \setupindenting[none]
>>>     \starttexdefinition unexpanded startBufTest
>>>       \bgroup
>>>       \dosingleempty\dostartBufTest
>>>     \stoptexdefinition
>>>     \starttexdefinition dostartBufTest [#SETUPS]
>>>       \getrawparameters[BufTest][xx=yy,#SETUPS]
>>>       \grabbufferdata[TestBuffer][startBufTest][stopBufTest]
>>>     \stoptexdefinition
>>>     \starttexdefinition stopBufTest
>>>       \startnarrower[left,right]
>>>       \startparagraph
>>>         \BeforePar{\dontleavehmode\llap{? }}\GotoPar
>>>         \inlinebuffer[TestBuffer]
>>>       \stopparagraph
>>>       \stopnarrower
>>>       \egroup
>>>     \stoptexdefinition
>>>
>>
>> \starttexdefinition stopBufTest
>>   \startnarrower[left,right]
>>   \startparagraph
>>     \dontleavehmode\llap{? }%
>>     \blank[overlay]
>>     \inlinebuffer[TestBuffer]
>>   \stopparagraph
>>   \stopnarrower
>>   \egroup
>> \stoptexdefinition
>>
>>
>> Wolfgang
>
> Thank you, Wolfgang. That does it. Note that the % escaping the line 
> end is not needed (    although it might be needed outside a 
> \starttexdefinition environment) – the following works as well:
>
>
>     \starttexdefinition stopBufTest
>
>       \startnarrower[left,right]
>
>       \startparagraph
>
>         \dontleavehmode{\llap{? }}
>
>         \blank[overlay]
>
>         \inlinebuffer[TestBuffer]
>
>       \stopparagraph
>
>       \stopnarrower
>
>       \egroup
>
>     \stoptexdefinition
>
>

Alas, this is not yet a workable solution. It does not work with a 
layout of grid=tolerant, which I am currently using (although it does 
work with some other grid settings). For now I will just add empty [] to 
the startBufTest invocations.

I really think, though, that a buffers.strip function would be the way 
to go, instead of futzing after the damage is done.

-- 
Rik

[-- Attachment #1.2: Type: text/html, Size: 4743 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
___________________________________________________________________________________

  reply	other threads:[~2018-08-14 14:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13  3:18 Rik Kabel
2018-08-13  3:44 ` Aditya Mahajan
2018-08-13  3:46 ` Henri Menke
2018-08-13  7:02   ` Hans Hagen
2018-08-13  7:01 ` Hans Hagen
2018-08-13 14:28   ` Rik Kabel
2018-08-13 16:04     ` Wolfgang Schuster
2018-08-13 17:09       ` Rik Kabel
2018-08-13 17:46         ` Wolfgang Schuster
2018-08-13 18:27           ` Rik Kabel
2018-08-13 19:52             ` Wolfgang Schuster
2018-08-13 22:43               ` Rik Kabel
2018-08-14 14:46                 ` Rik Kabel [this message]
2018-08-15  3:31                   ` Aditya Mahajan
2018-08-15  7:07                     ` Hans Hagen
2018-08-15 21:46                       ` Rik Kabel
2018-08-16 14:55                         ` Aditya Mahajan
2018-08-16 20:02                           ` Rik
2018-08-13 16:15     ` Rik Kabel
2018-08-13 17:51     ` Rik Kabel

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=e3a3d5e8-26c1-a025-000c-1602e5c8ef40@rik.users.panix.com \
    --to=context@rik.users.panix.com \
    --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).