[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

TeX and ruby

pierodancona

12/9/2006 4:50:00 PM

Hi,
how diffcult could it possibly be to fully integrate TeX
(and, for that matter, pdftex) as a subset of ruby?
Essentially, TeX is just some trivial arithmetic.
Maybe pdftex is a bit more complex.
Regards,
Piero

14 Answers

Vincent Fourmond

12/9/2006 5:08:00 PM

0

> Hi,
> how diffcult could it possibly be to fully integrate TeX
> (and, for that matter, pdftex) as a subset of ruby?

What do you mean by that ? Do you want to produce Pdf files formatted
by Tex from within ruby ? Or do you want to be able to make a LaTeX
document using Ruby to write macros, like PerlTex ?

http://www.tug.org/tex-archive/help/Catalogue/entries/pe...

In either case, I don't believe it's less than a few month
more-than-fulltime work.

> Essentially, TeX is just some trivial arithmetic.

Maybe it is trivial, but I don't believe it to be small, and I have a
strong feeling that the author was not writing code for nothing...

Vince

--
Vincent Fourmond, PhD student
http://vincent.fourmon...

pierodancona

12/9/2006 5:31:00 PM

0

Well, perltex basically extends TeX: you work
inside TeX, then at some point you go out, do
someting in perl, then go back in TeX. In some
sense this is already present in the original
implementation of TeX (via write18 stuff etc).

What I mean is: would it be possible to completely
dispense with TeX? I mean, to produce a dvi file from
inside ruby, using a syntax as close as possible
to TeX's. Or to produce a pdf output via commands
close to pdftex's. Of course I can easily write some
ruby code which outputs a .tex file and then asks TeX
to compile it, but that would be pointless.

Why I am asking: TeX's algorithms (paragraph
formatting, hyphenation, math formatting etc) are
close to optimal, and having them at hand would
be much more useful that leaving them buried inside
the TeX program (or pdftex). One simple application
could be to insert beautifully formatted formulas
into any document; or, one might play with the
basics of TeX and produce a superTeX with more
bells and whistles. In any case, every ruby programmer
could play wiih TeX and expand or simply use its
algorithms.

Just dreaming,
Piero


Vincent Fourmond wrote:
> > Hi,
> > how diffcult could it possibly be to fully integrate TeX
> > (and, for that matter, pdftex) as a subset of ruby?
>
> What do you mean by that ? Do you want to produce Pdf files formatted
> by Tex from within ruby ? Or do you want to be able to make a LaTeX
> document using Ruby to write macros, like PerlTex ?
>
> http://www.tug.org/tex-archive/help/Catalogue/entries/pe...
>
> In either case, I don't believe it's less than a few month
> more-than-fulltime work.
>
> > Essentially, TeX is just some trivial arithmetic.
>
> Maybe it is trivial, but I don't believe it to be small, and I have a
> strong feeling that the author was not writing code for nothing...
>
> Vince
>
> --
> Vincent Fourmond, PhD student
> http://vincent.fourmon...

Paul Lutus

12/9/2006 5:56:00 PM

0

pierodancona@gmail.com wrote:

> Why I am asking: TeX's algorithms (paragraph
> formatting, hyphenation, math formatting etc) are
> close to optimal, and having them at hand would
> be much more useful that leaving them buried inside
> the TeX program (or pdftex).

Yes, unless the effort required to recreate the TeX algorithms is unduly
onerous, and unless no sane person would be willing to undertake the task
of converting the code.

> One simple application
> could be to insert beautifully formatted formulas
> into any document; or, one might play with the
> basics of TeX and produce a superTeX with more
> bells and whistles. In any case, every ruby programmer
> could play wiih TeX and expand or simply use its
> algorithms.

In principle, yes, all you say is true -- one could recreate all TeX
processing in plain Ruby code. But it would probably be very slow, and it
would be a case of reinventing the wheel.

> Just dreaming,

Fair enough. Have you considered reducing your idea to practice, by
recreating the TeX engine in Ruby? It's one think to speculate about such a
thing, it's quite another to write and test the code.

--
Paul Lutus
http://www.ara...

Logan Capaldo

12/9/2006 9:37:00 PM

0

