-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Make sure that having a LaTeX distribution is optional #24
Comments
For users who do not have LaTeX installed, what about adding an option to use the website API to render LaTeX formulas(get SVG file directly) online instead of the local offline rendering. Like this, using the LaTeX rendering API on the Zhihu website in China will directly return the rendered svg file.
There may also be better APIs to choose from, but I may know less. For some people, they want to write some simple formulas with LaTeX, but they can't handle the installation of LaTeX, or they can't afford a large capacity. I think online rendering is a good solution at this time. But for those who want to use other LaTeX features, they may also need to install the LaTeX distribution. (I’m in a poor English.Hope that you can understand me.) |
This is a really creative solution, but it would require people to always have internet. Honestly, that shouldn't be much of a problem though, so maybe we could add a flag for it. Thanks! |
@tony031218 your English is perfectly understandable! You propose a very interesting solution. As with most new features, I think it comes down to: if we offer it as an alternative, users will expect us to maintain it. If the online service we choose happens to change their API, or it has privacy or security issues, or if it just stops working altogether, we are going to receive a barrage of issues about a feature that we cannot control. We would be trading the barrage of features about miktex, with a barrage of features about this feature. Is it worth it? I don't know |
I simply implemented this feature and will improve it later. Currently I plan to use Zhihu's API, but if this function is used by enough people, maybe we can build a server by ourselves. Online rendering is just an alternative, we still recommend using offline rendering. |
I really don't think we should implement the server ourselves. That sounds like orthogonal to manim, and like a whole very different project. |
We could probably add that part in a try-except block, like try:
download_latex_image_online()
except ConnectionError:
print("No internet connectivity. Aborting latex download.") (assuming ConnectionError is defined somewhere.) |
After about two hours, I will submit a pr, then you can try it and make some suggestions. I'm going to take an exam now. |
I don't think we should build code making web requests to private servers into manim. Even if we put the complexity of the issue aside, it's a pretty niche issue and gets us into a potential privacy issue that we can avoid entirely. |
I agree. We can, however, make this extendable, i.e., people should be allowed to handle this in their own away. In this sense, this falls into the discussion about manim addons. I feel the need for an issue about this |
This I can totally get behind, if someone provides an extension/addon and some people want to download it, that's perfectly fine. |
I'm sorry you are not satisfied with my plan. I made this suggestion not to make online rendering a complete replacement for the LaTeX distribution, but to provide a solution for those who cannot successfully install LaTeX or are unwilling to install the distribution, that is, to connect to the Internet for online rendering. This has many limitations, such as the inability to use LaTeX's other functions and macro packages flexibly, and as you said, it is not good to send requests to the server frequently (but in fact, these APIs excuse the processing time is very short, and there are many People use them via links). You can see my implementation here: https://github.com/Tony031218/manim/tree/online-latex btw, do I need or can I submit a pr to this repo? |
@tony031218 Yes, it was clear that this was never meant to be a full replacement :) The major problem with implementing a feature "just in case" something else doesn't work is that we will be expected to maintain it and support it, even when it is used only every once in a while because, well, it is "just in case". You are of course welcome to submit PRs! Just note that every PR needs to be code reviewed and approved by at least two members with write access. |
This got derailed for a little bit, but the question still stands: can we make manim independent of a latex distribution? And if so, how can this be achieved? What would installation look like? |
just don't use |
OK, if it's that easy then this is a problem of documenting this within the official installation instructions. |
I'm beginning to think that anything we want to be optional shouldn't be baked into the library at all. I think they should be add-ons that come shipped with it, but can removed or added as necessary. |
@yoshiask I like that idea. And it seems like this is a problem of documentation. So let's keep that in mind when writing the tutorial. |
As mentioned in #23.
The installation instructions in the README should allow users who will not use/need LaTeX, but only text.
The installation instructions in the README should guide the user to install a suitable (preferably small) LaTeX distribution in as many platforms as possible (Windows/MacOS/Linux).
Tests should be aware of this being optional. For example, a fresh installation of manim (without latex) will not pass tests that require LaTeX.
The text was updated successfully, but these errors were encountered: