Skip to main content
Inspiring
August 4, 2024
Answered

Paragraph style adding a full stop at the end of paragraph (or content)

  • August 4, 2024
  • 2 replies
  • 1767 views

I have picture captions which I want to format with a full stop in a paragraph style (I would prefer it to just be in the style, not actually typing it, as it is not to be used in e.g. the ToC).

Can this be done? In the GREP maybe (in that case how)?

This topic has been closed for replies.
Correct answer Barb Binder

Hi Chris:

 

As per @James Gifford—NitroPress, we can't add a period/full stop to a paragraph style—just formatting

 

You could add it with a GREP find/change (not a GREP style) but then you'd have to remove it via second GREP find/change each time you updated the List of Figures, which can only pick up full paragraphs, punctuation included. Or again, as per @James Gifford—NitroPress, you could add a GREP style to the LOF entry to just hide the period. 

 

 

To add the full stop to the captions

Find: (.+)

Change: $1.

Paragraph style: Caption (call it anything)

 

Assuming all captions are one sentence, to hide it in the LOF:

Create a character style with the color set to none.

Assign the character style as a GREP style to the LOF entry

Apply style: Hide (call it anything)

To text: \.

 

~Barb

2 replies

Barb Binder
Community Expert
Barb BinderCommunity ExpertCorrect answer
Community Expert
August 5, 2024

Hi Chris:

 

As per @James Gifford—NitroPress, we can't add a period/full stop to a paragraph style—just formatting

 

You could add it with a GREP find/change (not a GREP style) but then you'd have to remove it via second GREP find/change each time you updated the List of Figures, which can only pick up full paragraphs, punctuation included. Or again, as per @James Gifford—NitroPress, you could add a GREP style to the LOF entry to just hide the period. 

 

 

To add the full stop to the captions

Find: (.+)

Change: $1.

Paragraph style: Caption (call it anything)

 

Assuming all captions are one sentence, to hide it in the LOF:

Create a character style with the color set to none.

Assign the character style as a GREP style to the LOF entry

Apply style: Hide (call it anything)

To text: \.

 

~Barb

~Barb at Rocky Mountain Training
Inspiring
August 11, 2024

I now saw that one of the captions include periods I want to keep (e.g. when the caption is "W. Williamson".  Is there a way to only select periods which occur at the end of a paragraph (no caption is longer than a single paragraph)?

James Gifford—NitroPress
Legend
August 11, 2024

Yes, that's what GREP is all about. It's trivial to just replace all [x] characters, but being selective is where it gets tricky.

 

Your GREP style for each affected TOC level/style should be something like:

  • GREP string: \.$
  • Apply: 'Invisible' style.

 

That will find periods only if they are at the end of a paragraph. This can be expanded if there are any variant cases.

James Gifford—NitroPress
Legend
August 4, 2024

By 'full stop,' I am assuming you mean 'period'? (Just clarifying; the former term isn't common in American English or outside of a typesetting shop. 🙂

 

But I read your query as that you want a stop/period at the end of every figure caption.... but you don't want that dot to appear in any secondary use like a TOC, list of figures, etc.?

 

GREP styles can't replace content, only apply format to it. This is sorta-kinda conditional text, but on the fly within the document, which can't really be done in any simple way. The only way I can think of to make this work is apply GREP styles to each secondary use (a TOC line entry style, for example) that applies a color of "None" to the terminal period/stop.

Inspiring
August 10, 2024

Many thanks! I will do what you suggest, add the period (is it the same expression used both in UK and US English?) and then hide it in my TOC.