dginev / LaTeXML-Plugin-ltxpsgi

PSGI web service for LaTeXML
The Unlicense
0 stars 2 forks source link

pass linelength option #6

Closed physikerwelt closed 9 years ago

physikerwelt commented 9 years ago

I was trying to pass the option linelength. However I was not sure, if it got though. Is there a debug option to figure out which options have been passed to latexml, so that one can investigate the problem via commandline.

physikerwelt commented 9 years ago

Maybe related... Is there any hidden debug option that allows to log which configuration was accepted

dginev commented 9 years ago

You're making so many issues, you'll make me believe you're using the repo heavily :) I will try to add a little support soon.

HowardCohl commented 9 years ago

A quick follow-up on this. Hi Deyan, if you get a chance to think about this a little bit, that would be great. We really want to see if we can get line breaking working in our applications which use LaTeXML server. The line breaking works with LaTeXML, just not yet with the Apache plugin. ...

dginev commented 9 years ago

Just to make this clear - I am really happy you guys are using the LaTeXML web service and I will do my best to offer good support. I am just a little short on time, but keeping my fingers crossed I can look at this tonight.

dginev commented 9 years ago

Ok, I am seeing linelength passed in and used. Can you give me an example TeX input that line-breaks with latexmlc but not with ltxpsgi?

physikerwelt commented 9 years ago

Hi,

we were testing with the input

${\displaystyle\ e^{2xz-z^{2}}=+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}}$

http://drmf.wmflabs.org/wiki/breaktest vs http://gw125.iu.xsede.org/a.html However, this involves a lot of specific options. I.e. the html page is HTML output and the wiki is whatsout=math

The intention of ths bug report was more to figure out how to track down which options are used to call latxmlc so that I can debug myself at which point the linebreaking breaks (i.e. not breaks the lines). Thanks for your help.

dginev commented 9 years ago

Writing out the options for the current job is a reasonable request. I can add that.

Why did you close the issue?

HowardCohl commented 9 years ago

Hi Deyan, if you set linelength=20 in the above TeX input, do you see line breaking? Can you reopen this issue so we can continue discussing the topic?

dginev commented 9 years ago

Reopened, will take a closer look at this tonight. Thanks for the example! Just to be sure, you see the line-breaking fail with the above TeX input:

${\displaystyle\ e^{2xz-z^{2}}=+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}}$
physikerwelt commented 9 years ago

Our current test case is the following

curl -d 'format=html5&whatsin=math&whatsout=math&pmml&cmml&nodefaultresources&preload=LaTeX.pool&preload=article.cls&preload=amsmath.sty&preload=amsthm.sty&preload=amstext.sty&preload=amssymb.sty&preload=eucal.sty&preload=%5Bdvipsnames%5Dxcolor.sty&preload=url.sty&preload=hyperref.sty&preload=%5Bids%5Dlatexml.sty&preload=DLMFmath.sty&linelength=80&tex=%7B%5Cdisplaystyle%20%5C%20e%5E%7B2xz-z%5E%7B2%7D%7D%3D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5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%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D-not-c%0A%7D' http://gw125.iu.xsede.org:8888 | grep -o 'mtr' | wc -l 

It might be that another set of options creates the line breaks as in the example on http://gw125.iu.xsede.org/a.html

I tried to change whatsout to html but that did not help either.

So what's opened now is more a support request on how to use the options correctly... it somehow diverged from the specific initial request "pass line length option".

physikerwelt commented 9 years ago

PS: It would also be nice to have a minimal example of a latexm-psgi curl request with respect to http://www.formulasearchengine.com/LaTeXML (testing)

For example the equivalent minimal mathoid request was

 curl -d 'q=\sin x^2' http://mathoid.testme.wmflabs.org | grep "sine x squared"
HowardCohl commented 9 years ago

Hello. This is a reminder. :) Any updates? thanks!

dginev commented 9 years ago

@physikerwelt your request is now too vague for me to interpret.

A minimal example for me is:

curl -d 'profile=math&source=\sin x^2' http://0:5000

Do I understand correctly that the remainder of your request is to see which options are used during the conversion? I can add that, but I am unsure how it would help you, given that you already know which options you are passing in.

physikerwelt commented 9 years ago

I closed the issue because the concrete part of the request was done. In a MediaWiki context I would have opened another related bug with another specific request. However, since the number of involved people is limited in this setup I think it's OK if this bug evolves... which means that the maintainer has to shoot at a moving target.

Given your minimal example, why does the following example does not add linebreaks.

curl -d 'profile=math&linelength=40&source=\sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2 \sin x^2  \sin x^2 \sin x^2 \sin x^2 \sin x^2'  http://gw125.iu.xsede.org:8888

To find out why this does not work, the equivalent latexmlc command (with all the options) would help to test this on the command-line.

HowardCohl commented 9 years ago

Here's another related curl command:

curl -d 'profile=math&linelength=40&source=\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2 +\sin x^2' http://gw125.iu.xsede.org:8888

HowardCohl commented 9 years ago

Can you write the full curl command that worked Deyan?

dginev commented 9 years ago
curl http://0:5000 -d 'format=html&pmml&linelength=80&tex=%5Cdocumentclass%5B11pt%5D%7Barticle%7D%0A%25%5Cusepackage%7BDLMFdefun%7D%0A%20%0A%5Cbegin%7Bdocument%7D%0A%20%0A%5Cbegin%7Bequation%7D%0A%7B%5Cdisplaystyle%5C%20e%5E%7B2xz-z%5E%7B2%7D%7D%3D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cn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imits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C!%5Cleft(x%5Cright)%7D%7Bn!%7Dz%5E%7Bn%7D%7D%0A%5Cend%7Bequation%7D%0A%20%0A%5Cend%7Bdocument%7D'
HowardCohl commented 9 years ago

