Table of Contents in Single Column in section

I thought the process would be simple enough, but either I’m doing something wrong or it can’t be done (yet).

I have a small section with two columns at the beginning of a chapter. I would like to put some introductory text in the first column, and a small table of contents in the second column.

When I try, either by copying an existing table or by creating a new one, the TOC stretches across the full width of the page, rather than staying inside the column. This is true even if I try it on a new unstyled document, so I don’t think my styles are to blame.

If I try to do do the same thing using tables, it all behaves as expected.

Any ideas?

Mark

You are not really doing something wrong, but you are likely not realising that a table of contents (ToC) is effectively a section in LO. This is what the XML code for a ToC looks like:

<style:style style:name="Sect1" style:family="section">
...
</style:style>
...
<text:table-of-content text:style-name="Sect1" text:name="Table of Contents1">
...
</text:table-of-content>

You could certainly try and embed a ToC within an existing section, but it doesn’t actually end up being set within it in the XML. Thus you are faced with having to style the ToC separately anyway.

If this small leading section is only going to contain a brief piece of text on the left and the ToC on the right and the following content is not in the same section, I would simply use the ToC and dispense with the section. Insert your ToC and set it to use two columns and be editable. At the beginning of the first column insert a column break. Then type your content in the left column as per usual. Here is an example.