From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101566 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 19:46:07 +0200 Message-ID: <01b9ac7b-89d5-7c9d-5b26-4895e37017c5@gmail.com> References: <1cd49a92-b6c9-0c48-d148-c863a503a809@xs4all.nl> <1bcbc82c-b9e3-4055-8e18-4786cdd8cc68@gmail.com> <0adfd084-48ce-f956-383b-3265ed4b5fee@rik.users.panix.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============3041051950025066614==" X-Trace: blaine.gmane.org 1534182272 6320 195.159.176.226 (13 Aug 2018 17:44:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2018 17:44:32 +0000 (UTC) User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 PostboxApp/6.1.1 Cc: mailing list for ConTeXt users To: Rik Kabel Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 13 19:44:27 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 1fpGtH-0001Wr-AX for gctc-ntg-context-518@m.gmane.org; Mon, 13 Aug 2018 19:44:27 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 652C850172; Mon, 13 Aug 2018 19:46:23 +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 KaCR76hr_qeR; Mon, 13 Aug 2018 19:46:22 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A16AA50187; Mon, 13 Aug 2018 19:46:22 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8B47E50187 for ; Mon, 13 Aug 2018 19:46:21 +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 fPCiclGuSwdK for ; Mon, 13 Aug 2018 19:46:21 +0200 (CEST) Original-Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) (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 14C5F50172 for ; Mon, 13 Aug 2018 19:46:11 +0200 (CEST) Original-Received: by mail-ed1-f65.google.com with SMTP id t2-v6so8700030edr.5 for ; Mon, 13 Aug 2018 10:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=zkvpvCzbCzfofcDen0JGdmSGOHZWY4l2LlSIxPWXUOU=; b=HVLvwx+MbpIH9GWCEZLExEQpblRg8HGhA3RW1LAf8wybzQYExKHctrhMSqId5R5XQk ftEl74RDqeOUR1uPZYvP1FNLjgs7MYmdcAkcStoD/wxlvlSZlKzqbykHBH4HQkcuEXtQ ZVoA8xnfouV5YREbt/TDdS841lSrc06U2I2Srth4lPUArAyve+tVHUwUEQFlYA82ImJc dLHF5fmksjbf6odHbdUM1HT1gv8C8ZWjo8hZu0zqihXhWvloQjOxrB7Rs7UMrFdw8vZ9 ZDGXHz0a72Km9sXiiuucBnWVcNpyogPwMrzz0+kwf1vVtseHb8idFzBOq87EcY1XlRhf nN3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=zkvpvCzbCzfofcDen0JGdmSGOHZWY4l2LlSIxPWXUOU=; b=CGI7g/3+ar8sdrW8GItMLpT1zQujHVk2t0az//qxsEevTOH6n2cbOW2OeQ9DYr7hDp t//PC0QopTEr9Y+vZ0T/866/0+p9qnLGstg7uTfqzhU25dIb3svXZXMPgNttzUC+vYMd 0t6l/UEThcmC5URuff/kWUq52PNIDgIms3iw8yJ/VCreGakhq4NW8t5+QSMgjW1ZeF62 f/1tzS11RDzOSGoZ8bwL0h46R9gNGEcEvbdHYDL7fFS0J2OEguMBabx6rAaE2TSaxH/a 6vmBMkyi/NZlRs3hGHdLpmE2/FoCjYUJRwEd/nEayfDiHA89nw0rARGtaGudwUwPZQFh Alfw== X-Gm-Message-State: AOUpUlForo5gLa8t+EJA6p/D6K1Mx8WhCPmSnEF1d0Daw2VKLqtsaShF 24kEyNHVwBVXOMu63T03uv2LwlBZ X-Google-Smtp-Source: AA+uWPwLHdG26EMynjfGrdwmXyWpzSxLSlllNhuBLGNJtjJ91CPFvxFDpk9xgdrK+cfE+FC0Op+MSQ== X-Received: by 2002:a50:8466:: with SMTP id 93-v6mr23991197edp.304.1534182370241; Mon, 13 Aug 2018 10:46:10 -0700 (PDT) Original-Received: from [192.168.1.11] (x4dbd8157.dyn.telefonica.de. [77.189.129.87]) by smtp.gmail.com with ESMTPSA id x13-v6sm27113211edx.17.2018.08.13.10.46.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Aug 2018 10:46:09 -0700 (PDT) In-Reply-To: <0adfd084-48ce-f956-383b-3265ed4b5fee@rik.users.panix.com> 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:101566 Archived-At: This is a multi-part message in MIME format. --===============3041051950025066614== Content-Type: multipart/alternative; boundary="------------C12BCA4901783FDB23D03A9E" Content-Language: en-US This is a multi-part message in MIME format. --------------C12BCA4901783FDB23D03A9E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Rik Kabel schrieb am 13.08.18 um 19:09: > On 8/13/2018 12:04, Wolfgang Schuster wrote: >> >> Hi Rik, >> >> what do you want to achieve and why do you need a buffer for it? >> >> Wolfgang >> > Fair question. > > I have a document with many (400+) block quotations. Each consists of > a text extract, which may be prose or poetry, and additional optional > components (alternate versions or transliterations, translations, > attribution). The optional components are distinguished > typographically – enlarged square brackets around alternate versions, > enlarged parentheses around translations, leading en-dash and hanging > indent for attributions. Each component is in a buffer. The structure > looks like: > > \startBlockQuotation[label=abc,authors={...},precis={short > extract},translators={...},tprecis={{short extract},{short > extract}}...] > > \startExtract[language=agr,align=yes,font=abc,tolerance=...,...] > > text of extract > > \stopExtract > > \startTransliteration[language=en,align=yes,font=abc,...] > > text of transliteration > > \stopTransliteration > > \startTranslation[...] > > text of translation > > \stopTranslation > > \startAttribution[tolerance=,...] > > attribution of quotation > > \stopAttribution > > \stopBlockQuotation > > and the code to handle it generates author index entries, a quotation > precis index, and so on from the attributes of the envelope, and > typesets each component based on the provided settings or defaults, > placing the appropriate decorations around those components that call > for them. The components are nestable, so one extract may contain > another, and components can be used separately without the envelope > (\startBlockQuotation or \startEpigraph) as well. > > (I have written it this way to ease the move to an XML-based format > for storing the quotations. I realize I am combining presentation > elements, like label, tolerance, and precis, and content elements, > like language, and some that may be either, like align and font, in > the attributes, but will deal with that later.) > > I prefer to leave blank lines around blocks of text and around macro > commands, so: > > \startparagraph > > some text > > \stopparagraph > > but when this is done with, for example, \startAttribution, and no > optional arguments are provided, I run into the problem I have described. Try to avoid blank lines at the begin/end of environments. > I realize that I can simply not include the blank line after > \startAttribution. I would prefer, however, to see consistent parallel > structures without having to distinguish them at the time it is > written. Perhaps I am being too picky, but that is what I am attempting. > > At this point, the \setupparagraphintro hack handles my needs, so I > will proceed with that. \starttext \BeforePar{\dontleavehmode\llap{? }}\GotoPar \input knuth \startnarrower \BeforePar{\dontleavehmode\llap{? }}\GotoPar \input knuth \stopnarrower \stoptext Wolfgang --------------C12BCA4901783FDB23D03A9E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Rik Kabel schrieb am 13.08.18 um 19:09:
On 8/13/2018 12:04, Wolfgang Schuster wrote:

