Truely not clear for me. Screenshots of what you have and what you want to obtain. Thanks!
I'd like to use only "Jarvis House about 1885" in a List of Figures. The rest is not needed in the LOF. The entire paragraph is currently paragraph styled as 'Caption' so the whole caption is printed into a LOF. Can I make two paragraph styles and have them not be separated by a return?
Ok. So you make a TOC with only this para style "Caption". The only thing you have to do is identify "Jarvis House about 1885" with, e.g., a char style [named Char_Caption]
Question: I presume you need page numbering! Can you show us the LOF layout?
So the TOC utility will pick either paragraph or character style?
If so, I'm good. But instructions in the Adobe site and in 2 manuals I have talk about using paragraph styles. Those are the ones in my list of choices. Will have to do an experiment with character styles.
The TOC will pick the the paras with the para style named "Caption". But who cares. Let me 5 min.
In fact, you only need a char style to control that you correctly mark what you want in the LOF.
See how I do:
1/ I create the para style "Caption" [color: Red] and insert a grep style in it.
2/ I create the char style "Char_Caption" [color: Blue]. It only needs to control what I want in the LOF.
3/ What I have to do is insert a "N-Joiner" in the "Caption" text. See the grep code of the grep style defined in the "Caption" para style.
4/ I generate the TOC, only with the "Caption" para style. I select the story where I insert the TOC and launch this simple regex.
Thanks for your help, but I'm not able to follow some of it.
First, I'm not sure how to mark the text for grep. Is that a manual operation or done by marking the character. Along those lines, I don't understand why you're showing the black text with the blue dot in it. It's not part of what is to be selected.
Did you generate the list you showed in the Layout > TOC.
@obi-wan: thanks for the tip. I was looking for something like this.
@rioy: black text with blue spot is just to show you the difference between the "text with non joiner" and normal text. I added the "non joiner" manually but I'm sure it can be done more efficiently.
Create the TOC with layout > TOC and the run the grep with F&C.
If you sure of what you do, you don't need grep style and char style [just for control]. Only manually insert NJ and launch the regex after generating the TOC.
Thanks, Obi-wan. The technique is still not so clear to me, but I'll play with it, get more information about using grep and see if I can make it work.
@obi-wan: I figured that out by with the GREP, but I can use it because we often have to make a TOC which uses the header in the article number. In that case the char style is very handy to automate things (find beginning of the paragraph which starts with "article", use para style with nested char style until first point, then insert non joiner....create TOC, run GREP ...
I've spent some time trying to figure out how your suggestion should work, but still without success. Where is this process going wrong.
1. I make a List of Figures using the TOC utility. The following is part of the output. It is formatted with a style paragraph to put in tabs and place the page number right justified. That all works. The entire caption is present in the List of Illustrations:
In the style sheet for this List of Figures, I have the following GREP. I think, in words, this statement says :where you find the named style, add a period and a non joiner.":
Should I see something in my text? I don't. If this is not correct, what is correct?
3. After I edited the list of illustrations paragraph style for each entry, I went to the find/replace and ran the following on the list of Illustration page that has the full captions. I think the statement says, approximately "Find the j plus anything else to the tab." It did not produce the desired product. What is it that I don't get about this? With the 'Change to' blank, I'm assuming this is the part that deletes the unwanted remainder of the caption:
Just a thought: The tab character shown in the ID window is ^t. Does that make a difference here? I read in one of my books something about the difference between grep and id codes.
Try to insert the "non joiner" code manually after the text you need (type menu, special char, other, non joiner). I think you missed that (as obi-wan said, it can be done without the grep style in the para style).
Make the code visible and look for the "non joiner" code.
Now run the grep (^t is in the text tab, in grep it's \t), leave the change field blank.
The grep says: find anything between the non joiner and the tab char, by running the grep you delete the selected part, leaving you with the non selected text and the page number.
OK! Putting the nonjointer in caption text page layout, then making the List of Illustrations in the Front Matter, then doing the search and replace works.
Wish the non joiner could be placed now, but I need to reformat the caption anyway, so it's not that big a deal at this point. At least I can make the text entry one, and then not have to work with it again.
For readers, to use this technique
1. Go to the text in the page layout and insert a jon-joiner marker:
Type>Insert Special Character > Other > non- joiner. If you are 'exposing' hidden characters, a small tilde ~ will be a superscript in the color of your hidden characters at the end of the text you want.
2. Save and close the file (in my case, part of a book)
3. Make (or update) the List of Figures, probably in front matter file or part of document
4. Position the cursor at beginning of the first line of the LOF text
5. Use the find/change utility
Edit>find/change to open the following window. Pick the GREP tab, as is shown here.
In the "Find What?" type
~j.+(?=\t) (as Obi-wan suggested). Leave the "Change to:" box empty.
If you click "Find", the first entry of the LOF should have the text you want to delete highlighted. The window will change when text is selected, activating the "Change" button. Click that one, and the highlighted text is dropped. You can either do each entry manually if you need to inspect as the process occurs, or can click "Change All" to have the extra text deleted in one step. In this case, looking in the document works because it is in a front matter for a book, and it's the only text in that file that has non-joiners inserted.
6 This works for me because the title verbiage I'm selecting is at the very beginning of the paragraph. I have to mark only the end of it, not the beginning, also.
Obi-Wan, I have more captions than I've counted to do this, and will likely do more than one edit pass. This is a big help. Thanks.