Re: [9fans] troff fonts with special characters

2010-09-13 Thread Jeff Sickel

On Sep 11, 2010, at 5:18 PM, Russ Cox wrote:

 That sounds about right, unfortunately.
 You might be better off just using TeX.
 It's better at math, it runs on Plan 9,
 and your colleagues who don't use
 Plan 9 will still be able to collaborate
 on documents with you.

Has anyone experimented with using TeX to generate equations, store them as 
.eps, and then insert them into troff in some way that makes:

.BP eqn1.eps
.EP

look like

.EQ (1)
sqrt{ {x sup 2 + x + 1} over {x - 1}}
.EN

Only without the broken font/line drawing when converted from postscript to pdf?

Convoluted I know, but it sure would make $\sqrt{ {{x^2 + x + 1}\over {x-1}} }$ 
look more acceptable in a PDF generated on Plan 9 from troff source.

-jas




Re: [9fans] troff fonts with special characters

2010-09-13 Thread erik quanstrom
 .EQ (1) sqrt{ {x sup 2 + x + 1} over {x - 1}} .EN
 
 Only without the broken font/line drawing when converted from
 postscript to pdf?
 
 Convoluted I know, but it sure would make $\sqrt{ {{x^2 + x + 1}\over
 {x-1}} }$ look more acceptable in a PDF generated on Plan 9 from troff
 source.

i know i did something with this.  i think i was convinced
that part of the problem was eqn was using the wrong font.

- erik



Re: [9fans] troff fonts with special characters

2010-09-13 Thread ron minnich
On Mon, Sep 13, 2010 at 7:05 AM, Jeff Sickel j...@corpus-callosum.com wrote:

 Has anyone experimented with using TeX to generate equations, store them as 
 .eps, and then insert them into troff in some way that makes:

 .BP eqn1.eps
 .EP

 look like

 .EQ (1)
 sqrt{ {x sup 2 + x + 1} over {x - 1}}
 .EN

 Only without the broken font/line drawing when converted from postscript to 
 pdf?

 Convoluted I know, but it sure would make $\sqrt{ {{x^2 + x + 1}\over {x-1}} 
 }$ look more acceptable in a PDF generated on Plan 9 from troff source.

now you're getting silly :-)

ron



Re: [9fans] troff fonts with special characters

2010-09-12 Thread Akshat
If you like the cleanliness and simplicity of troff files for writing  
papers, and would like to avoid the hideousness of TeX, then you might  
want to try Lout. I ported it to Plan 9 earlier this year and just  
copied it to my contrib: contrib/akumar/lout.tgz



Best of luck,
ak

On Sep 12, 2010, at 2:25, Rudolf Sykora rudolf.syk...@gmail.com wrote:


On 12 September 2010 00:18, Russ Cox r...@swtch.com wrote:

That sounds about right, unfortunately.
You might be better off just using TeX.
It's better at math, it runs on Plan 9,
and your colleagues who don't use
Plan 9 will still be able to collaborate
on documents with you.

Russ


Thanks for the answer.
I've actually used TeX and LaTeX for more than 15 years. LaTeX is de
facto standard for physics journals.
But for private work LaTeX is a no-way for me --- plain TeX is much
simpler without illegible complex macros.
When acquianted with troff, tbl, eqn, grap, pic, I started to like
their simplicity, smallness. And basically I can do almost all my work
with them.

Ok. I will have to think. Maybe TeX really is the right choice for  
me now.


But, generally. If troff in plan9 is to be a serious tool in the
future, the procedure must be simplified, I believe. I think that
plan9 troff should be able to use (read metrics) from otf/t1/ttf fonts
(like the Heirloom troff can).

Thank you
Ruda





Re: [9fans] troff fonts with special characters

2010-09-12 Thread Rudolf Sykora
On 12 September 2010 20:25, Akshat aku...@mail.nanosouffle.net wrote:
 If you like the cleanliness and simplicity of troff files for writing
 papers, and would like to avoid the hideousness of TeX, then you might want
 to try Lout. I ported it to Plan 9 earlier this year and just copied it to
 my contrib: contrib/akumar/lout.tgz


 Best of luck,
 ak

Thanks for the idea.
Actually I was considering this a while ago. I even printed out the
manual.(I have lout in linux.)
However, from what I read there I gained the feeling that
-- it doesn't know utf (thus you can't really just write a single
letter 'alpha' as you can in troff)
-- it somehow seems to be an 'all together software' (as opposed to
tbl/pic/eqn/...), which I don't like.
-- the syntax for writing math is more complicated than in eqn. The
syntax is rather closer to TeX, which I wanted to avoid, though the
results, I feel, are no better than eqn's.
True, I haven't actually tried the software much. May be that I am
also wrong in some points.

