• Document processing -- modern deroff(1)?

    From vallor@21:1/5 to All on Thu Aug 15 05:30:25 2024
    So I'm (finally) writing a book, and using groff -mom macros
    for typesetting. Wanted to run what I have so far through
    style(1) and diction(1), which on Linux requires one to
    run the input through deroff(1) first.

    Linux doesn't seem to have deroff.

    So, here is my q&d solution:

    $ cat mini_deroff.pl
    #!/usr/bin/perl

    %roffchars = ('.',1,' ',1,"\\",1);

    while(<>)
    {
    if(/^\.PP/) { print "\n"; }
    next if (exists($roffchars{substr($_,0,1)}));
    print;
    }
    exit 0;

    Constructive comments appreciated.

    BTW, if there's interest in the document processing, I have
    a Makefile that eases the pain of processing, including
    a "make look" rule that gens the pdf and views it.

    Also, if anyone knows where there is source for a working
    Linux deroff(1), would very much appreciate the pointer.
    So far I found the OpenBSD one, but it seems to rely on
    a lot of preprocessor macros that Linux doesn't have.

    Finally, one last look on Google, and I found a version
    of deroff for Debian... but it seems to be dated 1996, and doesn't
    grok -mom macros. (It is, however, written in lex, which
    might be an opportunity for me to learn that lingo and
    fix it...)

    --
    -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
    OS: Linux 6.11.0-rc3 Release: Mint 21.3 Mem: 258G
    "Cause of crash: Inadvertent contact with the ground."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lawrence D'Oliveiro@21:1/5 to vallor on Thu Aug 15 06:24:31 2024
    On 15 Aug 2024 05:30:25 GMT, vallor wrote:

    So I'm (finally) writing a book, and using groff -mom macros for
    typesetting. Wanted to run what I have so far through style(1) and diction(1), which on Linux requires one to run the input through
    deroff(1) first.

    Linux doesn't seem to have deroff.

    pandoc -f man -t plain «infile» >«outfile»

    works for man pages, anyway.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nuno Silva@21:1/5 to vallor on Thu Aug 15 11:39:32 2024
    On 2024-08-15, vallor wrote:

    So I'm (finally) writing a book, and using groff -mom macros
    for typesetting. Wanted to run what I have so far through
    style(1) and diction(1), which on Linux requires one to
    run the input through deroff(1) first.

    Linux doesn't seem to have deroff.
    [...]
    Also, if anyone knows where there is source for a working
    Linux deroff(1), would very much appreciate the pointer.
    So far I found the OpenBSD one, but it seems to rely on
    a lot of preprocessor macros that Linux doesn't have.

    Finally, one last look on Google, and I found a version
    of deroff for Debian... but it seems to be dated 1996, and doesn't
    grok -mom macros. (It is, however, written in lex, which
    might be an opportunity for me to learn that lingo and
    fix it...)

    Never used it, but GNU roff mentions in one of its files (MORE.STUFF) a
    deroff by Michael Haardt at

    http://www.moria.de/~michael/deroff/

    (Timestamps are from 2003 and 2004?)

    Besides one for Debian by David Frey (which, I suppose, is the one you
    found?)

    Does the moria.de one support any of these "mom" macros?

    --
    Nuno Silva

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich@21:1/5 to vallor on Thu Aug 15 14:33:37 2024
    vallor <vallor@cultnix.org> wrote:
    style(1) and diction(1), which on Linux requires one to
    run the input through deroff(1) first.
    ...
    Linux doesn't seem to have deroff.
    ...
    Also, if anyone knows where there is source for a working
    Linux deroff(1), would very much appreciate the pointer.

    Maybe because it is not needed with GNU groff because groff has
    -T ascii or -T utf8 (depending on which you need) to perform a
    similar function (remove roff declarations, output plain text).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Carlos E.R.@21:1/5 to vallor on Thu Aug 15 23:25:50 2024
    On 2024-08-15 07:30, vallor wrote:
    So I'm (finally) writing a book, and using groff -mom macros
    for typesetting. Wanted to run what I have so far through
    style(1) and diction(1), which on Linux requires one to
    run the input through deroff(1) first.

    Linux doesn't seem to have deroff.

    I never heard of that procedure. I heard of Latex and Tex. Or LyX.

    --
    Cheers, Carlos.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From vallor@21:1/5 to All on Fri Aug 16 01:59:43 2024
    On Thu, 15 Aug 2024 14:33:37 -0000 (UTC), Rich <rich@example.invalid>
    wrote in <v9l3k1$10059$1@dont-email.me>:

    vallor <vallor@cultnix.org> wrote:
    style(1) and diction(1), which on Linux requires one to run the input
    through deroff(1) first.
    ...
    Linux doesn't seem to have deroff.
    ...
    Also, if anyone knows where there is source for a working Linux
    deroff(1), would very much appreciate the pointer.

    Maybe because it is not needed with GNU groff because groff has -T ascii
    or -T utf8 (depending on which you need) to perform a similar function (remove roff declarations, output plain text).

    (facepalm)

    That works. Thank you.

    (However, I did spend a productive evening last night learning
    flex. :) )

    --
    -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
    OS: Linux 6.11.0-rc3 Release: Mint 21.3 Mem: 258G
    "PARANOID:Paying MORE for Surge-Protectors than Computers"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From vallor@21:1/5 to nunojsilva@invalid.invalid on Fri Aug 16 14:04:26 2024
    On Thu, 15 Aug 2024 11:39:32 +0100, Nuno Silva
    <nunojsilva@invalid.invalid> wrote in <v9klt5$u0r9$1@dont-email.me>:

    On 2024-08-15, vallor wrote:

    So I'm (finally) writing a book, and using groff -mom macros for
    typesetting. Wanted to run what I have so far through style(1) and
    diction(1), which on Linux requires one to run the input through
    deroff(1) first.

    Linux doesn't seem to have deroff.
    [...]
    Also, if anyone knows where there is source for a working Linux
    deroff(1), would very much appreciate the pointer.
    So far I found the OpenBSD one, but it seems to rely on a lot of
    preprocessor macros that Linux doesn't have.

    Finally, one last look on Google, and I found a version of deroff for
    Debian... but it seems to be dated 1996, and doesn't grok -mom macros.
    (It is, however, written in lex, which might be an opportunity for me
    to learn that lingo and fix it...)

    Never used it, but GNU roff mentions in one of its files (MORE.STUFF) a deroff by Michael Haardt at

    http://www.moria.de/~michael/deroff/

    (Timestamps are from 2003 and 2004?)

    Besides one for Debian by David Frey (which, I suppose, is the one you found?)

    Does the moria.de one support any of these "mom" macros?

    Hello. I tried it, and still found macro text in the output.

    Rich suggested using groff with -Tascii or -Tutf8, which of course
    does the trick. (It was a "facepalm" moment for me.)

    (I actually kind of feel bad for the author of deroff-2.0: the
    scanner appears to be hand-written...)

    --
    -v System76 Thelio Mega v1.1 x86_64 NVIDIA RTX 3090 Ti
    OS: Linux 6.11.0-rc3 Release: Mint 21.3 Mem: 258G
    "Computer - A device designed to speed and automate errors."

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)