✅ 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:
ComponentDescriptionExample
StarsDefine the level (required)*, **, ***
TODO keywordTask state (optional)TODO, DONE
PriorityImportance marker (optional)[#A], [#B]
TitleThe headline text (required)Any text
TagsCategorization 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:

StateShows
FoldedOnly the headline, children hidden
ChildrenHeadline and immediate child headlines
SubtreeAll content under this headline

Example cycle:

  1. * Heading... (folded - ellipsis shows hidden content)

  2. * Heading with child headlines visible

  3. * Heading with all content visible

✅ Global Cycling with Shift-Tab

Press S- anywhere in the document to cycle global visibility:

StateShows
OverviewOnly top-level headlines
ContentsAll headlines at all levels
Show AllEverything expanded

✅ Visibility Commands

KeyCommand
Cycle visibility at current heading
S-Cycle global visibility

Additional visibility can be controlled through speed commands (see Speed Commands):

Speed KeyAction
cCycle visibility
CShow children
oOverview (fold all)

✅ Motion Between Headlines

Efficient navigation between headlines is essential for working with large documents.

✅ Navigation Commands

KeyCommand
C-c C-jJump to any heading (with menu)
Next/Previous headingBuilt-in VS Code outline

✅ Using the Outline View

The VS Code Outline view provides visual navigation:

  1. Open the Outline view (sidebar or Cmd/C-S-O)

  2. Click any heading to jump to it

  3. 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.

✅ Speed Command Navigation

With speed commands enabled (scimax.speedCommands.enabled: true), when your cursor is at the beginning of a headline, single keys navigate:

KeyAction
nNext heading (any level)
pPrevious heading (any level)
fNext heading (same level - forward)
bPrevious heading (same level - back)
uUp to parent heading
jJump to heading (opens menu)
gGo to... (opens navigation menu)

✅ 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:

KeyCommand
M-Promote heading (decrease level)
M-Demote heading (increase level)
M-S-LeftPromote subtree
M-S-RightDemote 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:

KeyCommand
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

CommandDescription
scimax.org.killSubtreeCut the current subtree
scimax.org.cloneSubtreeDuplicate the current subtree

Speed command keys (at heading start):

KeyAction
wKill (cut) subtree
WClone (duplicate) subtree
yYank (paste) subtree

✅ Insert New Headings

KeyCommand
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:

CommandDescription
scimax.org.insertSubheadingInsert 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
OptionValuesDescription
toct, nil, numberTable of contents depth
numt, nilSection numbering
HnumberHeadline levels for export
^t, nil, {}Subscript/superscript handling
authort, nilInclude author in export
datet, nilInclude 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:

PropertyDescription
IDGlobally unique identifier (UUID)
CUSTOMIDDocument-unique identifier for linking
CATEGORYCategory for agenda views
EFFORTEstimated time (H:MM format)
COLUMNSColumn view format specification
VISIBILITYInitial 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:

FeatureExample
TODO state*************** TODO Task
Priority*************** [#A] High priority
Tags*************** Task :urgent:work:
Body textContent 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:

HeadlineTime
Total0:00

✅ Column View Examplecolumns

Column view displays properties in a table format:

ITEMTODOPRIORITYTAGS
✅ 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:

ParameterDescriptionExample
:maxlevelMaximum headline depth:maxlevel 3
:scopeScope of clock data:scope file
:tstartStart time for report:tstart "<-1w>"
:tendEnd time for report:tend ""
:blockTime 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

  1. Start with an outline - Create your heading structure before adding content

  2. Use consistent levels - Don't skip levels arbitrarily

  3. Keep headings concise - Use brief, descriptive titles

  4. Use tags for cross-cutting concerns - Don't rely solely on hierarchy

✅ Heading Depth Guidelines

LevelTypical Use
1Major sections/chapters
2Subsections
3Topics within subsections
4Detailed points
5+Rarely needed; consider restructuring

✅ Navigation Efficiency

  1. Use C-c C-j for direct jumps to any heading

  2. Use outline view for visual navigation in long documents

  3. Enable speed commands for rapid single-key navigation

  4. Use S- to get an overview before diving in

Navigation

Footnotes