Re: Asciidoc not processing stem blocks correctly

Posted by David Jencks on
URL: https://discuss.asciidoctor.org/Asciidoc-not-processing-stem-blocks-correctly-tp7681p7682.html

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

On Feb 26, 2020, at 12:33 PM, siddjain [via Asciidoctor :: Discussion] <[hidden email]> wrote:

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?


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Asciidoc-not-processing-stem-blocks-correctly-tp7681.html
To start a new topic under Asciidoctor :: Discussion, [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML