Atom : First meet

Atom

由下面轉述Atom網頁的介紹,可以對Atom有個初步的概念。

Why Atom?

There are a lot of text editors out there; why should you spend your time learning about and using Atom?

Editors like Sublime and TextMate offer convenience but only limited extensibility. On the other end of the spectrum, Emacs and Vim offer extreme flexibility, but they aren't very approachable and can only be customized with special-purpose scripting languages.

We think we can do better. Our goal is a zero-compromise combination of hackability and usability: an editor that will be welcoming to an elementary school student on their first day learning to code, but also a tool they won't outgrow as they develop into seasoned hackers.

As we've used Atom to build Atom, what began as an experiment has gradually matured into a tool we can't live without. On the surface, Atom is the modern desktop text editor you've come to expect. Pop the hood, however, and you'll discover a system begging to be hacked on.

Atom 是一個功能強大的本文檔編輯器。他可以用 markdown 的格式編輯文件,再轉成 html 格式,非常快速。

編輯markdown文件時,它可以用Latex語法書寫數學公式、動態預覽html網頁的表現。文件完成的時候,可以用Copy as HTML的方式複製到blogspot當作部落格的文章,也可用Save as Html的方式存成檔案,送到GitHub當作網頁。

Copy as html 與 Save as html有所差別,前者只有html檔案的內容(<body></body>裡面的部分),後者則是完整的html檔案。因此,前者適合送到BlogSpot,後者適合GitHub使用。

因為送到BlogSpot沒有html的標頭,若要使用數學公式,必須把

\<script src='https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'
    type='text/javascript'>
\</script>

放在BlogSpot樣板的標頭裡,建議放在</head>的前面。

安裝

Atom下載AtomSetup.exe並安裝。

若要使用Mathematics,則需在Atom裡安裝markdown preview plus與mathjax-wrapper兩個套件。

數學公式

mathjax可呈現兩種數學公式形式。

  1. 夾雜在文句之中,所謂的內嵌數學(inline math)。
  2. 自己單獨一行,所謂的外顯數學(display math)。

內嵌數學(inline math)

將數學式子用成對的$包起來,如$\int_0^1 x^2 dx=\frac{1}{3}$,會產生

或者,將數學式子用 \(\)包起來, 如\(\int_0^1 x^2 dx=\frac{1}{3}\),會產生

注意:假如要用Pandoc將md檔轉成html、docx、pdf等格式,不要使用 \(\)包起來的方式。

注意:編輯內嵌數學的時候,領頭的$\(的後面不能有空白,算是一個小小的Bug。

外顯數學(display math)

將數學式子用成對的$$包起來, 如$$ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} $$ 產生

或者,將數學式子用 \[\]包起來 如\[ x=\frac{-b\pm\sqrt{b^2-4ac}}{2a} \] 產生

注意:假如要用Pandoc將md檔轉成html、docx、pdf等格式,不要使用 \[\]包起來的方式。

Share this

Previous
Next Post »

技術提供:Blogger.