<div dir="ltr"><div dir="ltr">I am far (very far!) from being a tex expert ... but could you not use a 2ndary program to do the calculations and format them into something tex understands and then \include that result into the main tex/latex/latex2html files? Wrap it all together in a makefile and you're done. Much easier, thinks I, than writing a pre-processor :)<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Apr 5, 2019 at 9:35 AM <<a href="mailto:bmassing@cs.trinity.edu">bmassing@cs.trinity.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">First, I agree that it doesn't seem feasible for latex2html to <br>
implement all of TeX.<br>
<br>
Below is a short simple program showing my current macros and<br>
usage.  I wrote the macros a long time ago, and on looking at<br>
them again, they're kind of ugly.  But they get the job done --<br>
as long as I only want to use integers.  That's starting to <br>
feel restrictive.<br>
<br>
There are various options for doing arithmetic on floating-point<br>
values, including what seem to be a variety of LaTeX packages.<br>
It occurs to me, however, that very likely none of them will do<br>
what I want to, *because* I want to be able to print the total<br>
at the top of the document.  My current macros can do that using<br>
\refstepcounter and \label, but I don't think any of the LaTeX<br>
packages I've looked at would do that.<br>
<br>
More and more I think I need to just write a preprocessor!  "How<br>
hard can it be" ....  :-)?<br>
<br>
<br>
==== start of .tex file ====<br>
<br>
\documentclass{article}<br>
<br>
% ---- macros ----<br>
<br>
\newcounter{Tpoints}<br>
\setcounter{Tpoints}{0}<br>
<br>
\newcommand{\EndAll}{<br>
        \addtocounter{Tpoints}{-1}<br>
        \refstepcounter{Tpoints}<br>
        \label{tpoints}<br>
}<br>
<br>
\newcommand{\Points}[1]{<br>
        ({#1} points)<br>
        \addtocounter{Tpoints}{#1}<br>
}<br>
<br>
% ---- document ----<br>
<br>
\begin{document}<br>
<br>
Total credit:  \ref{tpoints} points.<br>
<br>
\begin{enumerate}<br>
\item \Points{10} Do this problem.<br>
\item \Points{30} Do that problem.<br>
\end{enumerate}<br>
<br>
\EndAll<br>
<br>
\end{document}<br>
<br>
==== end of .tex file ====<br>
<br>
<br>
-- blm<br>
<br>
<br>
<br>
On Fri, Apr 05, 2019 at 08:19:48AM +0300, Сергей Знаменский wrote:<br>
>>  <br>
>>  Dear <a href="mailto:bmassing@cs.trinity.edu" target="_blank">bmassing@cs.trinity.edu</a>!<br>
>>  <br>
>>  True TeX syntax is too complicated to be fully implemented <br>
>>  in convertors like latex2html. Only the most sensitive features <br>
>>  can be supported.<br>
>>  <br>
>>  In order to recommend some approach the simple usage examples <br>
>>  (TeX source fragment with desirable text/HTML results) are<br>
>>  necessary. <br>
>>  <br>
>>  Would You like to provide simple examples of what You'd like to get?  <br>
>>  <br>
>>  Yours, Sergej<br>
>>  <br>
>>  > ----- Original Message ----- <br>
>>  > From: <a href="mailto:bmassing@cs.trinity.edu" target="_blank">bmassing@cs.trinity.edu</a><br>
>>  > To: <a href="mailto:latex2html@tug.org" target="_blank">latex2html@tug.org</a><br>
>>  > Sent: Thu, 4 Apr 2019 17:47:59 -0500<br>
>>  > Subject: [l2h] non-integer calculations -- any way to do this?<br>
>>  > <br>
>>  > I have a set of macros I originally wrote only for LaTeX that<br>
>>  > do some primitive calculations, calculating a runniing total<br>
>>  > using LaTeX's counter mechanism.  At some point I started using<br>
>>  > these macros with TeX source to be processed with latexh2ml.<br>
>>  > They seem to work fine, but now I'd like to revise the macros to<br>
>>  > support non-integer values for the running total.  It looks like<br>
>>  > there are many options for doing this in LaTeX, but no surprise,<br>
>>  > I'm not finding anything that latex2html can deal with properly.<br>
>>  > So:<br>
>>  > <br>
>>  > Can anyone think of a way to easily do this?  perhaps a<br>
>>  > latex2html-friendly LaTeX package??  (This seems unlikely,<br>
>>  > but might as well ask?)<br>
>>  > <br>
>>  > If that's not feasible, I'm thinking that if I get really<br>
>>  > determined I could try to tweak latex2html, but I can't figure<br>
>>  > out where to start!  Documentation says it provides some<br>
>>  > primitive support for plain-TeX commands such as \newdimen,<br>
>>  > but I'm sure not finding anyplace in the source that does that.  ?<br>
>>  > <br>
>>  > Or maybe there's some totally different approach I could use<br>
>>  > instead?  pre-processing the source, post-processing the result .... ?<br>
>>  > <br>
>>  > Suggestions appreciated!<br>
>>  > <br>
>>  > -- blm<br>
>>  > <br>
<br>
-- <br>
-----------------------------------------------------------------<br>
Dr. Berna L. Massingill<br>
Associate Professor, Computer Science<br>
Trinity University<br>
One Trinity Place; San Antonio, TX 78212-7200<br>
210-999-8138<br>
<a href="mailto:bmassing@cs.trinity.edu" target="_blank">bmassing@cs.trinity.edu</a><br>
-----------------------------------------------------------------<br>
_______________________________________________<br>
latex2html mailing list<br>
<a href="mailto:latex2html@tug.org" target="_blank">latex2html@tug.org</a><br>
<a href="https://tug.org/mailman/listinfo/latex2html" rel="noreferrer" target="_blank">https://tug.org/mailman/listinfo/latex2html</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><span><font color="#888888"><br><div>**** Listen to my FREE CD at <a href="http://www.mellowood.ca/music/cedars" target="_blank">http://www.mellowood.ca/music/cedars</a> ****<br>Bob van der Poel ** Wynndel, British Columbia, CANADA **<br>EMAIL: <a href="mailto:bob@mellowood.ca" target="_blank">bob@mellowood.ca</a><br>WWW:   <a href="http://www.mellowood.ca" target="_blank">http://www.mellowood.ca</a></div></font></span></div></div></div>