-
Notifications
You must be signed in to change notification settings - Fork 500
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
Support the stem macros (math support) #45
Comments
👍 |
For LaTeX this could be done by handing the equation/formula to a LaTeX to SVG parser, whose output can easily be embedded. This shouldn't be that much work. |
The best LaTeX to SVG parser that I'm aware of is MathJax. Unfortunately, it only works in a browser. But, we have figured out a way to use it as a utility to generate an SVG by delegating to mathoid. See /~https://github.com/asciidoctor/asciidoctor-extensions-lab/tree/master/lib/mathoid-treeprocessor. I was planning on integrating this utility into Asciidoctor PDF. If you know of a simpler utility, I'm all for exploring it. Ideally, we want to keep external dependencies and tools to an absolute minimum. |
The first step to solving this issue might just be to document how to use the aforementioned extension. I'm able to use it, but that doesn't mean anyone else can figure it out easily unless we document it :) |
How about using Mathematical? |
Interesting. That looks like what GitHub is (or is planning) to use to support Math expressions on GitHub (given who is committing to it). Let's definitely consider it! |
I just build a library wrapper for it here. I don't know if it's working, so we should run some tests with it. |
I've written a sample file and a test-case and it seems to be working pretty good. |
Cool! Super exciting! I welcome you to send a pull request for your extension into the extensions lab (/~https://github.com/asciidoctor/asciidoctor-extensions-lab). That helps get it exposure and a stop towards official integration. |
Fantastic!!
|
@mojavelinux As you may have seen I've sent a pull request. No response yet, but I'm looking forward for a fast implemetation of this feature in asciidoctor-pdf (no more LaTeX for pdfs yeah!) |
When we get this working, I will open a bottle!
|
I apologize for the delay. This has been a crazy busy week. I'll be sure to Cheers, -Dan On Fri, Jun 26, 2015 at 6:08 AM, tstumm notifications@github.com wrote:
Dan Allen | http://google.com/profiles/dan.j.allen |
Yay!!! Sent from my iPhone
|
Any chance that Asciidoctor-off will be able to handle Asciidoc-LaTeX files? That would give us another rest selling point in the STEM. Communities. Sent from my iPhone
|
Fantastic!! Sent from my iPhone
|
In time, I'm sure of it as both mature and LaTeX and PDF have such a close relationship. For now, the focus is just to get Asciidoctor PDF out of alpha so we can start doing interesting things with it :) |
@tstumm This looks really nice. I'm quite impressed by mathematical and the extension that you wrote. It's important to note that right now, this will only handle stem blocks. We'll need to add another extension to handle inline. That's a bit trickier since it's not yet possible to override a built-in inline macro. We'll need to think about the best way to approach that, or perhaps we need a change to core to allow us to tap into the stem inline macro. In order to use this extension or the mathoid one in Asciidoctor PDF, we'll need to graduate it from the extensions lab. I think a first step is just to document how someone can use the extension in the extensions lab so we get some feedback and testing. That way, no one is waiting for the graduation to happen. In the meantime, we can start to think about where we want to put it. Perhaps a gem named asciidoctor-mathematical. |
I forgot to mention that I sent revisions to your pull request. Once you look those over and merge or revise, I'll merge in the pull request. |
@mojavelinux Thank your for the commendation. I'm a ruby first-timer though. Maybe we can reuse the readme as documentation. The code itself is rather trivial, so we should mainly document the needed dependencies (fonts etc.). |
Yes, for right now the README is the user manual. In the future, each component (e.g., asciidoctor-pdf) will have it's own user manual under the docs folder to keep the README can stay lean. However, not yet :) @tstumm You did a nice job for a Ruby first timer. This is a great start and the rest will come quickly now that the ball is rolling. I think the biggest challenge for most users will be installing mathematical...because a lot of people have no development libraries installed. For me, I only had to install "flex" (whatever that is). |
Well, for me I had to install a bunch of libraries (because I hadn't looked up the dependencies, shame on me). On a debian or ubuntu system that should be fulfilled by one apt-get install command. I think we can now mark this as "in progress"! |
@nathany Please open a separate issue at the asciidoctor-mathematical repo. |
Discussions related to OS X can be continued here: asciidoctor/asciidoctor-mathematical#3 All other issues can be proclaimed at the issue page. |
By the way: asciidoctor-mathematical is now available on RubyGems! |
Since the main functionality is now given, I think we can close this issue now @mojavelinux. |
Thanks for all your effort. It's a nice job 👍 @tstumm |
@tstumm For my purposes, I ended up using Thanks for releasing a gem, btw. |
When I set @mojavelinux Can you suggest a standard with these attributes? |
Well, ltdr; |
It makes sense. But generated images are saved in |
Hello, I'm on OSX (have installed everything with
When running
Installing |
It looks something wrong happes to mathematical. Is it correctly installed? |
I followed the instructions here. Also checked the And I said wrong,
Otherwise the installation is "good". I see that the |
After installing
I get the following
|
@igagis Seems like you could not install mathematical correctly. You can find further help on /~https://github.com/gjtorikian/mathematical |
I had to manually copy liblasem.so from /var/lib/gems/2.1.0/gems/mathematical-1.5.12/ext/mathematical/lasem/build to /usr/lib |
Since there are multiple solutions for processing math (aka stem) equations, and those solutions require external dependencies, I think it's safe to say that this processing should be handled by an extension (at least for now). One solution is asciidoctor-mathematical. The other is the soon to be asciidoctor-mathoid (which now resides in the extensions-lab repository). We still have some challenges to overcome, but I think we should address those challenges by submitting issues in the respective extension project. Once we have determined that the extensions are both stable and reliable, we can consider enabling one of the extensions by default. |
I think it's really important that image generation be handled consistently between asciidoctor-diagram, asciidoctor-mathematical, and asciidoctor-mathoid. Since Asciidoctor Diagram is the most mature in this regard, it should be used as the reference. |
I do think it would be a good idea to add information to the README about asciidoctor-mathematical (and perhaps the mathoid extension too). @tstumm or @ProgramFan, would you be willing to submit a PR to the README that introduces asciidoctor-mathematical. I recommend adding a section named "Converting STEM Nodes" before the "Optional Scripts" section. |
I'll close the issue once asciidoctor-mathematical is mentioned in the README. I'll then add an introduction to the mathoid extension (though I'm not recommending it until it gets moved into its own repository and published to RubyGems.org). |
When we mention Asciidoctor Mathematical, we should also mention that it doesn't yet have support for table cells and refer to the issue. |
No description provided.
The text was updated successfully, but these errors were encountered: