kerner1000
kerner1000

Reputation: 3558

asciidoc: Return to Section after Subsection

I have the following document:

= Section
main text
== Subsection
some details text

Now I would like to continue my main text after the subsection. How can I "return" to the section part?

Differently speaking, how can I go up in the section hierarchy? As far as I know, defining a new section, e.g., a == after a =, will bring me down one hierarchy. Is there also a way to go back up one hierarchy? I.e., to go back to the previous = level? If I write = again, I start a new section, but I want to continue the old section, that already started before the current subsection.

I am imagining something like this:

= Section
main text
== Subsection
some details text
= (some keyword to return to the previous section)
continue main text

Upvotes: 0

Views: 174

Answers (1)

eskwayrd
eskwayrd

Reputation: 4521

You can return to a "parent" section level by introducing a new parent heading, as described in the documentation.

Since there is no some keyword to return to the previous section, you cannot do:

== Section

Loreum ipsum...

=== Sub-section...

Ipso facto...

Parent section content here.

However, you could use one of the various blocks types to simulate that structure. Here's an example of using an open block with a discrete heading:

== Section

Lorem ipsum...

--
[discrete]
=== Sub-section

Ipso facto...
--

'''

Parent section content here.

The discrete heading is necessary to prevent the heading being counted as a sub-section title, which in turn would include the following parent section content within the sub-section. Note that using the discrete heading removes the heading from the table of contents too.

I included a horizontal rule with ''' so that there is a visual delineation between the sub-section content and the parent section's continuing content.

Upvotes: 1

Related Questions