Mastering Emacs Org-mode

Table of Contents

1. 1 Introduction

2. 2 Document Structure

2.1. What is Org-mode?   drill emacs_orgmode

Org-mode is a mode for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system in Emacs.

2.2. How do you create a new heading in Org-mode?   drill emacs_orgmode

To create a new heading in Org-mode, use the asterisk (*) symbol at the beginning of a line. More asterisks create sub-headings.

2.3. Structure Editing   drill emacs_orgmode


M-RET (org-meta-return)
C-RET (org-insert-heading-respect-content)
M-S-RET (org-insert-todo-heading)
C-S-RET (org-insert-todo-heading-respect-content)
TAB (org-cycle)

2.4. Drawers   drill emacs_orgmode

2.4.1. This is a headline

  • Note taken on [2024-08-08 Thu 12:53]
    This is a note from C-c C-z

Still outside the drawer

This is inside the drawer.

After the drawer.

3. 3 Tables

3.1. How do you create a table in Org-mode?   drill emacs_orgmode

To create a table in Org-mode, start a line with a vertical bar (|) and use TAB to move between cells. Press RETURN to create a new row.

c1 c2 c3
a b c

3.2. What is the command to recalculate all tables in an Org file?   drill emacs_orgmode

The command to recalculate all tables in an Org file is C-u C-c * (org-table-recalculate-buffer-tables).

x y
8 8
2 2

3.3. What is a column group?   drill emacs_orgmode

N N^2 N^3 N^4 sqrt(n) sqrt[4](N)
1 1 1 1 1 1
2 4 8 16 1.4142136 1.1892071
3 9 27 81 1.7320508 1.3160740

3.4. What is required to use Plot   drill emacs_orgmode

