public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* PDF book improvements
@ 2023-08-12 21:46 Alejandro Colomar
  2023-08-12 21:53 ` Alejandro Colomar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Alejandro Colomar @ 2023-08-12 21:46 UTC (permalink / raw)
  To: Deri, linux-man; +Cc: Brian Inglis, G. Branden Robinson, groff


[-- Attachment #1.1: Type: text/plain, Size: 1747 bytes --]

Hi Deri,

My end goal is to be able to embed the creation of the PDF book in the
Makefiles.  To that end, as a first step, I'd like to reuse part of
what we already have in the Makefile.  Currently, we process all files
with -Tpdf, which I guess we'll be able to reuse.

     $ make build-pdf -kij >/dev/null 2>&1
     $ touch man2/gettimeofday.2 
     $ make build-pdf V=1 | sed '/^[[:upper:]]/s/^/\n/'

     PRECONV	.tmp/man/man2/gettimeofday.2.tbl
     preconv   man2/gettimeofday.2 >.tmp/man/man2/gettimeofday.2.tbl

     TBL	.tmp/man/man2/gettimeofday.2.eqn
     tbl <.tmp/man/man2/gettimeofday.2.tbl >.tmp/man/man2/gettimeofday.2.eqn

     EQN	.tmp/man/man2/gettimeofday.2.pdf.troff
     ! (eqn -Tpdf   <.tmp/man/man2/gettimeofday.2.eqn 2>&1 >.tmp/man/man2/gettimeofday.2.pdf.troff) \
     | grep ^ >&2

     TROFF	.tmp/man/man2/gettimeofday.2.pdf.set
     ! (troff -Tpdf -wbreak  -man  <.tmp/man/man2/gettimeofday.2.pdf.troff 2>&1 >.tmp/man/man2/gettimeofday.2.pdf.set) \
     | grep ^ >&2

     GROPDF	.tmp/man/man2/gettimeofday.2.pdf
     gropdf   <.tmp/man/man2/gettimeofday.2.pdf.set >.tmp/man/man2/gettimeofday.2.pdf

What part of this "pipeline" can we reuse?  I guess we can reuse the
.pdf.troff files.  The .pdf.set files probably cannot be reused for
the single book, as they'll have the page numbers and so on already
set, right?

So, I'm imagining that we could cat(1) your front cover with all
these files, and then process with troff(1) and gropdf(1).  Does
that make sense?

Could we also reuse the .pdf.set files and only run gropdf(1) on
the catenation of them?

Cheers,
Alex

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PDF book improvements
  2023-08-12 21:46 PDF book improvements Alejandro Colomar
@ 2023-08-12 21:53 ` Alejandro Colomar
  2023-08-12 23:36 ` Alejandro Colomar
  2023-08-13 14:34 ` [linux-man book] Fonts from a library (was: PDF book improvements) Alejandro Colomar
  2 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2023-08-12 21:53 UTC (permalink / raw)
  To: Deri, linux-man; +Cc: Brian Inglis, G. Branden Robinson, groff


[-- Attachment #1.1: Type: text/plain, Size: 2395 bytes --]

On 2023-08-12 23:46, Alejandro Colomar wrote:
> Hi Deri,
> 
> My end goal is to be able to embed the creation of the PDF book in the
> Makefiles.  To that end, as a first step, I'd like to reuse part of
> what we already have in the Makefile.  Currently, we process all files
> with -Tpdf, which I guess we'll be able to reuse.
> 
>      $ make build-pdf -kij >/dev/null 2>&1
>      $ touch man2/gettimeofday.2 
>      $ make build-pdf V=1 | sed '/^[[:upper:]]/s/^/\n/'
> 
>      PRECONV	.tmp/man/man2/gettimeofday.2.tbl
>      preconv   man2/gettimeofday.2 >.tmp/man/man2/gettimeofday.2.tbl
> 
>      TBL	.tmp/man/man2/gettimeofday.2.eqn
>      tbl <.tmp/man/man2/gettimeofday.2.tbl >.tmp/man/man2/gettimeofday.2.eqn
> 
>      EQN	.tmp/man/man2/gettimeofday.2.pdf.troff
>      ! (eqn -Tpdf   <.tmp/man/man2/gettimeofday.2.eqn 2>&1 >.tmp/man/man2/gettimeofday.2.pdf.troff) \
>      | grep ^ >&2
> 
>      TROFF	.tmp/man/man2/gettimeofday.2.pdf.set
>      ! (troff -Tpdf -wbreak  -man  <.tmp/man/man2/gettimeofday.2.pdf.troff 2>&1 >.tmp/man/man2/gettimeofday.2.pdf.set) \
>      | grep ^ >&2
> 
>      GROPDF	.tmp/man/man2/gettimeofday.2.pdf
>      gropdf   <.tmp/man/man2/gettimeofday.2.pdf.set >.tmp/man/man2/gettimeofday.2.pdf
> 
> What part of this "pipeline" can we reuse?  I guess we can reuse the
> .pdf.troff files.  The .pdf.set files probably cannot be reused for
> the single book, as they'll have the page numbers and so on already
> set, right?
> 
> So, I'm imagining that we could cat(1) your front cover with all
> these files, and then process with troff(1) and gropdf(1).  Does
> that make sense?
> 
> Could we also reuse the .pdf.set files and only run gropdf(1) on
> the catenation of them?

Oh, and another thing.  I have a branch that uses the new MR macros.
It would be interesting to use them to do the hyperlinking.

If you want to check the branch, it's here:
<http://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/log/?h=MR>
However, I rebase that branch against master, to update it with any
new man-page references that are introduced by new patches, so please
don't rely on its stability (If you need something stable, we can
agree on something).

