[Zope] A ZClass for LaTeX documents

John Verzani verzani@postbox.csi.cuny.edu
23 Oct 2000 13:45:13 -0500


Hi,

I've been using a ZClass for LaTeX documents that I put together in a
manner very similar to the one described in making a ZClass for STX
documents at http://www.zope.org/Members/tseaver/STX_Document I like
to mark things up in LaTeX as I can type it faster than HTML, I can
create very nice printouts in PDF or PostScript and there is a nice
renderer into HTML called tth.

There are a few annoyances that I would like some help on.

* I am using tth (http://hutchinson.belmont.ma.us/tth/) which can
  convert LaTeX into HTML quite well. In order to do so, when
  uploading the tex file or changing the tex file, I call tth and
  store the HTML along with the tex source. My DTML for this is

<dtml-if uploaded_body>
  <dtml-call "REQUEST.set('body_tex', uploaded_body )">
</dtml-if>
<dtml-if body_tex>
	<dtml-let body_html="PARENTS[-1].SiteMethods.tth(body_tex)">
	<dtml-call "REQUEST.set('body_html',body_html)">
	</dtml-let>
</dtml-if>

<dtml-call "propertysheets.Basic.manage_editProperties( REQUEST )">
<dtml-call reindex_object>

  Which if there is a new file upload stores it in body_tex, and then
  takes body tex and run tth on this to create the body_html. 

  When I do this though, the tth is called on the old body_tex data, not 
  the recently stored one. Because of this, I have to change the file
  twice. 

  Any ideas as to why and how I can fix this? My guess is
  subtransactions, but I don't know how to fix that. 


* Ideally, I would like to be able to call the latex file this way
  <dtml-var latex_filename fmt=tth> 

  (or even better just as <dtml-var latex_filename>) 

  where tth is a method which takes a latex document and returns
  HTML. I couldn't figure out how to do this though. How does one go
  about defining new format methods for ZClasses? I would imagine it
  isn't hard, I just need to know where to look.

* If that isn't too hard, I would also like to know how to make this
  an option for markup in SquishDot. I have a math class using this as 
  a discussion board, and it would be nice to let them use basic LaTeX 
  for math markup.

Thanks for any pointers.

John Verzani



-- 
....................................................................
.  John Verzani                  mailto:verzani@math.csi.cuny.edu  .
.  Dept. of Mathematics      http://www.math.csi.cuny.edu/~verzani .
.  City University of New York                 tel: (718) 982-3623 .
.  College of Staten Island                    fax: (718) 982-3631 .
.  Staten Island, NY 10314                                         .
....................................................................