Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for formula elements #65

Open
ImtiazHiader opened this issue Jan 9, 2020 · 9 comments
Open

Support for formula elements #65

ImtiazHiader opened this issue Jan 9, 2020 · 9 comments

Comments

@ImtiazHiader
Copy link

Does jlatexmath support following Elements? I am getting exception while processing them:

  • equation
    org.scilab.forge.jlatexmath.ParseException: Unknown environment: equation at position 1:2

  • eqnarray*, align* (eqnarray and align are working without *)
    org.scilab.forge.jlatexmath.ParseException: Unknown environment: eqnarray* at position 1:2

  • \nonumber
    org.scilab.forge.jlatexmath.ParseException: Problem with command [ at position 2:343 Problem with command array@@env at position 0:311 Unknown symbol or command or predefined TeXFormula: 'nonumber'

I am generating PDF using Apache fop, jlatexmath and jlatexmath-fop.

Thanks

@murkle
Copy link
Collaborator

murkle commented Jan 9, 2020

Please post the exact LaTeX syntaxes you need

@ImtiazHiader
Copy link
Author

Thanks for quick Reply.
Actually for the following Formula:

\begin{align} y &=& x^4 + 4 \\ &=& (x^2+2)^2 -4x^2 \\ &\le&(x^2+2)^2 \end{align}
I am expecting result with Equation numbers. But If i use align* instead of align then the equation numbers should not be generated. The * should supress the numbering.
FormulaResult

For the following Formula:
\begin{align} y &=& x^4 + 4 \\ &=& (x^2+2)^2 -4x^2 \nonumber \\ &\le&(x^2+2)^2 \end{align}

the equation 2 should not be numbered (due to \nonumber). The result should look like:
FormulaResult_2

The \begin{equation} ….. \end{equation} is also not supported.

@davidmoten davidmoten changed the title Suport for formula elements Support for formula elements Jan 9, 2020
@murkle
Copy link
Collaborator

murkle commented Jan 10, 2020

There's no support for automatic numbering at the moment. The more examples you can give the better eg \begin{equation} ….. \end{equation} - thanks for the nice ones so far!

Also worth noting that some existing users (eg me :) won't want that so if it's added at some point it will need to be configurable.

@ImtiazHiader
Copy link
Author

Thanks again for your reply.
In General, the results of the API are very good.
I think equation numbering or labeling is an important feature. It would be very nice if it will added.
Is there any plan for new Version in coming days or in near future?

@murkle
Copy link
Collaborator

murkle commented Jan 20, 2020

Yes, brand new version in "experimental" branch

@ImtiazHiader
Copy link
Author

Hello,
I am using FOP and JlatexMath-FOP to generate PDF. Formulas are displaying correctly.
I Have situation:
My Formula contains a Variable. I want to create hyperlink from this variable to some Location in PDF.
Is it possible?

@raducoravu
Copy link

I have a similar problem with something like:

\begin{align*} a = \mathrm{test<float>}\end{align*}

I get an error when rendering the image:

   org.scilab.forge.jlatexmath.ParseException: Unknown environment: align* at position 0:15

If * is removed from the {align*} then the rendering starts working.
Is there any feature I can set to the TeXFormula class to make it more lenient?

@FORDEVUSE5
Copy link

we use * in LaTeX to avoid numbering multi-line formulas, which helps keep the formulas looking cleaner. Without the , the formulas are automatically numbered, which can sometimes create visual clutter. Therefore, using align is a common practice to maintain the neatness of the formulas without numbering when alignment is needed.
Image

@Liujianxiang
Copy link

The following formula cannot be rendered:

$$
\begin{equation}
ddy=
\begin{cases}
0, & x[i]==0,\\
-ddx[i] & x \lt 0, \\
ddx[i] & x \gt 0 \\
\end{cases}
\end{equation}
$$

But we removed "\begin{equation}" and "\end{equation}", the rendering worked:

$$
ddy=\begin{cases}
0,&\text{ }x[i]==0,\\
-ddx[i]&\text{ }x<0,\\
ddx[i]&\text{ }x>0
\end{cases}
$$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants