Skip navigation
Currently Being Moderated

How to avoid number/fraction partitions in (very good) kitchen recipes?

Aug 7, 2012 4:15 AM

Screen Shot 2012-08-07 at 6.06.00 AM.png

 

In the third line that number 1 should go to the next line.

How to catch these figures for 700 recipes?

I tried with Grep but this boundary is not easily tagged.

.

 
Replies
  • Currently Being Moderated
    Aug 7, 2012 4:36 AM   in reply to camilo umaña

    Use GREP

     

    find what: \b(\d+)\x{20}

    change to: $1~S

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2012 4:44 AM   in reply to camilo umaña

    I'd build it into the Paragraph Style using a GREP style

     

    \d+\s+

     

    then create a character style and activate the "No Break" option

     

     

    You can do it as a Find/Change (as above) but you'd need to continually do Find/Change over the course of the book.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2012 6:41 AM   in reply to camilo umaña

    camilo umaña wrote:

     

    We need to tag only those numbers that are finishing the line...

     

    I'm not sure I see the problem with applying a non-breaking space after the digit, wherever it falls. If it's at the end of the line it will move to the next line, if it's not at the end it will do no harm and you won't notice the non-breaking attribute.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2012 6:54 AM   in reply to camilo umaña

    GREP can't find things like that - it can only find at the beginning of a word/paragraph or at the end of a word or paragraph - but it doesn't know when something is approaching the end of a line within a story.

     

    It will either find a string of numbers or nothing at all - it can't descriminate between, 1 apple, 100 mgs and 1000 mgs and 2004 (year).

     

    It can find just a Number (\d) or a string of numbers (\d+) or you can instruct for (\d{3}) to find 1 or 3 digits etc.

     

    The next piece of the puzzle is the space which is \s+ for a constant string of white space, which also includes tabs and other space characters. If you want just a Space then you have press the space bar so it looks like this (without the brackets) (_+) (the underline represents a blank space by pressing the space bar).

     

     

    So the GREP solution would have to find any number followed by a space and either replace the space with a non-breaking space or a Apply a No Break in the style.

     

    The problem with the Script Solution and the Find/Change is that I imagine you'd have to it multiple times and if you forget to do it once then you end up with a number being left behind on the line above.

     

     

    I'd still be inclined to use a GREP style to change the Number followed by a Space into a Non-Breaking character style.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2012 9:24 AM   in reply to camilo umaña

    You should not need to insert a hard or soft return. All that happens when you use a non-breaking space, or Eugene's No Break character style, is to guarantee that you will never have a number followed by a space at the end of a line unles it really is the end of a paragraph. Anytime there is something following that space the pargaraph composer will automatically keep the number and space together with that next character. If there is not enough space on the line for all of it to fit, it will move to the next line automatically. If recomposing will work, ID may bring additional charcates from the following line up. In any case, if the number and space fall anywhere other than the end of the line, a non-breaking attribute is irrelevant.

     

    This is very similar to using a non-breaking space between the last two words in a paragraph to prevent the last line from having only one word.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 7, 2012 12:26 PM   in reply to camilo umaña

    Please manually put a non-breaking space between the 1 and cucharada on the third line in your example, then explain to me why that isn't working the way you want it to.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points