Try   HackMD

Typora:跨平臺的 Markdown 編輯器

作者:王一哲
日期:2020/4/7

前言

之前的介紹了簡單的〈Notepad++ 及 Markdown 外掛〉,但是這個方法對於數學式子和程式碼高亮度語法的效果較差,這次介紹效果較好的跨平臺 Markdown 編輯器:Typora。

下載及安裝 Typora

Typora 網站上提供了 Windows、OS X、Linux 三種平臺的版本,以下是 Windows 以及 Linux 版的安裝方法。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Typora 下載頁面

Windows

下載對應的版本,分為64位元以及為32位元。下載完畢之後在安裝檔上按滑鼠右鍵,點選以系統管理員身份執行,接著只要一直按下一步即可。下圖是 Typora Windows 版預設模式的畫面。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Typora Windows 版預設模式

Linux

測試版本為 Lubuntu 19.04,按照官網上的指示使用以下的指令安裝

wget -qO - https://typora.io/linux/public-key.asc | sudo apt-key add - sudo add-apt-repository 'deb https://typora.io/linux ./' sudo apt-get update sudo apt-get install typora

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Typora Linux 版預設模式

數學式子測試

若要顯示獨立為一個段落並且置中的數學式子,可以用兩組 $$ 將數學式子的

LATEX 包在裡面,以馬克士威方程式為例,需要輸入以下的編碼

$$\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}$$ $$\nabla \cdot \mathbf{B} = 0$$ $$\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}$$ $$\nabla \times \mathbf{B} = \mu_0 \left ( \mathbf{J} + \varepsilon_0 \frac{\partial \mathbf{E}}{\partial t} \right )$$

理論上會看到以下的數學式子

E=ρε0

B=0

×E=Bt

×B=μ0(J+ε0Et)

但實際上無法順利顯示,需要調整偏好設定

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
數學式子測試

從選單依序點選檔案偏好設定或按快速鍵 Ctrl + ,,點選左側最下方的 Markdown,將 Markdown 語法擴充支援行內數學式選項打勾,重新啟動 Typora 之後應該就能顯示數學式子。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
檔案 ⇒ 偏好設定

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Markdown 偏好設定(Markdown 語法擴充支援)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
數學式子測試2

程式碼高亮度語法測試

Markdown 支援相當多種的程式碼高亮度語法,例如 Python、C、C++、Shell……等等,以 Python 程式碼為例,在程式碼區段開頭用 ```python 標記,程式碼區段結尾再加上 ```,就能夠插入程式碼區段。從選單依序點選檔案偏好設定或按快速鍵 Ctrl + ,,點選左側最下方的 Markdown,將 程式碼區塊選項都打勾,重新啟動 Typora 之後應該就能顯示帶有行號的程式碼。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
Markdown 偏好設定(程式碼區塊)

以下是使用 Python 印出九九乘法表的程式碼,下圖是測試結果。

for i in range(2, 10, 1): for j in range(2, 10, 1): print("{:d} * {:d} = {:d}".format(i, j, i*j), end='\t') print('')

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
程式碼高亮度語法測試

匯出檔案

Typora 支援相當多種匯出的檔案格式,這是 Typora 比較強大的地方。

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →
匯出檔案

結語

Typora 很適合 Markdown 的重度使用者,而且還有許多可以調整的細節,例如更換主題、字體……等等,有興趣的同學可以上網搜尋相關的文章。


tags:電腦