Skip to content

Commit

Permalink
Merge pull request #1544 from alixander/latex-substack
Browse files Browse the repository at this point in the history
include asm mathjax
  • Loading branch information
alixander authored Aug 8, 2023
2 parents 0e7058b + e329b0f commit 0d92ebc
Show file tree
Hide file tree
Showing 8 changed files with 869 additions and 681 deletions.
2 changes: 2 additions & 0 deletions ci/release/changelogs/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#### Improvements 🧹

- Latex now includes Mathjax's ASM extension for more powerful Latex functionality [#1544](https://github.com/terrastruct/d2/pull/1544)

#### Bugfixes ⛑️

- Fixes `d2 fmt` to format all files passed as arguments rather than first non-formatted only [#1523](https://github.com/terrastruct/d2/issues/1523)
4 changes: 2 additions & 2 deletions d2renderers/d2latex/mathjax.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion d2renderers/d2latex/setup.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const adaptor = MathJax._.adaptors.liteAdaptor.liteAdaptor();
MathJax._.handlers.html_ts.RegisterHTMLHandler(adaptor)
const html = MathJax._.mathjax.mathjax.document('', {
InputJax: new MathJax._.input.tex_ts.TeX({ packages: ['base', 'mathtools', 'amscd', 'braket', 'cancel', 'cases', 'color', 'gensymb', 'mhchem', 'physics'] }),
InputJax: new MathJax._.input.tex_ts.TeX({ packages: ['base', 'mathtools', 'ams', 'amscd', 'braket', 'cancel', 'cases', 'color', 'gensymb', 'mhchem', 'physics'] }),
OutputJax: new MathJax._.output.svg_ts.SVG(),
});
6 changes: 6 additions & 0 deletions e2etests/stable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1374,6 +1374,12 @@ sugar -> c
c: mixed together
c -> solution: we get
Linear program: {
formula: |latex
\\min_{ \\mathclap{\\substack{ x \\in \\mathbb{R}^n \\ x \\geq 0 \\ Ax \\leq b }}} c^T x
|
}
`,
},
{
Expand Down
201 changes: 141 additions & 60 deletions e2etests/testdata/stable/latex/dagre/board.exp.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0d92ebc

Please sign in to comment.