Comments (8)
I'm glad that the problem is solved for you.
Apparently, some other renderers behave differently and prioritize quoteblocks over math expressions. mdBook-KaTeX is a pre-renderer, so I think it makes sense that we prioritize math expressions the most. However, we could prioritize quoteblocks, but it would require parsing themβwe currently don'tβand a more complicated codebase.
from mdbook-katex.
btw inline rendering works fine
\mathrm{O(n)}
from mdbook-katex.
I cannot reproduce. This is what I see:
from mdbook-katex.
Please tell me your mdBook-KaTeX version, provide me the related section in your book.toml
.
Please also copy the rendered HTML if you know how to do that.
from mdbook-katex.
preprcocessor version
Polling registry 'https://index.crates.io/'.
Package Installed Latest Needs update
mdbook-katex v0.5.3 v0.5.3 No
No packages need updating.
Overall updated 0 packages.
bool.toml
[book]
authors = ["Sped0n"]
language = "en"
multilingual = false
src = "src"
title = "data-structure"
[preprocessor.katex]
after = ["links"]
rendered html
first one
<blockquote>
<p>
<span class="katex-display">
<span class="katex">
<span class="katex-html" aria-hidden="true">
<span class="base"><span class="strut" style="height: 0.5782em; vertical-align: -0.0391em;"></span><span class="mrel">></span><span class="mspace" style="margin-right: 0.2778em;"></span></span>
<span class="base">
<span class="strut" style="height: 2.2954em; vertical-align: -0.7693em;"></span>
<span class="mord">
<span class="mord">
<span class="mord mathrm">n</span>
<span class="msupsub">
<span class="vlist-t vlist-t2">
<span class="vlist-r">
<span class="vlist" style="height: 0.1514em;">
<span style="top: -2.55em; margin-left: 0em; margin-right: 0.05em;">
<span class="pstrut" style="height: 2.7em;"></span>
<span class="sizing reset-size6 size3 mtight">
<span class="mord mtight"><span class="mord mathrm mtight">max</span></span>
</span>
</span>
</span>
<span class="vlist-s">β</span>
</span>
<span class="vlist-r">
<span class="vlist" style="height: 0.15em;"><span></span></span>
</span>
</span>
</span>
</span>
<span class="mspace" style="margin-right: 0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.2778em;"></span>
<span class="mord">
<span class="mopen nulldelimiter"></span>
<span class="mfrac">
<span class="vlist-t vlist-t2">
<span class="vlist-r">
<span class="vlist" style="height: 1.5261em;">
<span style="top: -2.314em;">
<span class="pstrut" style="height: 3em;"></span>
<span class="mord">
<span class="mord mathrm">m</span><span class="mspace" style="margin-right: 0.2222em;"></span><span class="mbin">β</span><span class="mspace" style="margin-right: 0.2222em;"></span>
<span class="mord mathrm">1</span>
</span>
</span>
<span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span>
<span style="top: -3.677em;">
<span class="pstrut" style="height: 3em;"></span>
<span class="mord">
<span class="mord">
<span class="mord mathrm">m</span>
<span class="msupsub">
<span class="vlist-t">
<span class="vlist-r">
<span class="vlist" style="height: 0.8491em;">
<span style="top: -3.063em; margin-right: 0.05em;">
<span class="pstrut" style="height: 2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathrm mtight">h</span></span>
</span>
</span>
</span>
</span>
</span>
</span>
<span class="mspace" style="margin-right: 0.2222em;"></span><span class="mbin">β</span><span class="mspace" style="margin-right: 0.2222em;"></span><span class="mord mathrm">1</span>
</span>
</span>
</span>
<span class="vlist-s">β</span>
</span>
<span class="vlist-r">
<span class="vlist" style="height: 0.7693em;"><span></span></span>
</span>
</span>
</span>
<span class="mclose nulldelimiter"></span>
</span>
</span>
<span class="mspace" style="margin-right: 0.2778em;"></span><span class="mrel">></span>
</span>
</span>
</span>
</span>
</p>
</blockquote>
second one
<blockquote>
<p>
<span class="katex-display">
<span class="katex">
<span class="katex-html" aria-hidden="true">
<span class="base"><span class="strut" style="height: 0.5782em; vertical-align: -0.0391em;"></span><span class="mrel">></span><span class="mspace" style="margin-right: 0.2778em;"></span></span>
<span class="base">
<span class="strut" style="height: 2.2954em; vertical-align: -0.7693em;"></span>
<span class="mord">
<span class="mrel amsrm">β΅</span><span class="mspace" style="margin-right: 0.2778em;"></span>
<span class="mord">
<span class="mord mathrm">n</span>
<span class="msupsub">
<span class="vlist-t vlist-t2">
<span class="vlist-r">
<span class="vlist" style="height: 0.1514em;">
<span style="top: -2.55em; margin-left: 0em; margin-right: 0.05em;">
<span class="pstrut" style="height: 2.7em;"></span>
<span class="sizing reset-size6 size3 mtight">
<span class="mord mtight"><span class="mord mathrm mtight">max</span></span>
</span>
</span>
</span>
<span class="vlist-s">β</span>
</span>
<span class="vlist-r">
<span class="vlist" style="height: 0.15em;"><span></span></span>
</span>
</span>
</span>
</span>
<span class="mspace" style="margin-right: 0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.2778em;"></span>
<span class="mord">
<span class="mopen nulldelimiter"></span>
<span class="mfrac">
<span class="vlist-t vlist-t2">
<span class="vlist-r">
<span class="vlist" style="height: 1.5261em;">
<span style="top: -2.314em;">
<span class="pstrut" style="height: 3em;"></span>
<span class="mord">
<span class="mord mathrm">m</span><span class="mspace" style="margin-right: 0.2222em;"></span><span class="mbin">β</span><span class="mspace" style="margin-right: 0.2222em;"></span>
<span class="mord mathrm">1</span>
</span>
</span>
<span style="top: -3.23em;"><span class="pstrut" style="height: 3em;"></span><span class="frac-line" style="border-bottom-width: 0.04em;"></span></span>
<span style="top: -3.677em;">
<span class="pstrut" style="height: 3em;"></span>
<span class="mord">
<span class="mord">
<span class="mord mathrm">m</span>
<span class="msupsub">
<span class="vlist-t">
<span class="vlist-r">
<span class="vlist" style="height: 0.8491em;">
<span style="top: -3.063em; margin-right: 0.05em;">
<span class="pstrut" style="height: 2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathrm mtight">h</span></span>
</span>
</span>
</span>
</span>
</span>
</span>
<span class="mspace" style="margin-right: 0.2222em;"></span><span class="mbin">β</span><span class="mspace" style="margin-right: 0.2222em;"></span><span class="mord mathrm">1</span>
</span>
</span>
</span>
<span class="vlist-s">β</span>
</span>
<span class="vlist-r">
<span class="vlist" style="height: 0.7693em;"><span></span></span>
</span>
</span>
</span>
<span class="mclose nulldelimiter"></span>
</span>
</span>
</span>
<span class="mspace newline"></span>
<span class="base"><span class="strut" style="height: 0.5782em; vertical-align: -0.0391em;"></span><span class="mrel">></span><span class="mspace" style="margin-right: 0.2778em;"></span></span>
<span class="base">
<span class="strut" style="height: 1em; vertical-align: -0.25em;"></span>
<span class="mord">
<span class="mrel amsrm">β΄</span><span class="mspace" style="margin-right: 0.2778em;"></span>
<span class="mord">
<span class="mord mathrm">h</span>
<span class="msupsub">
<span class="vlist-t vlist-t2">
<span class="vlist-r">
<span class="vlist" style="height: 0.3175em;">
<span style="top: -2.55em; margin-left: 0em; margin-right: 0.05em;">
<span class="pstrut" style="height: 2.7em;"></span>
<span class="sizing reset-size6 size3 mtight">
<span class="mord mtight"><span class="mord mathrm mtight">min</span></span>
</span>
</span>
</span>
<span class="vlist-s">β</span>
</span>
<span class="vlist-r">
<span class="vlist" style="height: 0.15em;"><span></span></span>
</span>
</span>
</span>
</span>
<span class="mspace" style="margin-right: 0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right: 0.2778em;"></span>
<span class="mop">
<span class="mop">lo<span style="margin-right: 0.01389em;">g</span></span>
<span class="msupsub">
<span class="vlist-t vlist-t2">
<span class="vlist-r">
<span class="vlist" style="height: 0.0573em;">
<span style="top: -2.4559em; margin-right: 0.05em;">
<span class="pstrut" style="height: 2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathrm mtight">m</span></span>
</span>
</span>
<span class="vlist-s">β</span>
</span>
<span class="vlist-r">
<span class="vlist" style="height: 0.2441em;"><span></span></span>
</span>
</span>
</span>
</span>
<span class="mopen">(</span><span class="mord mathrm">n</span><span class="mspace" style="margin-right: 0.2222em;"></span><span class="mbin">Γ</span><span class="mspace" style="margin-right: 0.2222em;"></span>
<span class="mopen">(</span><span class="mord mathrm">m</span><span class="mspace" style="margin-right: 0.2222em;"></span><span class="mbin">β</span><span class="mspace" style="margin-right: 0.2222em;"></span>
<span class="mord mathrm">1</span><span class="mclose">)</span><span class="mspace" style="margin-right: 0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right: 0.2222em;"></span>
<span class="mord mathrm">1</span><span class="mclose">)</span>
</span>
<span class="mspace" style="margin-right: 0.2778em;"></span><span class="mrel">></span>
</span>
</span>
</span>
</span>
</p>
</blockquote>
from mdbook-katex.
Thanks for your clear version and book.toml
.
I see that you have these expressions in blockquotes. I am guessting that you put >
before every line of math expressions. The correct way (to use mdBook-KaTeX) would be to put >
only before the starting line of each math expression, no matter they have empty lines in them or not.
This is because mdBook-KaTeX takes everything between the delimiters as a math expression, pre-renders it into one single line of HTML, and sends the whole book back to mdBook, where mdBook renders it as ordinary Markdown.
Does this solve the problem for you?
from mdbook-katex.
This is the code for the above example.
```markdown
> $$
\mathrm{n_{max} = \frac{m^h-1}{m-1}}
$$
```
> $$
\mathrm{n_{max} = \frac{m^h-1}{m-1}}
$$
```markdown
> $$
> \mathrm{n_{max} = \frac{m^h-1}{m-1}}
> $$
```
> $$
> \mathrm{n_{max} = \frac{m^h-1}{m-1}}
> $$
```markdown
> $$
\mathrm{\because n_{max} = \frac{m^h-1}{m-1}}\\
\mathrm{\therefore h_{min} = \log_m(n\times (m-1) + 1)}
$$
```
> $$
\mathrm{\because n_{max} = \frac{m^h-1}{m-1}}\\
\mathrm{\therefore h_{min} = \log_m(n\times (m-1) + 1)}
$$
from mdbook-katex.
oops, my badπ€―
thanks for the thorough explanation
from mdbook-katex.
Related Issues (20)
- Backslashes process Error(?), like $$ \\\\begin HOT 4
- Support many custom delimiters HOT 8
- Devanagri package HOT 1
- cannot use macro `\newcommand` HOT 1
- Scrollable equations HOT 2
- Debugging the plugin HOT 2
- `\\` line separators invalid in matrix environments HOT 7
- Undefined references in new release v0.5.10 HOT 3
- About client-side katex.js features HOT 2
- When a delimiter starts with backtick (`), katex renders inside code blocks HOT 1
- Possibility of serverside TikZJax rendering? HOT 1
- option for MathML output HOT 3
- Error: The "katex" preprocessor exited unsuccessfully with signal: 6 (SIGABRT) (core dumped) status HOT 7
- Process chapter names as well HOT 2
- Error: The katex preprocessor does not support the 'pdf' renderer HOT 2
- Help: matrix not display correctly HOT 3
- Unable to render matrix HOT 2
- square brackets cause problems HOT 6
- matrix rendering HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdbook-katex.