Rule that detects paragraph style change

I have a CS5 paragraph style called "Code", which needs Space After="0p0" if the following paragraph is also "Code", but it needs Space After="0p3" if the following paragraph is not "Code".
Actually, I have several paragraph styles for which I need this behavior. Presently, I have two separate styles for each of these styles, for example, "Code" and "Code: Final Line". I could eliminate several paragraph styles and lots of manual labor if I could create a rule to do what I've described.
I don't see how to do it with GREP Style, but that seems like the place where I should be able to do it.
Is it possible? How?

hi, Cary
interesting case...
No, grep doesn't look for styles, it just looks for text and applies styles…
the only suggestion comes to mind so far, is a dirty workaround. Maybe it's worth dancing around, if your document is really too big for manual edits, and your text is not justified, but, let's say, aligned left.
Then the goal is: merge all "Code" and "Code: Final Line" text to one paragraph.
1. In Text tab find hard returns formatted as "Code: Final Line", change them to some special character, surely not used in your "Code" text anywhere, and hard return, lets say:
Find What: ^p Change To: +^p
2. In Grep tab change all hard returns formatted as "Code" to soft returns, except those with your "special character" behind (plus sign in my example):
Find What: (?<!\+)\r Change To: \n
3. Finally, easy part - find/remove all occurencies of your 'special character' from your text. Former it was formatted as "Code: Final Line", now it's "Code". You can specify it in Find Format field. "Code: Final Line" is not used nowhere anymore.
4. After all, you can apply desired Space After to your "Code" style.
And yeah, it's faster to do than to describe...
Hope it helps if you didn't find better solution yet. If you did, please share

