Skip to content

Instantly share code, notes, and snippets.

@eddieh
Last active June 4, 2021 22:42
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eddieh/1c784cd92b2de48a214d16734dd59807 to your computer and use it in GitHub Desktop.
Save eddieh/1c784cd92b2de48a214d16734dd59807 to your computer and use it in GitHub Desktop.
Org-mode example doc that tests GitHub support

Org-mode Test Document

Heading Level

This is either the heading or the title when interpreted by GitHub Gist. I don’t recall which. Donec sed odio operae, eu vulputate felis rhoncus. Nihilne te nocturnum praesidium Palati, nihil urbis vigiliae. Quae vero auctorem tractata ab fiducia dicuntur. Quisque placerat facilisis egestas cillum dolore. Paullum deliquit, ponderibus modulisque suis ratio utitur. Plura mihi bona sunt, inclinet, amari petere vellent.

Heading Level 2

This is a level two heading above a second paragraph of text. Petierunt uti sibi concilium totius Galliae in diem certam indicere. Curabitur blandit tempus ardua ridiculus sed magna. Quid securi etiam tamquam eu fugiat nulla pariatur. Praeterea iter est quasdam res quas ex communi. Quisque ut dolor gravida, placerat libero vel, euismod.

Scource Code

Quis aute iure reprehenderit in voluptate velit esse. Me non paenitet nullum festiviorem excogitasse ad hoc. Tu quoque, Brute, fili mi, nihil timor populi, nihil!

An example of portable C skeleton.

#include <stdlib.h>

int main(int argc, char **argv) {
    // code
    return EXIT_SUCCESS;
}

Text formatting

Me non paenitet nullum festiviorem excogitasse ad hoc. Morbi fringilla convallis sapien, id pulvinar odio volutpat. Petierunt uti sibi concilium totius Galliae in diem certam indicere. Quid securi etiam tamquam eu fugiat nulla pariatur.

Want something bold use *bold*. Want something italic use /italic/. Want something underlined use _underlined_. Want something strikethrough use +strikethrough+. And lastly, want something monospaced use =monospaced= or ~monospaced~.

Links

Etiam habebis sem dicantur magna mollis euismod. Fictum, deserunt mollit anim laborum astutumque! Ullamco laboris nisi ut aliquid ex ea commodi consequat. Vivamus sagittis lacus vel augue laoreet rutrum faucibus. This gist is marked up with org-mode https://orgmode.org

Org-mode is one of the most reasonable markup languages for document preparation. Yes that is basically taken from a blog post about org-mode. Read it here Org-Mode Is One of the Most…

Link syntax is pretty simple, but to avoid encoding issues it is best to insert links with C-c C-l, but if you must insert with markup use [[url]] for plain URLs and use [[url][description]] for links with descriptions.

Paragraphs

Paragraphs are separated by at least one empty line. Qui ipsorum lingua Celtae, nostra Galli appellantur.

Use a double backslash \\ at the end of a line to force a line break. Nihilne te nocturnum praesidium Palati, nihil urbis vigiliae. Quisque placerat facilisis egestas cillum dolore. Etiam habebis sem
dicantur magna mollis euismod. Quisque ut dolor gravida, placerat libero vel, euismod. At nos hinc posthac, sitientis piros Afros. Vivamus sagittis lacus vel augue laoreet rutrum faucibus. Excepteur sint obcaecat cupiditat non proident culpa. Hi omnes lingua, institutis, legibus inter se differunt.

Format some poetry. Unfortunately GitHub does not (at this time) render org-mode’s #+BEGIN_VERSE ... #+END_VERSE. So the verse bellow does not even show up on GitHub.

—William Blake

Format a quote.

Give a man a fish and feed him for a day. Don’t teach a man to fish and feed yourself. He’s a grown man. And fishing’s not that hard.

—Ron Swanson

Now center some text. Unfortunately GitHub displays the text (at this time) in a #+BEGIN_CENTER .. #+END_CENTER block, but it does not render it centered.

Centered.

Subscripts and Superscripts

Text characters set below or above the line of type for a font/size combination are necessary for technical writing. Subscripts and superscripts are achieved in the same way as in TeX or LaTeX.

The radius of the sun is Rsun = 6.96 × 108 m. On the other hand, the radius of Alpha Centauri is RAlpha Centauri = 1.28 × Rsun.

Special Symbols

There are many special symbols and non-Latin alphabets that can be inserted in an org document. The syntax is like TeX or LaTeX too.

Given a circle Γ of diameter d, the length of its circumference is πd. We can type α as \alpha, β as \beta, and χ as \chi. If you need a symbol in a word or formula it can be terminated with a pari of curly braces, so the previous πd is achived by typing \pi{}d.

Some other symbols include © as \copy, \dag as \dag, and × as seen in the subscript/superscript section above as \times. There’s ± as \pm or \plusmn. There’s ½ as \frac12 and there’s ¾ as \frac34. There’s x → ∞, typed as x \to \infin. Don’t forget the en dash – or the em dash —, respectively -- and ---.

Get a list of special symbols with org-entities-help or you can add your own in the variable org-entities-user.

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