Cheers,
Alex

> 
> Cheers,
> Alex
> 

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: PDF book improvements
  2023-08-12 21:46 PDF book improvements Alejandro Colomar
  2023-08-12 21:53 ` Alejandro Colomar
@ 2023-08-12 23:36 ` Alejandro Colomar
  2023-08-13 14:34 ` [linux-man book] Fonts from a library (was: PDF book improvements) Alejandro Colomar
  2 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2023-08-12 23:36 UTC (permalink / raw)
  To: Deri, linux-man; +Cc: Brian Inglis, G. Branden Robinson, groff


[-- Attachment #1.1: Type: text/plain, Size: 2405 bytes --]

On 2023-08-12 23:46, Alejandro Colomar wrote:
> Hi Deri,
> 
> My end goal is to be able to embed the creation of the PDF book in the
> Makefiles.  To that end, as a first step, I'd like to reuse part of
> what we already have in the Makefile.  Currently, we process all files
> with -Tpdf, which I guess we'll be able to reuse.
> 
>      $ make build-pdf -kij >/dev/null 2>&1
>      $ touch man2/gettimeofday.2 
>      $ make build-pdf V=1 | sed '/^[[:upper:]]/s/^/\n/'
> 
>      PRECONV	.tmp/man/man2/gettimeofday.2.tbl
>      preconv   man2/gettimeofday.2 >.tmp/man/man2/gettimeofday.2.tbl
> 
>      TBL	.tmp/man/man2/gettimeofday.2.eqn
>      tbl <.tmp/man/man2/gettimeofday.2.tbl >.tmp/man/man2/gettimeofday.2.eqn
> 
>      EQN	.tmp/man/man2/gettimeofday.2.pdf.troff
>      ! (eqn -Tpdf   <.tmp/man/man2/gettimeofday.2.eqn 2>&1 >.tmp/man/man2/gettimeofday.2.pdf.troff) \
>      | grep ^ >&2
> 
>      TROFF	.tmp/man/man2/gettimeofday.2.pdf.set
>      ! (troff -Tpdf -wbreak  -man  <.tmp/man/man2/gettimeofday.2.pdf.troff 2>&1 >.tmp/man/man2/gettimeofday.2.pdf.set) \
>      | grep ^ >&2
> 
>      GROPDF	.tmp/man/man2/gettimeofday.2.pdf
>      gropdf   <.tmp/man/man2/gettimeofday.2.pdf.set >.tmp/man/man2/gettimeofday.2.pdf
> 
> What part of this "pipeline" can we reuse?  I guess we can reuse the
> .pdf.troff files.  The .pdf.set files probably cannot be reused for
> the single book, as they'll have the page numbers and so on already
> set, right?
> 
> So, I'm imagining that we could cat(1) your front cover with all
> these files, and then process with troff(1) and gropdf(1).  Does
> that make sense?
> 
> Could we also reuse the .pdf.set files and only run gropdf(1) on
> the catenation of them?

I added a script to sort these files, as you do with your sortman()
perl function.  I called it sortman too :)


$ cat scripts/sortman 
#!/bin/sh

# Copyright 2023, Alejandro Colomar <alx@kernel.org>
# SPDX-License-Identifier: GPL-3.0-or-later

export LC_COLLATE=en_US.UTF-8;

sed   -E '/\/intro./ s/.*\.([1-8])$/\10\t&/' \
| sed -E '/\/intro./!s/.*\.([1-8])$/\11\t&/' \
| sed -E '/\/intro./!s/.*\.([1-8].+)/\1\t&/' \
| sort \
| cut -f2;


We'll probably need this to sort the files in the shell.

> 
> Cheers,
> Alex
> 

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [linux-man book] Fonts from a library (was: PDF book improvements)
  2023-08-12 21:46 PDF book improvements Alejandro Colomar
  2023-08-12 21:53 ` Alejandro Colomar
  2023-08-12 23:36 ` Alejandro Colomar
@ 2023-08-13 14:34 ` Alejandro Colomar
  2 siblings, 0 replies; 4+ messages in thread
From: Alejandro Colomar @ 2023-08-13 14:34 UTC (permalink / raw)
  To: Deri, linux-man; +Cc: Brian Inglis, G. Branden Robinson, groff


[-- Attachment #1.1: Type: text/plain, Size: 326 bytes --]

Hi Deri,

Is there any chance we could use a font that is installed with the
system (Debian would be good)?  I'd also like to be able to remove the
font from our source repository, if possible.

Cheers,

Alex

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-13 14:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-12 21:46 PDF book improvements Alejandro Colomar
2023-08-12 21:53 ` Alejandro Colomar
2023-08-12 23:36 ` Alejandro Colomar
2023-08-13 14:34 ` [linux-man book] Fonts from a library (was: PDF book improvements) Alejandro Colomar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox