[l2h] subequations and pictures

Ross Moore ross.moore at mq.edu.au
Fri Jan 22 11:57:29 CET 2021


Hello Tomas and Daniel,

On 22 Jan 2021, at 8:24 pm, Tomas Davidek <Tomas.Davidek at cern.ch<mailto:Tomas.Davidek at cern.ch>> wrote:

Thanks Daniel, this is interesting. It really works on the simple
example. Therefore, I tried to apply the same method to the more complex
case, but then dvips seem to crash and consequently no images are
written to images.pdf. I run:

latex2html -nouse_pdftex example_l2h.tex >& example_l2h.log

both the source code and log file are attached. Can you please help me
in figuring out what's going on?

Your document is written for pdftex, using UTF8 input,
to handle the Czech language.

The figures are run through  dvips+gs  to create images of the figures.
But there’s nothing there that allows TeX+dvips  to interpret the UTF8
letters in the figure captions.

So you are going to get a failure, unless you are prepared to customise
so that TeX + dvips  can interpret those letters.

Look at the  images.tex  file that you get from  latex2html .
Try to run it. See where it fails.


To test whether this assessment is correct, comment out the captions
in your figures,  then run  latex2html  on what is left.  Does it work now?


LaTeX2HTML is roughly 20 years old — I know, ‘cos I wrote a lot of it, way back then.
LaTeX has moved on. People expect more.

The best way to do LaTeX to PDF is now going via PDF, using Acrobat Pro.
Spend some money and do yourself a favour.



Thanks a lot, cheers,

                                        Tomas


Hope this helps.

Ross



On 1/21/21 5:56 PM, Daniel Gildea wrote:
> Your picture seems to be working for me:
> https://www.cs.rochester.edu/~gildea/test/mypicture/node1.html<https://protect-au.mimecast.com/s/Of7NCGv0Z6fGBJDotp2Kcm?domain=cs.rochester.edu>
>
> I used "latex2html -nouse_pdftex" to make this. Are you using
> any other command line options, or config files, for latex2html?
> Can you send the output of latex2html?
>
> Dan
>
>
> On Thu, January 21, 2021 at 4:38PM, Tomas Davidek wrote:
>> Thanks Daniel (and sorry for being late with the answer), the fixes in
>> /usr/bin/latex2html you proposed really fix the issue with subequation
>> numbering.
>>
>> One more rather general issue - if I understood well, all environments "not
>> known" to latex2html are processed with (pdf)latex and a picture of the
>> corresponding part is included in the HTML instead, right? Nevertheless, I
>> have a picture environment (example is attached). When processing this
>> simple example, the first picture appears in the web page. The 2nd one does
>> not. Well, it requires the axohelp command to be run at some point and I
>> don't know how to achieve that. Any idea, please?
>>
>> Then I have a more complex case with exactly the same simple LaTeX picture
>> (figure 1 in the above example). This one is not processed and does not
>> appear in the Web page. Hmm, I checked the generated images.pdf file and it
>> is not there, but I cannot see any error message in the images.log file....
>> It is not even in the images.tex file.... So, somehow the filter did not
>> dump it to the images.tex.... Where should I look to figure out what
>> happened?
>>
>> Thanks a lot for any hint.
>>
>> Best regards, Tomas
>>
>> On 1/8/21 5:45 PM, Daniel Gildea wrote:
>>> Hi,
>>>
>>> I wonder if you could try commenting out the lines
>>> shown in the attached patch in the latex2html script.
>>> This seems to make the numbering work better for me.
>>>
>>> I don't know why the character encoding wouldn't match
>>> the charset tag. Can you send an example file and tell
>>> me what command line options you are using?
>>>
>>> Dan
>>>
>>>
>>> On Fri, January 8, 2021 at 3:55PM, Tomas Davidek wrote:
>>>> Hi Dan,
>>>>
>>>>   thanks for the mail. Well, I tried to prepare a short example (attached),
>>>> but this one works perfectly. I have a much larger project that I would like
>>>> to convert to HTML. I can't send it as a whole tarball right now, but just
>>>> to give you a flavour what wrong I attach a snapshot of one page (pdf is
>>>> attached). As you can see, the subequations are numbered as 2.7a - 2.7c (but
>>>> they should in fact be 2.8a - 2.8c). Moreover, the last sentence refers to
>>>> one of the subequations (p_{\parallel}), but here the "correct" number
>>>> appears (2.8b).
>>>>
>>>> It is very strange, I should experiment more with that. I double-checked
>>>> that I processed both the simple example and the complex case in the same
>>>> way. First I thought the complex case needs one more run of latex to produce
>>>> the references correctly, but I ran latex/pdflatex before I launched
>>>> latex2html.... Looking into aux-file, the equation numbers are correct (i.e.
>>>> 2.8a - 2.8c), so I really don't understand why the picture of the three
>>>> subequations is produced with incorrect number. Can you suggest another test
>>>> I can perform?
>>>>
>>>> One more item that worries me - latex2html systematically puts
>>>> charset=iso-8859-2 into the corresponding meta tag, even if the text is
>>>> encoded in UTF-8. Is there a way to force latex2html to enter the specified
>>>> charset in every html page?
>>>>
>>>> Thanks a lot,
>>>>
>>>> cheers,
>>>>
>>>>                    Tomas
>>>>
>>>> On 1/8/21 2:57 PM, Daniel Gildea wrote:
>>>>> Hi,
>>>>>
>>>>> Could you send a small example file for each of these problems?
>>>>>
>>>>> Dan
>>>> \documentclass[11pt]{article}
>>>> \usepackage[czech]{babel}
>>>> \usepackage[utf8]{inputenc}
>>>> \usepackage{amsmath}
>>>>
>>>> \begin{document}
>>>> Pro popis interakcí částic se často používají i~tzv.~Mandelstamovy
>>>> invarianty\index{Mandelstamovy invarianty} $s, t,
>>>> u$. Představme si interakci dvou částic (1,\,2) za vzniku obecně jiných
>>>> částic (3,\,4)
>>>> \begin{equation}
>>>> \label{eq:interaction}
>>>> 1 + 2 \rightarrow 3 + 4
>>>> \end{equation}
>>>> Mandelstamovy invarianty jsou pak definovány vztahy
>>>> \begin{subequations}
>>>> \begin{align}
>>>> \label{eq:mandelstam_s}
>>>> s & \equiv (P_1 + P_2)^2 \\
>>>> \label{eq:mandelstam_t}
>>>> t & \equiv (P_1 - P_3)^2 \\
>>>> \label{eq:mandelstam_u}
>>>> u & \equiv (P_1 - P_4)^2
>>>> \end{align}
>>>> \end{subequations}
>>>> Invariant $s$ zjevně představuje kvadrát celkové energie soustavy v~jejím
>>>> těžišťovém systému (CMS), invarianty $t, u$ lze vyjádřit pomocí $s$ a úhlu
>>>> vylétajících částic v~CMS.
>>>>
>>>> The velocity $\beta$ is defined as
>>>> \begin{equation}
>>>> \label{eq:beta_def}
>>>> \vec{\beta} \equiv \vec{v}/c
>>>> \end{equation}
>>>>
>>>> This is the reference to sub-equations
>>>> (\ref{eq:mandelstam_s})--(\ref{eq:mandelstam_u}).
>>>>
>>>> \end{document}
>> \documentclass[11pt]{report}
>>
>> \usepackage[czech]{babel}
>> \usepackage{a4}
>> \usepackage{axodraw2}
>>
>> \newcommand{\gev}{\ifmmode \mathrm{GeV}\else GeV\fi}
>> \newcommand{\mev}{\ifmmode \mathrm{MeV}\else MeV\fi}
>> \newcommand{\kev}{\ifmmode \mathrm{keV}\else keV\fi}
>> \newcommand{\ele}{\ensuremath{\mathrm{e}^{-}}}
>> \newcommand{\pozitron}{\ensuremath{\mathrm{e}^{+}}}
>> \newcommand{\photon}{\ensuremath{\mathrm{\gamma}}}
>>
>> \begin{document}
>> \chapter{Jednotky}
>> \label{sec:Jednotky}
>> \index{jednotky|(}
>> Ve fyzice částic se z~praktických důvodů veličiny energie ($E$),
>> hybnost ($p$) a hmota\footnote{Pro elementární částice používáme
>> termín hmota, nikoli hmotnost. Termínem hmota vždy rozumíme
>> hmotu částice v~jejím klidovém systému, což je ekvivalentní její
>> klidové energii.} ($m$) udávají ve
>> stejných jednotkách, a~to v~jednotkách
>> energie, tedy v~násobcích eV (eV, MeV, GeV, \dots).
>> Pracujeme tedy ve skutečnosti s~veličinami $E$, $pc$, $mc^2$,
>> které ovšem zapisujeme jako $E$, $p$ a $m$.
>>
>> Tím se výrazně zjednodušují vztahy mezi jednotlivými kinematickými
>> proměnnými, např.\ pro celkovou energii částice pak platí
>> relativistický vztah
>> \begin{equation}
>> \label{eq:total_energy}
>> E = \sqrt{p^2 + m^2},
>> \end{equation}
>> kde $p$ je hybnost a $m$ klidová hmota částice.
>>
>> Při výpočtech budeme často používat součin rychlosti světla $c$ a
>> Planckovy konstanty, proto je velmi užitečné si zapamatovat výslednou
>> hodnotu:
>> \begin{equation}
>> \label{eq:hc}
>> \hbar c \doteq 0{,}197~\mathrm{fm}\cdot\gev
>> \end{equation}
>>
>> Poznamenejme, že v~některé literatuře %(především v~teoretických pracích)
>> se používá soustava jednotek
>> \begin{displaymath}
>> c = \hbar = 1,
>> \end{displaymath}
>> tj.~tyto konstanty ve výrazech jednoduše nevystupují. Při číselných
>> výpočtech však musíme \uv{doplnit} příslušné mocniny $c$ a $\hbar$ tak, aby
>> výsledná jednotka odpovídala SI\@. Hodnota $\hbar c$ ze
>> vztahu~(\ref{eq:hc}) pak představuje převodní
>> faktor mezi veličinami s~rozměrem délky a energie.
>>
>> V~této knize budeme pro lepší orientaci čtenářů používat obě zmíněné
>> konstanty $\hbar$ i $c$. Jedinou výjimkou je vyjádření hybnosti a hmoty částic
>> v~energetických jednotkách, jak je uvedeno výše.
>> \index{jednotky|)}
>>
>> \begin{figure}
>> \centering
>> \setlength{\unitlength}{0.5mm}
>> \begin{picture}(60,100)
>> % \put(0,0){\framebox(60,100){}}
>> \put(5,5){\makebox(0,0)[c]{a)}}
>> \put(20,50){\vector(0,1){50}}
>> \put(20,50){\vector(0,-1){50}}
>> %
>> \put(45,50){\makebox(0,0)[c]{$\vec{P}=\vec{0}, M$}}
>> \put(35,75){\makebox(0,0)[c]{$\vec{p}_1, m_1$}}
>> \put(35,25){\makebox(0,0)[c]{$\vec{p}_2, m_2$}}
>> \thinlines
>> \put(20,50){\circle*{15}}
>> \end{picture}\hfill%
>> \begin{picture}(180,100)
>> % \put(0,0){\framebox(180,100){}}
>> \put(5,5){\makebox(0,0)[c]{b)}}
>> \put(20,50){\vector(0,1){50}}
>> \put(20,50){\vector(0,-1){50}}
>> %
>> \put(45,50){\makebox(0,0)[c]{$\vec{P}=\vec{0}, M$}}
>> \put(35,75){\makebox(0,0)[c]{$\vec{p}_{12}, m_{12}$}}
>> \put(35,25){\makebox(0,0)[c]{$\vec{p}_3, m_3$}}
>> \thinlines
>> \put(20,50){\circle*{15}}
>>
>> \thicklines
>> \put(85,50){\makebox(0,0)[c]{\LARGE $\oplus$}}
>> \put(130,50){\vector(1,1){40}}
>> \put(130,50){\vector(-1,-1){40}}
>> \put(160,50){\makebox(0,0)[c]{$\vec{p}^{\,*}_{12} = \vec{0}, m_{12}$}}
>> \put(135,75){\makebox(0,0)[c]{$\vec{p}^{\,*}_1, m_1$}}
>> \put(125,25){\makebox(0,0)[c]{$\vec{p}^{\,*}_2, m_2$}}
>> \thinlines
>> \put(130,50){\circle*{15}}
>> \end{picture}
>> \caption{Schéma dvoučásticového rozpadu (a) a
>> tříčásticový rozpad (b) nahlížený jako dva po sobě jdoucí
>> dvoučásticové rozpady, každý ve svém těžišťovém systému.}
>> \label{fig:rozpad_1_2_3}
>> \end{figure}
>>
>> \begin{figure}
>> \centering
>> \setlength{\unitlength}{0.5mm}
>> \begin{picture}(140,100)
>> \SetScale{1.42} % default to 1 => 1pt (1/72 inch). Now scaled
>> % to 0.5mm (72/25.4)
>>
>> \ArrowLine(0,50)(50,50) \put(10,44){\makebox(0,0)[c]{\ele}}
>> \ArrowLine(50,50)(90,80) \put(75,60){\makebox(0,0)[c]{\ele}}
>> \Photon(50,50)(90,20){2}{5.5} \put(75,40){\makebox(0,0)[c]{\photon}}
>> \Vertex(50,50){2}
>>
>> \ArrowLine(90,80)(136,100) \put(115,85){\makebox(0,0)[c]{\ele}}
>> \Photon(90,80)(130,50){2}{5.5} \put(110,55){\makebox(0,0)[c]{\photon}}
>> \Vertex(90,80){2}
>>
>> \ArrowLine(90,20)(135,40) \put(115,37){\makebox(0,0)[c]{\ele}}
>> \ArrowLine(90,20)(135,0) \put(115,2){\makebox(0,0)[c]{\pozitron}}
>> \Vertex(90,20){2}
>> \end{picture}
>> \caption{Schéma elektromagnetické spršky vytvořené vysokoenergetickým
>> elektronem.}
>> \label{fig:ele_shower}
>> \end{figure}
>>
>> \end{document}
<example_l2h.log><example_l2h.tex>_______________________________________________
latex2html mailing list
latex2html at tug.org<mailto:latex2html at tug.org>
https://protect-au.mimecast.com/s/4xaZCE8wlRCMlWvKUwfdiL?domain=tug.org


Dr Ross Moore
Department of Mathematics and Statistics
12 Wally’s Walk, Level 7, Room 734
Macquarie University, NSW 2109, Australia
T: +61 2 9850 8955  |  F: +61 2 9850 8114
M:+61 407 288 255  |  E: ross.moore at mq.edu.au<mailto:ross.moore at mq.edu.au>
http://www.maths.mq.edu.au
[cid:image001.png at 01D030BE.D37A46F0]
CRICOS Provider Number 00002J. Think before you print.
Please consider the environment before printing this email.

This message is intended for the addressee named and may
contain confidential information. If you are not the intended
recipient, please delete it and notify the sender. Views expressed
in this message are those of the individual sender, and are not
necessarily the views of Macquarie University. <http://mq.edu.au/>
<http://mq.edu.au/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/latex2html/attachments/20210122/dc8a296e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4605 bytes
Desc: image001.png
URL: <https://tug.org/pipermail/latex2html/attachments/20210122/dc8a296e/attachment-0001.png>


More information about the latex2html mailing list.