org-syntax

  1. Table of Contents
  2. Org Mode - Your life in plain text
    1. Metadata
    2. Headlines
    3. Markup
    4. Lists
    5. Links
    6. Images
    7. Blocks
    8. Table
    9. Commnet
    10. Macros
    11. footnotes
  3. Footnotes

Table of Contents

  1. Org Mode - Your life in plain text
    1. Metadata
    2. Headlines
    3. Markup
    4. Lists
    5. Links
    6. Images
    7. Blocks
    8. Table
    9. Commnet
    10. Macros
    11. footnotes

Org Mode - Your life in plain text

Org is a highly flexible structured plain text file format, composed of a few simple, yet versatile, structures – constructed to be both simple enough for the novice and powerful enough for the expert.

Org mode is Emacs major mode for convenient plain text markup,is for

  • keeping notes,
  • maintaining to-do lists,
  • planning projects,
  • authoring documents,
  • computational notebooks,
  • literate programming
  • and more

in a fast and effective plain text system.

Metadata

At the start of a file(before the first headline), it’s common to set the title, author and other export options

#+title: Example Org File
#+author: Mr.Frame
#+date: Fri May  7 10:07:35 CST 2021
#+startup: overview content showall showeverything nohideblocks  hideblocks

Headlines

Lines that start with an asterisk * are headlines
A single * denotes a 1st-level headline

* Revamp orgmode.org website
** Make screenshots

Markup

Text markup follows th pattern, PRE, MARKER, CONTENTS, MARKER and POST are not separated by whitespace characters.
<Pre><Marker><Contents><Marker><Post>

  • : - ( { ' " and whitespace1,
  • : a character among *(bold), =(verbatim), /(italic), +(strikethrough), _(underline), ~(code)
  • : ,- . , ; : ! ? ‘ “ ) } [
  • : <non-whitespace-character><any character but may not span over more than 3 lines><non-whitespace-character>
Font Style Singal Effect
Bold *Bold* Bold
Italic /Italic/ Italic
Underline _underline_ underline
Strikethrough +strikethrough+ strikethrough
code ~code~ code
verbatim =verbatim= berbatim
Superscripts R_sun=6.96 x 10^8m Rsun=6.96 x 108m
Subscripts R_{AlphaCentauri} = 1.28 x R_{sum} RAlphaCentauri = 1.28 x Rsum

Lists

Unordered lists start with + -
Ordered lists start with 1. 1) A. A)
Unordered and odered bullets can be nested in any order.

To buy:
1. Milk
2. Eggs
  - Organic
3. Cheese
  + Parmesan
  + Mozzarella

Lists can contain checkboxes [ ] [-] [X]
- [ ] not started
- [-] in progress
- [X] complete 

Lists can contain tags (and checkboxes at the same time)
- [ ] fruits :: get apples
- [X] vegiies :: get carrots

put the target between two square brackets,like so: [[type:target]] or [[type:target][desc]]
same as an html <a> tag <a href="target">desc</a>

[[https://orgmode.org][a nice website]]
[[file:~/Pictures/dank-emem.png]]
[[earlier heading][an earlier heading in the document]]

Images

Org mode automatically recognizes and renders image links during export.
Just link to an image (don’t include a description).

[[https://upload.wikimedia.org/wikipedia/commons/5/5d/Konigsberg_bridges.png]]

Images located on your computer can also be rendered in the Emacs buffer with C-c C-x C-v

Blocks

Org mode uses #+BEGIN#+END blocks for many purposes.

(defun org-xor (a b)
   "Exclusive or."
   (if a (not b) b))

Table

| Tool         | Literate programming? | Reproducible Research? | Languages |
|--------------+-----------------------+------------------------+-----------|
| Javadoc      | partial               | no                     | Java      |
| Haskell .lhs | partial               | no                     | Haskell   |
| noweb        | yes                   | no                     | any       |
| Sweave       | partial               | yes                    | R         |
| Org-mode     | yes                   | yes                    | any       |

Commnet

  • Line comments start with #

  • Inline comments wrap @@comment: like so@@

  • Block comments are wrapped with #+BEGIN_COMMENT and #+END_COMMENT

  • Section comments can be created by adding the COMMENT keyword to a headline

        # A line commment
    
        Example of an @@comment: inline@@ comment.
      #+begin_comment
      This is a block comment.
      It can span multiple line.
      As well as other markup.

      #+begin_src emacs-lisp
      (+ 1 2)
      #+end_src

      #+end_comment
      * A top level headline
      ** COMMENT This section and subsections are commented out
      *** This headline inherits the =COMMENT= keyword
    This text is commented out
      ** This headline is not commented

Macros

#+macro: attn _*/$1/*_
{{{attn(This text gets all the markup!)}}}

Attention! This text gets all the markup! _ this will underline_

footnotes

  • [fn:name:description]

  • [fn::description]

  • [fn:name2]

    [fn:name2] description

    ** Footnotes
    The Org homepage[fn:1] now looks a lot better than it used to.

    Tom is a boy[fn:name].

    Jim is a boy[fn:: This is the inline definition of this footnote] too.

    Lily is a girl[fn:lily: a definition].

[fn:1] The link is: http://orgmode.org
[fn:name] Tom is a boy.

Footnotes

1 \space \tab \enter


转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 askding@qq.com

💰

×

Help us with donation