9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Plan 9 troff paper size solution
@ 2021-01-27 20:57 John A.
  2021-02-02 13:09 ` sirjofri
  0 siblings, 1 reply; 2+ messages in thread
From: John A. @ 2021-01-27 20:57 UTC (permalink / raw)
  To: 9fans

Hi everyone,

I've been trying to figure out how to create A4 documents with
Plan 9 troff.  Looking at the source of dpost and the PostScript
output of GNU troff, I found a very easy solution.

1. Call dpost with -P to set the correct page size:

   dpost -P '<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice' 

2. Use .pl to set the page length:

    .pl 29.7c

3. Use .ll (.nr LL with ms) to set the line length:

    .nr LL 15.92c \" assuming PO = 1i

This seems to work properly with ms footers, too.  The last two steps
have been mentioned on the mailing list before, but I think the first
step is new.

Best regards
John


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T529d24fea0ba8e21-Mc36efd1fabd3853324e659b6
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

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

* Re: [9fans] Plan 9 troff paper size solution
  2021-01-27 20:57 [9fans] Plan 9 troff paper size solution John A.
@ 2021-02-02 13:09 ` sirjofri
  0 siblings, 0 replies; 2+ messages in thread
From: sirjofri @ 2021-02-02 13:09 UTC (permalink / raw)
  To: 9fans

Quoth John A. <john@ankarstrom.se>:
> I've been trying to figure out how to create A4 documents with
> Plan 9 troff.  Looking at the source of dpost and the PostScript
> output of GNU troff, I found a very easy solution.
> 
> 1. Call dpost with -P to set the correct page size:
> 
>    dpost -P '<< /PageSize [ 595 842 ] /ImagingBBox null >> setpagedevice' 
> 
> 2. Use .pl to set the page length:
> 
>     .pl 29.7c
> 
> 3. Use .ll (.nr LL with ms) to set the line length:
> 
>     .nr LL 15.92c \" assuming PO = 1i

(At least on 9front) you can just use ps2pdf ghostscript arguments
instead of step 1.  I use:

  troff -ms | lp -dstdout | ps2pdf '-sPAPERSIZE=a4' > $target

which works fine. Adjusting pagelength and linelength is still needed as in steps 2 and 3.

sirjofri


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T529d24fea0ba8e21-Me7a7dd9036c4b754ac6c4cce
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

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

end of thread, other threads:[~2021-02-02 13:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 20:57 [9fans] Plan 9 troff paper size solution John A.
2021-02-02 13:09 ` sirjofri

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).