✅ Document Structure
Org documents are structured around headlines, which create a hierarchical outline that can be folded, navigated, and manipulated. This chapter covers how to create and work with document structure in Scimax VS Code.
✅ Headlines
Headlines are the backbone of org documents. They define the structure and allow for powerful outline-based navigation and organization.
✅ Creating Headlines
A headline starts with one or more asterisks (*) at the beginning of a line, followed by a space:
,* Top Level Headline
,** Second Level
,*** Third Level
,**** Fourth Level
There is no hard limit on headline levels, but most documents use 3-5 levels.
✅ Headline Components
A headline can contain several components:
,* TODO [#A] Headline Title :tag1:tag2:
| Component | Description | Example |
|---|---|---|
| Stars | Define the level (required) | *, **, *** |
| TODO keyword | Task state (optional) | TODO, DONE |
| Priority | Importance marker (optional) | [#A], [#B] |
| Title | The headline text (required) | Any text |
| Tags | Categorization labels (optional) | :work:urgent: |
✅ Headline Levels
Headlines can be nested to any depth:
,* Level 1: Main Section
,** Level 2: Subsection
,*** Level 3: Sub-subsection
,**** Level 4: Paragraph grouping
,***** Level 5: Fine detail
Use consistent levels throughout your document. Skipping levels (e.g., going from * to ***) works but may cause confusion.
✅ Visibility Cycling
One of the most powerful features of org documents is the ability to fold (collapse) and unfold (expand) sections to manage complexity.
✅ Folding with Tab
Press Tab on a headline to cycle through visibility states:
| State | Shows |
|---|---|
| Folded | Only the headline, children hidden |
| Children | Headline and immediate child headlines |
| Subtree | All content under this headline |
Example cycle:
* Heading... (folded - ellipsis shows hidden content)
* Heading with child headlines visible
* Heading with all content visible
✅ Global Cycling with Shift-Tab
Press S-
| State | Shows |
|---|---|
| Overview | Only top-level headlines |
| Contents | All headlines at all levels |
| Show All | Everything expanded |
✅ Visibility Commands
| Key | Command |
|---|---|
| Cycle visibility at current heading | |
| S- | Cycle global visibility |
Additional visibility can be controlled through speed commands (see Speed Commands):
| Speed Key | Action |
|---|---|
| c | Cycle visibility |
| C | Show children |
| o | Overview (fold all) |
✅ Motion Between Headlines
Efficient navigation between headlines is essential for working with large documents.
✅ Using the Outline View
The VS Code Outline view provides visual navigation:
Open the Outline view (sidebar or Cmd/C-S-O)
Click any heading to jump to it
Use the filter box to search headings
✅ Jump to Heading
Press C-c C-j to open a quick-pick menu of all headings. Type to filter and press Enter to jump.
✅ Structure Editing
Scimax VS Code provides commands to restructure your document without manual cut-and-paste.
✅ Promote/Demote Headlines
Change the level of a headline:
| Key | Command |
|---|---|
| M- | Promote heading (decrease level) |
| M- | Demote heading (increase level) |
| M-S-Left | Promote subtree |
| M-S-Right | Demote subtree |
✅ Single Heading vs Subtree
Promote/Demote Heading: Changes only the current headline's level
Promote/Demote Subtree: Changes the headline AND all its children
Example - promoting a subtree:
,** Parent * Parent
,*** Child 1 -> ** Child 1
,*** Child 2 ** Child 2
✅ Move Subtrees Up/Down
Reorder sections without changing their level:
| Key | Command |
|---|---|
| M- | Move subtree up (swap with previous) |
| M- | Move subtree down (swap with next) |
The entire subtree (heading and all its content/children) moves together.
✅ Kill/Clone Subtrees
| Command | Description |
|---|---|
| scimax.org.killSubtree | Cut the current subtree |
| scimax.org.cloneSubtree | Duplicate the current subtree |
Speed command keys (at heading start):
| Key | Action |
|---|---|
| w | Kill (cut) subtree |
| W | Clone (duplicate) subtree |
| y | Yank (paste) subtree |
✅ Insert New Headings
| Key | Command |
|---|---|
| C- | Insert heading at same level |
The command scimax.org.insertHeading inserts a new heading. The behavior depends on context:
On a heading line: Insert new heading at same level
In body text: Insert new heading after current section
For subheadings:
| Command | Description |
|---|---|
| scimax.org.insertSubheading | Insert heading one level deeper |
✅ Document Keywords
Document keywords appear at the beginning of the file and configure document-wide settings.
✅ Common Keywords
,#+TITLE: Document Title
,#+AUTHOR: Author Name
,#+DATE: 2026-01-13
,#+EMAIL: author@example.com
✅ Options Keyword
The #+OPTIONS: keyword controls export and display behavior:
,#+OPTIONS: toc:2 num:t H:4 ^:nil
| Option | Values | Description |
|---|---|---|
| toc | t, nil, number | Table of contents depth |
| num | t, nil | Section numbering |
| H | number | Headline levels for export |
| ^ | t, nil, {} | Subscript/superscript handling |
| author | t, nil | Include author in export |
| date | t, nil | Include date in export |
✅ Startup Keyword
Control initial visibility:
,#+STARTUP: overview # Start with all headings folded
,#+STARTUP: content # Show all headings, hide body
,#+STARTUP: showall # Show everything
✅ Property Keyword
Set default properties for source blocks:
,#+PROPERTY: header-args :exports both
,#+PROPERTY: header-args:python :session *python*
✅ Properties Drawers
Properties drawers store metadata about a headline in key-value pairs.
✅ Creating Properties Drawers
Properties appear in a :PROPERTIES: drawer immediately after the headline:
,* My Headline
:PROPERTIES:
:CUSTOM_ID: my-headline
:CATEGORY: work
:EFFORT: 2:00
:END:
✅ Special Properties
Certain properties have special meaning:
| Property | Description |
|---|---|
| ID | Globally unique identifier (UUID) |
| CUSTOMID | Document-unique identifier for linking |
| CATEGORY | Category for agenda views |
| EFFORT | Estimated time (H:MM format) |
| COLUMNS | Column view format specification |
| VISIBILITY | Initial visibility (folded, children, all) |
✅ Adding Properties
To add a property via speed commands, press P at a heading start.
You can also add properties manually by typing inside the drawer.
✅ Inherited Properties
Some properties are inherited by child headlines. The CATEGORY property, for example, applies to all children unless overridden.
✅ Drawers
Drawers are collapsible sections that hide auxiliary information.
✅ Standard Drawers
✅ PROPERTIES Drawer
Stores headline metadata (see above).
✅ LOGBOOK Drawer
Stores clock entries and state change history:
,* TODO My Task
:LOGBOOK:
CLOCK: [2026-01-13 Mon 09:00]--[2026-01-13 Mon 10:30] => 1:30
- State "TODO" from "WAITING" [2026-01-12 Sun 14:00]
:END:
✅ Custom Drawers
Create custom drawers for any purpose. These are not exported.
These are private notes that won't be exported.
- Reference: Smith et al. 2024
- Follow up with collaborator
cite:&kitchin-2018-machin-learn-catal
cite:&kitchin-2015-examp-effec
Drawer names must be uppercase letters and can contain numbers and underscores.
✅ Drawer Visibility
Drawers are typically displayed collapsed. Click or use fold commands to expand/collapse them.
✅ Inline Tasks
Inline tasks are special headlines at a very deep level (default: 15 stars or more) that are treated as inline content within a section rather than as document structure.
✅ Creating Inline Tasks
An inline task uses many stars (15+) and has a matching END marker:
,* Main Headline
Content of the headline.
,*************** TODO Quick inline task
This is an inline task that doesn't affect document structure.
It's useful for small, self-contained TODOs within prose.
,*************** END
More content continues here.
✅ Inline Task Features
Inline tasks support the same features as regular headlines:
| Feature | Example |
|---|---|
| TODO state | *************** TODO Task |
| Priority | *************** [#A] High priority |
| Tags | *************** Task :urgent:work: |
| Body text | Content between task and END |
✅ When to Use Inline Tasks
Quick TODOs embedded in documentation
Small tasks that don't warrant their own section
Notes or reminders within prose
Tasks that shouldn't appear in document outline
✅ Configuration
The minimum headline level for inline tasks is configurable. By default, headlines with 15 or more stars are treated as inline tasks.
✅ Footnote Definitions
Footnotes allow you to add supplementary information without interrupting the main text flow.
✅ Footnote Definition Syntax
Footnotes are defined with [LABEL] at the start of a line:
This paragraph has a footnote reference[fn:1].
[fn:1] This is the footnote content. It can span
multiple lines if subsequent lines are indented.
Another paragraph continues here.
✅ Footnote Labels
Footnotes can use numeric or named labels:
See the paper for details[fn:1].
This is a key concept[fn:important-note].
[fn:1] Smith et al., 2024.
[fn:important-note] A named footnote for easy reference.
✅ Multi-line Footnotes
Footnote definitions can span multiple lines with indentation:
[fn:long-note] This is a longer footnote that spans
multiple lines. All continuation lines must be
indented to be included in the footnote.
You can even have multiple paragraphs by leaving
a blank line with proper indentation.
✅ Inline Footnotes
For short footnotes, use inline syntax:
This has an inline footnote[fn:: This is the definition].
✅ Dynamic Blocks
Dynamic blocks are special regions whose content is generated programmatically. They are defined with #+BEGIN: and #+END: markers.
✅ Dynamic Block Syntax
,#+BEGIN: block-name parameters
Content that will be replaced when block is updated.
,#+END:
✅ Clock Table Example
The most common dynamic block is the clock table, which summarizes time spent:
| Headline | Time |
|---|---|
| Total | 0:00 |
✅ Column View Example
Column view displays properties in a table format:
| ITEM | TODO | PRIORITY | TAGS |
|---|---|---|---|
| ✅ Document Structure | |||
| ✅ Headlines | |||
| ✅ Creating Headlines | |||
| ✅ Headline Components | |||
| ✅ Headline Levels | |||
| ✅ Visibility Cycling | |||
| ✅ Folding with Tab | |||
| ✅ Global Cycling with Shift-Tab | |||
| ✅ Visibility Commands | |||
| ✅ Motion Between Headlines | |||
| ✅ Navigation Commands | |||
| ✅ Using the Outline View | |||
| ✅ Jump to Heading | |||
| ✅ Speed Command Navigation | |||
| ✅ Structure Editing | |||
| ✅ Promote/Demote Headlines | |||
| ✅ Single Heading vs Subtree | |||
| ✅ Move Subtrees Up/Down | |||
| ✅ Kill/Clone Subtrees | |||
| ✅ Insert New Headings | |||
| ✅ Document Keywords | |||
| ✅ Common Keywords | |||
| ✅ Options Keyword | |||
| ⚠️ Startup Keyword | |||
| ⚠️ Property Keyword | |||
| ✅ Properties Drawers | |||
| ✅ Creating Properties Drawers | |||
| ✅ Special Properties | |||
| ✅ Adding Properties | |||
| ⚠️ Inherited Properties | |||
| ✅ Drawers | |||
| ✅ Standard Drawers | |||
| ✅ PROPERTIES Drawer | |||
| ✅ LOGBOOK Drawer | |||
| ✅ Custom Drawers | |||
| ✅ Drawer Visibility | |||
| ✅ Inline Tasks | |||
| ✅ Creating Inline Tasks | |||
| ✅ Inline Task Features | |||
| ✅ When to Use Inline Tasks | |||
| ✅ Configuration | |||
| ✅ Footnote Definitions | |||
| ✅ Footnote Definition Syntax | |||
| ✅ Footnote Labels | |||
| ✅ Multi-line Footnotes | |||
| ✅ Inline Footnotes | |||
| ✅ Related Topics | |||
| ✅ Dynamic Blocks | |||
| ✅ Dynamic Block Syntax | |||
| ✅ Clock Table Example | [#C] | ||
| ✅ Column View Example | :columns: | ||
| ⚠️ Dynamic Block Parameters | |||
| ⚠️ Updating Dynamic Blocks | |||
| ✅ Best Practices | |||
| ✅ Document Organization | |||
| ✅ Heading Depth Guidelines | |||
| ✅ Navigation Efficiency | |||
| ✅ Related Topics | |||
| Navigation |
✅ Dynamic Block Parameters
Common parameters for clock tables:
| Parameter | Description | Example |
|---|---|---|
| :maxlevel | Maximum headline depth | :maxlevel 3 |
| :scope | Scope of clock data | :scope file |
| :tstart | Start time for report | :tstart "<-1w>" |
| :tend | End time for report | :tend " |
| :block | Time block (today, thisweek, etc.) | :block thisweek |
✅ Updating Dynamic Blocks
Dynamic blocks are updated when explicitly requested (C-c C-c on the header). The content between
✅ Best Practices
✅ Document Organization
Start with an outline - Create your heading structure before adding content
Use consistent levels - Don't skip levels arbitrarily
Keep headings concise - Use brief, descriptive titles
Use tags for cross-cutting concerns - Don't rely solely on hierarchy
✅ Heading Depth Guidelines
| Level | Typical Use |
|---|---|
| 1 | Major sections/chapters |
| 2 | Subsections |
| 3 | Topics within subsections |
| 4 | Detailed points |
| 5+ | Rarely needed; consider restructuring |