Hi Rik,

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

Wolfgang

Fair question.

I have a document with many (400+) block quotations. Each consists of a text extract, which may be prose or poetry, and additional optional components (alternate versions or transliterations, translations, attribution). The optional components are distinguished typographically – enlarged square brackets around alternate versions, enlarged parentheses around translations, leading en-dash and hanging indent for attributions. Each component is in a buffer. The structure looks like:

\startBlockQuotation[label=abc,authors={...},precis={short extract},translators={...},tprecis={{short extract},{short extract}}...]

\startExtract[language=agr,align=yes,font=abc,tolerance=...,...]

  text of extract

\stopExtract

\startTransliteration[language=en,align=yes,font=abc,...]

  text of transliteration

\stopTransliteration

\startTranslation[...]

  text of translation

\stopTranslation

\startAttribution[tolerance=,...]

  attribution of quotation

\stopAttribution

\stopBlockQuotation

and the code to handle it generates author index entries, a quotation precis index, and so on from the attributes of the envelope, and typesets each component based on the provided settings or defaults, placing the appropriate decorations around those components that call for them. The components are nestable, so one extract may contain another, and components can be used separately without the envelope (\startBlockQuotation or \startEpigraph) as well.

(I have written it this way to ease the move to an XML-based format for storing the quotations. I realize I am combining presentation elements, like label, tolerance, and precis, and content elements, like language, and some that may be either, like align and font, in the attributes, but will deal with that later.)

I prefer to leave blank lines around blocks of text and around macro commands, so:
\startparagraph

  some text

\stopparagraph
but when this is done with, for example, \startAttribution, and no optional arguments are provided, I run into the problem I have described.

Try to avoid blank lines at the begin/end of environments.

I realize that I can simply not include the blank line after \startAttribution. I would prefer, however, to see consistent parallel structures without having to distinguish them at the time it is written. Perhaps I am being too picky, but that is what I am attempting.

At this point, the \setupparagraphintro hack handles my needs, so I will proceed with that.

\starttext

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\startnarrower

\BeforePar{\dontleavehmode\llap{? }}\GotoPar

\input knuth

\stopnarrower

\stoptext

Wolfgang
--------------C12BCA4901783FDB23D03A9E-- --===============3041051950025066614== 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 --===============3041051950025066614==--