在 VScode 裡打 Markdown 檔案太方便
移到部落格裡才發現原來不是所有套件都可以在網頁顯示 Latex 的 Mathjax 套件中執行
例如 \xRightarrow
, \xLeftarrow
, \xLeftrightarrow
以下就介紹如何在 Mathjax 套件環境中打出
\(\require{extpfeil}\Newextarrow{\xLeftrightarrow} {5,5}{0x21D4}\xLeftrightarrow[\text{text below}]{\text{text above}}\)
\(\require{extpfeil}\Newextarrow{\xRightarrow} {5,5}{0x21D2}\xRightarrow[\text{text below}]{\text{text above}}\)
\(\require{extpfeil}\Newextarrow{\xLeftarrow} {5,5}{0x21D0}\xLeftarrow[\text{text below}]{\text{text above}}\)
感謝 peter 大大無私分享:在Blogger中使用LaTeX 表達數學式
在 HTML 的編輯環境下輸入
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML">
</script>
就可以使用 Mathjax 套件了
在 Mathjax 環境下要引入套件用:
\require{extpfeil}
在 Mathjax 文件中定義
\Newextarrow{\cs}{lspace,rspace}{unicode-char}
\cs
:new control sequence name to be defined (名稱)lspace, rspace
:the amount of space (空格)unicode-char
:unicode character position in either decimal or hexadecimal notation其中 unicode-char
可在此網頁對照
Mathjax 打出 \xRightarrow
, \xLeftarrow
, \xLeftrightarrow
:
\require{extpfeil}
\Newextarrow{\xLeftrightarrow} {5,5}{0x21D4}
\xLeftrightarrow[\text{text below}]{\text{text above}}
\require{extpfeil}
\Newextarrow{\xRightarrow} {5,5}{0x21D2}
\xRightarrow[\text{text below}]{\text{text above}}
\require{extpfeil}
\Newextarrow{\xLeftarrow} {5,5}{0x21D0}
\xLeftarrow[\text{text below}]{\text{text above}}
雖然這個套件主要是表達化學式
但因為我也用到了一個 \xrightleftharpoons
但是在 Mathjax 環境中也無法顯示出來
所以順便分享這個套件的用法
同樣也是引入套件
\require{mhchem}
接著定義箭頭
\ce{<=>[\text{text above}][\text{text below}]
成果
\require{mhchem}
\ce{<=>[\text{text above}][\text{text below}]
\[\require{mhchem} \ce{<=>[\text{text above}][\text{text below}]}\]
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing