Skip to content

Commit 8287e42

Browse files
authored
fix: display of long equations is cut off (saicaca#287)
1 parent 18cc3e0 commit 8287e42

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/content/posts/markdown.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,14 @@ math should get its own line and be put in in double-dollarsigns:
162162

163163
$$I = \int \rho R^{2} dV$$
164164

165+
$$
166+
\begin{equation*}
167+
\pi
168+
=3.1415926535
169+
\;8979323846\;2643383279\;5028841971\;6939937510\;5820974944
170+
\;5923078164\;0628620899\;8628034825\;3421170679\;\ldots
171+
\end{equation*}
172+
$$
173+
165174
And note that you can backslash-escape any punctuation characters
166175
which you wish to be displayed literally, ex.: \`foo\`, \*bar\*, etc.

src/layouts/Layout.astro

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,8 @@ function initCustomScrollbar() {
305305
autoHideSuspend: false,
306306
},
307307
});
308-
document.querySelectorAll('pre').forEach((ele) => {
308+
const preElements = document.querySelectorAll('pre');
309+
preElements.forEach((ele) => {
309310
OverlayScrollbars(ele, {
310311
scrollbars: {
311312
theme: 'scrollbar-base scrollbar-dark px-2',
@@ -315,6 +316,14 @@ function initCustomScrollbar() {
315316
}
316317
});
317318
});
319+
const katexElements = document.querySelectorAll('.katex-display') as NodeListOf<HTMLElement>;
320+
katexElements.forEach((ele) => {
321+
OverlayScrollbars(ele, {
322+
scrollbars: {
323+
theme: 'scrollbar-base scrollbar-auto py-1',
324+
}
325+
});
326+
});
318327
}
319328

320329
function showBanner() {

0 commit comments

Comments
 (0)