Page 1 of 2

[Solved] Make Table of Contents hyperlink?

Posted: Tue Apr 08, 2008 5:37 am
by JDlugosz
How do I make the entries in the table of contents (or at least the page numbers therin) become hyperlinks to the referenced content?

Re: Make Table of Contents hyperlink?

Posted: Tue Apr 08, 2008 7:07 am
by Bhikkhu Pesala
From my tips page. Table of Contents

The paragraph heading styles to be included in the Table of Contents are definted in the document outline — Tools, Outline Numbering. This is where you decide which headings or subheadings should be included when the TOC is generated.

When you insert the TOC or edit it you can decide how to format each one. The Entries tab of the Insert Index/Table dialogue for each TOC level allows you to add or remove chapter numbers, entries, page numbering, dot leader tabs, and to add hyperlinks around any part of the TOC entry. You can even type text to include in each entry if you wish. To delete any code, select it and press the delete key.
TOC Hyperlinks.png
Insert the cursor in the structure field before the Entry code [E] and click the hyperlink button to enter the link start code [LS]. Insert the cursor after the entry code and click the hyperlink button again to insert the link end code [LE]. In this way, you can add hyperlinks to just the entry, just to the page number, to both or to the entire entry including the dot leader tab. To edit the character style of the hyperlink, e.g. to change the colour or remove the underlining, select the Internet Link from the Character Style drop list.

Re: Make Table of Contents hyperlink?

Posted: Wed Apr 09, 2008 4:02 am
by JDlugosz
Thanks. I had played with that settings window, but I would never have figured that out.

Is there a way to specify which character style is applied? I want "stealth" links, not blue underlined. But changing the link style changes the style of all links in the document. So, I want to not apply the link character style at all, but have them function as links.

Re: Make Table of Contents hyperlink?

Posted: Wed Apr 09, 2008 9:27 am
by Hagar Delest
Sure.

In the Entries tab, click the LS button and in the Character Style drop-down list below, select the Default entry. Same for the LE button. Click the All button right of the structure line if needed.

Thanks to add '[Solved]' at beginning of your first post title (edit button) if your issue has been fixed.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Tue Jan 13, 2009 10:24 pm
by TheRealOrion
If I loaded up a table of contents with these kinds of hyperlinks and then generated a PDF, would the hyperlinks end up in the PDF document as well?

Re: [Solved] Make Table of Contents hyperlink?

Posted: Tue Jan 13, 2009 10:32 pm
by Hagar Delest
Yes. That's the great advantage of OOo PDFs (compared to the files made with a virtual printer like PDFCreator). Same for cross-references and bookmarks.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Thu Mar 19, 2009 8:09 am
by mosestruong
It seems like if I change the style to Default, the link doesn't work in PDF - however if the style is Internet Link, and i only edit the character style, the link works in PDF... Is this a bug? I'm using OpenOffice 3 on Ubuntu.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Sun Mar 22, 2009 4:29 pm
by TheRealOrion
I have, perhaps, an only tangentially related question: is there a way to make a ToC such that when it exports to a .pdf, the ToC lines "link" within the document? Which is to say, you click a line in the ToC that refers to an entry on p56, and then your .pdf instantly jumps to p56. I'd love to build this functionality into the manuals that I write. I know it's possible in .pdf's in general, but I've never thought to instantiate it in an Open-Office .pdf as an export.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Sun Mar 22, 2009 4:50 pm
by Hagar Delest
mosestruong wrote:It seems like if I change the style to Default, the link doesn't work in PDF - however if the style is Internet Link, and i only edit the character style, the link works in PDF... Is this a bug? I'm using OpenOffice 3 on Ubuntu.
I see the same indeed, with OOo 3.0.1 (Sun version). You can file a report: [Tutorial] Reporting bugs or suggestions.
TheRealOrion wrote:is there a way to make a ToC such that when it exports to a .pdf, the ToC lines "link" within the document? Which is to say, you click a line in the ToC that refers to an entry on p56, and then your .pdf instantly jumps to p56.
That's the way it works when you set the hyperlinks as described above. Check perhaps your PDF export settings in File>Export as PDF. The Export Bookmarks option has to be checked.

