Skip to content

Commit d71711d

Browse files
docs: add more content in Mathematics and fix some typos (#1306)
1. Add docs for block math and inline math 2. Change a grammar mistake at line 137, the single form should be used 3. Change the comma from Chinese to English for consistency of the doc. --------- Co-authored-by: Cotes Chung <[email protected]>
1 parent 50835b4 commit d71711d

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

_posts/2019-08-08-write-a-new-post.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,33 @@ math: true
107107
---
108108
```
109109

110+
After enabling the mathematical feature, you can add math equations with the following syntax:
111+
112+
- **Block math** should be added with `$$ math $$` with **mandatory** blank lines before and after `$$`
113+
- **Inline math** (in lines) should be added with `$$ math $$` without any blank line before or after `$$`
114+
- **Inline math** (in lists) should be added with `\$$ math $$`
115+
116+
```markdown
117+
<!-- Block math, keep all blank lines -->
118+
119+
$$
120+
LaTeX_math_expression
121+
$$
122+
123+
<!-- Inline math in lines, NO blank lines -->
124+
125+
"Lorem ipsum dolor sit amet, $$ LaTeX_math_expression $$ consectetur adipiscing elit."
126+
127+
<!-- Inline math in lists, escape the first `$` -->
128+
129+
1. \$$ LaTeX_math_expression $$
130+
2. \$$ LaTeX_math_expression $$
131+
3. \$$ LaTeX_math_expression $$
132+
```
133+
110134
## Mermaid
111135

112-
[**Mermaid**](https://github.com/mermaid-js/mermaid) is a great diagrams generation tool. To enable it on your post, add the following to the YAML block:
136+
[**Mermaid**](https://github.com/mermaid-js/mermaid) is a great diagram generation tool. To enable it on your post, add the following to the YAML block:
113137

114138
```yaml
115139
---
@@ -123,7 +147,7 @@ Then you can use it like other markdown languages: surround the graph code with
123147

124148
### Caption
125149

126-
Add italics to the next line of an imagethen it will become the caption and appear at the bottom of the image:
150+
Add italics to the next line of an image, then it will become the caption and appear at the bottom of the image:
127151

128152
```markdown
129153
![img-description](/path/to/image)

0 commit comments

Comments
 (0)