MaxMelcher / AzureDevOps.WikiPDFExport

Export Azure DevOps Wiki to PDF
MIT License
191 stars 65 forks source link

Math blocks not rendered correctly #68

Closed Jheronymus closed 3 years ago

Jheronymus commented 3 years ago

I've just tested the new version with my markdown test file.

It appears that the math-blocks $$ (double-dollar) are not working correctly. Whereas the inline with a single $ are correct: Is there something in the CSS that needs to happen?

Screenshot of my PDF: image

HTML from the logging:

<h3 id="mathematical-notation-and-characters">Mathematical notation and characters</h3>
<h5 id="supported-in-pull-requests-wikis">Supported in: Pull Requests | Wikis</h5>
<p>Both inline and block <a href="https://khan.github.io/KaTeX/function-support.html">KaTeX</a> notation is supported in wiki pages and pull requests. The following supported elements are included:</p>
<ul>
<li>Symbols</li>
<li>Greek letters</li>
<li>Mathematical operators</li>
<li>Powers and indices</li>
<li>Fractions and binomials</li>
<li>Other KaTeX supported elements</li>
</ul>
<p>To include mathematical notation, surround the mathematical notation with a <code>$</code> sign, for inline, and <code>$$</code> for block,  as shown in the following examples:</p>
<blockquote>
<p>This feature is supported within Wiki pages and pull requests for TFS 2018.2 or later versions.</p>
</blockquote>
<h4 id="example-greek-characters">Example: Greek characters</h4>
<pre><code class="language-KaTeX">$$
\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \eta, \theta, \kappa, \lambda, \mu, \nu, \omicron, \pi, \rho, \sigma, \tau, \upsilon, \phi, ...
$$

$\Gamma,  \Delta,  \Theta, \Lambda, \Xi, \Pi, \Sigma, \Upsilon, \Phi, \Psi, \Omega$
</code></pre>
<p><strong>Result:</strong></p>
<pre><code class="math">\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \eta, \theta, \kappa, \lambda, \mu, \nu, \omicron, \pi, \rho, \sigma, \tau, \upsilon, \phi, ...
</code></pre>
<p><span class="math">\(\Gamma,  \Delta,  \Theta, \Lambda, \Xi, \Pi, \Sigma, \Upsilon, \Phi, \Psi, \Omega\)</span></p>
<h4 id="example-algebraic-notation">Example: Algebraic notation</h4>
<pre><code class="language-KaTeX">Area of a circle is $\pi r^2$

And, the area of a triangle is:

$$
A_{triangle}=\frac{1}{2}({b}\cdot{h})
$$
</code></pre>
<p><strong>Result:</strong></p>
<p>Area of a circle is <span class="math">\(\pi r^2\)</span></p>
<p>And, the area of a triangle is:</p>
<pre><code class="math">A_{triangle}=\frac{1}{2}({b}\cdot{h})
</code></pre>
<h4 id="example-sums-and-integrals">Example: Sums and Integrals</h4>
<pre><code class="language-KaTeX">$$
\sum_{i=1}^{10} t_i
$$

$$
\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x
$$     
</code></pre>
<p><strong>Result:</strong></p>
<pre><code class="math">\sum_{i=1}^{10} t_i
</code></pre>
<pre><code class="math">\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x
</code></pre>

The Markdown in the file Markdown:

## Mathematical notation and characters

#### Supported in: Pull Requests | Wikis

Both inline and block [KaTeX](https://khan.github.io/KaTeX/function-support.html) notation is supported in wiki pages and pull requests. The following supported elements are included:

- Symbols
- Greek letters
- Mathematical operators
- Powers and indices
- Fractions and binomials
- Other KaTeX supported elements

To include mathematical notation, surround the mathematical notation with a `$` sign, for inline, and `$$` for block,  as shown in the following examples:

> This feature is supported within Wiki pages and pull requests for TFS 2018.2 or later versions.

### Example: Greek characters

``KaTeX
$$
\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \eta, \theta, \kappa, \lambda, \mu, \nu, \omicron, \pi, \rho, \sigma, \tau, \upsilon, \phi, ...
$$

$\Gamma,  \Delta,  \Theta, \Lambda, \Xi, \Pi, \Sigma, \Upsilon, \Phi, \Psi, \Omega$
``

**Result:**

$$
\alpha, \beta, \gamma, \delta, \epsilon, \zeta, \eta, \theta, \kappa, \lambda, \mu, \nu, \omicron, \pi, \rho, \sigma, \tau, \upsilon, \phi, ...
$$

$\Gamma,  \Delta,  \Theta, \Lambda, \Xi, \Pi, \Sigma, \Upsilon, \Phi, \Psi, \Omega$

### Example: Algebraic notation

``KaTeX
Area of a circle is $\pi r^2$

And, the area of a triangle is:

$$
A_{triangle}=\frac{1}{2}({b}\cdot{h})
$$
``

**Result:**

Area of a circle is $\pi r^2$

And, the area of a triangle is:

$$
A_{triangle}=\frac{1}{2}({b}\cdot{h})
$$
### Example: Sums and Integrals

``KaTeX
$$
\sum_{i=1}^{10} t_i
$$

$$
\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x
$$     
``

**Result:**

$$
\sum_{i=1}^{10} t_i
$$

$$
\int_0^\infty \mathrm{e}^{-x}\,\mathrm{d}x
$$

Note that I had tweak the markdown blocks in the markdown block (now have double quotes in the example above)

MaxMelcher commented 3 years ago

will be fixed in version 4.