On Sun, Dec 10, 2006 at 03:00:05AM +0900, Paul Lutus wrote:
> pierodancona@gmail.com wrote:
>
> > Why I am asking: TeX's algorithms (paragraph
> > formatting, hyphenation, math formatting etc) are
> > close to optimal, and having them at hand would
> > be much more useful that leaving them buried inside
> > the TeX program (or pdftex).
>
> Yes, unless the effort required to recreate the TeX algorithms is unduly
> onerous, and unless no sane person would be willing to undertake the task
> of converting the code.
>
I think you misunderstood what he was saying. I think he wants ruby
bindings to TeX at the level below the TeX syntax (IOW instead of
producing TeX and piping it thru pdftex, link to libtex (I don't think
there is such a thing)). He doesn't want to reimplement TeX in ruby.
> > One simple application
> > could be to insert beautifully formatted formulas
> > into any document; or, one might play with the
> > basics of TeX and produce a superTeX with more
> > bells and whistles. In any case, every ruby programmer
> > could play wiih TeX and expand or simply use its
> > algorithms.
>
> In principle, yes, all you say is true -- one could recreate all TeX
> processing in plain Ruby code. But it would probably be very slow, and it
> would be a case of reinventing the wheel.
>
*reiterates what I said above*
> > Just dreaming,
>
> Fair enough. Have you considered reducing your idea to practice, by
> recreating the TeX engine in Ruby? It's one think to speculate about such a
> thing, it's quite another to write and test the code.
>
Again, I don't think this is what he's going for.
> --
> Paul Lutus
> http://www.ara...

ishamid

12/9/2006 10:42:00 PM

0

On Dec 9, 9:50 am, pierodanc...@gmail.com wrote:
> Hi,
> how diffcult could it possibly be to fully integrate TeX
> (and, for that matter, pdftex) as a subset of ruby?
> Essentially, TeX is just some trivial arithmetic.
> Maybe pdftex is a bit more complex.
> Regards,
> Piero

Actually the luaTeX project is the result of similar concerns and
needs. It's being developed by fans of Ruby but lua was chosen for
embedding in the TeX engine itself for a number of reasons (much
smaller for one thing, and also that lua was designed for just this
sort of thing).

Check out

https://foundry.supelec.fr/frs/?g...

There is a manual in there as well.

At the macropackage level (eg ConTeXt) Ruby plays a much more important
role.

luaTeX is the most important development (at the engine level) in TeX
in years so check it out!

Take care
Idris

David Kastrup

12/9/2006 11:18:00 PM

0

"ishamid" <ishamid@colostate.edu> writes:

> On Dec 9, 9:50 am, pierodanc...@gmail.com wrote:
>
>> how diffcult could it possibly be to fully integrate TeX
>> (and, for that matter, pdftex) as a subset of ruby?
>> Essentially, TeX is just some trivial arithmetic.
>> Maybe pdftex is a bit more complex.
>
> Actually the luaTeX project is the result of similar concerns and
> needs. It's being developed by fans of Ruby but lua was chosen for
> embedding in the TeX engine itself for a number of reasons (much
> smaller for one thing, and also that lua was designed for just this
> sort of thing).
>
> Check out
>
> https://foundry.supelec.fr/frs/?g...
>
> There is a manual in there as well.
>
> At the macropackage level (eg ConTeXt) Ruby plays a much more important
> role.
>
> luaTeX is the most important development (at the engine level) in
> TeX in years so check it out!

Does that mean that you have given up on Omega?

--
David Kastrup, Kriemhildstr. 15, 44793 Bochum

ishamid

12/10/2006

0

Hi David,

It's been a long time....

On Dec 9, 4:17 pm, David Kastrup <d...@gnu.org> wrote:

> > luaTeX is the most important development (at the engine level) in
> > TeX in years so check it out!

> Does that mean that you have given up on Omega?

Well, I gave up on Omega a long time ago... Switched to Aleph, a stable
version of omega1.15, which has very recently been integrated into
luaTeX, which in turn is a merge of pdfTeX, the best/stable of
Aleph,and lua. This work is supported in part by a grant I received
from my university which, in part, allows Taco Hoekwater to work on the
merge etc..

Still alpha, but I can use luatex reliably for my aleph/omega docs.
OpenType fonts should be done soon, as well as direct pdf output for
omega's large fonts.

In short, luaTeX is on the move, and the developers listen to users.

Best
Idris

ishamid

12/10/2006 12:28:00 AM

0

Hi,

On Dec 9, 9:50 am, pierodanc...@gmail.com wrote:
> Essentially, TeX is just some trivial arithmetic.

Not so, designing/implementing its algorithms provided more than one
gradaate student with his doctorate :-)

Look up the collection Digital Typography by Knuth to see just how
non-trivial TeX is...

Best
Idris

ishamid

12/10/2006 12:29:00 AM

0

Hi Piero,

On Dec 9, 9:50 am, pierodanc...@gmail.com wrote:
> Essentially, TeX is just some trivial arithmetic.

Not so, designing/implementing its algorithms provided more than one
gradaate student with his doctorate :-)

Look up the collection Digital Typography by Knuth to see just how
non-trivial TeX's arithmetic is...

Best
Idris

ishamid

12/10/2006 12:53:00 AM

0

Hi,

On Dec 9, 9:50 am, pierodanc...@gmail.com wrote:
> Essentially, TeX is just some trivial arithmetic.

Not so, designing/implementing its algorithms provided more than one
gradaate student with his doctorate :-)

Look up the collection Digital Typography by Knuth to see just how
non-trivial TeX is...

Best
Idris