9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] troff bug?
@ 2009-01-15 16:45 hugo rivera
  2009-01-15 17:09 ` erik quanstrom
  0 siblings, 1 reply; 4+ messages in thread
From: hugo rivera @ 2009-01-15 16:45 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Hi,
I have written a couple of documents using plan 9's troff utility, but
it can be safely assured that I am a troff newbie.
Now I have to write some sort of manual, and I am using eqn(1) to
write all the formulas and equations, but I ran into trouble as soon
as I had to write a ≥ character.
First of all I tried the eqn(1) approach, using something like $>= 1$
or $"" >= 1$ with $$ as delimiters. It did not work and produces a 'g
1' in the ps output. After a couple of attempts I decided not to use
the eqn(1) approach and I moved to just the troff syntax, so I wrote
'\(<= 1' to get the character, but no success, the output is still 'g
1'. Finally I remembered UTF so I just wrote '≥1', but again it
failed, but this time with no output at all. Is this a bug in troff?
and for me it raises a bigger question, isn't plan 9 and its utilities
supposed to support UTF-8?
Note that the command I am using is

9 eqn manual.ms | 9 troff -ms | tr2post > manual.ps

I think that this is probably a bug in plan9's troff (or maybe I am
doing something wrong) since with groff

eqn manual.ms | groff -ms -Tps > manual.ps

works just fine with the eqn(1) aproach and with the troff aproach.

-- 
Saludos

Hugo

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

* Re: [9fans] troff bug?
  2009-01-15 16:45 [9fans] troff bug? hugo rivera
@ 2009-01-15 17:09 ` erik quanstrom
  2009-01-15 22:05   ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: erik quanstrom @ 2009-01-15 17:09 UTC (permalink / raw)
  To: 9fans

> I think that this is probably a bug in plan9's troff (or maybe I am
> doing something wrong) since with groff
>
> eqn manual.ms | groff -ms -Tps > manual.ps
>
> works just fine with the eqn(1) aproach and with the troff aproach.

you seem to be missing "psfonts" in your pipeline, unexpectedly
adding it did not correct my output.  (i get "g g e".  definately using
the wrong font.)  also there seem to be some font confusions, too,
as nroff produces this incorrect output:

	; echo '≥ $>=$ \(>='|9 eqn -d^'$$'|9 nroff | sed 1q
	≥ > >

on plan 9 this produces

	; echo '≥ $>=$ \(>='|eqn -d^'$$'|nroff | sed 1q
	≥ ≧ ≧

the troff -> ps output looks fine, too.

- erik



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

* Re: [9fans] troff bug?
  2009-01-15 17:09 ` erik quanstrom
@ 2009-01-15 22:05   ` Russ Cox
  2009-01-15 22:21     ` erik quanstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Russ Cox @ 2009-01-15 22:05 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> you seem to be missing "psfonts" in your pipeline, unexpectedly
> adding it did not correct my output.  (i get "g g e".  definately using
> the wrong font.)  also there seem to be some font confusions, too,
> as nroff produces this incorrect output:
>
>        ; echo '≥ $>=$ \(>='|9 eqn -d^'$$'|9 nroff | sed 1q
>        ≥ > >

not as incorrect as it appears on first glance.

$ echo '≥ $>=$ \(>=' | 9 eqn -d'$$' | 9 nroff | sed 1q | xd -c
0000000  e2 89 a5     _ \b  >     _ \b  > \n
000000c
$

russ

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

* Re: [9fans] troff bug?
  2009-01-15 22:05   ` Russ Cox
@ 2009-01-15 22:21     ` erik quanstrom
  0 siblings, 0 replies; 4+ messages in thread
From: erik quanstrom @ 2009-01-15 22:21 UTC (permalink / raw)
  To: 9fans

> >        ; echo '≥ $>=$ \(>='|9 eqn -d^'$$'|9 nroff | sed 1q
> >        ≥ > >
>
> not as incorrect as it appears on first glance.
>
> $ echo '≥ $>=$ \(>=' | 9 eqn -d'$$' | 9 nroff | sed 1q | xd -c
> 0000000  e2 89 a5     _ \b  >     _ \b  > \n
> 000000c
> $

on the other hand, appearance is the only reason
to use troff over plain text.  :-)

- erik



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

end of thread, other threads:[~2009-01-15 22:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-15 16:45 [9fans] troff bug? hugo rivera
2009-01-15 17:09 ` erik quanstrom
2009-01-15 22:05   ` Russ Cox
2009-01-15 22:21     ` erik quanstrom

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