15 Replies Latest reply on Aug 21, 2016 9:26 PM by karthiks94217840

    Punctuation stack

    tpk1982 Level 4



      My indesign document have lot of paragraph. My client dont want word and punctuation stack. That means, we dont want three same character, hyphens... So what i do is giving trackin/kerning or giving non-breaking space to avoid this stsck.


      Is there any way to control this through script?


      Also is there any way to control loose/tight line?


      Thanks in advance,


        • 1. Re: Punctuation stack
          Harbs. Level 6

          I don't know what you are asking. If you don't want more than a certain number of consecutive hyphenated words, that can be set in the Hyphenation settings using "Hyphen Limit".



          • 2. Re: Punctuation stack
            tpk1982 Level 4

            Hi Harbs,


            Thanks for your reply. Actually i mean, i dont want three consecutive hyphen or character or punctuations at end opf word in a paragraph. We can set hyphen limit in indesgn. But my requirement is different.


            For example, Pls take alook at below screenshot,





            I dont want this kind of things. What i do, i give tracking or use non-breaking space to avoid this. Is it a javascript which to find this kind of instances and highlight? If possible it will give non-breaking space to first or secong word?




            • 3. Re: Punctuation stack
              Marijan Tompa [tomaxxi] Level 4

              Try enabling "Optical Margin Alignment" in Story panel.

              It enables punctation and hyphens to go outside text frame.



              Marijan (tomaxxi)



              • 4. Re: Punctuation stack
                John Hawkinson Level 5

                Thanks for the screenshot. It made what you wanted much more clear. It wasn't really possible to understand from your original question.


                I do not think Optical Margin Alignment is what you want.


                You want to adjust the tracking and breaking of the paragraph such that these "stacks" do not occur at the last character.


                It is certainly possible to do this with scripting. But you are not likely to find a canned solution -- you will need to learn and write it yourself.

                Do you know Javascript, or have any experience scripting InDesign whatsoever? You'll need that.


                To get started, you need to decide on a very clear sequence of steps that would be taken to identify and address this problem.


                I would start by turning on the Single-line [paragraph] Composer, so that a change you make at the end of the paragraph will not affect the beginning of the paragraph.


                Then you must loop over the lines of the paragraph, and remeber the last line that it is safe to change tracking in, and check to see if you have a stack. If you find a stack, then go back to that last safe line and start adjusting the text's tracking to remove the stack. You'll have to define some tolerances. They will depend on your type of text. At our newspaper, we track between -15 and +15, but that may not be appropriate for you. Once you've removed the stack,

                you need to check and make sure you have not inadvertatly created a ne wstack.


                Once you succesfully adjust the tracking to remove the stack, then you should reset the safe line counter to the next line following your stack, and then keep searching for more stacks.


                Is that what you want to do? I guess the above algorithm might not work if you have a case of two overlapping stacks. Where lines 1-3 form a stack, and when you fix them, lines 3-5 form a stack, and when you fix them, lines 1-3 form a stack a swell. So you'll have to be careful.


                But anyhow, first figure out the algorithm, then implement it in JavaScript. Which part do you need help with?


                It would also help if you were VERY clear in your english, because it can be hard to understand you.

                • 5. Re: Punctuation stack
                  [Jongware]-9BC6tI Level 4

                  Can someone draw Big Red Circles on the offending positions? I still don't get it. Only thing I see -- dark gray text on a black background, ugh! What were you thinking? -- is a "stack" of consecutive hyphens, and those can and will be affected by the Consecutive Hyphen option that has been mentioned twice.

                  • 6. Re: Punctuation stack
                    John Hawkinson Level 5

                    Jongware, you have to click on his image, the forums are cropping it; and it's a CMYK JPEG. Or try this one:


                    Anyhow, the problem is a vertical stack of hyphens or other characters at the right margin.

                    • 7. Re: Punctuation stack
                      [Jongware]-9BC6tI Level 4

                      Ah -- Mac Preview Strikes Again. This is what I see:


                      Screen shot 2011-02-28 at 2.32.57 AM.png


                      (So, next to Tip #1, which is "an image of reasonable size", let's add Tip #2: "No CMYK JPEGs.")


                      Still, I don't see "the problem". The top circle (barely visible, on my screen) shows three consecutive hyphens, and the bottom one shows one single hyphen. That hardly counts as a "stack", doesn't it?


                      I still don't get what "other characters" is referring to.

                      • 8. Re: Punctuation stack
                        John Hawkinson Level 5

                        Surely its visible in my version?


                        Anyhow, the problem is a stack of OTHER characters in the last example. The letter 'o', in this case.

                        • 9. Re: Punctuation stack
                          tpk1982 Level 4



                          Thanks for everyone who spent time for reply my question. Really sorry maybe my english is bad. Now i want to explain clearly what i exactly what.

                          screen 1.JPG




                          The above screen shots show the stack, my hyphenation and justification settings.


                          I want a javscript which will do the following process. (i don't know how to write javascript)


                          1) Javascript find end character of a paragraph. If it have same character, it will apply non-breaking space to the second word. Example, in screenshot 1, the nonbreaking space should apply in between words 'extreml' and 'and'. So the stack will eliminated. If it will create loose line then i take a look and give tracking. As per my client he don't want to apply tracking for a single line. If i want to give tracking, then i will give it to whole para.


                          2) If the above one is not possible, then javascript will find the stack and atleast give a color, then we can easily look where it is.



                          Maybe this will help you. I am eagerly waiting for your answers. Please help me regarding this issue. It will make a bit pain to me.




                          • 10. Re: Punctuation stack
                            John Hawkinson Level 5

                            OK, so have you tried to learn scripting? You should give it a shot! It seems like the kind of thing where you will have to do a lot of fine-tuning of the scripts, so it's important that you understand what you're doing.


                            This is not a case where you can run the script once and forget it...

                            • 11. Re: Punctuation stack
                              tpk1982 Level 4

                              Hi John,


                              One of my friend told me this can be done by script. I don't want to learn javascript. It is so complex for me. I just want a solution, if i am not get it okay. I will continue my manual working......

                              • 12. Re: Punctuation stack
                                Awesome Books Level 1

                                Not sure why no one knew what you were trying to achieve but I have the answer for you.

                                Here you go.


                                This resolves word stacking.

                                • 13. Re: Punctuation stack
                                  tpk1982 Level 4

                                  HI Books,


                                  Thank you so much. It helps me to get some solution now.



                                  • 14. Re: Punctuation stack
                                    karthiks94217840 Level 2

                                    Hi TPK,


                                    I need your help TPK,


                                    Sorry for asking this.


                                    Your completed for above script?


                                    I have some doubt TPK.




                                    • 15. Re: Punctuation stack
                                      karthiks94217840 Level 2

                                      Hi TPK,


                                      Any updated?