From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101562 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: How can I remove a blank leading line from a buffer Date: Mon, 13 Aug 2018 18:04:12 +0200 Message-ID: <1bcbc82c-b9e3-4055-8e18-4786cdd8cc68@gmail.com> References: <1cd49a92-b6c9-0c48-d148-c863a503a809@xs4all.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8117858443142925455==" X-Trace: blaine.gmane.org 1534176161 3869 195.159.176.226 (13 Aug 2018 16:02:41 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2018 16:02:41 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 PostboxApp/6.1.1 To: mailing list for ConTeXt users , Rik Kabel Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 13 18:02:37 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fpFIj-0000tC-2w for gctc-ntg-context-518@m.gmane.org; Mon, 13 Aug 2018 18:02:37 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 4C6EB50299; Mon, 13 Aug 2018 18:04:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OsE8ukKn0Z4t; Mon, 13 Aug 2018 18:04:27 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 97F8C5032F; Mon, 13 Aug 2018 18:04:27 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id ABAB050332 for ; Mon, 13 Aug 2018 18:04:26 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hCX7xnS__utZ for ; Mon, 13 Aug 2018 18:04:26 +0200 (CEST) Original-Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 45A515032F for ; Mon, 13 Aug 2018 18:04:16 +0200 (CEST) Original-Received: by mail-ed1-f42.google.com with SMTP id f23-v6so8526906edr.11 for ; Mon, 13 Aug 2018 09:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=amj973jJQQImQv34fOgyhc2kAmJIAPBNeeURNa2LHGQ=; b=PIU8f7L+eQdtPTHRA5L7p9rQwN3MINj+2zlN1p+W0Wdwyub6WFYZ56dJ8hW8lKl1YA kLPVsAgdAMC18bcfR7SEpMnfHrZZWDyMKz7DPixagt5JnhAvlvn3D6fkSI/4+gwkgMTk BmRiBLlInDUIBXXmKXjOBVczVEmg3UhE1UTZW9LTc9mmzkqcidt9TCssenMLPelnGoqP 9TKQ8nRkBg769RdS8ApJn3l2HlqZiCFByF3+Mj7LV5KZMpe00Bz8dAJNgc/c1vkekFZ/ IHptNlOGQd3c1mq+s4diLrOHHJKTsnPKP6eAOhWZkZjeOZF735yz+jG/ASjNx1Z6WCHF CT0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=amj973jJQQImQv34fOgyhc2kAmJIAPBNeeURNa2LHGQ=; b=OMs10TgxxuL1WKUZVh+9qp8R0zYERMn/KPpvH97Gylyc3Z/8JFqp786KdVWMxKQFkH 7NwSYptjMDhvIsciMufELV6YneN9dm53R1segkxFtjpIQUlZseKqdBJdoK5QzwTg0e94 /uC5L870f+Iot8ywK74jFcAB5F5t5G3/kF0nAGfKTgYCcrLMi1S0ooVyj603Im6hh8HI Sp+z/IUeARvai9RhPw48VUQt7TJ8H1YfxAdNyIzJRDE3NdfaU4APsGM94cWfmapff60B l/2zgir6/HU122GYkaSwZPuos2XAZsOfcApuISrsB1xtfr8rda3k6jUM2FTnFVC4aM5P Fy6A== X-Gm-Message-State: AOUpUlGCSDg7DOCJmqqmHcdFDGZVBSUr3MhLg25O7YdeJLmBGfltEFx+ 1ozSU020k93gjmFXJqHkICxbKZCE X-Google-Smtp-Source: AA+uWPy4mFxoBRCnu3fQh3Ulzh3gJqvhwSQTG+qaPiYAoKSCvTnx1XJAWVOLPV5VKgK7GrKvkMi5lA== X-Received: by 2002:a50:8406:: with SMTP id 6-v6mr22828126edp.97.1534176256027; Mon, 13 Aug 2018 09:04:16 -0700 (PDT) Original-Received: from [192.168.1.11] (x4dbd8157.dyn.telefonica.de. [77.189.129.87]) by smtp.gmail.com with ESMTPSA id a15-v6sm19842015edd.47.2018.08.13.09.04.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 09:04:14 -0700 (PDT) In-Reply-To: Content-Language: en-US X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:101562 Archived-At: This is a multi-part message in MIME format. --===============8117858443142925455== Content-Type: multipart/alternative; boundary="------------7158551DAC29194C8CE2ED8C" Content-Language: en-US This is a multi-part message in MIME format. --------------7158551DAC29194C8CE2ED8C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Rik Kabel schrieb am 13.08.18 um 16:28: > Hans, > > That works for the over-simplified case here, but fails in practice. > For a \startnarrower[left] paragraph, the mark is still in the main > margin, not the 'margin' of the narrowed paragraph. Also, the > placement of the text in the margin is wrong and not easily controlled > as with \llap and \rlap. The code started out more like: > > \define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }} > \setwidthof{\Mark}\to\MarkWidth > ... > \starttexdefinition stopBufTest > \startluacode > buffers.prepend("TestBuffer","\\dontleavehmode\\llap{\\Mark}") > \stopluacode > \setupnarrower[left=\MarkWidth] > \startnarrower[left,right] > \startparagraph > \inlinebuffer[TestBuffer] > \stopparagraph > \stopnarrower > \egroup > \stoptexdefinition > Hi Rik, what do you want to achieve and why do you need a buffer for it? Wolfgang --------------7158551DAC29194C8CE2ED8C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Rik Kabel schrieb am 13.08.18 um 16:28:
Hans,

That works for the over-simplified case here, but fails in practice. For a \startnarrower[left] paragraph, the mark is still in the main margin, not the 'margin' of the narrowed paragraph. Also, the placement of the text in the margin is wrong and not easily controlled as with \llap and \rlap. The code started out more like:

\define\Mark{\color[middlegray]{\hskip.6cm\itb¿\ }}
\setwidthof{\Mark}\to\MarkWidth
...
\starttexdefinition stopBufTest
  \startluacode
      buffers.prepend("TestBuffer","\\dontleavehmode\\llap{\\Mark}")
  \stopluacode
  \setupnarrower[left=\MarkWidth]
  \startnarrower[left,right]
  \startparagraph
    \inlinebuffer[TestBuffer]
  \stopparagraph
  \stopnarrower
  \egroup
\stoptexdefinition

Hi Rik,

what do you want to achieve and why do you need a buffer for it?

Wolfgang

--------------7158551DAC29194C8CE2ED8C-- --===============8117858443142925455== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============8117858443142925455==--