Skip to content

Latest commit

 

History

History
325 lines (200 loc) · 12 KB

SYNTAX.md

File metadata and controls

325 lines (200 loc) · 12 KB

\title{Welcome to Mathpix Markdown!}

Mathpix Markdown uses a combination of Markdown and LaTeX syntax to create a great writing experience for technical documents.

This means that you can use all the standard Markdown syntax in addition to some LaTeX and other features that we will list below.


Using Chemistry with SMILES syntax

OC(=O)c1cc(Cl)cs1

Using Math mode LaTeX syntax

You can insert inline mathematics using LaTeX delimiters $...$ or \(...\) like this $\vec { F } = m \vec { a }$ and this (ax^2 + bx + c = 0).

You can insert non-numbered block mode mathematics by using the LaTeX delimiters $$...$$, \[...\], \begin{equation*}...\end{equation*}, and \begin{align*}...\end{align*}:

$$ x = \frac { - b \pm \sqrt { b ^ { 2 } - 4 a c } } { 2 a } $$

[ y = \frac { \sum _ { i } w _ { i } y _ { i } } { \sum _ { i } w _ { i } } , i = 1,2 \ldots k ]

\begin{equation*} l ( \theta ) = \sum _ { i = 1 } ^ { m } \log p ( x , \theta ) \end{equation*}

You can insert numbered block mode mathematics by using the LaTeX delimiters \begin{equation}...\end{equation} and \begin{align}...\end{align}:

\begin{equation} m = \frac { m _ { 0 } } { \sqrt { 1 - v ^ { 2 } / c ^ { 2 } } } \end{equation}

\begin{align} ^{|\alpha|} \sqrt{x^{\alpha}} \leq(x \bullet \alpha) /|\alpha| \end{align}

Use \label{} and \ref{} or \eqref{} to link to any numbered equation in your document

In equation \eqref{eq:1}, we find the value of an interesting integral:

\begin{equation} \int_0^\infty \frac{x^3}{e^x-1},dx = \frac{\pi^4}{15} \label{eq:1} \end{equation}

\begin{equation} | x + y | \geq | | x | | - | y | | \label{eq:2} \end{equation}

Look at the Equation \ref{eq:2}

Use \tag{} to create a custom tag for your equation

In addition to using numbered block mode equation syntax for standard numbering (ie. 1, 2, 3), you can use also include \tag{} inside of your LaTeX delimiters to create a custom tag. Note that if \tag{} is used in a numbered equation, it will override the document's numbering.

$$ \frac{x\left(x^{2 n}-x^{-2 n}\right)}{x^{2 n}+x^{-2 n}} \tag{1.1} $$

\begin{equation} \max {\theta} \mathbb{E}{\mathbf{z} \sim \mathcal{Z}{T}}\left[\sum{t=1}^{T} \log p_{\theta}\left(x_{z_{t}} | \mathbf{x}{\mathbf{z}{<t}}\right)\right] \tag{1.2} \end{equation}

Other math mode LaTeX environments supported

Snip also supports some less common math mode LaTeX environments, such as:

\begin{split}...\end{split} to split your equation into smaller pieces:

\begin{split} a& =b+c-d\ & \quad +e-f\ & =g+h\ & =i \end{split}

  • Use \\ to denote a new line and & to denote where the lines should align.
  • Need it numbered? Wrap it in \begin{equation}...\end{equation}

\begin{gather}...\end{gather} for displaying a set of consecutive equations that don't require special alignment and \begin{gather*}...\end{gather*} if you don't want equation numbering:

\begin{gather} a_1=b_1+c_1\ a_2=b_2+c_2-d_2+e_2 \end{gather}

\begin{gather*} a_1=b_1+c_1\ a_2=b_2+c_2-d_2+e_2 \end{gather*}



Using Text mode LaTeX in Snip

Our LaTeX Flavored Markdown includes support for many standard text mode LaTeX commands that Markdown editors do not support.

\title{Title}

In Snip, You can use the \title{} command wherever you want the title to appear in your document. If pasting LaTeX code into Snip, please note that the \maketitle command will be ignored.

\author{Author}

\author{Author\can also be\multiline}

\begin{abstract} This is the abstract to my paper. You are going to learn a lot in this paper, just you wait. I am going to tell you about all the different LaTeX and Markdown syntax you can use in Snip. \end{abstract}

\section{My great section}

\subsection{My really great subsection}

You can use LaTeX commands for \textit{italicizing...}

...and for \textbf{bolding}

Use \url{} to insert a \url{link}.



Using Markdown in Snip

Snip is a Markdown editor first, so you can use all standard Markdown syntax!

h1 Heading

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading

This is bold text

This is also bold text

This is italic text

This is also italic text

Strikethrough

==This is marked text==




(c) (C) (r) (R) (tm) (TM) (p) (P) +-

test.. test... test..... test?..... test!....

!!!!!! ???? ,, -- ---

Quotes

Use a > to write a blockquote

or

Blockquotes can also be nested...

...by using additional > right next to each other...

...or with spaces between >.

Lists

Create an unordered list by starting a line with "+", "-", or "*"

  • Sub-lists are made by indenting 2 spaces:
    • Different characters in in the same sub-list will render the same characters:
      • Ac tristique libero volutpat at
      • Facilisis in pretium nisl aliquet
      • Nulla volutpat aliquam velit
  • Very easy!

Create an ordered list by writing 1.

  1. Lorem ipsum dolor sit amet
  2. Consectetur adipiscing elit
  3. Integer molestie lorem at massa

...

  1. You can use sequential numbers...
  2. ...or keep all the numbers as 1.

Or start your list with any number and the numbering will continue:

  1. foo
  2. bar
  3. foo

Code

Wrap inline code in single backticks

...or wrap code blocks in 3 backticks or 3 tildes

var foo = function (bar) {
  return bar++;
};

Include the programming language for syntax highlighting:

var foo = function (bar) {
  return bar++;
};

All major languages supported via highlight.js.

You can also create a code block by indenting all lines:

\\ some comments 
line 1 of code 
line 2 of code
line 3 of code

Tables

Colons can be used to align columns:

Tables Are Cool
col 3 is right-aligned $1600
col 2 is centered $12
zebra stripes are neat $1

There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily:

Markdown Less Pretty
Still renders nicely
1 2 3

Links and images

This is a link to the Mathpix website

Feynman Lecture 1

Include text in quotes for a tooltip (hover over the image to see): Feynman Lecture 2

Footnotes

You can write footnotes either by writing out "first", "second", "third", etc:

Footnote 1 link1.

Footnote reference2

And you can reference the same footnote again like this2

Or you can use numbers:

This is my next footnote3

And another4

You can reference multiple footnotes in a row34

You can also write inline footnotes:

Inline footnote^[Text of inline footnote] definition.

Emojies

Classic markup: 😉 😢 😆 😋

Shortcuts (emoticons): :-) :-( 8-) ;)

Subscripts and Superscripts

  • 19^th^
  • H2O


Using HTML in Snip

You can also use HTML tags in Snip. Here is an example of a header:

This is a Blue Heading

You can also insert SVGs!

\n\t<style> #function random() { [native code] } {pointer-events:none; } #function random() { [native code] } .event { pointer-events:all;} </style>\n\tO\n\tO\n\tH\n\tO\n\tH\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n


Footnotes

  1. Footnotes can have markup

    and multiple paragraphs.

  2. Footnote text. 2

  3. Hello I am the third footote! 2

  4. And I'm the 4th! 2