Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Add line break after 300 characters?

Return to Member Forum

  • Author
    Posts
    • #14366107

      I have a very large block of monospaced text that has no spaces (this is deliberate!). My goal is to have the characters all line up neatly across the page. By default InDesign seems to vary the line character count per line based on its own rules regardless of if the para is left aligned or force justified, so I’d like to take control of that and limit the text frame to exactly 300 characters and then have a line break. Can anyone think of a solution?

      Thanks!

      https://www.dropbox.com/s/ftonup7tj555ezh/Screen-Shot-2022-05-28-at-11.31.15-AM.jpg?dl=0

    • #14366108
      John Kramer
      Participant

      Caspian, I think I see what is going on. To Indesign, anything between spaces is one word, and with hyphenation turned off, it doesn’t know how to break the line.
      But it looks like a few punctuation marks — period, underscore, right curly bracket, close paren — allow for a line break. (See line endings in your example on the left.)

      I’m not a programmer, so I’m not sure how to tell it to count 300 characters, but I believe that if you could count to 300 and then put a discretionary line break it will do the same thing. Or just a manual return, I guess.

      Normally I would say that one shouldn’t justify monospaced type, but if you have the EXACT number of characters in each line, it looks like it retains the vertical alignment:
      https://capture.dropbox.com/QIK13UxffsEucv8U

    • #14366109

      This is more of a decorative element to the document so the normal rules about typesetting don’t apply. I have a hunch the answer lies in some GREP magic. I have the ‘GREP in InDesign’ book but can’t find any hints about how to instruct something so specific as ‘find every 300th character (including slashes, numbers, punctuation etc) and add a line break.’

    • #14366110

      I have found an answer that does exactly what I was looking for from a helpful contributor on the Adobe forum.

      Find What: .{300}
      Change to: $0

      Here . matches any character.
      The number inside {} specifies the number of characters to match. $0 is the match found

    • #14366115
      David Blatner
      Keymaster

      Caspian: I’m glad you found a solution! Here’s a good link for future reference:

      Favorite GREP Expressions You Can Use

Viewing 4 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads