asciidoctor / asciidoctor-mathematical

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

\underbrace #39

Open RarrugasTetra opened 6 years ago

RarrugasTetra commented 6 years ago

Dear Developers, I have a problem with underbraces in my formulae, namely, they are too small.

Here is a small example of asciidoctor source:

= Underbrace example
Me <me@me.home>
:stem: latexmath

Test of underbrace:

[stem]
++++
  \Phi = \underbrace{\sum_{i} \gamma_i \left( s_i M^{model}(s_i) - s_i M^{exp}(s_i) \right)}_{\Phi_{GED}} + \alpha \cdot \underbrace{ \sum_{j} \gamma_j \left( p_j^{model} - p_j^{QC} \right)}_{\Phi_{QC}} \rightarrow min
++++

I am using the command asciidoctor --backend=html5 -a embedded -a nofooter -r asciidoctor-mathematical -a mathematical-format=svg -o test.html test.adoc and getting a respective output HTML with too small underbraces

In contrast, pure latex works well. An equivalent code

\documentclass{article}
\title{Testing underbrace}
\begin{document}
\maketitle
\begin{equation}
 \label{eq:ged_qc_min}
  \Phi = \underbrace{\sum_{i} \gamma_i \left( s_i M^{model}(s_i) - s_i M^{exp}(s_i) \right)}_{\Phi_{GED}} + \alpha \cdot \underbrace{ \sum_{j} \gamma_j \left( p_j^{model} - p_j^{QC} \right)}_{\Phi_{QC}} \rightarrow min \ ,
\end{equation}
\end{document}

produces correct output PDF

How can I get underbraces with correct size in asciidoctor?

Thank you in advance!

ProgramFan commented 6 years ago

This can be a problem in mathematical, or in its upstream. How does it work in mathjax?

RarrugasTetra commented 6 years ago

With MathJax (I am removing latexmath option from :stem:) the equation looks somewhat strange but the underbraces are ok but I need this latexmath since I need to generate PDF version of my document with asciidoctor-pdf and it works correctly with latexmath.

ProgramFan commented 6 years ago

So it looks like a bug in mathematical. Would you please report it there?

RarrugasTetra commented 6 years ago

But how to isolate it so that I can reproduce the problem without using asciidoctor-mathematical ?

ProgramFan commented 6 years ago

The best way is to consult the mathematical documentation. Or you can refer to asciidoctor-mathematical code for it.

RarrugasTetra commented 6 years ago

Done. Thank you!