Similar Messages

  • Why won't paragraph styles change?

    I opened a document from a few months ago and updated paragraph styles to a different font. However when I click on text and assign a style it has no effect. If I go to "basic paragraph" and click on that while holding down the option and shift keys, then it seems to remove whatever is stuck and then I can assign the style. But if I have to do this with every part of this 70 page document it is going to take a long time. Is there some way to make this go easier?
    The other thing is that I assigned keys to each style and I notice that even though I changed the paragraph styles to a different font the keys say they are assigned to the prior font, so maybe this is part of the problem.
    Suggestions very welcome.

    No.
    Break Link with Style does exactly what is reads.
    If you have a paragraph using the 'Body' style and you use the Break Link with Style option, then the paragraph retains the current appearance and settings, but is no longer associated with the 'Body' style. So, when and if you change the 'Body' style, that paragraph will not change.
    Clear Overrides reverts manual styling to the applied Paragraph Style. So, using the example above, assume your 'Body' style uses Myriad Pro Bold, and you manually change the font in a paragraph to Myriad Pro Black, that is an override. Selecting "Clear Overrides" reverts the font back to Myriad Pro Bold.
    Clear Overrides does not appear in the palette menu for character styles.
    Your text cursor needs to be active within the paragraph (or some of the text must be selected with the text tool) in order for the contextual menu to show the Clear Overrides option.
    Another option is to check the Paragraph Style Palette with the text cursor active in a paragraph. If there is any paragraph style applied, then it should appear bolded in the list. If there are any overrides applied, there should be a
    + at the end of the style name. You can then Control Click on the Paragraph style to see a list of options such as:
    Apply Style
    Apply Style, Clear Overrides
    Apply Style, Clear Character Styles
    Apply Style, Clear All
    HTH
    -mt

  • Locking up with paragraph style change

    I'm using the latest version of InDesign CC 2014; I'm working on a relatively simple 154-page document.
    When I try to apply a change to a paragraph style, however, the application quits responding and I get the "beachball" until I force-quit. I've tried changing the style within the Paragraph Styles dialog, and changing it in the text then redefining the style. Nothing works.
    I also tried exporting the file to be able to be opened in InDesign CS6; that crashed the application, and sent a report to Adobe.
    Any help?

    I've found that it is document-specific; in other words, it only happens with certain ID documents. But I can't tell what the common points are among the documents.

  • Changes to [No Paragraph Style] causing unwanted style overrides

    Hi fellow InDesigners
    I'm using InDesign CS6. I'm working with long documents that were originally created in previous versions (CS4 and possibly earlier). My standard workflow for these jobs is to do the bulk of the text formatting in a newly created, bare-bones, single column document. First, I load the paragraph and character styles from the template, and when I'm done I copy and paste the formatted text back into the template for final layout and typesetting. This used to work fine in CS4, but in CS6, all my paragraphs show the plus sign in the Paragraph Styles panel, indicating that they have been overridden. They should be identical, since I imported the styles from one file to the other. The overrides include drop cap alignment, and even more obscure things like 'IdeoSpaceBehavior' and 'Diacritic Positioning'.
    It seems likely to me that this problem is due to Adobe having changed the definition of the mysteriously ubiquitous '[No Paragraph Style]' style between versions. The template file has carried over the definition from CS4, but the newly created working files have the new definition, and since [No Paragraph Style] is not included when importing styles from one document to another, the inconsistency remains. Copying and pasting text with no overrides in one document, shows overrides in the other.
    So the simplest solution I can think of, would be to change the [No Paragraph Style] in the template to match the definition of new CS6 documents. Is this even possible? My Googling thus far suggests that [No Paragraph Style] is pretty much untouchable.
    Is there nothing for it but to create the template files again as new documents in CS6?

    No worries Michael. Yes, I vaguely remember the change too.
    My understanding is, [No Paragraph Style] is very much a style—a paradoxically named style to be sure, but a style nonetheless. Check out the [Basic Paragraph] style definition by double clicking on it in the Paragraph Styles panel. It's style definition is: '[No Paragraph Style] + next: [Same style]'. That's it. Minion Pro 12 point, with auto leading—and every other conceivable paragraph attribute—all handled by [No Paragraph Style]. Adobe needed some defaults, and that's what [No Paragraph Style] is—just a default style. You can never escape it either, since every style, no matter what it's based on, has [No Paragraph Style] as its most senior ancestor.
    So that's essentially my problem. Adobe has, in their wisdom, changed the [No Paragraph Style] style between versions, so that a document originally created in an earlier version and a document created in CS6 have different [No Paragraph Style] settings. I'm pretty confident this is the cause of my problems.
    Lots of my paragraph styles inherit from other styles. Why would I not want that? My custom 'Paragraph' style has lots of other styles based on it—from typesetting variations, to quotes, lists, etc. But the 'Paragraph' style itself is based on [No Paragraph Style]. As I said, you can't really escape [No Paragraph Style].

  • Vertical rules in paragraph style?

    Hi,
    I'm about to design a book with a lot of interviews. To make it a bit easier for the reader to follow I've designed a thin colored line to the left of the paragraph indicating who's saying what (see pic). The problem is that I can't seem to make these lines with the paragraph style which will be a problem further down the line if I do it manual with the line-tool. So my question is; Dose anyone have a solution that will make the lines flow dynamically together with the text?

    Make a Paragraph Rule Above
    Basically - on the paragraph go to Paragraph Rules in the Paragraph Style
    Then Apply a negative right or left indent and set the point size to equal the leading of the paragraph, so if you have 5 lines and the leading is 14pt, then the pt size for the thickness of the rule should be 70
    For 8/14pt with 8 lines of text
    So Rule Below (tick box)
    Color: (pick a color)
    Weight 113pt (14 x 8 = 113)
    Width = Column
    Offset = 108 pts
    Left indent = -8.5 pts
    Right indent = 173pts
    (adjust left and right indents to vary thickness)
    It's not perfect as if the text increases or decreases you have to adjust the size of the line.
    You could always anchor an object to the text, and offset (http://help.adobe.com/en_US/InDesign/6.0/WSa285fff53dea4f8617383751001ea8cb3f-6c43a.html )

  • Is there a script to change paragraph style based on even/odd page

    Is there a script or way to have paragraph style change between 2 styles based on the text being on an even or odd page? 

    @JustMikey – as I understand your task, the problem has nothing to do with "special" paragraph styles, but (nearly) all with anchored objects (the images and parts of the gray bar) and appropriate margin settings.
    Just see the following IDML file I exported from InDesign CS5.5:
    Dropbox - ImagesAwayFromSpine-CS5.5.zip
    ImagesAwayFromSpine-CS5.5.zip
         ImagesAwayFromSpine-CS5.5.idml
         080731_Manchester-xxl_Grau.tif
    Of course you could add paragraph styles to format the data automatically or optimize in other ways.
    That's up to you. But you can see the principle:
    Inspect the Anchored Object Options for the image and the gray bar. Also the frame fitting options for the image.
    Note: See also the margin settings, that are not exactly mirrored on even and odd pages (for good reason).
    Uwe

  • Paragraph Style Problem

    I have the weirdest problem that I cannot yet understand. I have a 76-page book that has at TOC plus 10 chapters. The book was created last year in ID CS3, and everything worked fine. I have updated it into CS4, and everything appeared to be working normally until I discovered this problem. My master chapter for synchronizing is Chapter 2 in the book panel. All fonts are loaded and present.
    In the last chapter (Ch. 10), the paragraph styles don't work. They not only don't work, they change the text to something totally weird. For example, if I set a block of type in Times New Roman and pick, say, the #1 Head style, which is Hypatia Sans Pro Bold, it converts it to a completely different font or it chooses a font I'm not even using. If I set the type in another chapter and cut and paste it to Chapter 10, it pastes fine. If I try to restyle it, it goes weird on me.
    I have looked extensively at the styles, and they are all correct and the same as all the other chapters. However, when I try to apply them, a different change results. I have checked the Basic Paragraph Style; however, none of my styles are based on that because I checked that also.
    Keep in mind that the paragraph styles worked properly last year and are working properly in every other chapter. Synchronizing does not help.
    This may be a bug of some sort or it may be something I've overlooked. But I haven't made any huge structural changes to the chapter other than to add a couple of pages. I've tried restarting the program and the computer. The only thing I have not tried is to completely remake the chapter, which, of course, I don't really want to do.
    I'm just throwing this out there. I'm not sure there is an easy answer. Let me know what you think.

    Try moving the pages to a new file. That's not going to be as effective, probably, as copying all the elements into a new file, but it's faster.
    Also, make a new book with just the problem chapter and the source chapter and synch again, see if it works.
    Peter

  • Following Paragraph Style - a bug?

    I have a list style that is currently active. I am on that list style now and over in the More section of the Text pane in the inspector, I choose a paragraph style as the "Following Paragraph Style". However when I hit return (to start a new paragraph) from the list style, the menu selection in the Following Paragraph Style changes to "same" (which results in the corresponding effect in the following paragraph, i.e. I end up having the characteristic of the list style I had before I hit return.
    I am assuming this is a bug?
    Thanks,
    Kenneth

    I still don't quite understand what you're trying to do, but it might help to understand how following style works. It's not very useful except when used in a defined style. In your example, I think when you hit return, the new paragraph took on the following style you'd set. That style, though, had its following style set to Same, which is why the pop-up changed back.
    Try this in a new document:
    Show the styles drawer.
    Apply the paragraph style "Body Bullet"
    In the text inspector, change the following style to "Title"
    Click on the red triangle next to "Body Bullet" in the styles drawer.
    Select "Redefine Style from Selection"
    Type some text and press return, type more text.
    The paragraph which follows the body-bullet style has the style you set as the following style, "Title."
    Press return again, more text.
    The next paragraph has the style "Body," the following style of "Title".
    Something which might be more useful would be to set Body Bullet's following style to Body. Then you could apply Body Bullet, and get a bulleted paragraph. As you are typing, each subsequent paragraph would be Body until you applied Body Bullet again.

  • Need to keep two paragraph styles on same line

    Coming from Ventura and need to recreate all publications in Indesign - can't find the equivalent of "breaks - line break: none".  Need to keep two paragraph styles on same line.

    Like Ventura, FrameMaker has been able to do this for decades.
    You're correct about zero leading being inadequate, if not only in appearance, but also for maintaining the document through changes, especially if someone other than you needs to edit it.
    Nested styles are logical to create and use. Search Google for terms like "InDesign nested styles," without quotes, for lots of links to tutorials and details.
    If you need to create TOC entries for each of the two parts of text in this example, even after formatting with a nested style, InDesign's TOC will see only the single paragraph. If that works, OK. If you want to be able to create a TOC reference to each part, you'll have to create hidden text for each part, and you'll need to create a paragraph style for each, as well. This is because InDesign's TOC only captures complete paragraphs.
    [EDIT] If you think this is an important feature enhancement that should be included in a future InDesign release, post a formal feature request in the form here: WISH.[/EDIT]
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices
    MW Design wrote:
    InDesign cannot create side-by-side paragraphs. The only viable work-around is to use tables.
    I do miss Ventura a lot. For others, basically side-by-side paragraphs are successive paragraphs (one below the other) that the paragraph style can then format so they are next to each other, out in the margin as callouts, etc.
    Mike
    Message was edited by: peter at knowhowpro

  • Font Size / Style changes on recipient's end?

    I've been using mail since Leopard and recently upgraded to Snow Leopard where I'm currently on Mail version 4.2 (1078).
    Whenever I compose and send a message where the default font is Helvetica 12 and the email format is rich text, some recipients receive my email where the font is very tiny, maybe a 4 pt font and the style changes.
    In many of my emails, I will copy and paste a paragraph or two from another email where the font is theoretically the same and then I will edit a few words in the body of the email before submitting.
    When some recipients reply back with my original email text, I sometimes see the edited text as a tiny font or the font size of my email has shrunk down considerably.
    I sent a test email to my hotmail and gmail accounts but this issue does not seem to arise. What I saw before sending my email is exactly the same font size/style in my hotmail and gmail accounts.
    Is this an issue with the recipient's email browser or are there some incompatibilities with Apple's Mail and other email browsers?

    Thanks baltwo and Tom. I'll try sending as a PDF file as well.
    Also, I did a test per Tom's instructions about reformatting text. First, I copied text from another email and then pasted it in a new message. I highlighted all the text where I wanted to increase the text size and left one paragraph unchanged.
    I sent the email to the recipient that's having these issues where she replied back with my forwarded email.
    All the text where I increased the point size shrunk and the text that I left alone was actually okay - Weird! I also noticed that the font style changed on their end. By the way, the recipient uses Microsoft Outlook as their email browser.

  • Problem applying Paragraph styles in CS4 InDesign

    I boughtCS4 InDesign for Windows perhaps six months ago, and it worked fine with Windows XP. I have recently installed Windows 7 and find that the paragraph styles won't always work. Of ten when I try to use the shortcut for paragraph style the paragraph in question turns pink with small squares in it. If I undo the application of paragraph styles it goes back to text. I am using Times New Roman as the major font. However, I have tried other fonts and they won't work in paragraph style either.
    I tried changing several pages of the manuscript to Times New Roman Special G1, but it won't do the commas, quotes, etc. (special characters).
    Has anyone else had this problem? What can I do to fix this mess?
    Thanks for any help.
    Earl Davis

    Well, here's the situation now. But before describing it, let me thank Peter
    Spier and Bob Levine who have endeavored to help me. Now, here's where we
    are:
    I copied a document over from Pagemaker into InDesign using Times New Roman
    font. (I did the same for two other book manuscripts this past summer,
    shortly after purchasing InDesign and had no problem). Suddenly a couple
    weeks ago I found that the shortcut I set for the paragraph styles did not
    format the paragraphs, etc., but rather turned the paragraph in which I
    placed the cursor into a series of pink squares highlighted in pink. I have
    tried the suggestions you fellows have given, such as copying the fonts
    presently in the Windows Font Directory into the Adobe/InDesign/Fonts
    directory, and then right-clicking on them and installing them. By the way,
    the InDesign font directory only had the Times New Roman and Times New Roman
    Special 1 and Renaissance font in it, until I copied all my fonts there and
    installed them. Another oddity, I make the first letter of the first
    paragraph of each chapter a decorative Renaissance font, spanning two lines.
    I now find that when I do that, I may get a black square, which may turn
    into the correct font after I adjust the size to two lines.
       But on the general problem, I have tried changing the font in the
    paragraph styles to Amerigo BT, and I sometimes get the shortcut to work,
    and sometimes it still turns it into Times New Roman Special or black
    squares. Also, I have opened a new file and put another copy of the text in
    it, setting up the paragraph styles, etc. and still have the same problem.
       So I'm at a loss what to do.  I do think it's possible I am doing
    something wrong with fonts or setting up the paragraph styles, but I don't
    see any errors there. All my computer fonts show up in the fonts panel of
    the document.  Any more ideas?

  • Need to add a carriage return in Paragraph styles

    Hi. I am in a muddle. I have a large amount of data from an xml source. I need to quickly add carriage returns appropriately throughout it so that the paragraph styles can be differentiated.I am using tags manually mapped to styles to do this.
    In order to carriage returns am I right in thinking that I can add a GREP style to each para style, and that it will sense the end of the para through the end marker position of each tag? If this is so, what would the GREP expressionlook like to that I can automate locating the end of a tag/para style so that I can add ~b to it?
    Gratefully!

    Hi @chantal_diva arts,
    It seems to be difficult, because you have much more invinsible character than only the xml markers in your document.
    I think one good way could be @obi-wan Kenobis way.
    Perhaps you can upload an example idml on a file hoster of your choise (e.g. xup.in).
    Regardless, you can try the following:
    1. text search:
    <FEFF>
    replace with:
    2. grep search:
    (?<=\b##)(.)
    replace with:
    \r$1
    3. clean document
    grep search:
    #+
    replace with:
    (nothing)  an empty replace field
    Have fun

  • Paragraph Styles not showing up in TOC window

    I am using a template that uses paragraph styles ( when I click on a heading line the corresponding Heading 1 becomes selected in the paragraph styles draw) yet no paragaph headings show up in the TOC window.
    thanks for any help

    Thank you.
    The problem is that sometimes they will display, and sometimes they 
    won't (within the same document).
    I finally got them to show up, but then if I re-open they may (or may 
    not) disappear.

  • Problem setting paragraph style using FindChangeByList

    am trying to apply a paragraph style using FindChangeByList. I can apply character styles but not paragraph styles.
    I need to apply the paragraph style "price" to every paragraph that begins with a "$"
    I have tried it everyway I can think of.
    any suggestions?

    Hi Carolyn,
    Try something like this (assuming JavaScript, and also assuming that the paragraph style is not in a paragraph style group):
    text<tab>{findWhat:"$"}<tab>{appliedParagraphStyle:app.documents.item(0).paragraphStyles.i tem("price")}<tab>{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
    (Where <tab> is a tab character.)
    Thanks,
    Ole

  • Drop Shadow possible within a paragraph style?

    I have a table and on a certain row I have a style that requires a dropdown. I have made a paragraph style that has everything perfect but I can't find the drop shadow option there. Is it possible to include drop shadow effects as a style?

    I've found this frustrating too.
    The way I get around it is as follows:
    1: Create a Text Frame and type the text to be shadowed.
    2: Select the Text Frame and choose Window > Effects.
    3: Expand the Object list and select just the text in the list.
    4: Click the fx dropdown and apply any effects you want to associate with the text.
    5: Feel free to save this as an Object Style to use again.
    Now the the part that will have old-school QuarkXpressers squirming...
    6: Select the whole text frame, choose Edit > Cut.
    7: ... and paste it into another text frame as an Anchored Object.
    8: You can then create a Paragraph Style to control the position/placement of the Anchored object.
    9: ... and even add some Text Wrap and offset to your Object Style.
    I know it is a filthy workaround, but it is the only way I can find to achieve the required result.
    Please, Adobe, can we have effect styles that can be applied as part of Paragraph Styles. I mean, there's a precedent : Character styles as part of Paragraph Styles, Table Styles containing Cell Styles that contain Paragraph Styles that could ostensibly contain Nested Styles.....

Maybe you are looking for

  • IE doesn't show my body background

    This is a very strange problem. I feel that the different aspects of this mistake are related, though. IE does not display my body background or recognize some of my links as working links. (except for the briefest of moment as it is loading the page

  • "Sender uses Virtual Receiver"...What it is?

    Hey Guys, In Sender Agreement, we have an option of selecting Sender uses virtual receiver option.I tried finding out wht "Sender uses virtual receiver" is all about all i could find out is....this option is used when we have parties communicating th

  • The wifi icon in settings has gone grey and inactive

    The wifi icon in Settings suddenly went grey and inactive. Have tried resetting network settings a few times without success

  • Need help in date columns

    Hi, Need a help in using a date columns, I have the below 2 columns (mm/dd/yyyy hh:mi:ss) and I want to exactly find the number of hours and minutes between those 2. please help me. Start time - 9/2/2010 8:12:03 AM End time - 9/3/2010 9:12:03 AM Than

  • Consolidate iTunes Library

    Is there any way to only consolidate music in the iTunes library? I recently purchased an iPhone and now use iTunes for some movies, but it wants to consolidate those as well. I want my music consolidated, but not the videos as I don't have enough ro