pressbooks / pb-mathjax

A replacement for wp.com/latex.php but instead of LaTeX, it uses MathJax.
GNU General Public License v3.0
4 stars 1 forks source link

Unsatisfactory display of latex formula in pdf exports #21

Closed luis-r-izquierdo closed 3 years ago

luis-r-izquierdo commented 4 years ago

In some cases (see MWE below), it seems that the presence of a link before a latex formula can mess up how the formula is displayed in the pdf export.

To be specific, the following code is fine:

imitate-if-better
[latex]a_k(0) = \mathbb{P}(X_k = 0 \,|\, X_0=0.5) > 0[/latex] for any [latex]k \ge 50[/latex].

i.e., it displays in the pdf as: https://pressbooks.community/uploads/default/original/1X/8ce97a331b031c305219a402cd0dcb4c77fcc64b.png

But if I turn the initial word into a link:

<a href="https://wisc.pb.unizin.org/agent-based-evolutionary-game-dynamics/chapter/1-0/#imitate-if-better-protocol">imitate-if-better</a>
[latex]a_k(0) = \mathbb{P}(X_k = 0 \,|\, X_0=0.5) &gt; 0[/latex] for any [latex]k \ge 50[/latex].

then the formula does not display correctly in the pdf: https://pressbooks.community/uploads/default/original/1X/f987667c38a94417a0daeb9ee618e903638532b1.png

Cheers Luis

SteelWagstaff commented 4 years ago

@mcgratay Note for testing -- this error is occurring when using the WP Quick LaTeX plugin, not our native LaTeX rendering solution.

mcgratay commented 4 years ago

@SteelWagstaff I was able to reproduce variations of this bug on MathJax as well; notes to come

mcgratay commented 4 years ago

Notes

Test book: https://equationalignment.textopress.com/

luis-r-izquierdo commented 4 years ago

At least in this book: https://wisc.pb.unizin.org/agent-based-evolutionary-game-dynamics/ the issue does affect the digital pdf. Thanks for your work Guys

SteelWagstaff commented 3 years ago

@luis-r-izquierdo we recently deployed a fix for special characters in LaTeX entities for PDF exports. Can you test this to see whether that fix resolved your issue, or if this still needs further attention? Hope all is well with you and family in Spain!

luis-r-izquierdo commented 3 years ago

Hi @SteelWagstaff ! The fix has indeed resolved the issue, thank you so much! I hope you and your family are doing very well too. And remember that, even though Real Valladolid is playing in "Segunda", you may still enjoy visiting us to watch a game :D All the very best for now, my Dear Friend, Luis

luis-r-izquierdo commented 4 days ago

Hi, I'm sorry to bring this up again, but apparently the issue is now present in EPUB exports. You can check by looking for " QuickLaTeX.com" in the EPUB export of https://wisc.pb.unizin.org/agent-based-evolutionary-game-dynamics/ The problem is not present in the pdf exports