From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sr37.firestorm.ch (sr37.firestorm.ch [188.40.219.19]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 07e2a79b for ; Tue, 23 Apr 2019 11:22:19 -0500 (EST) Received: from orion.esse.ch (unknown [80.254.171.29]) by mx-out.sr37.firestorm.ch (Postfix) with ESMTPSA id E83343500455 for ; Tue, 23 Apr 2019 18:22:17 +0200 (CEST) Received: from [192.168.1.9] (unknown [192.168.1.9]) by orion.esse.ch (Postfix) with ESMTP id 8FB9E1A4 for ; Tue, 23 Apr 2019 18:22:17 +0200 (CEST) To: discuss@mandoc.bsd.lv From: Fabio Scotoni Subject: Handling .%P ranges with hyphen in mdoc(7); pp./p. Openpgp: preference=signencrypt Autocrypt: addr=fabio@esse.ch; prefer-encrypt=mutual; keydata= mQINBFYECD8BEADFv+IKzYX6mHXl6Km0w3c1narLlZ1sCw37GMUuzh/tRXAgyv+fdXFKo8rX qMZLphFRhaHwjC7XuGMjiLOPKG/4FgVKPR6SEYgTVnNcvlT1XtszZWh+QJmKL4+sJaoZQm7c I5ZX9KvN/5SFKGjaZyhtMPUabCrjWhHUPCbhgKu02aQy+0YgThXcwX2dwYSoIrVAsL5Dtrs1 qvfcc0cGEmCAQ3naCteKx88ih9UwwODA7jmLvcLgOBQZ1m3WArz3W9QZGRsVLEhqYrB2FFne zRHvfCrD6M6xVVI9+ZJmd5aZ6FRSEZ598ExF7ObhNGKDLAxJP7ANPmjQwzzgDFv/NG47mzyG pr3mHPwhGXesApvG6p4ykdosu+61PHdm2RcNZxwaGxiwOZ610yIVTRZ3fb2NK5YEpb37geAN P+4dNGBf/2PI6ql9FaeUK/SMNTF//lKUB4AM8VbExoQTACwpmi3IP6S/hkAMgOybdfYzEpZI LVTJaygIfvt4JT9esbAqZuM/8lv9H4EJhA1LEmcpzu+7oTJNOH9oUch4lSV5f4X89LAQJAMM ajnpJC+rU5hNXKxIZP4bs9U5CmFjxnOPkLb+K7LfmNHR+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lf6ZIH9mJfHCJub/9ij/xfcg4mD+ZTFSPDyc NflbQSUegSmoV0EsrE8+7rgnq0WU6hOwfY4JTyeIA3mkMJikunjojmOGAKb6pp8xNNiS7DCw VE/u8c0yBr/A5azvtBPqg05NeuBAe6LrleceYxfiqi23JNU5kGAnXmzsizn6ydnXOfOnWzvV KfH175v86xDHFfHKb+Huw/T0LWn3I71r1HtJE23PIcc9/U6S2WjkguCAketXzySg3hf9xOjz xE2zBWdVVoBBVufAAE/dfQhSMPYXfi3qP2U2W6XFW5RRbvxYpLcprn/KUD6wvePCMg== Message-ID: <74971648-e4d7-ace2-5a96-b80f304fc259@esse.ch> Date: Tue, 23 Apr 2019 18:22:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 X-Mailinglist: mandoc-discuss Reply-To: discuss@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: de-CH Content-Transfer-Encoding: 7bit X-GBUdb-Analysis: 0, 80.254.171.29, Ugly c=0.184641 p=-0.666667 Source Normal X-MessageSniffer-Scan-Result: 0 X-MessageSniffer-Rules: 0-0-0-9519-c X-MessageSniffer-Clean: Yes Summary: a. .%P does not insert "pp." or "p." and this may need to be documented or changed; b. A hyphen in .%P should be converted to an en dash in the output. In mdoc(7), .%P specifies a "book or journal page of an Rs block". It leaves open how exactly this is meant to be specified. Regarding the question of whether inserting "pp."/"p." is the responsibility of -mdoc or the user: As an example, there seem to be five different variants of how .%P is invoked in the OpenBSD tree: - lib/libc/db/man/btree.3: .%P pp 121-138 ("pp" with no dot, range with hyphen) - lib/libc/hash/rmd160.3: .%P pp. 24-28 ("pp." with dot, range with hyphen) - lib/libc/stdlib/qsort.3: .%P pp. 114\-123, 145\-149 ("pp." with dot, range with explicit ASCII hyphen) - share/man/man4/kate.4: .%P pp. 21--23 and pp. 179--184 ("pp." with dot, range with double hyphen) - share/man/man7/eqn.7: %P 151\(en157 (no page number, range with \(en) These probably cover just about everything that could be found in the wild. While it seems most of the pages specify "pp."/"p." themselves, but it may be worthwhile to insert "pp."/"p." if the first character of the first argument is a number ("pp." if a hyphen is found, "p." otherwise). The .%P macro seems inspired by refer(1), as it mostly follows the format of .[ .] references except for specifiers having to begin with a dot. Checking with the GNU refer(1) man page, it says that "A range of pages can be specified as m-n", using \- in the troff source of refer.1, apparently without specifying "p." or "pp.". The example for UNIX refer(1) %P in "Some Applications of Inverted Indexes on the UNIX System" by M. E. Lesk in Vol. 2A of the Seventh Edition UNIX Programmer's Manual also suggests using a hyphen for a range of pages with no leading "p." or "pp.". Seventh Edition refer(1) would indeed prepend "p." and "pp.", as do GNU refer(1) and heirloom-doctools refer(1). Neither groff -mdoc nor mandoc do this, however. The cause is probably tradition in 4.4BSD, where .%P arguments consistently specified "p."/"pp.". Regarding the question of what to do with the hyphen: It seems that common typographical wisdom suggests that ranges of numbers are specified with an en dash (see the section on hyphens and dashes in Matthew Butterick's Practical Typography). However, neither GNU refer and heirloom-doctools refer do this. Some man pages do this manually (e.g. eqn.7 in the mandoc distribution). To improve the quality of output, mandoc should convert hyphens in .%P to en dashes in HTML, PostScript and PDF output, possibly also in UTF-8 output. The benefit of changing the behavior of .%P would be fairly minimal (typographically correct dashes), but it may be worth considering nonetheless. Fabio -- To unsubscribe send an email to discuss+unsubscribe@mandoc.bsd.lv