asciidoctor / asciidoctor-mathematical

An extension for Asciidoctor that converts the content of STEM blocks and inline macros using Mathematical.
MIT License
50 stars 45 forks source link

Asciimath matrix not rendered correctly #108

Closed peter-jerry-ye closed 2 years ago

peter-jerry-ye commented 2 years ago

Problem

The asciimath matrix is not rendered correctly

Input

= Test
:stem: 

== Content
stem:[[[1,2,3\], [4,5,6\]\]]

Command

asciidoctor-pdf -r asciidoctor-mathematical Test.adoc

Expected

image

Output

image

Gem Versions

Ascii85 (1.1.0) asciidoctor (2.0.16) asciidoctor-mathematical (0.3.5) asciidoctor-pdf (1.6.1) asciimath (2.0.3)

ProgramFan commented 2 years ago

Have your tried to use asciimath macro directly? To my best knowledge, the above case shall not work since it does not specify the stem type. We encourage to use the concrete stem macro directly.

peter-jerry-ye commented 2 years ago

Have your tried to use asciimath macro directly?

You mean like this:

= Test
:stem:

== Content
asciimath:[[[1,2,3\],[4,5,6\]\]]

It doesn't work either, nor with this one

= Test
:stem:

== Content
[asciimath]
++++
[[1,2,3\],[4,5,6\]\]
++++

To my best knowledge, the above case shall not work since it does not specify the stem type. We encourage to use the concrete stem macro directly.

This is the exact example given in the official document of asciidoc, so I don't see why it shall not work.

ProgramFan commented 2 years ago

There used to be an asciimath handler, it seems the the handler does not work.

ProgramFan commented 2 years ago

How about [[1,2,3],[4,5,6]] in block stem? The handler is still there in the code and shall work.

peter-jerry-ye commented 2 years ago

How about [[1,2,3],[4,5,6]] in block stem?

It renders correctly.

ProgramFan commented 2 years ago

OK. This seems a problem in the expression itself. You do not have to escape them in block macros. The inline macro can not handle [] at the moment, unfortunately.