You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: replace #+begin_src org with #+begin_example throughout
#+begin_src org blocks whose content contains org headings (* lines)
cause the org-mode parser to break out of the block, rendering the
#+begin_src/#+end_src markers as plain text and the headings as real
headings. #+begin_example is the correct verbatim display construct
for org-syntax examples in a book — no evaluation, no parser confusion.
167 blocks replaced across 12 chapters.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: 02-getting-started.org
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ Let's create your first =.org= file. In Emacs:
65
65
66
66
Congratulations! You're now in Org-Mode. Let's type something:
67
67
68
-
#+begin_src org
68
+
#+begin_example
69
69
* Welcome to Org-Mode
70
70
71
71
This is a top-level heading. The asterisk at the start makes it special.
@@ -91,7 +91,7 @@ thoughts, notes—whatever you need.
91
91
92
92
Org files are organized as an outline. This structure is the foundation of
93
93
everything else.
94
-
#+end_src
94
+
#+end_example
95
95
96
96
Type this into your file (or something like it—creativity encouraged).
97
97
@@ -171,15 +171,15 @@ Don't panic if elisp is unfamiliar. You're not expected to become an Emacs Lisp
171
171
172
172
An Org file is fundamentally an outline with superpowers:
173
173
174
-
#+begin_src org
174
+
#+begin_example
175
175
* Level 1
176
176
** Level 2
177
177
*** Level 3
178
178
**** Level 4
179
179
180
180
Back to level 1
181
181
** Another Level 2
182
-
#+end_src
182
+
#+end_example
183
183
184
184
That's it. That's the core structure. Everything else in Org-Mode—todos, timestamps, tags, properties, tables, code blocks—gets added to this outline foundation.
Copy file name to clipboardExpand all lines: 03-document-structure.org
+44-44Lines changed: 44 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,19 +11,19 @@ You've mastered the basics: headings, folding, moving things around. Now let's e
11
11
12
12
We've established that asterisks create headings:
13
13
14
-
#+begin_src org
14
+
#+begin_example
15
15
* One asterisk = Level 1
16
16
** Two asterisks = Level 2
17
17
*** Three asterisks = Level 3
18
-
#+end_src
18
+
#+end_example
19
19
20
20
But headings in Org-Mode are more than visual organization—they're structural containers with their own properties, metadata, and behaviors.
21
21
22
22
** The Anatomy of a Heading
23
23
24
24
A complete heading can include several components:
25
25
26
-
#+begin_src org
26
+
#+begin_example
27
27
* TODO Write documentation :work:urgent:
28
28
SCHEDULED: <2025-01-15 Wed>
29
29
:PROPERTIES:
@@ -32,7 +32,7 @@ A complete heading can include several components:
32
32
33
33
This is the heading body. Everything until the next heading belongs to
34
34
this section.
35
-
#+end_src
35
+
#+end_example
36
36
37
37
Let's break this down:
38
38
- =*= - The level indicator
@@ -49,32 +49,32 @@ Each component is optional. A heading can be just =* Simple= or a metadata-rich
49
49
50
50
Org-Mode supports rich text formatting using simple markup:
51
51
52
-
#+begin_src org
52
+
#+begin_example
53
53
*bold text*
54
54
/italic text/
55
55
_underlined text_
56
56
=verbatim text= (displayed in monospace)
57
57
~code~ (also monospace)
58
58
+strikethrough text+
59
-
#+end_src
59
+
#+end_example
60
60
61
61
When Org-Mode displays these, they render beautifully, but open the file in any text editor and it's still human-readable. This is the plain-text philosophy in action.
62
62
63
63
** Escaping Special Characters
64
64
65
65
Need to write an actual asterisk without creating a heading? Precede it with a comma or use a zero-width space:
66
66
67
-
#+begin_src org
67
+
#+begin_example
68
68
,* This is not a heading
69
-
#+end_src
69
+
#+end_example
70
70
71
71
* Lists: Bullets, Numbers, and Checkboxes
72
72
73
73
Org-Mode has sophisticated list support. Simple to start, powerful when you need it.
74
74
75
75
** Unordered Lists
76
76
77
-
#+begin_src org
77
+
#+begin_example
78
78
* Shopping List
79
79
- Milk
80
80
- Eggs
@@ -83,13 +83,13 @@ Org-Mode has sophisticated list support. Simple to start, powerful when you need
83
83
- Coffee
84
84
- Dark roast
85
85
- Bread
86
-
#+end_src
86
+
#+end_example
87
87
88
88
Start a line with =-=, =+=, or =*= (if not at the start of the line) to create a list item. Press =M-RET= on a list item to create another at the same level.
89
89
90
90
** Ordered Lists
91
91
92
-
#+begin_src org
92
+
#+begin_example
93
93
* Recipe Steps
94
94
1. Preheat oven to 350°F
95
95
2. Mix dry ingredients
@@ -98,27 +98,27 @@ Start a line with =-=, =+=, or =*= (if not at the start of the line) to create a
98
98
3. Baking powder
99
99
3. Add wet ingredients
100
100
4. Bake for 25 minutes
101
-
#+end_src
101
+
#+end_example
102
102
103
103
Org-Mode automatically renumbers lists when you add or remove items. Move an item with =M-up/down= and the numbers update automatically. It's the little things.
104
104
105
105
** Description Lists
106
106
107
-
#+begin_src org
107
+
#+begin_example
108
108
* Git Commands
109
109
- git add :: Stage changes for commit
110
110
- git commit :: Save staged changes to history
111
111
- git push :: Send commits to remote repository
112
112
- git pull :: Fetch and merge remote changes
113
-
#+end_src
113
+
#+end_example
114
114
115
115
The =::= separator creates description lists—perfect for glossaries, definitions, or any term/description pairs.
116
116
117
117
** Checkbox Lists
118
118
119
119
Here's where lists get seriously useful:
120
120
121
-
#+begin_src org
121
+
#+begin_example
122
122
* Project Tasks
123
123
- [ ] Design mockups
124
124
- [ ] Get client approval
@@ -129,26 +129,26 @@ Here's where lists get seriously useful:
129
129
- [ ] Dashboard
130
130
- [ ] Reports
131
131
- [ ] Deploy to staging
132
-
#+end_src
132
+
#+end_example
133
133
134
134
=[ ]= creates an unchecked box, =[X]= is checked. Press =C-c C-c= (Control-c twice) on a checkbox to toggle it.
135
135
136
136
The magic: parent items show completion statistics:
137
137
138
-
#+begin_src org
138
+
#+begin_example
139
139
* Project Tasks [1/5]
140
140
- [ ] Task 1
141
141
- [X] Task 2
142
142
- [ ] Task 3
143
143
- [ ] Task 4
144
144
- [ ] Task 5
145
-
#+end_src
145
+
#+end_example
146
146
147
147
Or as a percentage:
148
148
149
-
#+begin_src org
149
+
#+begin_example
150
150
* Project Tasks [20%]
151
-
#+end_src
151
+
#+end_example
152
152
153
153
Add =[/]= or =[%]= after the heading text, and Org-Mode calculates it automatically when you toggle child checkboxes. This is phenomenal for tracking progress in nested task lists.
154
154
@@ -182,7 +182,7 @@ Narrowing is underrated. Working on one section of a large document? Narrow to i
182
182
183
183
Drawers are collapsible sections for metadata that you don't need to see all the time:
184
184
185
-
#+begin_src org
185
+
#+begin_example
186
186
* Project Meeting Notes
187
187
:PROPERTIES:
188
188
:MEETING_DATE: 2025-01-15
@@ -195,70 +195,70 @@ Drawers are collapsible sections for metadata that you don't need to see all the
195
195
:END:
196
196
197
197
The actual meeting notes go here.
198
-
#+end_src
198
+
#+end_example
199
199
200
200
The =:PROPERTIES:= drawer stores key-value pairs. The =:LOGBOOK:= drawer (auto-created) stores notes and state changes. Press TAB on a drawer to collapse/expand it.
201
201
202
202
You can create custom drawers too:
203
203
204
-
#+begin_src org
204
+
#+begin_example
205
205
* Project
206
206
:RESOURCES:
207
207
- https://docs.example.com
208
208
- https://github.com/example/repo
209
209
:END:
210
-
#+end_src
210
+
#+end_example
211
211
212
212
* Blocks: Special Sections
213
213
214
214
Blocks are regions with special formatting or behavior:
215
215
216
216
** Quote Blocks
217
217
218
-
#+begin_src org
218
+
#+begin_example
219
219
#+BEGIN_QUOTE
220
220
The best way to predict the future is to invent it.
221
221
— Alan Kay
222
222
#+END_QUOTE
223
-
#+end_src
223
+
#+end_example
224
224
225
225
** Example Blocks
226
226
227
-
#+begin_src org
227
+
#+begin_example
228
228
#+BEGIN_EXAMPLE
229
229
This text is displayed in monospace
230
230
and preserves spacing exactly.
231
231
#+END_EXAMPLE
232
-
#+end_src
232
+
#+end_example
233
233
234
234
** Source Code Blocks
235
235
236
-
#+begin_src org
236
+
#+begin_example
237
237
#+BEGIN_SRC python
238
238
def fibonacci(n):
239
239
if n <= 1:
240
240
return n
241
241
return fibonacci(n-1) + fibonacci(n-2)
242
-
#+END_SRC
242
+
#+end_example
243
243
#+end_src
244
244
245
245
We'll dive deep into code blocks in Chapter 11 (spoiler: they're executable).
246
246
247
247
** Center Blocks
248
248
249
-
#+begin_src org
249
+
#+begin_example
250
250
#+BEGIN_CENTER
251
251
This text will be centered when exported.
252
252
#+END_CENTER
253
-
#+end_src
253
+
#+end_example
254
254
255
255
Press =C-c '= (Control-c single-quote) inside a code block to edit it in a dedicated buffer with full syntax highlighting and language-specific features. Edit, then =C-c '= again to return. It's magical.
256
256
257
257
* Comments and Comment Blocks
258
258
259
259
Sometimes you need notes that don't export:
260
260
261
-
#+begin_src org
261
+
#+begin_example
262
262
# This is a comment line (won't export)
263
263
264
264
* A Regular Heading
@@ -272,21 +272,21 @@ Great for draft notes or internal documentation.
272
272
#+END_COMMENT
273
273
274
274
This also exports.
275
-
#+end_src
275
+
#+end_example
276
276
277
277
You can also comment entire subtrees:
278
278
279
-
#+begin_src org
279
+
#+begin_example
280
280
* COMMENT This heading won't export
281
281
Neither will anything inside it.
282
282
Great for drafts or deprecated sections.
283
-
#+end_src
283
+
#+end_example
284
284
285
285
* Footnotes: Academic Precision
286
286
287
287
Org-Mode has first-class footnote support:
288
288
289
-
#+begin_src org
289
+
#+begin_example
290
290
The Org-Mode manual[fn:1] is comprehensive but dense. Some prefer community
291
291
guides[fn:2] for learning.
292
292
@@ -295,21 +295,21 @@ guides[fn:2] for learning.
295
295
[fn:1] https://orgmode.org/manual/
296
296
297
297
[fn:2] Various blogs and tutorials exist, though quality varies.
298
-
#+end_src
298
+
#+end_example
299
299
300
300
Or use inline footnotes:
301
301
302
-
#+begin_src org
302
+
#+begin_example
303
303
Org-Mode was created in 2003[fn::Though it built on earlier work in Outline mode].
304
-
#+end_src
304
+
#+end_example
305
305
306
306
Press =C-c C-c= on a footnote reference to jump to its definition. Press it again to jump back. Org-Mode handles numbering automatically.
307
307
308
308
* Horizontal Rules
309
309
310
310
Sometimes you need a visual separator:
311
311
312
-
#+begin_src org
312
+
#+begin_example
313
313
* Section One
314
314
315
315
Content here.
@@ -319,22 +319,22 @@ Content here.
319
319
* Section Two
320
320
321
321
More content.
322
-
#+end_src
322
+
#+end_example
323
323
324
324
Five or more dashes on a line creates a horizontal rule.
325
325
326
326
* Archiving Old Content
327
327
328
328
Documents grow. Eventually you'll want to move completed or outdated items without deleting them:
329
329
330
-
#+begin_src org
330
+
#+begin_example
331
331
* Active Projects
332
332
** TODO Current work
333
333
** DONE Old project
334
334
:PROPERTIES:
335
335
:ARCHIVE: this/file/name.org::* Archived Projects
336
336
:END:
337
-
#+end_src
337
+
#+end_example
338
338
339
339
=C-c C-x C-a= archives the current subtree, moving it to your archive file (or archive location) while preserving its structure and metadata.
0 commit comments