-
Notifications
You must be signed in to change notification settings - Fork 122
Move UnitfulLatexify into Unitful extension #795
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
Conversation
|
Once this is merged and released, gustaphe/UnitfulLatexify.jl#21 should also get merged and released. |
|
CI failure on Julia 1.0 is because Latexify v.0.15.16 (current version: 0.16.8, needed for extension) upped compat bound to Julia 1.6, and for testing, Latexify needs to be loaded. I suspect that pre-1.6 users who don't need Latexify might still be able to install and use Unitful, although I don't know for sure. I'm not sure what the value is of testing as far back as Julia 1.0, at this point--even 1.6 is no longer considered LTS. |
|
(I guess @gustaphe may not see this unless I ping him directly.) |
|
Fantastic! I will try this out at some point during the day, but I have one thought already: I think the range thing is still relevant. Ranges are only expanded when the flag is set, and then only for evaluated ranges. If you use |
|
Okay, that doesn't currently work anyway, I'll work on a PR for it once this is merged. I must have forgotten to write tests for it. The documentation still refers to qtyrange, that should probably be looked over. Other than that LGTM |
|
Alright, with that doc fix then I think I am happy with this @sostock . Do you have any other questions? |
|
@sostock any objections to this PR? Or things you would like clarified? |
…into latexify-ext
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #795 +/- ##
=========================================
Coverage ? 89.51%
=========================================
Files ? 21
Lines ? 1698
Branches ? 0
=========================================
Hits ? 1520
Misses ? 178
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Is there anyone who feels qualified to comment on this? This is holding up JuliaPlots/Plots.jl#5143, which will make it so that the Plots.jl extension for Unitful can fully drop UnitfulLatexify as a dependency and make |
|
I hadn't thought to build the docs locally🫣 but doing so now did allow me to catch and fix a couple other details in the docs.
This was happening for me too, because the generated LaTeX was delimited with
This is a font setup thing, I had to pick a font to install for the CI (since none were there by default) and picked one that probably isn't on your machine. It works correctly on my machine, and I believe it works on CI (no missing-font errors in the CI logs). Because these docs load Plots, which at present still has UnitfulLatexify as a dependency, the plots in the docs won't render quite correctly until that dependency gets dropped from Plots. But since that circular dependency is only at the docs level, I am inclined to say it would be better to move ahead here and perhaps plan to re-deploy the docs in CI after a new release from Plots has the required changes. (And although there are almost certainly exist possible improvements, I am satisfied with the code as it stands.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have some comments regarding spacing. I think \, is more commonly used than \;, but we don’t have to change that right now. In my opinion, if the spacing in the docs is changed so that it is consistent with what is generated by the code, this is ready to merge.
| Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" | ||
| Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" | ||
| Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" | ||
| Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid. Rookie mistake on my part, I wasn't sure how to do this in a more robust way--thanks for pointing to an example.
| LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" | ||
| Latexify = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" | ||
| Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" | ||
| Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it'd be always good to have compat bounds at least for non-stdlibs non-jll packages.
|
For the record, this completely broke the possibility of building the docs on macOS, because exponents are rendered differently than all other systems (which is an issue on its own, but at least doesn't normally fully prevent building the docs) |
|
Should we revert it for now? We could let the CI build the docs on all three major systems (but only deploy it on one) to catch something like this in the future, but I’m not sure it’s worth it. |
|
I'm a bit contrived. It's annoying this is running with a somewhat unrelated issue (platform-specific rendering of the units). I don't remember, is there a way to render the powers the same across all platforms, which would be used for generating the docs? |
|
Yes, there is the environment variable Line 230 in 3a7ceb5
|
what am I doing wrong? |
|
I don’t know what happens there, but to me the error doesn’t suggest that it has anything to do with the exponent rendering. |
|
Ok, so this is even worse 😂 |
|
Are you building the docs with a different Unitful version (which would happen as you noted in #795 (comment))? I get that same error if I try to build the docs from this PR with the released Unitful (v1.24.0), since that doesn’t have the Latexify extension. |
|
Nuking the manifest and re-resolving the environment on This should really be using |
|
Shoot, sorry @giordano . I will freely admit that I did not anticipate people needing to build docs on another OS--in the CI I separately installed ghostscript (and also a small Debian font package) in order to get the docs working.
This error looks like what you get if ghostscript isn't installed, which is why in the CI I had to manually install Ghostscript. I had no idea there was such a thing as |
|
#808 should make the docs build easier to work with once korsbo/Latexify.jl#344 merges. I apologize for the confusion about that, and thanks @giordano, @sostock , @gustaphe for following me along here! |


This should supercede #668, including with the discussion that took place there.
A couple notes for posterity:
\qtyrange. I dropped that dispatch here, since Add range operator korsbo/Latexify.jl#333 turns ranges into vectors now.