Add a bookmark to TOC

First, I do understand how to create a
      TOC based on heading levels, but what I am trying to work out is
      how to add some kind of flag/marker (I am using the term bookmark)
      to a paragraph in order to have it appear as the first entry in a
      TOC.To illustrate with a hypothetical example: An author wishes to add
      a 1 paragraph dedication on a page at the start of a book and have
      the word "Dedication" appear as the first entry in the TOC, but
      does not want the word to appear on the dedication page in the
      form of a heading.It would be much appreciated if someone could point me to a source
      of information about this, because my own searches have uncovered
      nothing.TIADave

Somtehing like this document:

https://gofile.io/d/KzdBTw

?

Thank you Luuk. Yes it does create the TOC entry I wanted, but an
alternative to white text on a white background would have been better.
There may be times when the document would be printed and the print
medium might not always be white. This would be one instance where
(otherwise useless) transparent text would be helpful.

Regards
Dave

First, I do understand how to create a
       TOC based on heading levels, but what I am trying to work out is
       how to add some kind of flag/marker (I am using the term bookmark)
       to a paragraph in order to have it appear as the first entry in a
       TOC.To illustrate with a hypothetical example: An author wishes
to add
       a 1 paragraph dedication on a page at the start of a book and have
       the word "Dedication" appear as the first entry in the TOC, but
       does not want the word to appear on the dedication page in the
       form of a heading.It would be much appreciated if someone could
point me to a source
       of information about this, because my own searches have uncovered
       nothing.TIADave

Somtehing like this document:

https://gofile.io/d/KzdBTw

Thank you Luuk. Yes it does create the TOC entry I wanted, but an
alternative to white text on a white background would have been better.
There may be times when the document would be printed and the print
medium might not always be white. This would be one instance where
(otherwise useless) transparent text would be helpful.

Regards
Dave

OK, maybe it is inspiring someone to come with a better solution :wink:

I'm sure that solves OU's problem, but:

(1) How did you make the word/paragraph "Dedication:" an indexing target?

(2) To hide it, what was the reason for choosing a White font color rather than the Hidden attribute?

Instead of building the Table of contents by "paragraph style", create a
Index of type "Table of Contents" using "Index marks".

https://drive.google.com/file/d/1CArlrl1zeQAWGxWrGVbxmtVdgNNNjmz9/view?usp=sharing

In the example I insert the mark after the first word (or number) of the
new chapter, to prevent it from getting moved or erased if someone later
works on vertical spacing with hard returns.

To create new hidden entries

   1. Set the cursor to each location you want the TOC to point to. Then in
   the Insert Menu - > Index and Table of Contents -> Index Entry
   - Index type : Table of Contents
      - Entry : (text you want to appear on the TOC page)
      - level : if you want to style some entries differently set them to a
      different level, then assign the alternate style in the TOC setup.
      - Each time you click OK, you create an entry that matches the field
      values. If you have fields set to display you can see a light
grey block.
      - Extra entries may be deleted with the backspace or delete key as a
      character in the paragraph.

      2. Set the cursor to the point you want the TOC to appear. Create a
   TOC as normal, but choose Index marks instead of 'Additional Styles.'

Hi Michael,Thanks for your response. It's getting late here, so I will have
        to take  look at your recommendation in a few hours time.Based on my initial reading of your recommendation, I think the
        Documentation Team would welcome your contributions.BTW I am subscribed to the mailing list so it is unnecessary to
        email me directly.RegardsDaveFrom:</b>
          Michael H [mailto:cmahte@gmail.com]
Sent:</b>
          Saturday, August 1, 2020, 20:12 UTC

John,

I am sure the solutions rendered by others will work, but here is another solution, manipulating the TOC format, which I use some times:

1. Create a new style, say "Dedication", and assign this style to the
    text you want hidden in the document body (i.e. the dedication
    heading). You can then make the style hidden. This is under Font
    Effects in the Paragraph Style window and at the bottom of the left
    column.
2. Edit the TOC, and assign the style "Dedication" to, say, Level 10.
    To do this, under the Index/Table tab, check Additional Styles and
    the ellipses button [...]. In the popup, select the Dedication style
    on the left and then using the >> button, move it to level 10 on the
    right and click OK.
3. Now under the Entries tab, select Level 10 and delete everything to
    the left of the "T" in the Structure format line. Then in the text
    block before the T, add "Dedication" (no quotes). This is needed
    because hiding the text in the Dedication paragraph style propagates
    to the Contents style in the TOC and it is hidden in the TOC as
    well. This is a sledge hammer approach and the two texts need to
    match, or maybe not, as you wish.
4. Then under the Styles tab, select the Paragraph Style you want to
    use for the Level 10 TOC line (do not select Dedication!), usually a
    Contents style.