Well, don't take me wrong. I have not much against (plain)TeX. When I
was about 15 and got a printed version of TeXBook, METAFONT, I was
amazed. Its documentation can't be better (nothing to compare to
anything). The algorithms are superior. It's not so big either
(although today's distributions are horrible, 1GB [this I really
hate]; but the core, as someone here is trying to put up, is fine; I
mean KerTeX or what). It's only that troff is even much simpler and
yet good enough. And also that the notation is much more human. Making
a table with tbl or a simple graph with grap is a pleasure. Equations
written for eqn can be read back from the source, without seeing
millions of \\\.This is, I would say, what totally grabbed me. And
the documentation as written by Kernighan is also awesome --- short,
answers many potential questions right away, explains things clearly.
This is why I also like plan 9, generally (though almost whatever I
try doesn't work). TeX is very 'strict', precise; but you must have a
good knowledge of it to talk it into something. Troff is more
straightforward, simpler, and is more fun, some things are playful,
e.g. traps.

Thanks
Ruda



Re: [9fans] troff fonts with special characters

2010-09-12 Thread Akshat
You are right in that Lout cannot handle non-ASCII input, which is  
something that kept me from using it much, as well. However, the  
overall approach to the syntax and what not is much nicer than TeX.  
Also, I would argue that Lout has much nicer output than both, troff  
and TeX.


On Sep 12, 2010, at 12:38, Rudolf Sykora rudolf.syk...@gmail.com  
wrote:


On 12 September 2010 20:25, Akshat aku...@mail.nanosouffle.net  
wrote:

If you like the cleanliness and simplicity of troff files for writing
papers, and would like to avoid the hideousness of TeX, then you  
might want
to try Lout. I ported it to Plan 9 earlier this year and just  
copied it to

my contrib: contrib/akumar/lout.tgz


Best of luck,
ak


Thanks for the idea.
Actually I was considering this a while ago. I even printed out the
manual.(I have lout in linux.)
However, from what I read there I gained the feeling that
-- it doesn't know utf (thus you can't really just write a single
letter 'alpha' as you can in troff)
-- it somehow seems to be an 'all together software' (as opposed to
tbl/pic/eqn/...), which I don't like.
-- the syntax for writing math is more complicated than in eqn. The
syntax is rather closer to TeX, which I wanted to avoid, though the
results, I feel, are no better than eqn's.
True, I haven't actually tried the software much. May be that I am
also wrong in some points.

Well, don't take me wrong. I have not much against (plain)TeX. When I
was about 15 and got a printed version of TeXBook, METAFONT, I was
amazed. Its documentation can't be better (nothing to compare to
anything). The algorithms are superior. It's not so big either
(although today's distributions are horrible, 1GB [this I really
hate]; but the core, as someone here is trying to put up, is fine; I
mean KerTeX or what). It's only that troff is even much simpler and
yet good enough. And also that the notation is much more human. Making
a table with tbl or a simple graph with grap is a pleasure. Equations
written for eqn can be read back from the source, without seeing
millions of \\\.This is, I would say, what totally grabbed me. And
the documentation as written by Kernighan is also awesome --- short,
answers many potential questions right away, explains things clearly.
This is why I also like plan 9, generally (though almost whatever I
try doesn't work). TeX is very 'strict', precise; but you must have a
good knowledge of it to talk it into something. Troff is more
straightforward, simpler, and is more fun, some things are playful,
e.g. traps.

Thanks
Ruda





Re: [9fans] troff fonts with special characters

2010-09-11 Thread Rudolf Sykora
Hello,

this starts to be daunting...

When I use troff with the R font, troff uses metrics from /sys/lib/troff/font/R.
Then something, when dpost -f is running, must take the real glyphs
and put them into the final ps.
I guess that something must read /sys/lib/postscript/troff/R to find
out that characters 0-0xFF are now from Times-Roman while above (at
least to 0x25FF) are from LucidaSansUnicodeXX (XX=01--25). Finally ps
is somehow generated (btw. there is no man page for neither
aux/tr2post, nor addpsfonts).

Now, if I want to add some characters which I miss in troff
(mathematics, like U27E8) while using Times-Roman for basic text, it
seems I have to
- find some font that covers my characters
- get the metrics (widths) of my characters (afm2troff.c for T1, some
other tool for TrueType, OpenType)
- add the metrics for troff (e.g. add characters to /sys/lib/troff/font/R)
- add an entry to the table in /sys/lib/postscript/troff/R saying the
name of the new font
- put the font somewhere where gs will find it
- find some bitmap font so that I can also see the characters on
screen, or produce such with ttf2subf
- prey :)

This, if it's really so, sounds really above my powers...
Am I wrong?

Thanks
Ruda



Re: [9fans] troff fonts with special characters

2010-09-11 Thread Russ Cox
That sounds about right, unfortunately.
You might be better off just using TeX.
It's better at math, it runs on Plan 9,
and your colleagues who don't use
Plan 9 will still be able to collaborate
on documents with you.

Russ



[9fans] troff fonts with special characters

2010-09-10 Thread Rudolf Sykora
Hello,

I've been trying to regularly use troff for my writings. Being a
physicist I generally write a lot of math. What I miss quite often are
special math characters like Dirac brackets, in TeX \langle, \rangle
(so far I've replaced them just with  and ; but then I sometimes
need them bigger...), but also others.
I want to ask if somebody tried to add such characters using some
fonts or at least can give some instructions as to what needs to be
done.

If I understand right, troff only needs to know widths of characters,
i.e. /sys/lib/troff/font/devutf/'font_description'. Is that all troff
needs?

Then I need to both somehow see the characters on screen and get them
to the postscript result, i.e. have a real font file for both.
Is there any documentation about how this should be done?
Is there anywhere any documentation about how 'dpost' (tr2post) works?

Thanks
Ruda