groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Use of sed in PDFPIC macro with OpenBSD


From: address@hidden
Subject: Use of sed in PDFPIC macro with OpenBSD
Date: Tue, 07 Dec 2021 09:41:55 +0000

Dear members,

I've switched to OpenBSD recently and noticed unexpected behaviour of the 
PDFPIC macro: There's no vertical space reserved.

The culprit seems to be the use of '\n' in the line where sed is used (line 89):

.  sy pdfinfo @$1 | \

grep "Page *size" | \

sed -e 's/Page *size: *\\([[:digit:].]*\\) *x *\\([[:digit:].]*\\).*$/\

.nr pdf-wid (p;\\1)\\n\

.nr pdf-ht  (p;\\2)/' \

> /tmp/pdfpic\n[$$]

This results in a single line in /tmp/pdfpic\n[$$]: .nr pdf-wid (p;\\)n.nr 
pdf-ht (p;\\2) and therefor only pdf-wid gets set.

>From what I understand is that posix sed requires a real linebreak in the sed 
>command to create a linebreak, but I assume that '.sy' sends all output 
>without any linebreaks.

I've noticed a suggestion in the "Problems with .PDFPIC caused by pdfinfo" 
thread to use awk instead of sed.

I'm not familiar enough with sed or awk to give a one line fix, but I'll be 
happy to open a bug report for this.

But before doing so, I would like to get some advice.

Thanks in advance.

Kind regards,

Hans


reply via email to

[Prev in Thread] Current Thread [Next in Thread]