diff --git a/assets/js/academic.js b/assets/js/academic.js index 9ceda759..6f17f929 100644 --- a/assets/js/academic.js +++ b/assets/js/academic.js @@ -404,6 +404,9 @@ $('#TableOfContents li').addClass('nav-item'); $('#TableOfContents li a').addClass('nav-link'); + // Fix Mmark task lists (remove bullet points). + $("input[type='checkbox'][disabled]").parents('ul').addClass('task-list'); + // Fix Mermaid.js clash with Highlight.js. let mermaids = []; [].push.apply(mermaids, document.getElementsByClassName('language-mermaid')); @@ -472,10 +475,6 @@ // Re-initialize Scrollspy with dynamic navbar height offset. fixScrollspy(); - // Fix inline math (workaround lack of Mathjax support in Blackfriday). - // Note `.MathJax_Preview` won't exist until after Mathjax has parsed the page, so call on page *load*. - $('.MathJax_Preview').unwrap('code'); - if (window.location.hash) { // When accessing homepage from another page and `#top` hash is set, show top of page (no hash). if (window.location.hash == "#top") { diff --git a/exampleSite/content/post/writing.md b/exampleSite/content/post/writing.md index 8c66ff86..8033bfa6 100644 --- a/exampleSite/content/post/writing.md +++ b/exampleSite/content/post/writing.md @@ -3,6 +3,7 @@ title: Writing technical content in Academic date: 2019-07-12 math: true diagram: true +markup: mmark --- Academic is designed to give technical content creators a seamless experience. You can focus on the content and Academic handles the rest. @@ -33,36 +34,24 @@ data.head() ### Math -Academic supports a Markdown extension for $\LaTeX$ math. You can enable this feature by toggling the `math` option in your `config/_default/params.toml` file or by adding `math: true` to your page front matter. +Academic supports a Markdown extension for $\LaTeX$ math. You can enable this feature by toggling the `math` option in your `config/_default/params.toml` file and adding `markup: mmark` to your page front matter. -To render a math *block*, wrap your LaTeX math with - -
$$...$$
- -whereas to render *inline* math, wrap your LaTeX math with backticks - - `$...$` - -otherwise your math will be parsed as Markdown. +To render *inline* or *block* math, wrap your LaTeX math with `$$...$$`. Example math block: -```html -
$$ -\gamma_{n} = \frac{ +```tex +$$\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |} -{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2} -$$
+{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}$$ ``` renders as -
$$\gamma_{n} = \frac{ \left | \left (\mathbf x_{n} - \mathbf x_{n-1} \right )^T \left [\nabla F (\mathbf x_{n}) - \nabla F (\mathbf x_{n-1}) \right ] \right |}{\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2}$$ -
-Example inline math `\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2` renders as `$\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2$`. +Example inline math `$$\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2$$` renders as $$\left \|\nabla F(\mathbf{x}_{n}) - \nabla F(\mathbf{x}_{n-1}) \right \|^2$$ . ### Diagrams @@ -180,4 +169,14 @@ renders as | Content Cell | Content Cell | | Content Cell | Content Cell | +### Asides + +```markdown +A> A Markdown aside is equivalent to using the Alert Shortcode, but simpler to use. +``` + +renders as + +A> A Markdown aside is equivalent to using the Alert Shortcode, but simpler to use. + ### Did you find this page helpful? Consider sharing it 🙌