(we identified that the problem is that we are trying to convert a fraction rather than a full document)

dginev commented 9 years ago

fragment is not a format. The format is the XML language used to serialize the document. For example: xml, html5, html5, xhtml, epub.

If you want a fragment on output, that option is --whatsout=fragment.

dginev commented 9 years ago

Here is the full option documentation, it would really pay off to study it in detail: http://dlmf.nist.gov/LaTeXML/manual/commonmodules/LaTeXML_Common_Config.html

HowardCohl commented 9 years ago

Thanks. We just realized that. Can you give an example of a curl command with line breaking which works on a fragment rather than a full file (with a \begin{document}...\end{document}).

dginev commented 9 years ago

Let's see...

HowardCohl commented 9 years ago

In fact, this was our first example

curl -d 'format=html5&whatsin=math&whatsout=math&pmml&cmml&nodefaultresources&preload=LaTeX.pool&preload=article.cls&preload=amsmath.sty&preload=amsthm.sty&preload=amstext.sty&preload=amssymb.sty&preload=eucal.sty&preload=%5Bdvipsnames%5Dxcolor.sty&preload=url.sty&preload=hyperref.sty&preload=%5Bids%5Dlatexml.sty&preload=DLMFmath.sty&linelength=80&tex=%7B%5Cdisplaystyle%20%5C%20e%5E%7B2xz-z%5E%7B2%7D%7D%3D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft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athop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D%2B%5Cfrac%7B%5Cmathop%7BH_%7Bn%7D%5C%2F%7D%5Cnolimits%5C%21%5Cleft%28x%5Cright%29%7D%7Bn%21%7Dz%5E%7Bn%7D-not-c%0A%7D' http://gw125.iu.xsede.org:8888 | grep -o 'mtr' | wc -l 
dginev commented 9 years ago

Ok, at this point I can certainly conclude several aspects:

I will diff the configuration objects tomorrow, but this is looking like a very edge case bug at the moment.

dginev commented 9 years ago

Actually no, I take that back, I have seen that there were tiny differences in the exact options ... Hmmm, there is a chance that the line lengths are interpreted differently in the two contexts, I will check the details of line breaking module.

dginev commented 9 years ago

Ok, found the reason line-breaking isn't working in the web service, after digging for an unreasonable amount of time. The reason is that you are giving it bad input. There is no bug in ltxpsgi, it will show you the exact same behaviour you would see with latexmlc with the same options, and I dare you to prove me otherwise.

The example Howard gave above translates exactly into the following latexmlc command (removing the DLMF style, as I don't have it locally and it doesn't play any part):

latexmlc --format=html5 --whatsin=math --whatsout=math --pmml --cmml --nodefaultresources --preload=LaTeX.pool --preload=article.cls --preload=amsmath.sty --preload=amsthm.sty --preload=amstext.sty --preload=amssymb.sty --preload=eucal.sty --preload=[dvipsnames]xcolor.sty --preload=url.sty --preload=hyperref.sty --preload=[ids]latexml.sty --linelength=80 'literal:{\displaystyle \ e^{2xz-z^{2}}=+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}+\frac{\mathop{H_{n}\/}\nolimits\!\left(x\right)}{n!}z^{n}-not-c}'

latexmlc will not line-break this example. So, I would like you to feel at least a little bit bad for wasting a lot of my time in looking for a bug you misreported, as it was your responsibility to check that the behaviours differ between latexmlc and ltxpsgi for line-breaking. I am now 100% convinced that they don't.

Instead, the confusion comes from line-breaking only working on display style equations, while at the same time having --whatsin=math defaulting to inline style equations, unless forced otherwise, by giving it a math wrapper such as \[ \] or \begin{equation}\end{equation}

There is a problem with using {\displaystyle ... } instead, as --whatsin=math would then transform it into:

\( {\displaystyle ... } \)

and that is an inline mode formula with displaystyle symbols (e.g. the sum and product big operators). From here on out, I can only recommend taking up the discussion with @brucemiller to decide whether line-breaking should be enabled in this case, or instead, whether you should be using \[ \] instead of {\displaystyle ...}, when using the math whatsin.

Here, Bruce and I bear a little blame for not documenting things better, and probably providing you with confusing advice, but I could have traced this issue in 5 minutes if you had directly asked me why latexmlc isn't line-breaking your formula.

No ltxpsgi bug here, closing.

dginev commented 9 years ago

I had written this for a different reason, but it's also relevant here: https://twitter.com/dginev/status/588722036618440704

dginev commented 9 years ago

Maybe I also did not communicate my expectation that you should always test whether latexmlc behaves in the same way as ltxpsgi before opening a bug for the web service. It is a lot harder to debug the web service peculiarities than it is to debug the core of LaTeXML, hence my frustration. Sorry.

HowardCohl commented 9 years ago

Hi Deyan, Thanks for much for your advice, input and lessons to be learned!

I don't know how the MediaWiki math extension is going to distinguish between {\displaystyle ... } as being inline or not since MediaWiki doesn't know about [ ... ] or ( ... ). I seem to recall Moritz was working on (or had completed) solution to inline vs. equation environments in the MediaWiki math extension. I hope Moritz knows how to resolve this within the MediaWiki math extensions call to ltxpsgi.