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

Fix text/latex MIME type in LaTeXWriter #1709

Merged
merged 5 commits into from
Oct 18, 2021

Conversation

odow
Copy link
Collaborator

@odow odow commented Oct 13, 2021

If there's an explicit text/latex MIME, then we should just write that directly. There's no point attempting to round-trip it through the intermediate Markdown representation.

Closes #1401
Closes #1346

This was motivated by jump-dev/JuMP.jl#1881, which is an attempt to build the full JuMP documentation to PDF. There's a lot of math/latex trickery involved, which is why we're running into issues.

@fredrikekre
Copy link
Member

Thanks. Instead of duplicating this code, perhaps it can be moved to Utilities.jl as a separate function used in both places? Would be great if you can also add a note in the changelog.

This is an identical bugfix fo JuliaDocs#1518, which was only applied to the
HTML writer.
@odow
Copy link
Collaborator Author

odow commented Oct 14, 2021

It seems like mdparse is only used by the LaTeX and HTML writers for the case of parsing MIME"text/latex", so I applied the fix there instead.

@odow odow changed the title Fix multiline display equations in LaTeX Fix text/latex MIME type in LaTeXWriter Oct 18, 2021
@odow
Copy link
Collaborator Author

odow commented Oct 18, 2021

Okay I took another pass at this. And after digging through to understand the code a little more, I think it can be simplified to just write out the text/latex directly.

It seems to make PDFs nicely, and it passes tests:
bug.pdf

@odow odow mentioned this pull request Oct 18, 2021
1 task
@odow
Copy link
Collaborator Author

odow commented Oct 18, 2021

The good news is, with this PR, the entire JuMP documentation builds! Lots of code, lots of examples, lots of plots.

@fredrikekre
Copy link
Member

Great, thanks!

@fredrikekre fredrikekre merged commit f766407 into JuliaDocs:master Oct 18, 2021
@fredrikekre
Copy link
Member

@odow odow deleted the od/fix-latexwriter branch October 18, 2021 19:28
@mortenpi mortenpi added Type: Bugfix Format: LaTeX Related to the LaTeX / PDF output labels Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Format: LaTeX Related to the LaTeX / PDF output Type: Bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output of StatsBase.describe not correctly rendered in the PDF form
3 participants