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
  • 1749 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 10, 2024

Many thanks! You read my mind - I am new to GREP so almost always need help in formulating it correctly - with your template I can fix my captions easily :).

James Gifford—NitroPress
Legend
August 10, 2024

Besides having your "hide" style change the color to 'None,' you might want to pile on making the period vanish by assigning it a size of 1 pt and a width of 1%. This will keep it from distorting any following spacing, such as for a tab leader.

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.