NB: you should update your forum user profile to make your configuration appear at right under your username.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Sun Apr 26, 2009 5:23 pm
by another_sam
http://user.services.openoffice.org/en/ ... d=a#p20266 is right.

But I want to express my disappointment with this dialog. Is like an advanced evolution of a yet-advanced dialog. It is only one step far from having to put in regular expressions an nerd things like that. In one word: it's painful.

I want one simple hangover-proof checkbox labelled "Make entries link to content". And I guess that's what 99.99% of world-wide use case instances need. Moreover, if you want, put an "Advanced" section where current dialog is shown. I'm will search about this topic on oooforum.org.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Mon May 04, 2009 6:55 pm
by Kirbert
May be solved for the original poster, but not for me. It's exactly what I want to do, too, but I edit the ToC, add in the LS and LE surrounding the page number, and it doesn't make any difference at all -- there is still no way to click on the ToC and have it go to the referenced page. I wish I had some idea what I'm doing wrong.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Mon May 04, 2009 9:04 pm
by Hagar Delest
Do you Ctrl+click the page number?

Re: [Solved] Make Table of Contents hyperlink?

Posted: Tue May 05, 2009 6:41 pm
by TheRealOrion
Well, it's clunky as all heck, but it works! The links function in the .odt and they get exported to the .pdf. All in all, I'm pleased. Now, is there a way to make them such that they turn blue when the mouse floats over them?

Re: [Solved] Make Table of Contents hyperlink?

Posted: Tue May 05, 2009 7:35 pm
by Hagar Delest
I don't think so.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Tue May 05, 2009 8:06 pm
by TheRealOrion
Too bad. I'll put in a feature request. I assume there's already a request to make the process less clunky. The buttons with letters are very confusing at first, and it would be great to have an option in the levels (the left-hand column) that was "1 - 10," like many other windows. Doing them all individually for multiple documents is a pain. Come to think of it, is it possible to create a template for a standard index, or maybe embed a standard format of index into a template? That would be very useful.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Tue May 05, 2009 9:11 pm
by Hagar Delest
TheRealOrion wrote:The buttons with letters are very confusing at first
But it allows a great customization of the fields, allowing the hyperlink to a part only of the heading.
TheRealOrion wrote:it would be great to have an option in the levels (the left-hand column) that was "1 - 10," like many other windows. Doing them all individually for multiple documents is a pain.
Right of the structure line, just hit the All button once you've customized the fields.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Wed May 06, 2009 4:42 am
by TheRealOrion
Yes, I see the customisation that's available, but I think they'd be better off with one "make TOC hyperlinked" option, and then another option to edit the specifics if you want to. Having a one-button solution is enough for most people, and if you don't want to tweak it, it's very counter-intuitive. If OO Writer wants to be a viable replacement for MS Word, then it needs to have those user-friendly options. That's just my opinion, though.

I had no noticed the "all" button. Thank you for pointing that out. I feel a bit embarrassed about that complaint now.

Thanks again for all your help.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Wed May 06, 2009 7:04 am
by Kirbert
Do you Ctrl+click the page number?
Tried that, makes no difference. There is no discernable difference from before I added the LS and LE to the entries.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Wed May 06, 2009 8:07 am
by Hagar Delest
Can you upload a sample file (see here: How to attach a document here)? Are you sure that you are customizing the right level of heading?

Re: [Solved] Make Table of Contents hyperlink?

Posted: Sun May 10, 2009 4:37 pm
by Kirbert
OK, I have trimmed the last 95% of this document off to make it reasonable size and attached it. The table of contents went from several pages long to only a few lines, but it still won't link.

