Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

apply 2 different character styles?

Participant ,
Jul 18, 2018 Jul 18, 2018

I realize I cannot apply 2 different character styles, so I'm wondering the best way to do this.

We have text with paragraph styles applied. Some text needs to be bold (basically random text, can't use a grep style to control it) so we have a bold character style we apply to this text. Now I want to go through and apply No Break to specifically defined text and the only way I can see to automate this is with find/change or another character style. But the problem is, if the text I don't want to break already has the bold character style applied to it, applying a No Break character style removes the bold.

How should I handle this? I don't really want a character style for Bold, a character style for No Break and a character style for Bold No Break...

6.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 19, 2018 Jul 19, 2018

but I won't be able to automate this very well.

I see, Sorry I missed the mixed no break part.

You might consider a scripting solution for applying the no break. With scripting you could string together multiple grep or text f&c to apply no breaks or remove them.

This Applescript so OSX only.

You would repeat the my GrepSearch("grep code here") line and replace the "grep code here" string with your find code.

Line 13 can be set to either true or false—false if you want to remove the no break

tell appl

...
Translate
Mentor ,
Jul 18, 2018 Jul 18, 2018

grudgemom  wrote

I want to go through and apply No Break to specifically defined text

Can you do this with a GREP style as a Paragraph style option? If yes, then you could manually (or again, using GREP) apply bold char style 'on top’, and still keep alive NoBreak, applied with GREP.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 18, 2018 Jul 18, 2018

I was originally trying to set it up as a Grep style within my paragraph style but grep styles can only apply styles so I have to set up No Break as a character style in order to do this, and then it overwrites the bolding already used. Trust me, many pages of proofreading changes because I didn't catch that this would happen

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2018 Jul 18, 2018

grudgemom  wrote

I was originally trying to set it up as a Grep style within my paragraph style but grep styles can only apply styles so I have to set up No Break as a character style in order to do this, and then it overwrites the bolding already used. Trust me, many pages of proofreading changes because I didn't catch that this would happen

That has not been my experience. When a GREP style or a Nested style applies a character style it stacks with character styles already applied, unless there is a conflict.

Below I have a paragraph style that applies three different character styles. Each character style effects a unique attribute, so they don’t conflict. Bold and Non-breaking will not conflict.

Screen-Shot-2018-07-18-at-5.45.49-PM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 18, 2018 Jul 18, 2018

grudgemom  wrote

I have to set up No Break as a character style in order to do this, and then it overwrites the bolding already used.

This only means that 'bolding' attribute in your NoBreak char style is somewhat defined, or the style itself is based on something other than [None]. It shouldn't.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2018 Jul 18, 2018
But the problem is, if the text I don't want to break already has the bold character style applied to it, applying a No Break character style removes the bold.

You can base one character style on another, so make the bold character style and then make a new style based on bold that includes the no break

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Jul 18, 2018 Jul 18, 2018

grudgemom  wrote

I don't really want a character style for Bold, a character style for No Break and a character style for Bold No Break...


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2018 Jul 18, 2018

But the problem is, if the text I don't want to break already has the bold character style applied to it, applying a No Break character style removes the bold.

Sorry if I've misunderstood, but you can have a no break style that doesn't strip the bold if the no break style is based on the bold style.

Screen Shot 44.png

Screen Shot 45.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2018 Jul 18, 2018

https://forums.adobe.com/people/rob+day  wrote

But the problem is, if the text I don't want to break already has the bold character style applied to it, applying a No Break character style removes the bold.

Sorry if I've misunderstood, but you can have a no break style that doesn't strip the bold if the no break style is based on the bold style.

OP already stated they don’t want three character styles: Bold, No Break, and Bold + No Break. I agree that stacking character styles that don’t conflict should be possible. I remember a program that could do this 30 years ago.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2018 Jul 18, 2018

https://forums.adobe.com/people/Scott+Falkner  wrote

https://forums.adobe.com/people/rob+day   wrote

But the problem is, if the text I don't want to break already has the bold character style applied to it, applying a No Break character style removes the bold.

Sorry if I've misunderstood, but you can have a no break style that doesn't strip the bold if the no break style is based on the bold style.

OP already stated they don’t want three character styles: Bold, No Break, and Bold + No Break. I agree that stacking character styles that don’t conflict should be possible. I remember a program that could do this 30 years ago.

It’s simply not possible to attribute 2 or more character styles together to a character, except for the grep styles. You can do a feature request for this. (I personaly would also like having stacked styles).

ABAMBO | Hard- and Software Engineer | Photographer
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 18, 2018 Jul 18, 2018

I can do this, and will likely end up having to, but I won't be able to automate this very well. I can have the same text string in multiple places, half bold, half not bold. In order to automate it I'd need extra greps to look for String A in bold and change to a Bold No Break style, String A in non-bold and change to a No Break style, etc.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 18, 2018 Jul 18, 2018

You can avoid a break if you use a non breaking space to keep together words and a hyphen (not visible) before a specific word oder in the entry of the dictionary if you never want to hyphen the word. So no need to use a character style for no break.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 18, 2018 Jul 18, 2018

That is how I am dealing with certain aspects like company ABC 123 or ABC 45, but there are others like website or email addresses and a company called A&B/CDE that have no spaces.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

Is it important for you to have proper character styles applied to everything?

My view on this is:

1. Use the correct character style to apply "required" formatting. That is, text that is bold should have a style applied.

2. Use a Non-breaking space only when it is "required": inside "Table 1", but not if you only happen to come across a couple of words that may look better when kept together in that particular single instance.

3. Use a local override for anything else that is "transient". For me, this is No Break, Tracking adjustments (to fit a paragraph better), and font overrides if the character code itself is correct but it just not happens to be available in a certain font.

Therefore, I would only consider a character style containing both Bold and No Break if there is a guideline that states "no text in Bold should ever break".

The idea of discerning between "transient" and "required" formatting is that one must always stay present in the document, and the other one can safely be ignored, removed, or overridden, when making changes to a document. If I'm exporting my document to an EPub, the transient formatting can – nay, should – be safely removed, and the rest should stay.

Compare it to using a shift-return to insert a "nicer break": of course it works, once, and if the text never re-runs then it is no problem. But as soon as you change something in the text, InDesign will have struggle to make everything fit again.

Another one is using Ctrl+Shft+K to capitalize a phrase. It is important to distinct between the capitalization as a design decision (for instance, if a heading should be all caps) and applying it to a lowercase character at the start of a sentence "because it must be caps". In that case, I always type in the actual uppercase text.

(I would not mind being able to apply multiple styles to text at all. But to me, that is a separate issue. You can vote for that here and hope it rises to the top: Allow multiple character styles to be applied to characters – Adobe InDesign Feedback. (Or at least above some of these "Feature requests" that already are possible with external plugins .))

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

Hi Jongware,

I added my vote to "Allow multiple character styles to be applied to characters".

Thanks for the link.

Regards,
Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

https://forums.adobe.com/people/%5BJongware%5D  wrote

Is it important for you to have proper character styles applied to everything?

YES (the Jive quoting system kills my nerve... )

ABAMBO | Hard- and Software Engineer | Photographer
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

A lot of people do not understand proper style allocation. I’ve hold an internal training with that to show best practices, as proper language attribution, P-styles vs C-styles etc, just to find documents created after that training with the wrong formatting attached. And it’s always the same excuse: time.

I find that proper preparation of your document structure helps later saving lot of time.

ABAMBO | Hard- and Software Engineer | Photographer
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

Oh I absolutely agree. My distinction as described above is between real formatting and ad hoc layout adjustments. For our workflow, it is important to diverse between the two – we need to repurpose the ID document *after* the printing process.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 19, 2018 Jul 19, 2018

The purpose of doing this is to prevent ad hoc layout adjustments. I'm working on a 1000 page book that has sections of text frames flowing through 5-10 pages. Previously people used soft returns to deal with the text strings we don't want to break. Then I come along with new text, everything reflows, and that soft return is no longer at the end of a line. By using the NoBreak attribute, I'm removing all the soft returns to improve the workflow. What a waste of time to send for proofreading, only to have it come back that text reflowed and I didn't notice.

Abambo​ I agree about proper prep saving time! Proper prep was only partially done on these documents and I'm trying to get them the rest of the way when I have time

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

but I won't be able to automate this very well.

I see, Sorry I missed the mixed no break part.

You might consider a scripting solution for applying the no break. With scripting you could string together multiple grep or text f&c to apply no breaks or remove them.

This Applescript so OSX only.

You would repeat the my GrepSearch("grep code here") line and replace the "grep code here" string with your find code.

Line 13 can be set to either true or false—false if you want to remove the no break

tell application "Adobe InDesign CC 2018"

  

    my GrepSearch("grep code 1 here")

    my GrepSearch("grep code 2 here")

  

end tell

on GrepSearch(f)

    tell application "Adobe InDesign CC 2018"

        set find grep preferences to nothing

        set change grep preferences to nothing

        set find what of find grep preferences to f

        set no break of change grep preferences to true

        change grep

    end tell

end GrepSearch

When you applescript grep searches you have to escape some characters, so the grep for tabs would be "\\t+" not "\t+"

You could also script regular text searches:

tell application "Adobe InDesign CC 2018"

   

    my TextSearch("find text 1")

    my TextSearch("find text 2")

   

end tell

on TextSearch(f)

    tell application "Adobe InDesign CC 2018"

        set find text preferences to nothing

        set change text preferences to nothing

        set find what of find text preferences to f

        set no break of change text preferences to true

        change text

    end tell

end TextSearch

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 19, 2018 Jul 19, 2018

OK, took that script, it's in my script folder. Changed "grep code 1 here" to "Company Name" and "grep code 2 here" to "ABC DEF". Run the script, no error messages, but nothing happens. My instances of "Company Name" have not had No Break applied...

But the really weird thing is that what I open a f/c dialog, the find box now contains "grep code 2 here" and has no break in the change style box. "grep code 2 here" is not in the script file that I am running AT ALL. So now I'm boggled.

But I like the idea of this script and if I can get it working, it may be my solution, so thank you.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 19, 2018 Jul 19, 2018

Nevermind. Try saving the file as an applescript first? lol

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 19, 2018 Jul 19, 2018

It looks like the regular text version might be what you should use—doesn't look like you need grep code, which can be tricky with AppleScript.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 19, 2018 Jul 19, 2018
LATEST

Nope, this works perfectly! I have about a dozen plain text strings to apply No Break to, but then I also have a number of grep strings, like date, page #, website addresses, email addresses, etc. So I can do it all in one now and it doesn't unbold my bolding.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines