From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101564 Path: news.gmane.org!.POSTED!not-for-mail From: Rik Kabel Newsgroups: gmane.comp.tex.context Subject: Re: How can I remove a blank leading line from a buffer Date: Mon, 13 Aug 2018 13:09:29 -0400 Message-ID: <0adfd084-48ce-f956-383b-3265ed4b5fee@rik.users.panix.com> References: <1cd49a92-b6c9-0c48-d148-c863a503a809@xs4all.nl> <1bcbc82c-b9e3-4055-8e18-4786cdd8cc68@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0145078577627741054==" X-Trace: blaine.gmane.org 1534180080 3744 195.159.176.226 (13 Aug 2018 17:08:00 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2018 17:08:00 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 To: Wolfgang Schuster , mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 13 19:07:56 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 1fpGJu-0000sd-Sv for gctc-ntg-context-518@m.gmane.org; Mon, 13 Aug 2018 19:07:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 568654FE5F; Mon, 13 Aug 2018 19:09:44 +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 Sf6_io76XKun; Mon, 13 Aug 2018 19:09:43 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 933064FEB1; Mon, 13 Aug 2018 19:09:43 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 8B7D14FEB1 for ; Mon, 13 Aug 2018 19:09:42 +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 bkcsVWAQ-Au0 for ; Mon, 13 Aug 2018 19:09:42 +0200 (CEST) Original-Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id E86294FE5F for ; Mon, 13 Aug 2018 19:09:31 +0200 (CEST) Original-Received: from [192.168.201.199] (cpe-24-194-22-135.nycap.res.rr.com [24.194.22.135]) by mailbackend.panix.com (Postfix) with ESMTPSA id B3CB61E329; Mon, 13 Aug 2018 13:09:30 -0400 (EDT) In-Reply-To: <1bcbc82c-b9e3-4055-8e18-4786cdd8cc68@gmail.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:101564 Archived-At: This is a multi-part message in MIME format. --===============0145078577627741054== Content-Type: multipart/alternative; boundary="------------1B8D1871E936AD3EC9A8D17F" Content-Language: en-US This is a multi-part message in MIME format. --------------1B8D1871E936AD3EC9A8D17F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit 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. 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. -- Rik --------------1B8D1871E936AD3EC9A8D17F Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
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.

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.

--
Rik

--------------1B8D1871E936AD3EC9A8D17F-- --===============0145078577627741054== 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 --===============0145078577627741054==--