I added the hyperlink to Level 1 and then clicked "all" which applied it to all the levels.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Sun May 10, 2009 8:51 pm
by Hagar Delest
You haven't used any style at all. So it can't work. You should read the documentation about headings styles and the Tools>Outline Numbering menu.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Mon May 11, 2009 11:51 am
by Kirbert
OK, I guess I'm just stupid, because I spent a couple of hours reading through the Writer Guide and trying to learn about styles and I still have absolutely no idea what you're talking about. Why would styles have anything to do with whether or not the ToC can link to the index marks throughout the document that it's pulling up to list the page numbers of? Can you give me a step-by-step of what to do to get these links to work? Please?

Re: [Solved] Make Table of Contents hyperlink?

Posted: Mon May 11, 2009 12:01 pm
by Hagar Delest
Because the ToC is build from the Heading styles set in the Tools>Outline Numbering feature.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Tue May 12, 2009 6:53 pm
by Kirbert
My ToC is built from index marks. Which apparently works fine, the ToC is correct and updates properly. That means it can find the index marks. If it can find the index marks, why can't it link to them?

Re: [Solved] Make Table of Contents hyperlink?

Posted: Tue May 12, 2009 9:49 pm
by Hagar Delest
Because the index marks are another feature that doesn't support hyperlinks yet. See: [Issue] Table of contents with hyperlinks on the titles.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Wed May 13, 2009 6:37 am
by Kirbert
So what you're saying is, to get hyperlinks to work in the ToC, I have to convert my document to create a ToC from "outline" or from "additional styles" rather than from "index marks"?

Or just sit back and wait and hope that this feature appears in a future release. That'll probably be the way I go since this document doesn't lend itself to a conventional outline format.

Thanks!

Re: [Solved] Make Table of Contents hyperlink?

Posted: Wed May 13, 2009 8:04 am
by Hagar Delest
Kirbert wrote:So what you're saying is, to get hyperlinks to work in the ToC, I have to convert my document to create a ToC from "outline" or from "additional styles" rather than from "index marks"?
Use the Outline only, Additional styles can't be hyperlinked too.

Can you upload a sample file showing what you are trying to achieve that the outline feature can't do?

Re: [Solved] Make Table of Contents hyperlink?

Posted: Thu May 14, 2009 7:34 pm
by Kirbert
Oh, I could probably force it to work with an outline setup, it just wouldn't be convenient. It wasn't convenient waaaay back when I started creating this document (on MS Word), that's why I went the index marks route to begin with. Some sections are 20 pages long with three levels of subheadings, other sections are a single paragraph, and the size of the section is unrelated to its importance.

Thanks anyway. Now I understand why it's not working -- sort of. I guess I still don't understand how hyperlinks could be set up to work with the outline setup without them also working with the index marks setup -- at least not without writing into the software a deliberate instruction to disable hyperlinks if the ToC uses index marks -- but that's software stuff, I dunno anything about software. But if I really want them to work, I just need to spend a month or two reworking this document to use the outline method of creating the ToC.

Re: [Solved] Make Table of Contents hyperlink?

Posted: Thu Jan 28, 2010 2:30 pm
by captainflack
Heavens, that dialog really is not intuitive. I've been reading this for 30 minutes and still haven't figured it out. Open office is a great product and deserves something better instead of this geeky input interface for ToC line formatting.

Now, after clicking the hyperlink button a couple of times I seem to have extra LE and LS buttons on the dialogue. It feels like I should be able to right click them and say "delete". THere appears to be no way to delete these extra bits I have added by mistake. Can it be so? Maybe someone can help point out to me how to delete extra things because I'm utterly stumped.

All these geeky little symbols, with buttons and gaps. I agree with the guy who suggested a simple 'hyperlink the TOC' which hyperlinks the whole line, then keep this advanced dialogue for those that (for some reason) want to only make the hyperlink apply to some part of the line and not the whole thing.

Honestly most people just want to hyperlink the whole line and it really should be as simple as just checking a box on the edit-index dialogue that says 'hyperlink contents'

Re: [Solved] Make Table of Contents hyperlink?

Posted: Thu Jan 28, 2010 2:39 pm
by Hagar Delest
Indeed. You can ask for it: [Tutorial] Reporting bugs or suggestions.