brew install gnuplot
(package-install 'gnuplot)

3.5. What is an example of a Histogram?   drill emacs_orgmode

Sede Max cites H-index
Chile 257.72 21.39
Leeds 165.77 19.68
Sao Paolo 71.00 11.50
Stockholm 134.19 14.33
Morelia 257.56 17.67

3.6. What is an example of a Radar?   drill emacs_orgmode

3.6.1. Initial Scores

Model Performance Fairness Utility Modesty Diversity Creativity
GPT-4 4.5 3.8 4.7 3.2 4.0 4.2
Claude 3 4.3 4.0 4.5 3.5 4.2 3.8
Gemini 4.2 3.7 4.3 3.0 3.8 3.9
Llama 2 3.8 3.5 4.0 3.3 3.5 3.6
PaLM 3.7 3.4 3.9 3.1 3.4 3.5
BLOOM 3.5 3.3 3.7 3.0 3.3 3.4
Jurassic-2 3.4 3.2 3.6 2.9 3.2 3.3
StableLM 3.3 3.1 3.5 2.8 3.1 3.2

3.6.2. Computed (Normalized)

Model Performance Fairness Utility Modesty Diversity Creativity
GPT-4 5.00 3.89 5.00 2.86 5.00 5.00
Claude 3 4.17 5.00 4.17 5.00 5.00 3.00
Gemini 3.75 3.33 3.33 1.43 3.75 3.50
Llama 2 2.08 2.22 2.08 3.57 2.50 2.00
PaLM 1.67 1.67 1.67 2.14 1.88 1.50
BLOOM 0.83 1.11 0.83 1.43 1.25 1.00
Jurassic-2 0.42 0.56 0.42 0.71 0.63 0.50
StableLM 0.00 0.00 0.00 0.00 0.00 0.00

Note: Values have been normalized to a 0-5 range for each metric, with 0.5 padding applied to the original minimum and maximum values. This normalization enhances visual differentiation but may exaggerate relative differences between models.

3.6.3. Python Comparison

import numpy as np
import matplotlib.pyplot as plt

# Data
models = ['GPT-4', 'Claude 3', 'Gemini', 'Llama 2', 'PaLM', 'BLOOM', 'Jurassic-2', 'StableLM']
metrics = ['Performance', 'Fairness', 'Utility', 'Modesty', 'Diversity', 'Creativity']

# Example data (replace with your actual data)
values = np.array([
    [5.00, 3.89, 5.00, 2.86, 5.00, 5.00],  # GPT-4
    [4.17, 5.00, 4.17, 5.00, 5.00, 3.00],  # Claude 3
    [3.75, 3.33, 3.33, 1.43, 3.75, 3.50],  # Gemini
    [2.08, 2.22, 2.08, 3.57, 2.50, 2.00],  # Llama 2
    [1.67, 1.67, 1.67, 2.14, 1.88, 1.50],  # PaLM
    [0.83, 1.11, 0.83, 1.43, 1.25, 1.00],  # BLOOM
    [0.42, 0.56, 0.42, 0.71, 0.63, 0.50],  # Jurassic-2
    [0.00, 0.00, 0.00, 0.00, 0.00, 0.00],  # StableLM
])

# Number of variables
num_vars = len(metrics)

# Compute angle for each axis
angles = np.linspace(0, 2 * np.pi, num_vars, endpoint=False).tolist()
angles += angles[:1]  # complete the circle

# Plot
fig, ax = plt.subplots(figsize=(10, 10), subplot_kw=dict(projection='polar'))

# Plot each model
for i, model in enumerate(models):
    values_model = values[i].tolist()
    values_model += values_model[:1]  # complete the polygon
    ax.plot(angles, values_model, linewidth=2, linestyle='solid', label=model)
    ax.fill(angles, values_model, alpha=0.1)

# Set chart properties
ax.set_theta_offset(np.pi / 2)
ax.set_theta_direction(-1)
ax.set_thetagrids(np.degrees(angles[:-1]), metrics)
ax.set_ylim(0, 5)
ax.set_yticks(np.arange(1, 6))
ax.set_yticklabels(np.arange(1, 6))
ax.set_rlabel_position(0)

# Add legend
plt.legend(loc='upper right', bbox_to_anchor=(1.3, 1.1))

# Add title
plt.title("Normalized Analysis of AI Language Models (2024)", y=1.08)

# Show the plot
plt.tight_layout()
plt.show()

3.7. ASCII bar plots   drill emacs_orgmode

Sede Max cites  
Chile 257.72 WWWWWWWWWWWW
Leeds 165.77 WWWWWWWh
Sao Paolo 71.00 WWW;
Stockholm 134.19 WWWWWW:
Morelia 257.56 WWWWWWWWWWWW
Rochefourchat 0.00  

4. 4 Hyperlinks

4.1. Link Abbreviations   drill emacs_orgmode

Link Type Example
ChatGPT https://chat.openai.com/
Claude https://claude.ai/
Gemini https://gemini.com/
Google https://www.google.com/
Hacker News https://news.ycombinator.com/
Khoj https://khoj.com/
Meta AI https://ai.meta.com/
Perplexity https://www.perplexity.ai/
Phind https://www.phind.com/
Wal.sh https://wal.sh/
YouTube https://www.youtube.com/

#+begin_src elisp (setq org-link-abbrev-alist '(("google" . "https://www.google.com/search?q=") ("hn" . "https://news.ycombinator.com/") ("yt" . "https://www.youtube.com/watch?v=") ("perplexity" . "https://www.perplexity.ai/") ("chatgpt" . "https://chat.openai.com/") ("claude" . "https://claude.ai/") ("gemini" . "https://gemini.com/") ("phind" . "https://www.phind.com/") ("metaai" . "https://ai.meta.com/") ("khoj" . "https://khoj.com/") ("walsh" . "https://wal.sh/"))) #+end_src**

5. DONE 5 TODO Items

5.1. What are basic commands for managing TODOs?   drill emacs_orgmode

Keybinding Description
C-c C-t Rotate the TODO state of the current item.
S-RIGHT S-LEFT Select the next/previous TODO state.
C-c / t View TODO items in a sparse tree.
M-x org-agenda t Show the global TODO list.
S-M-RET Insert a new TODO entry below the current one.

5.2. DONE What are workflow states?   drill emacs_orgmode

(setq org-todo-keywords
      '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))

5.3. DONE Progress Logging   drill emacs_orgmode

  • State "TODO" from [2024-08-08 Thu 13:06]
    C-u C-c C-t

5.4. Tracking your habits   drill emacs_orgmode

5.4.1. TODO Shave

  • State "DONE" from "TODO" [2024-08-08 Thu 13:37]
  • State "DONE" from "TODO" [2024-08-08 Thu 13:37]
  • State "DONE" from "TODO" [2024-08-08 Thu 13:08]
  • State "DONE" from "TODO" [2024-08-08 Thu 13:08]
  • State "DONE" from "TODO" [2024-08-08 Thu 13:08]
  • State "DONE" from "TODO" [2024-08-08 Thu 13:08]
  • State "DONE" from "TODO" [2009-10-15 Thu]
  • State "DONE" from "TODO" [2009-10-12 Mon]
  • State "DONE" from "TODO" [2009-10-10 Sat]
  • State "DONE" from "TODO" [2009-10-04 Sun]
  • State "DONE" from "TODO" [2009-10-02 Fri]
  • State "DONE" from "TODO" [2009-09-29 Tue]
  • State "DONE" from "TODO" [2009-09-25 Fri]
  • State "DONE" from "TODO" [2009-09-19 Sat]
  • State "DONE" from "TODO" [2009-09-16 Wed]
  • State "DONE" from "TODO" [2009-09-12 Sat]

5.5. Checkboxes   drill emacs_orgmode

5.5.1. Show checkboxes

5.5.1.1. DONE Organize party [1/4]
  • [-] call people [1/3]
    • [ ] Peter
    • [X] Sarah
    • [ ] Sam
  • [ ] order food
  • [ ] think about what music to play
  • [X] talk to the neighbors

6. 6 Tags

7. 7 Properties and Columns

7.1. What are special properties?   drill emacs_orgmode

Property Description
ALLTAGS All tags, including inherited ones.
BLOCKED t if task is currently blocked by children or siblings.
CATEGORY The category of an entry.
CLOCKSUM The sum of CLOCK intervals in the subtree. `org-clock-sum` must be run first to compute values.
CLOCKSUM_T The sum of CLOCK intervals in the subtree for today. `org-clock-sum-today` must be run first.
CLOSED When was this entry closed?
DEADLINE The deadline timestamp.
FILE The filename the entry is located in.
ITEM The headline of the entry.
PRIORITY The priority of the entry, a string with a single letter.
SCHEDULED The scheduling timestamp.
TAGS The tags defined directly in the headline.
TIMESTAMP The first active keyword-less timestamp in the entry.
TIMESTAMP_IA The first inactive keyword-less timestamp in the entry.
TODO The TODO keyword of the entry.

8. 8 Dates and Times

8.1. DONE Show Clocking Work Time   drill emacs_orgmode

(setq org-clock-persist 'history)
(org-clock-persistence-insinuate)

8.2. Taking Notes with a Relative Timer   drill emacs_orgmode

0:00:00

Command Description
C-c C-x C-c Start or reset the timer.
C-c C-x , Pause or resume the timer.
C-c C-x . Insert timestamp.
C-c C-x : Set a timer.
C-c C-x C-c Start a new timer.
C-c C-x Reset or stop the timer.

8.3. What is the command to schedule a task in Org-mode?   drill emacs_orgmode

The command to schedule a task in Org-mode is C-c C-s (org-schedule).

8.4. How do you mark a task as DONE in Org-mode?   drill emacs_orgmode

To mark a task as DONE in Org-mode, place the cursor on the task and press C-c C-t, then select DONE from the list of states.

9. TODO 9 Refiling and Archiving

  • C-c C-w (org-refile)

10. TODO 10 Capture and Attachments

11. TODO 11 Agenda Views

12. TODO 12 Markup for Rich Contents

13. TODO 14 Publishing

14. TODO 15 Citation handling

15. TODO 16 Working with Source Code

16. TODO 15 Citation handling

17. TODO 16 Working with Source Code

18. TODO 17 Miscellaneous