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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12482 invoked from network); 22 Jan 2022 02:35:23 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 22 Jan 2022 02:35:23 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 1DE769C8B0; Sat, 22 Jan 2022 12:35:18 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id C94CE9BAB6; Sat, 22 Jan 2022 12:34:46 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="C1OtmKAx"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id EE4AF9BAB6; Sat, 22 Jan 2022 12:34:43 +1000 (AEST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by minnie.tuhs.org (Postfix) with ESMTPS id 626979BA6A for ; Sat, 22 Jan 2022 12:34:41 +1000 (AEST) Received: by mail-pj1-f51.google.com with SMTP id w12-20020a17090a528c00b001b276aa3aabso15217002pjh.0 for ; Fri, 21 Jan 2022 18:34:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jObc/VcFBcqD3GVUWRAtf82ier1h0vxGY5TeDOjXE1c=; b=C1OtmKAx52BH94wfOOFqMfMWTzflVNxrlHjDJciHOIFFHmjXQq+dzkRmxcsD8LMc1S cPprsrNOxrmZ2do8e2b/474p11G34UCKcL0wTlv0+iZHqPMldRoWO8z+LVKm6BM1vPRB 55cROVb8WyPCin+yWnMFmXjU1KkLRn9kcCpbnzlkx/2ZZQJqmCW2SWFdesO7bhgymX73 0zmWpdEvFRYgDxR6pCL9BwPes1X65msytU7AdYNH6DKwmp+UebEotqjjFry+9VpZ/d/m 5z0HaBPCo9sQhcpWhukz7iv3wFBh3dMBwL+G/HkiBXdNStMH5YrCZ2e8DhYgNzEU7Fgm RIbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jObc/VcFBcqD3GVUWRAtf82ier1h0vxGY5TeDOjXE1c=; b=HIoqWCHWYAx9oqtnmIRcwjck1Qnr1EX0kZfNO8QljuSdpMZQ/1K74al1LyZfDbe6bo 51ABocdGPcwAQ/IiU7XtsEm7oKB5TC/At857FOpbHQ0c1oSMNe+nT6Z/NPKY5gM2To7+ fyzB1pIuSK49jXSHS9Cc2gINSL83NMwoXKIzB9Dc80fozMsGrluKysv8ijSH6KiqpzuR C/cv3/pgcr2Jnfg32qIQZFGZ8mjNFr+J0cg9wn4rkAvPkgQ441hP7b/B/5Y/0pJ+qZqs 8jYymq1stC1Wq38DAW9xV6yQatgjkh6kRFKl6LKsbbsXfN0mP3BWNUe5JqeZFTdw2UmS HtcQ== X-Gm-Message-State: AOAM5314d248ie9wDnTELQQImHmx7sVRtDAa7BrIgr+win7mEhMVYxnI gTNeuuneUSI4tZeoW53rVdg= X-Google-Smtp-Source: ABdhPJwb1LINMl/w+7PcJFhYaxDDkegZdmBvmyp2g/xp11L4/WpK4bZwdwLKxBGCGx6ZFTixnQ5bRg== X-Received: by 2002:a17:90b:108c:: with SMTP id gj12mr3354786pjb.231.1642818880630; Fri, 21 Jan 2022 18:34:40 -0800 (PST) Received: from localhost.localdomain ([1.145.116.152]) by smtp.gmail.com with ESMTPSA id w24sm5760006pgl.11.2022.01.21.18.34.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jan 2022 18:34:40 -0800 (PST) Date: Sat, 22 Jan 2022 13:34:36 +1100 From: Branden Robinson To: "Lyndon Nerenberg (VE7TFX/VE6BBM)" Message-ID: References: <20211231234039.GU31637@mcvoy.com> <20220101005605.GL75481@eureka.lemis.com> <20220101031511.GB8135@mcvoy.com> <20220110203300.GY3441@mcvoy.com> <4409b93407ed2118@orthanc.ca> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jcno4yu66hnj5onh" Content-Disposition: inline In-Reply-To: <4409b93407ed2118@orthanc.ca> User-Agent: NeoMutt/20180716 Subject: [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" --jcno4yu66hnj5onh Content-Type: multipart/mixed; boundary="dci25lsmktrcadml" Content-Disposition: inline --dci25lsmktrcadml Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --dci25lsmktrcadml Content-Type: text/html; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable
Foo

--dci25lsmktrcadml-- --jcno4yu66hnj5onh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEh3PWHWjjDgcrENwa0Z6cfXEmbc4FAmHrbTIACgkQ0Z6cfXEm bc5NFw//XTBwN/JFxDuZbfbttgs2gZW51nO0ssdy+ReUl4f5v+LJTzYhc5fWzfEj imph8/5eLmJrHTrpYPzZfxN397gNopQYyegXCDfNso3GQzAwPetajcza7Twmn5wW 3mj/TTcdSNTMs7Psksx75hpvEYzZ2RRb4GQdCtMtuPI7XFb/5SmjTUsTeLrr+6AV PgEjSm+51NT6XyIdu83U8dMGxidjB0NzggSXIfdxqk3FAWcDoNyxJ4CXH68VLW3h z6/XeLekmgUxlSJ3v9j+C8kQJQl2t/9etTi6KcdPexsN3SQg187HShnSsez6Mxjz c8o26bwlKKcvkLhIlBOi8TVVimxphjXNQa992S61L6hhHFHyEdzAcL/T2NNHya/l tKwle2z1NGz/IBkCWYCmhBYC4qngLepxnaewkJDh2dKj0++A4H+ZbkIfhAHO/cAC 5bzoXi8bCnwSZ2hWmi7PxvK3PxEgDHDBSwswIanVeB1UK6zVzkuSrse75/oLdDHP UjhL8wYLVy9E48OgZuTwU7U6DNpO6zsoNyv3h1oiRXxwKAmg87qzwrB+qHyG2Xv/ zAYW8AQQqnsRBtAd4RhNH/EnBwuuymhbgc9FZ9Nl/oW5twU2LI/e4uEgiAvK0SYq Lu/GAAdZTcVvFe/JMhVXYEx9y4mmFsYUsNu85tH4nP4zZbxaM1I= =A4db -----END PGP SIGNATURE----- --jcno4yu66hnj5onh--