Skip to content

Instantly share code, notes, and snippets.

@bangonkali
Last active July 14, 2025 01:45
Show Gist options
  • Save bangonkali/1bc25ce0739349fae8878810b9e17629 to your computer and use it in GitHub Desktop.
Save bangonkali/1bc25ce0739349fae8878810b9e17629 to your computer and use it in GitHub Desktop.
Some markdown I use for testing markdown renderer πŸ˜….

Yes, Markdown can render mathematical formulas and LaTeX, especially when used with platforms that support it, such as Jupyter Notebooks, GitHub, or certain Markdown editors. Here’s an example of how you can include mathematical formulas using LaTeX syntax in Markdown:

Markdown with LaTeX

Inline Math

You can include inline math using single dollar signs:

The quadratic formula is $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$.

Block Math

For displaying math on its own line, you can use double dollar signs:

$$ E = mc^2 $$

Examples

Integral

The integral of a function $f(x)$ from $a$ to $b$ is given by:

$$ \int_{a}^{b} f(x) , dx $$

Matrix

Here is a matrix:

$$ \begin{pmatrix} a & b \\ c & d \end{pmatrix} $$

Summation

The summation of a series can be represented as:

$$ \sum_{i=1}^{n} i = \frac{n(n+1)}{2} $$

Derivative

The derivative of a function $f(x)$ with respect to $x$ is:

$$ \frac{d}{dx} f(x) $$

Limit

The limit of a function $f(x)$ as $x$ approaches $a$ is:

$$ \lim_{x \to a} f(x) $$

Logarithm

The natural logarithm of $x$ is:

$$ \ln(x) $$

Trigonometric Functions

The sine and cosine functions are:

$$ \sin(x) \quad \text{and} \quad \cos(x) $$

These examples demonstrate how you can include mathematical expressions in your Markdown documents using LaTeX syntax. Keep in mind that the rendering of these formulas depends on the platform or editor you are using. For instance, GitHub supports basic LaTeX for math, but for more complex formulas, you might need a more specialized tool like Jupyter Notebooks or a dedicated LaTeX editor.


Advertisement :)

  • pica - high quality and fast image resize in browser.
  • babelfish - developer friendly i18n with plurals support and easy syntax.

You will like those projects!


h1 Heading 8-)

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading

Horizontal Rules




Typographic replacements

Enable typographer option to see result.

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

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

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

"Smartypants, double quotes" and 'single quotes'

Emphasis

This is bold text

This is bold text

This is italic text

This is italic text

Strikethrough

Blockquotes

Blockquotes can also be nested...

...by using additional greater-than signs right next to each other...

...or with spaces between arrows.

Lists

Unordered

  • Create a list by starting a line with +, -, or *
  • Sub-lists are made by indenting 2 spaces:
    • Marker character change forces new list start:
      • Ac tristique libero volutpat at
      • Facilisis in pretium nisl aliquet
      • Nulla volutpat aliquam velit
  • Very easy!

Ordered

  1. Lorem ipsum dolor sit amet

  2. Consectetur adipiscing elit

  3. Integer molestie lorem at massa

  4. You can use sequential numbers...

  5. ...or keep all the numbers as 1.

Start numbering with offset:

  1. foo
  2. bar

Code

Inline code

Indented code

// Some comments
line 1 of code
line 2 of code
line 3 of code

Block code "fences"

Sample text here...

Syntax highlighting

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

console.log(foo(5));

Tables

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

Right aligned columns

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

Links

link text

link with title

Autoconverted link https://github.com/nodeca/pica (enable linkify to see)

Images

Minion Stormtroopocat

Like links, Images also have a footnote style syntax

Alt text

With a reference later in the document defining the URL location:

Plugins

The killer feature of markdown-it is very effective support of syntax plugins.

Classic markup: πŸ˜‰ 😒 πŸ˜† πŸ˜‹

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

see how to change output with twemoji.

  • 19^th^
  • H2O

++Inserted text++

==Marked text==

Footnote 1 link1.

Footnote 2 link2.

Inline footnote^[Text of inline footnote] definition.

Duplicated footnote reference2.

Term 1

: Definition 1 with lazy continuation.

Term 2 with inline markup

: Definition 2

    { some code, part of Definition 2 }

Third paragraph of definition 2.

Compact style:

Term 1 ~ Definition 1

Term 2 ~ Definition 2a ~ Definition 2b

This is HTML abbreviation example.

It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.

*[HTML]: Hyper Text Markup Language

::: warning here be dragons :::

Footnotes

  1. Footnote can have markup

    and multiple paragraphs. ↩

  2. Footnote text. ↩ ↩2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment