Making {toc} macro links heading size


I was wondering if anyone knew if it is possible to make the links in a table of contents the size of headers? For example, we have an instance where a user would like to make a table of contents list the size of Heading 3.

If anyone has a trick to doing this I would really appreciate it!

Thank you!


2 answers

1 accepted

2 votes
Accepted answer

Thank you for the above answer. I probably should have mentioned we were using Confluence 4.3. Since we have the source editor plugin installed, I was able to make the table of contents a heading by editing the storage format with something like:

<h5><ac:macro ac:name="toc">
<ac:parameter ac:name="maxLevel">5</ac:parameter>
<ac:parameter ac:name="type">flat</ac:parameter>
<ac:parameter ac:name="separator">pipe</ac:parameter>

This is a touch complicated because the div that contains the TOC doesn't have a class or ID. So, give it one.

Put in a div macro. Give it a class name, such as "toc".

Put the TOC macro inside that div.

Add a CSS stylesheet macro, and put in your styling info, such as this:

.toc div ul li{font-size:18pt;font-weight:bold;line-height:24pt}

You'll need to play around with the settings to get exactly what you want.

FYI -- it is really helpful (maybe necessary for this kind of thing) to have something like Firebug or the equivalent so you can see the CSS settings.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

895 views 45 7
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you