Skip to content

Latest commit

 

History

History
334 lines (246 loc) · 9.41 KB

example.org

File metadata and controls

334 lines (246 loc) · 9.41 KB

Document top-level heading

This is an example of a complex document. To see the Org syntax, view the raw version of this file.

Main ToC: Itself excluded

This heading itself is excluded from its TOC.

Chapter 1: Inline TOC

This chapter includes its TOC inline, with text before…

…and after it.

Section 1a

This section is included in the chapter’s TOC.

Subsection 1a1

This subsection is also included.

Section 1b: Excluded, but child included

This section is not included in the chapter’s TOC, but its subsection is (you probably wouldn’t want to do this, but you could).

Subsection 1b1: Included, despite its excluded parent

This subsection is included in the chapter’s TOC even though its parent is excluded.

Chapter 2: TOC as sibling

This chapter has its TOC as a sibling of its sections.

Chapter 2 TOC

Section 2a

This section is included.

Subsection 2a1

This subsection is included.

Section 2b: Child is excluded

This section is included in the TOC.

Subsection 2b1: The excluded child

But its subsection is not.

Chapter 3: TOC as parent

This chapter has its TOC as a parent of the chapter sections.

Chapter 3 TOC

Section 3a

This section is included.

Subsection 3a1

This subsection is included.

Section 3b

This section is included.

Subsection 3b1

This subsection is included.

Chapter 4: Limited depth

This chapter’s TOC uses :depth 1 to exclude subsections.

Section 4a

This section is included in the chapter’s TOC.

Subsection 4a1

This subsection is excluded.

Section 4b

This section is included in the chapter’s TOC.

Subsection 4b1

This subsection is excluded.

Chapter 5: Local settings

This chapter’s TOC includes descendants only two levels deep by default. However, Section 5b sets :depth 3 (relative to itself) in order to include deeper descendants in its own section TOC. Normally this depth setting would propagate up to the Chapter 5 TOC and cause, e.g. Section 5b1a to be included in the Chapter 5 TOC. However, Section 5b also sets :local depth, which prevents its depth setting from propagating up the tree, so the sections 5b1a and 5b1b are excluded from the Chapter 5 TOC.

One could also set :force depth in the chapter 5 TOC to accomplish the same thing. However, doing so would force the depth setting for all subtrees in its TOC. Instead, by using :local depth on Section 5b, we allow Section 5c to set :depth 3, which is allowed to propagate up to the chapter 5 TOC. So notice that, although Sections 5b and 5c are structurally identical, the way they are shown in the Chapter 5 TOC differs, because Section 5b sets :local depth while Section 5c does not.

If this seems complicated, perhaps it is, but it’s optional power that’s available when needed.

Section 5a

This section is included in the Chapter 5 TOC.

Section 5a1

This section is included in the Chapter 5 TOC.

Section 5a2

This section is included in the Chapter 5 TOC.

Section 5b

Section 5b1

This section is included in the Chapter 5 TOC.

Section 5b1a

This section is not included in the Chapter 5 TOC.

Section 5b1b

This section is not included in the Chapter 5 TOC.

Section 5c

Section 5c1

This section is included in the Chapter 5 TOC.

Section 5c1a

This section is included in the Chapter 5 TOC.

Section 5c1b

This section is included in the Chapter 5 TOC.

Appendices

The appendices have a local TOC, and one of them is a comprehensive TOC of the entire document (unlike the main TOC at the top of the document, which is abridged).

Appendix A: Comprehensive TOC

This comprehensive TOC uses :include all :force (depth ignore) to force all headings to be included, regardless of their local settings.

Appendix B

Possibly vestigial.

Appendix C

Definitely vestigial.

Footer: Excluded