I tested this using OpenOffice, but it should be the same for LO, and it does work - no "Dedication" paragraph text before the actual dedication paragraph, but there is a "Dedication" entry in the TOC.

The downside to this solution is that you may not use TOC level 10 for the usual association with Heading 10, and there are limited (less than 10) different styles that can be assigned this way. In fact, to be safe, under the Index/Table tab and then in the "Evaluate up to level" spinbox, change it from 10 to 9 in order to disable normal Heading 10 styles. I used this method for appendixes where I wanted the appendix letter and a dash to prefix appendix page numbers in the TOC. In this application, I only had two heading levels, one for the main body and the other for Appendix A. Both headings have their own styles, associated with different TOC levels and I am not using any of the "canned" Heading styles.

HTH

Girvin

Guys, thank you so much. I have to go and get some sleep now, but I am
overwhelmed by the level of knowledge. I will get back to the list in a
few hours.

Regards
Dave

Hi Girvin,

... here is another solution, manipulating the TOC format, which I use some times:

1. Create a new style, say "Dedication", and assign this style to the
   text you want hidden in the document body (i.e. the dedication
   heading). You can then make the style hidden. This is under Font
   Effects in the Paragraph Style window and at the bottom of the left
   column.

Yes, I think that is close to what Luuk proposed, except that he hid "Dedication:" by making the font color white rather than using the Hidden attribute (prompting my question in that regard) ...

2. Edit the TOC, and assign the style "Dedication" to, say, Level 10.
   To do this, under the Index/Table tab, check Additional Styles and
   the ellipses button [...]. In the popup, select the Dedication style
   on the left and then using the >> button, move it to level 10 on the
   right and click OK.

... and here you have done what I would have done: make the "Dedication" style explicitly part of the hierarchy. But Luuk (if I understood correctly) did not do that (which is what prompted my other question to him).

3. Now under the Entries tab, select Level 10 and delete everything to
   the left of the "T" in the Structure format line. Then in the text
   block before the T, add "Dedication" (no quotes). This is needed
   because hiding the text in the Dedication paragraph style propagates
   to the Contents style in the TOC and it is hidden in the TOC as
   well. This is a sledge hammer approach and the two texts need to
   match, or maybe not, as you wish.

This may be the reason for using White font color rather than the Hidden attribute...

4. Then under the Styles tab, select the Paragraph Style you want to
   use for the Level 10 TOC line (do not select Dedication!), usually a
   Contents style.

... and this is a standard part of TOC setup.

Thanks for explaining in such detail. As I said, I think it is close to what Luuk proposed, except that in step 2 you do what I would do to establish the indexing reference (if using "Additional styles" indexing), and I still don't see how Luuk did it. Did you see what Michael H proposed, using "Index marks" rather than "Additional styles"? That seems the cleanest way to do this.

Kind regards,
John

Hi Michael,

Instead of building the Table of contents by "paragraph style", create a
Index of type "Table of Contents" using "Index marks".

https://drive.google.com/file/d/1CArlrl1zeQAWGxWrGVbxmtVdgNNNjmz9/view?usp=sharing> In the example I insert the mark after the first word (or number) of the
new chapter, to prevent it from getting moved or erased if someone later
works on vertical spacing with hard returns.

To create new hidden entries

    1. Set the cursor to each location you want the TOC to point to. Then in
    the Insert Menu - > Index and Table of Contents -> Index Entry
    - Index type : Table of Contents
       - Entry : (text you want to appear on the TOC page)
       - level : if you want to style some entries differently set them to a
       different level, then assign the alternate style in the TOC setup.
       - Each time you click OK, you create an entry that matches the field
       values. If you have fields set to display you can see a light
grey block.
       - Extra entries may be deleted with the backspace or delete key as a
       character in the paragraph.

       2. Set the cursor to the point you want the TOC to appear. Create a
    TOC as normal, but choose Index marks instead of 'Additional Styles.'

For creating the hidden "Dedication" reference target, I think your approach is the right one. However, it's also important to respect Dave's (OU) existing outline structure, so wouldn't it be better to built the TOC on a combination of structure (the usual default indexing basis) /plus/ index mark(s), rather than going to the extra effort of making index marks when there is an existing structure to the document?

Kind regards,
John

...
Somtehing like this document:

https://gofile.io/d/KzdBTw
?

I'm sure that solves OU's problem, but:

(1) How did you make the word/paragraph "Dedication:" an indexing target?

Of course, this info should have been added.

- Rightclick the 'Table of Contents'

- 'Edit Index'

- On the tab 'Type', 'Create From' there is an option 'Additional styles'

- I did assign something to the style 'Text body'

