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

Doxygen Latex Inline #106

Closed
goldbattle opened this issue May 31, 2019 · 3 comments
Closed

Doxygen Latex Inline #106

goldbattle opened this issue May 31, 2019 · 3 comments

Comments

@goldbattle
Copy link

Is there a specific syntax I should be following to get proper inline equation formatting?
It looks like if I follow this the m-math class is not added properly to the svg.
I am on commit 97e5cca.

Example:

The distance between \f$(x_1,y_1)\f$ and \f$(x_2,y_2)\f$ is 
\f$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\f$.

\f[
|I_2|=\left| \int_{0}^T \psi(t) 
       \left\{ 
          u(a,t)-
          \int_{\gamma(t)}^a 
          \frac{d\theta}{k(\theta,t)}
          \int_{a}^\theta c(\xi)u_t(\xi,t)\,d\xi
       \right\} dt
    \right|
\f]

\f{eqnarray*}{
  g &=& \frac{Gm_2}{r^2} \\ 
    &=& \frac{(6.673 \times 10^{-11}\,\mbox{m}^3\,\mbox{kg}^{-1}\,
        \mbox{s}^{-2})(5.9736 \times 10^{24}\,\mbox{kg})}{(6371.01\,\mbox{km})^2} \\ 
    &=& 9.82066032\,\mbox{m/s}^2
\f}

image

@goldbattle
Copy link
Author

goldbattle commented Jun 11, 2019

I was able to fix this by removing the following in plugins/latex2svgextra.py:
https://gist.github.com/goldbattle/c230bfcc56efdbb3442f385f486a5547/revisions#diff-4e8e7edf1a3bb5316b79ca3b5a5eafbf

< _patch_src = re.compile(r"""<\?xml version='1\.0' encoding='UTF-8'\?>
---
> _patch_src = re.compile(r"""<\?xml version='1\.0'\?>

Seems that the output of dvisvgm was slightly different, thus the regex failed.
I am on Ubuntu 16.04 with dvisvgm (TeX Live) 1.9.2.

@mosra
Copy link
Owner

mosra commented Jul 7, 2019

Hi, thanks for the report and sorry for my delayed reply -- been busy with other projects. I pushed the above as 29ddf48 (ignoring the encoding attribute if it's not there).

One note though -- 1.9.2 is extremely buggy and even though the above makes it work at least partially, I doubt it fixes the vertical misalignment (seen on the screenshot above). I was fighting this for a while until I ultimately gave up: #75 . If you can, upgrade to 2.2 (18.04) at least, the output will get much better :)

@mosra mosra closed this as completed Jul 7, 2019
@goldbattle
Copy link
Author

Fixed it for me, thanks!

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

No branches or pull requests

2 participants