[l2h] greetings

Ross Moore ross@ics.mq.edu.au
Thu, 9 Aug 2001 10:08:24 +1000 (EST)


> Hi,
> 
> Yesterday I downloaded and installed latex2html on my computer. I'm messing
> around with graph theory (and lots of remedial math) and needed a way to
> order my thoughts in browsable format.
> 
> This is some very nice software, I love it!
> 
> It needs some refactoring though, and I want to know if anyone would mind
> if I took a swing at it.  I'm new to TeX, but a pretty sure hand at Perl.

Definitely.
As I don't have a lot of time to do any major reworking,
it would be great to have someone new, with enthusiasm.

The main deficiency is that most of LaTeX2HTML was written for Perl 4,
and could not assume that too many packages were available.
This is no longer the case.
Revamping the code for precompiled packagesshould result
in a significant speed-up, I'd guess.
 
> I've already seen some stuff I'd like to do:
> 
> 	* I think there might have been a big change in the way pnmcrop works,
> 	  because I was able to remove a big chunk of code from pstoimg based
> 	  on a discrepency between pnmcrops function and its implementation
> 	  in pstoimg.pin;
> 
> 	  very roughly, this:
> 	  	my $crop_cmd = "$PNMCROP < $in | $PNMCROP -black -s"
> 		print "trying $crop_cmd, now\n" if $opt{debug};
> 		do_cmd ( $in, $tmp, $crop_cmd ) || return 0;

Maybe...
> 
> 	  can replace the existing code;
> 	  	(er I won't burden you with around 50 lines of code, it's the
> 		 central while loop constructing pstoimg's pnmcrop command,
> 	     passing it to gs, and a couple lines above that, as well.)
> 
> 	  It's not necessary to nibble away at the edges using crop, you
> 	  can just tell it what color you don't like and the -s flag

... if you know what that color is.
It has to work with colored text and cropping bars,
as well as colored backgrounds.

The difficult part of programming pnmcrop is to capture exactly the
right amount of (background colored) space below the text,
so that images are correctly aligned when centered vertically.
(One cannot just crop to the minimal rectangle containing the text.)

There needs to be at least 3 crops, and there is a 4th 'shaving'
to fine tune the bottom edge of some images.
All of this is deliberately programmed.

If you have an alternative way that is guaranteed to always work,
then I'd definitely like to see it.

> 	  handles the rest.  I'm not sure if older versions of netpbm
> 	  had substantially different command line interfaces though,
> 	  in which case some version checks would need to be included.
> 	  That's not a problem, the netpbm people keep the old versions
> 	  available.

Yes; there are differences in the 8.x and 9.x versions.


> 	* General code cleanup (I think I see at least two different stylistic
> 	  approaches in the code and some refactoring and pretty printing
> 	  might help with maintenance.)

Yep; this is related to its Perl 4 origins, and my comments above.
 
> 	* Several different methods of accessing data in files.  I think
> 	  that could be cleaned up very easily, using the IO objects.

agreed.

> 	* Total freakin rewrite. OOPs. Did I say that?  I just think a
> 	  lot of this code would look real good in its own module, in a
> 	  class by itself, so to say. Abstracting the functionality of
> 	  pstoimg & brethren into an image manipulation class would make
> 	  maintenance a lot simpler, too.

 :-)  
 no arguments from me; I just don't have the time to do it myself.

Being more modular would probably also help with making a version
for translating into general XML markup schemes.
Existing XML modules for Perl could then be used.

> 	* Error Handling. Mostly pretty cool except most of the posts
> 	  I saw in the mailing list were gs 'Illegal Seek' and other
> 	  arcane gobbledygeek. Carp (or even Coy if you think Carp
> 	  smells), the IO objects and stricter error checking would
> 	  help users to know what to post and developers tired of poking
> 	  through -debug output.
 
> 	* I'm bored.  I've been on vacation too long and I want something

That's the best reason I've ever heard for volunteering to do some work.
 :-)
> 	  nifty to work on.  Trying to grok graph theory and reconcile it
> 	  to principles in molbio got me on this visual kick (& Knuth
> 	  is da bomb.)
 
> That's it, except to say again I think latex2html is a very nice program.

Thanks for saying so, and for offering to help make it better.


All the best,

	Ross Moore

 
> CA
> -- 
> There was a time
> A wind that blew so young
> For this could be the biggest sky
> And I could have the faintest idea
> 
> _______________________________________________
> latex2html mailing list
> latex2html@tug.org
> http://tug.org/mailman/listinfo/latex2html