An unofficial blog that watches Google's attempts to move your operating system online since 2005. Not affiliated with Google.

Send your tips to

August 10, 2008

Add a Table of Contents to Google Docs and More

Basic features like table of contents, footnotes or thesaurus are still missing from Google Docs. Some of the features are already implemented and they're ready to be added to the interface.

(Update: If you have Google Gears, temporarily disable it for Google Docs by removing from the list of allowed sites in Google Gears Settings.)

For example, to generate a table of contents from the headings of a document, just paste this code in the address bar:


You should see a dialog that lets you choose the numbering style.

There's also an option to insert a HTML snippet without editing the HTML code. The dialog can be invoked by pasting in the address bar:


A word processor is more useful if you can easily access a dictionary, an encyclopedia and other sources of information. Select some text from a document and paste the following lines to show information from:

Encyclopædia Britannica

Merriam-Webster's Online Dictionary

Merriam-Webster's Online Thesaurus

Hopefully, these features will soon be added in the interface.


  1. Not sure why, but when I paste one of those lines into the address bar and hit "enter", nothing happen, except that when I try the table of contents, it downloads the doc as a pdf. I'm using FF3.
    Otherwise, it will be great when these features get into the interface. And, just curious: how did you figure this out? Do you have to actually read the code, or do you find documentation? Just wondering . . .

  2. You'd need to sort thru the code.

  3. to: Ephilei

    How to do it ?
    I insert the code "[script type='text/javascipr']mr("TocSettings")[/script]" but it ignored

  4. I first got the same "save as PDF" when pasting the code "mr("TocSettings");" into firebug...

    Then I disabled gears (offline access to google docs) and tried again, and it worked.
    (and "updating the table of contents" works too, when I launch the command again)

    So I suppose this only works - at least for now - with the online version of google docs ; maybe that's why it doesn't appear in the menus ?

  5. Yes, it works with disabled of gears.

  6. @Pascal:
    Thanks for noticing that. I updated the post.

  7. I find mine does the same as Pascal's (in FF v3.0.1) but it works if i leave the ';void(0);' or just 'void(0);' off
    (i have gears, but don't have offline access enabled for docs)

  8. @Ionut : thanks to you for your posts :-)

    Generating a Table of contents was something I really missed in Google Docs ; glad it's becoming possible !
    (And looking forward to seeing it possible with gears activated too ! )

  9. But what about footnotes?

  10. I struggled for some time to get this to work until I discovered it only works if you have English US set"

  11. Hyperwords does similar things also without the need for Javascript codes and also has more options. I think it is a more effective tool than this one but if Google builds it in, then it will be good.

  12. for footnotes i suggest