Thanks Michael. I am sure there is a use for your method, but it is much
too complicated for my small requirement.

Unfortunately, I wasn't able to view your document, because the Google
dictatorship would not allow me to see it without creating one of their
malware accounts.

Regards
Dave

Thanks to all who offered advice. For this small requirement I created a
"dedication" style with an outline level of 1 and 100% transparency.

Regards
Dave

Malware is something COMPLETELY different ...

If you create such an account (i do not say you have to ), you still have the possibility to only use it under 'special' circumstances.

Malware is something which gets used without permission(s).

Luuk,

Under no circumstances whatsoever will you ever lecture me about
whatever terminology I choose to use.

You obviously lack the intellect to comprehend what was meant by my
reference to Google.

Your commentary is both unnecessary, unwelcome.

I ask that you never again respond to anything I post to this list and
any attempt at private contact will be ignored.

Please let this be an end to this thread.

Dave

Actually, Dave, Michael's method (inserting an index mark in the Dedication paragraph) is the simplest and easiest way to accomplish what you want. Your case happens to be the *reason* for having TOC index marks.

Kind regards,
John

...
Somtehing like this document:

https://gofile.io/d/KzdBTw
?

I'm sure that solves OU's problem, but:

(1) How did you make the word/paragraph "Dedication:" an indexing target?

Of course, this info should have been added.

- Rightclick the 'Table of Contents'

- 'Edit Index'

- On the tab 'Type', 'Create From' there is an option 'Additional styles'

- I did assign something to the style 'Text body'

Oh, of course. Actually that's what I was looking for, but dismissed because it was "Text Body" - which I presumed was used elsewhere - rather than a custom style. Now that I look again, I see that all other text is "Default Style", so "Text Body" is available for custom use.

What about this? -

(2) To hide it, what was the reason for choosing a White font color rather than the Hidden attribute?

The Hidden attribute has the advantage of not adding a line before the Dedication paragraph, and also seems to be closer philosophically to the designers' choice for hiding text.

That said, in that latter consideration (staying close to the spirit of the program design), doesn't it seem like simply using an index mark (as recommended by Michael H) is truest to Writer's design for this case?

Kind regards,
John

...
Unfortunately, I wasn't able to view your document, because the Google
dictatorship would not allow me to see it without creating one of their
malware accounts. ...

Malware is something COMPLETELY different ...

If you create such an account (i do not say you have to ), you still
have the possibility to only use it under 'special' circumstances.

Malware is something which gets used without permission(s)

Luuk,

Under no circumstances whatsoever will you ever lecture me about
whatever terminology I choose to use.

You obviously lack the intellect to comprehend what was meant by my
reference to Google.

Your commentary is both unnecessary, unwelcome.

I ask that you never again respond to anything I post to this list and
any attempt at private contact will be ignored.

Please let this be an end to this thread.

Sorry, Dave, but it should not end there: AFAICS (and if you see differently, please say how), Luuk has done nothing but try to help. He gave a solution to your problem (maybe not quite optimal, but one that you adopted in the end) and tried to show you how to access Michael's Google Drive file (which as inadvertently posted without public read privilege; as it happens, even if you had a Google account, you would have still needed to request to see the file).

OK, I get it: you don't like Google. That is your right. FWIW, I use my account rarely (never mail from it, and all mail to it forwards directly my regular email account), but the account is occasionally useful for taking advantage of Google services like collaboration tools (when initiated by others) or correcting Google browsing tag errors. That's all Luuk was trying to say: you don't have to let Google into your life to make use of some handy tools they offer. As he put it:

If you create such an account (i do not say you have to ), you still have the possibility to only use it under 'special' circumstances.

Does that helpful hint warrant the kind of abuse you just delivered -- especially after he helped solve your problem?

John

Everyone,

It was not my intention to force google accounts onto everyone. Google
used to work in that "viewable by all" access was automatic when "get
sharable link" was clicked. Now it's hidden in a tiny obscure looking click
spot. However, after the feedback on the list, and the many access
requests, I've gont back and played find the hidden link, and now the file
is now set to be viewable, if you are still interested. It will display
as XML text, but there is a download link in the upper right corner. If you
just save it with the same name ending .fodt, it should open properly in
librewriter.

What "works" is what's best for you. My solution isn't the simplest. There
is a "simpler" solution that only involves using 1 index mark, and mixing
the paragraph styles and index mark together in the TOC setup, but
sometimes "simplest to do" isn't the "simplest to fit into a 100 word
email." If you can master index marks, it's the easiest way to edit Table
of Contents of all types, and make your work viewable from all outputs, as
this method turns into slightly better ebook than 'whitepainted',
'invisible', or 'shrunken' text.