From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9646 invoked from network); 22 Jan 2022 16:03:08 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 22 Jan 2022 16:03:08 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 7E2C39C1E1; Sun, 23 Jan 2022 02:03:05 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 21E559BB0B; Sun, 23 Jan 2022 02:02:31 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=dartmouth.edu header.i=@dartmouth.edu header.b="tacMSawU"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 6E7269BAB6; Sun, 23 Jan 2022 02:02:28 +1000 (AEST) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by minnie.tuhs.org (Postfix) with ESMTPS id 9051B9BA6A for ; Sun, 23 Jan 2022 02:02:27 +1000 (AEST) Received: by mail-wr1-f51.google.com with SMTP id f17so5446922wrx.1 for ; Sat, 22 Jan 2022 08:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dartmouth.edu; s=google1; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gym0edePlgcdBd0lxGu6k1Lw4UfJkAcTg6tDXd/ng/c=; b=tacMSawUy8Gt4l3vKRYLtbNGXjYa8zfo3q35IVbm3DJ3faACQSigXqCwPPHoJ4pdPU A3NgSuCmBeqDl09cjl9fIQOBtZNTTIsDqb7Y3FcGvC+BIeweuIBebzpswhmfB4he8upp mkV5+ypEVkZ3aEq5A3QfFp6KsmigQKBmuIH2uhmbvc1zMy5UDLyhgV+EfwDwaFY3lK+N IzcWJvFogV4dmjSyoqk77vbFYB+xRWZgHRUTQWFY2DluN/f4yiDSX1VxGb8P9cAYb2PA IV2zHRcfU4NJ+w2HaD3mWkvbw3RuPR6wZ+57sXIgMbygv0VGT5UVgpMF3R1GqFRZ4Y71 OP8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gym0edePlgcdBd0lxGu6k1Lw4UfJkAcTg6tDXd/ng/c=; b=0oJzcsb6ZZGz6KiSD0ZM4TMr+Wyg7kg/i4vA5d/IsEwdOGvxXFdjQUCWsIoR0gdPma ZzpyhJfuC4oQurxDa/JK2dD1JBRY8JiBhD5Y2LlX1YoOqh6zw9wpMXG0kAyu9KrYIKKi TOb34AyOcMUCsBcS+SaVGxLSoYl/JUeVAn5mzOqBFYoMMQS0a4UK9sLMVB7kNbYgAnP7 gmRD4AJinKHh998gVrbVT8ONw2vxtPXSUmBRKCyZzdz8s6WSI8VUHGAAZefEDecV8ieD FUWtlhIcXBbLTpmwfzqn5h4RvC6UNk1VF8KngERt8+O3JpdKxpMV3RU0Q24o0fa5cNr8 JOEQ== X-Gm-Message-State: AOAM532UDkLEq00N+gkBD9b1Vlve4FwvfINhiZn5fpbsc2e+RBfqp6mi H33qMI7Nt9Ry+vNhK7HcjshTDozsbJfnbIt1JzuJe88eFmLpeg== X-Google-Smtp-Source: ABdhPJxUrJ7RSXP2sDhUCv8iSfl7DmPRawBH4WPtHVBeBc+OCtdE8B2K1gsWu8pRNNWv55FwgRfw7T648e4irUNUbq4= X-Received: by 2002:adf:ea41:: with SMTP id j1mr7892056wrn.649.1642867345936; Sat, 22 Jan 2022 08:02:25 -0800 (PST) MIME-Version: 1.0 References: <20211231234039.GU31637@mcvoy.com> <20220101005605.GL75481@eureka.lemis.com> <20220101031511.GB8135@mcvoy.com> <20220110203300.GY3441@mcvoy.com> <4409b93407ed2118@orthanc.ca> In-Reply-To: From: Douglas McIlroy Date: Sat, 22 Jan 2022 11:02:10 -0500 Message-ID: To: Branden Robinson Content-Type: text/plain; charset="UTF-8" Subject: Re: [TUHS] troff environments, traps, and diversions (was: TeX and groff) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tuhs@minnie.tuhs.org Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" Branden, I like these intro paragraphs and the elision of the ominous adjective, "advanced". > An environment is created for the footnote so that it is set at a smaller typeface. To avoid implying that one must create an environment with each footnote and to illustrate that environments are collections of settings, you might say something like this > Switch to a previously created footnote environment with a smaller typeface and distinctive line length. Doug On Fri, Jan 21, 2022 at 9:34 PM Branden Robinson wrote: > > On Tue, Jan 11, 2022 at 1:25 PM Lyndon Nerenberg (VE7TFX/VE6BBM) > wrote: > > A lot of people get turned off by how troff markup can often look like > > line noise. That's true, but if you spend the time to actually learn > > the syntax (and it's really not that hard), you can't help but be > > overwhelmed by the beauty of its self-consistency. Although after > > three decades I still can't wrap my head around traps and diversions > > :-P > > It seems like a lot of people get stuck on the dread trio of traps, > diversions, and environments. Some old groff documentation did not, I > think, help matters very much by characterizing them as "advanced" and > particularly by comparing diversions to pointers in C. I've been > rewriting a lot of groff's documentation over the past five years. > > Here's my attempt to introduce these 3 concepts in the groff(7) page of > the forthcoming 1.23 release. Let me know how I can improve it. (I > retiterate that it's just an introduction--there is much more detail > about all three later in the page and in groff's Texinfo manual, much of > which has parallel content to its man pages.) > > A further few language elements arise as page layouts become more > sophisticated and demanding. Environments collect formatting > parameters like line length and typeface. A diversion stores > formatted output for later use. A trap is a condition on the > input or output, tested automatically by the formatter, that is > associated with a macro, causing it to be called when that > condition is fulfilled. > > Footnote support often exercises all three of the foregoing > features. A simple implementation might work as follows. A pair > of macros is defined: one starts a footnote and the other ends > it. The author calls the first macro where a footnote marker is > desired. The macro establishes a diversion so that the footnote > text is collected at the place in the body text where its > corresponding marker appears. An environment is created for the > footnote so that it is set at a smaller typeface. The footnote > text is formatted in the diversion using that environment, but it > does not yet appear in the output. The document author calls the > footnote end macro, which returns to the previous environment and > ends the diversion. Later, after much more body text in the > document, a trap, set a small distance above the page bottom, is > sprung. The macro called by the trap draws a line across the > page and emits the stored diversion. Thus, the footnote is > rendered. > > Regards, > Branden > Foo > > On Tue, Jan 11, 2022 at 1:25 PM Lyndon Nerenberg (VE7TFX/VE6BBM) wrote: >> >> Dan Cross writes: >> >> > This is interesting; I've always felt like I could pick out troff pretty >> > readily; I agree that TeX has a certain "look" to it (at least by default), >> > but I always felt the same about troff as well. >> >> My guess this is more about how ms(7) does page layout. I can spot >> those documents from a mile away :-) >> >> But older versions of troff can often be spotted by how box corners >> don't always line up properly. >> >> A lot of people get turned off by how troff markup can often look >> like line noise. That's true, but if you spend the time to actually >> learn the syntax (and it's really not that hard), you can't help >> but be overwhelmed by the beauty of its self-consistency. Although >> after three decades I still can't wrap my head around traps and >> diversions :-P >> >> --lyndon