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

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

912 views 23 12
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