9 Replies Latest reply on Mar 27, 2014 10:30 AM by Comms Mike

    Paragraph Styles - formatting specific text

    Comms Mike

      Hi,

       

      At the moment I have the following layout which is using paragraph styling on data drawn from a XML file. (part code/description/price)

       

      screenshot 1.png

       

      The issue I have is that some products have a long description so will bump the price down a line. (Causing the price to stay on the left):

       

      screenshot2.png

       

      Is there a way of using a style to produce this layout if the description falls onto two lines?

       

      - Description shouldn't take up entire line to allow for price to stay noticeable

      - Description should align together rather than to left of frame

       

      screenshot3.png

       

      Cheers

        • 1. Re: Paragraph Styles - formatting specific text
          Obi-wan Kenobi Adobe Community Professional

          Hi,

           

          To do this, I would use a table structure with 3 columns, useful for your problem and useful too for the end of the first line when it goes to an second line.


          • 2. Re: Paragraph Styles - formatting specific text
            Comms Mike Level 1

            Cheers, I will have a look into using the tables. Am I right in thinking that sections of the table have to be tagged within the XML?

             

            (Haven't linked XML and tables before)

            • 3. Re: Paragraph Styles - formatting specific text
              [Jongware] Most Valuable Participant

              CM Bali wrote:

              .. Is there a way of using a style to produce this layout if the description falls onto two lines?

               

              - Description shouldn't take up entire line to allow for price to stay noticeable

              - Description should align together rather than to left of frame

               

              Are there tabs between the catalog number and description text, and text and price(?)? If not, can you easily add them?

               

              If so:

               

              1. Add a tab at the first indent distance

              2. Set Left Indent to this same number

              3. Set First Line Indent to minus this number

               

              -- this takes care of the left indent. Then,

               

              4. Add a right-aligned tab at the rightmost possible position -- all the way at the end of the text frame. Don't try to 'drag' the tab marker there; enter it anywhere inside the tab ruler, then type in the exact number. This number should be the width of your text frame.

              5. Set a Right Indent to some reasonable value -- this is going to be the distance where you want your long descriptions broken at.

              6. Set a Last Line Indent to minus that same number.

               

              If you find that the last word before the tab and price(?) may sneak up too close to the price, type an em-space just before the tab.

              • 4. Re: Paragraph Styles - formatting specific text
                Obi-wan Kenobi Adobe Community Professional

                I can't reply because I'm not a XML specialist.

                 

                About what Jongware proposed, He's totally right. I did not think about this double setting:

                 

                Capture d’écran 2014-03-27 à 17.25.50.png

                 

                Jongware, Thanks for this tip!

                • 5. Re: Paragraph Styles - formatting specific text
                  Comms Mike Level 1

                  [Jongware] wrote:

                   

                  CM Bali wrote:

                  .. Is there a way of using a style to produce this layout if the description falls onto two lines?

                   

                  - Description shouldn't take up entire line to allow for price to stay noticeable

                  - Description should align together rather than to left of frame

                   

                  Are there tabs between the catalog number and description text, and text and price(?)? If not, can you easily add them?

                   

                  If so:

                   

                  1. Add a tab at the first indent distance

                  2. Set Left Indent to this same number

                  3. Set First Line Indent to minus this number

                   

                  -- this takes care of the left indent. Then,

                   

                  4. Add a right-aligned tab at the rightmost possible position -- all the way at the end of the text frame. Don't try to 'drag' the tab marker there; enter it anywhere inside the tab ruler, then type in the exact number. This number should be the width of your text frame.

                  5. Set a Right Indent to some reasonable value -- this is going to be the distance where you want your long descriptions broken at.

                  6. Set a Last Line Indent to minus that same number.

                   

                  If you find that the last word before the tab and price(?) may sneak up too close to the price, type an em-space just before the tab.

                   

                  Cheers for this in most instances this solution would work, unfortunately the product codes being drawn in will be in different lengths so the left tabbing will remain miss-aligned on longer product codes?

                  • 6. Re: Paragraph Styles - formatting specific text
                    [Jongware] Most Valuable Participant

                    CM Bali wrote:

                     

                    [Jongware] wrote:

                     

                    CM Bali wrote:

                    .. Is there a way of using a style to produce this layout if the description falls onto two lines?

                     

                    - Description shouldn't take up entire line to allow for price to stay noticeable

                    - Description should align together rather than to left of frame

                     

                    Are there tabs between the catalog number and description text, and text and price(?)? If not, can you easily add them?

                     

                    If so:

                     

                    1. Add a tab at the first indent distance

                    2. Set Left Indent to this same number

                    3. Set First Line Indent to minus this number

                     

                    -- this takes care of the left indent. Then,

                     

                    4. Add a right-aligned tab at the rightmost possible position -- all the way at the end of the text frame. Don't try to 'drag' the tab marker there; enter it anywhere inside the tab ruler, then type in the exact number. This number should be the width of your text frame.

                    5. Set a Right Indent to some reasonable value -- this is going to be the distance where you want your long descriptions broken at.

                    6. Set a Last Line Indent to minus that same number.

                     

                    If you find that the last word before the tab and price(?) may sneak up too close to the price, type an em-space just before the tab.

                     

                    Cheers for this in most instances this solution would work, unfortunately the product codes being drawn in will be in different lengths so the left tabbing will remain miss-aligned on longer product codes?

                     

                    Correct -- I was assuming these product codes were of constant length. But, unless you need *wildly* varying lengths, it might still be worth the effort of creating 3 or 5 or so different styles -- given that "all the rest" will follow suit automatically.

                    • 7. Re: Paragraph Styles - formatting specific text
                      Comms Mike Level 1

                      Thanks to both of you with your help on this, reckon I will produce a couple of variations as (hopefully) the codes for each section shouldn't vary too much

                      • 8. Re: Paragraph Styles - formatting specific text
                        Obi-wan Kenobi Adobe Community Professional

                        If fact, Jongware is totally right.

                         

                        One para style (modifying tabulations / screenshot 1) and a regex to launch (screenshot 2).

                         

                        Capture d’écran 2014-03-27 à 17.50.31.png

                         

                         

                        Capture d’écran 2014-03-27 à 18.00.34.png

                         

                        This regex can be launched whenever you want. It also has the distinction of not change what has already been processed! 

                        1 person found this helpful
                        • 9. Re: Paragraph Styles - formatting specific text
                          Comms Mike Level 1

                          Legend!

                           

                          Thank you very much