Rock It 《ML》JupyterLab 【乙】Markdown 《E》

數學對於科技以及工程的重要性不言而喻。故而寫作文本多少得與數學符號和方程式打交道也。因此 JupyterLab 之筆記本 Markdown 自然支援數學表達式語法,而且是大名鼎鼎的

LaTeX

LaTeX/ˈlɑːtɛx/,常被讀作/ˈlɑːtɛk//ˈleɪtɛk/),排版時通常使用,是一種基於TeX排版系統,由美國電腦科學萊斯利·蘭伯特在20世紀80年代初期開發,利用這種格式系統的處理,即使使用者沒有排版和程式設計的知識也可以充分發揮由TeX所提供的強大功能,不必一一親自去設計或校對,能在幾天,甚至幾小時內生成很多具有書籍品質的印刷品。對於生成複雜表格和數學公式,這一點表現得尤為突出。因此它非常適用於生成高印刷品質的科技和數學、物理文件。這個系統同樣適用於生成從簡單的信件到完整書籍的所有其他種類的文件。[來源請求]

LaTeX使用TeX作為它的格式化引擎,目前的版本是LaTeX2e(寫作LATEX2ε)。

呦☆

LaTeX equations

Courtesy of MathJax, you can include mathematical expressions both inline: e^{i\pi} + 1 = 0 and displayed:

    \[e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i\]

Inline expressions can be added by surrounding the latex code with $:

e^{i\pi} + 1 = 0

Expressions on their own line are surrounded by $$:

    \[e^x=\sum_{i=0}^\infty \frac{1}{i!}x^i\]

 

他的賞心悅目高品質輸出,一探筆記本範例可知矣☺

The Markdown parser included in the Jupyter Notebook is MathJax-aware. This means that you can freely mix in mathematical expressions using the MathJax subset of Tex and LaTeX. Some examples from the MathJax site are reproduced below, as well as the Markdown+TeX source.

Motivating Examples

The Lorenz Equations

Source

(1)   \begin{align*} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{align*}

Display

\dot{x} = \sigma(y-x)
\dot{y} = \rho x - y - xz
\dot{z} = -\beta z + xy

………

 

如果你用的 Latex 標記,呈現結果不如預期☻

還請注意 MathJax

MathJax

 

Beautiful math in all browsers

A JavaScript display engine for mathematics that works in all browsers.
No more setup for readers. It just works.

 

與 LaTex 間之差異也︰

MathJax TeX and LaTeX Support

The support for TeX and LaTeX in MathJax consists of two parts: the tex2jax preprocessor, and theTeX input processor. The first of these looks for mathematics within your web page (indicated by math delimiters like $$...$$) and marks the mathematics for later processing by MathJax. The TeX input processor is what converts the TeX notation into MathJax’s internal format, where one of MathJax’s output processors then displays it in the web page.

The tex2jax preprocessor can be configured to look for whatever markers you want to use for your math delimiters. See the tex2jax configuration options section for details on how to customize the action of tex2jax.

The TeX input processor handles conversion of your mathematical notation into MathJax’s internal format (which is essentially MathML), and so acts as a TeX to MathML converter. The TeX input processor has few configuration options (see the TeX options section for details), but it can also be customized through the use of extensions that define additional functionality (see the TeX and LaTeX extensions below).

Differences

Since MathJax renders for the web and TeX is a print layout engine, there are natural limitations of which parts of TeX can be supported in a reasonable way. Accordingly, there are several differences between “real” TeX/LaTeX systems and MathJax’s TeX Input.

First and foremost, the TeX input processor implements only the math-mode macros of TeX and LaTeX, not the text-mode macros. MathJax expects that you will use standard HTML tags to handle formatting the text of your page; it only handles the mathematics. So, for example, MathJax does not implement \emph or \begin{enumerate}...\end{enumerate} or other text-mode macros or environments. You must use HTML to handle such formatting tasks. If you need a LaTeX-to-HTML converter, you should consider other options.

There are two exception to this rule. First, MathJax supports the \ref macro outside of math-mode. Second, MathJax supports some macros that add text within math-mode (such as \text{}) as well as $...$ within such macros (to switch back into math-mode) and \$ to escape.

Second, some features in MathJax might be necessarily limited. For example, MathJax only implements a limited subset of the array environment’s preamble, i.e., only the l, r, c, and |characters alongside : for dashed lines; everything else is ignored.

Note

If you are not familiar with TeX/LaTeX, a good starting point is the LaTeX Wiki book.

 

不熟悉

 LATEX

This is a guide to the LaTeX typesetting system. It is intended as a useful resource for everybody, from new users who wish to learn, to old hands who need a quick reference.

TeX and LaTeX

TeX is a typesetting computer program created by Donald Knuth, originally for his magnum opus, The Art of Computer Programming. It takes a “plain” text file and converts it into a high-quality document for printing or on-screen viewing. LaTeX is a macro system built on top of TeX that aims to simplify its use and automate many common formatting tasks. It is the de-facto standard for academic journals and books, and provides some of the best typography free software has to offer.

This book is organized into different parts:

  • Getting Started will provide you with the very first steps to print your first document, from installing the needed software to basic concepts and syntax.
  • Common Elements discusses common features you would expect from a document processor, including fonts, layout, colors, lists, and figures.
  • Mechanics are some topics that are not really necessary to write a basic document, but could help you understand how some parts of the system work. These topics are required for fine-tuning documents. Use them as support for various chapters, as they are often being referred to.
  • Technical Texts focuses on different specialized matters, mostly for scientific work.
  • Special Pages is for the structured pages usually put in appendices.
  • Special Documents: this part tackles other kind of documents different from the classic article style.
  • Creating Graphics is for the process of writing graphics from a LaTeX document.
  • Programming or how to create your own macros and packages.
  • Miscellaneous contains everything that does not fit in the previous parts, like project management and other subjects related to LaTeX but not inherent to LaTeX itself.
  • Help and Recommendations : the FAQ encompasses very common pitfalls and important recommendations for everyone, we urge you to read it; the Tips and Tricks are much more specific matters.
  • Appendices.

 

者,就從閱讀這本書開始吧◎