Skip to content

Commit

Permalink
Merge pull request #248 from jmooring/fix/use-single-backslash-in-lat…
Browse files Browse the repository at this point in the history
…ex-examples

use single quotes in LaTeX and Tex examples
  • Loading branch information
alixander authored Feb 4, 2025
2 parents 4a6def7 + 60045c9 commit 4bd0f57
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 14 deletions.
2 changes: 0 additions & 2 deletions docs/tour/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ You can use `latex` or `tex` to specify a LaTeX language block.

A few things to note about LaTeX blocks:

- You must escape `\`, as these are escape characters. Note the usage of `\\` in the above
example.
- LaTeX blocks do not respect `font-size` styling. Instead, you must style these inside
the Latex script itself with commands:
- `\tiny{ }`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ D2는 중국어, 일본어, 한국어, 심지어 이모지와 같은 비라틴
plankton -> formula: will steal
formula: {
equation: |latex
\\lim_{h \\rightarrow 0 } \\frac{f(x+h)-f(x)}{h}
\lim_{h \rightarrow 0 } \frac{f(x+h)-f(x)}{h}
|
}
```
Expand Down
20 changes: 10 additions & 10 deletions static/d2/latex.d2
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,31 @@ grid-gap: 100

amscd plugin: {
ex: |tex
\\begin{CD} B @>{\\text{very long label}}>> C S^{{\\mathcal{W}}_\\Lambda}\\otimes T @>j>> T\\\\ @VVV V \\end{CD}
\begin{CD} B @>{\text{very long label}}>> C S^{{\mathcal{W}}_\Lambda}\otimes T @>j>> T\\ @VVV V \end{CD}
|
}

braket plugin: {
ex: |tex
\\bra{a}\\ket{b}
\bra{a}\ket{b}
|
}

cancel plugin: {
ex: |tex
\\cancel{Culture + 5}
\cancel{Culture + 5}
|
}

color plugin: {
ex: |tex
\\textcolor{red}{y} = \\textcolor{green}{\\sin} x
\textcolor{red}{y} = \textcolor{green}{\sin} x
|
}

gensymb plugin: {
ex: |tex
\\lambda = 10.6\\,\\micro\\mathrm{m}
\lambda = 10.6\,\micro\mathrm{m}
|
}

Expand All @@ -42,20 +42,20 @@ mhchem plugin: {

physics plugin: {
ex: |tex
\\var{F[g(x)]}
\\dd(\\cos\\theta)
\var{F[g(x)]}
\dd(\cos\theta)
|
}

multilines: {
ex: |tex
\\displaylines{x = a + b \\\\ y = b + c}
\\sum_{k=1}^{n} h_{k} \\int_{0}^{1} \\bigl(\\partial_{k} f(x_{k-1}+t h_{k} e_{k}) -\\partial_{k} f(a)\\bigr) \\,dt
\displaylines{x = a + b \\ y = b + c}
\sum_{k=1}^{n} h_{k} \int_{0}^{1} \bigl(\partial_{k} f(x_{k-1}+t h_{k} e_{k}) -\partial_{k} f(a)\bigr) \,dt
|
}

asm: {
ex: |latex
\\min_{ \\mathclap{\\substack{ x \\in \\mathbb{R}^n \\ x \\geq 0 \\ Ax \\leq b }}} c^T x
\min_{ \mathclap{\substack{ x \in \mathbb{R}^n \ x \geq 0 \ Ax \leq b }}} c^T x
|
}
2 changes: 1 addition & 1 deletion static/d2/text-2.d2
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plankton -> formula: will steal
formula: {
equation: |latex
\\lim_{h \\rightarrow 0 } \\frac{f(x+h)-f(x)}{h}
\lim_{h \\rightarrow 0 } \frac{f(x+h)-f(x)}{h}
|
}

0 comments on commit 4bd0f57

Please sign in to comment.