Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I am writing a book and my chapters contain math. I am using asciidoc-mathematical and the
:stem: latexmath directive at the beginning of every chapter. If I run asciidoc on a chapter itself, the generated PDF has math rendered correctly in it. But when I try to run asciidoc on my book.adoc which is simply include::chapter01.adoc[] include::chapter02.adoc[] and so on, the math is not rendered correctly. Additional Information: each of my chapters have a imagesdir defined which is like ../images/<the-folder-for-the-chapter>. E.g.: :imagesdir: ../images/chapter01 How can I get it to work? |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
I believe asciidoctor-mathematical doesn’t handle attributes correctly, see Most likely attributes redefined throughout the document are not visible to this extension In order for it to notice that you set :stem: latexmath you will need to define that at the top of your book.adoc.
For this reason I doubt you can put the images automatically into separate directories for each chapter. This issue might be relevant, I’m not sure: Generate images into output folder It’s in a “sometimes works, extremely experimental” stage, but you could try asciidoctor-pdf.js which uses browser rendering and prints to pdf; with that you could use my asciidoctor-mathjax plugin which handles attributes more correctly and also allows you to put the rendered math into your document as inline svg. Asciidoctor-pdf.js: Mogztter/asciidoctor-pdf.js: Convert AsciiDoc documents to PDF using web technologies asciidocotr-mathjax: David Jencks
/
asciidoctor-mathjax.js And if you want to organize your project with Antora there’s the even more experimental djencks/asciidoctor-pdf.js at antora
David Jencks
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Thanks David.
Its pretty weird because my stem blocks are getting processed but any inline stem is not getting processed. E.g., this gets processed [stem] ++++ p = \frac{t}{2^{256}} ++++ but this does not Geometric Distribution: stem:[p*(1-p)^{n-1}] and as I said if I run asciidoctor-pdf on the chapter itself, there is no problem. So its very puzzling. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
When I was writing asciidoctor-mathjax I ran into a similar inconsistency between block and inline. I think it has to do with when they are processed, but I don’t really understand the details. Fixing the algorithm to walk the tree rather than query it and tracking the attributes fixed the problems.
When you process a chapter at a time, the :stem: declaration is in the document attributes so it’s always visible. My suggestion of putting it at the top of the book.adoc gives the same effect for the book…. does it work? thanks David Jencks
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
My suggestion of putting it at the top of the book.adoc gives the same effect for the book…. does it work?
Yes this works. I had to put :stem: latexmath at top of book.adoc. Its funny the way it works in asciidoc. I can't be sure of anything. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
David Jencks
|
Free forum by Nabble | Edit this page |