9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] troff & eqn sqrt{} output as pdf
@ 2021-01-15 13:14 Ethan Long
  2021-01-15 13:52 ` Steve Simon
  0 siblings, 1 reply; 3+ messages in thread
From: Ethan Long @ 2021-01-15 13:14 UTC (permalink / raw)
  To: 9front

Hello, unfortunately when using equations in troff there is one
bug/erratic behaviour that I cannot fix, so I was wondering if anyone
here would be able to help.

Basically when using the sqrt function in eqn, everything appears to
work okay and well if you're outputting as ps and viewing in page on
9front.
However, when one uses ps2pdf or views this postscript elsewhere
(ps2pdf on 9front and linux both do this), the horizontal line that
typically covers the whole square root is detached from the radical
that starts the root.

Try this example:

eqn file | troff -ms | dpost | page
eqn file | troff -ms | dpost | ps2pdf | page

.EQ
sqrt {g} = pi
.EN

It doesn't matter how long the root is, you will notice that if you
simply run dpost and pipe into page all is fine, but if you use
ps2pdf, the top of the root is offset by a large gap.

Does anyone have any ways of fixing this or working around this? If
it's a ghostscript bug then it's been there a long while.

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

* Re: [9front] troff & eqn sqrt{} output as pdf
  2021-01-15 13:14 [9front] troff & eqn sqrt{} output as pdf Ethan Long
@ 2021-01-15 13:52 ` Steve Simon
  2021-01-17  9:40   ` umbraticus
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Simon @ 2021-01-15 13:52 UTC (permalink / raw)
  To: 9front


there is a formatting bug in tbl - which i think has been fixed in the heirloom code. i don’t know if this is related but small vertical shifts so horizontals and verticals don't meet is very reminiscent of that problem.

-Steve


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

* Re: [9front] troff & eqn sqrt{} output as pdf
  2021-01-15 13:52 ` Steve Simon
@ 2021-01-17  9:40   ` umbraticus
  0 siblings, 0 replies; 3+ messages in thread
From: umbraticus @ 2021-01-17  9:40 UTC (permalink / raw)
  To: 9front

So we discovered that this change:

diff -r 6086ad8502ee sys/lib/postscript/prologues/dpost.ps
--- a/sys/lib/postscript/prologues/dpost.ps	Fri Jan 15 19:32:02 2021 +0100
+++ b/sys/lib/postscript/prologues/dpost.ps	Sun Jan 17 22:17:45 2021 +1300
@@ -188,1 +188,1 @@
-	/radicalex		[-50 0 500 0]
+	/radicalex		[-50 0 500 1]

makes this:

; echo '.EQ
sqrt {g} = pi
.EN' | eqn | troff -ms | dpost | ps2pdf | page

work but have no idea why.
Making the changes suggested at:

B /sys/lib/postscript/prologues/dpost.ps:169,176

didn't help but changing that 0 to 1 (or anything else!)
seems to do the trick for whatever reason.
Any thoughts? or just push it?

Ethan → can confirm on a 5 page report that it fixes all instances of roots

I also checked man -t eqn | dpost | ps2pdf | page

umbraticus

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

end of thread, other threads:[~2021-01-17 10:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-15 13:14 [9front] troff & eqn sqrt{} output as pdf Ethan Long
2021-01-15 13:52 ` Steve Simon
2021-01-17  9:40   ` umbraticus

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).