16 Replies Latest reply on Mar 12, 2014 6:18 PM by kyriosity

    Need some equation styling help

    kyriosity Level 1

      For equations in running text, I need to be able to do two things: 1) nonbreaking spaces so the whole equation stays together in one line, and 2) smaller spaces between operators and numerals. I can figure out how to do either/or with character styles, but I can't figure out how to do both/and. Any ideas?

       

      ~Valerie

        • 1. Re: Need some equation styling help
          Salah Fadlabi Level 5

          kyriosity wrote:

           

          1) nonbreaking spaces so the whole equation stays together in one line

           

          ~Valerie

          Create a character style with No Break then select the eqution and apply the style.

          • 2. Re: Need some equation styling help
            kyriosity Level 1

            Yes. As I said, I can do EITHER of the styles mentioned, but I need to be able to do BOTH at the same time.

             

            ~Valerie

            • 3. Re: Need some equation styling help
              Ellis home Level 4

              How about increasing Tracking for the whole equation. You can include that in your character style along with nonbreaking.

              Edit: I meant reducing Tracking but that might have other issues.

              • 4. Re: Need some equation styling help
                Peter Spier Most Valuable Participant (Moderator)

                There's a fairly good set of narrower spaces avaialble from the Insert White Space menu....

                • 5. Re: Need some equation styling help
                  kyriosity Level 1

                  Ellis, that was my first thought, too, but it cramps things too much for some characters.

                   

                  ~Valerie

                  • 6. Re: Need some equation styling help
                    kyriosity Level 1

                    Peter,

                     

                    Yeah, or I could reduce the font size or tracking on every. single. space. in every. single. equation., but that wouldn't spare me the pain-in-the-tuchus factor. ;^)

                     

                    ~Valerie

                    • 7. Re: Need some equation styling help
                      Peter Spier Most Valuable Participant (Moderator)

                      How good are you with GREP? It should be reasonably easy to create some GREP styles that would apply horizontal scaling to spaces inside equations.

                      • 8. Re: Need some equation styling help
                        kyriosity Level 1

                        But I can't apply a GREP to a character style.

                         

                        Ooh...but I could do it with find and replace: apply a character style to create the nonbreaking spaces, and then, once the document's all finished, do a find and replace to change every space with that character style to a smaller space. That should work somehow, right?

                         

                        ~V

                        • 9. Re: Need some equation styling help
                          Peter Spier Most Valuable Participant (Moderator)

                          You've missed the point, I think. If you don't want to take the trouble to key in smaller spaces (and you could customize keyboard shorcuts for all of them), then the next best thing is probably to scale the normal space width. If you can use a GREP query to find them, you can apply a style that does the scaling automatically as youo enter the text by making that query int a nested GREP style in your paragraph style. You can have multiple grep styles, and can apply both a GREP style and a regular Character style to the same text, you can even apply multiple GREP styles.

                          • 10. Re: Need some equation styling help
                            Laubender Adobe Community Professional & MVP

                            @Peter – recently I ran into the same problem (task?, challenge?).

                            Different case but in essence the same problem.

                             

                            Pointed at the challenge here:

                            How can we tell white space inside equations from ordinary white space outside equations?


                            That's the real point we have to tackle first. If there is a safe solution to that, we can solve the problem with GREP Styles bound to Paragraph Styles.

                             

                            In my particular case I could not do it.

                            So I decided for a GREP search/replace.

                             

                            Uwe

                            • 11. Re: Need some equation styling help
                              Peter Spier Most Valuable Participant (Moderator)

                              Uwe, that's always the challenge, isn't it?  I would have thought that using lookarounds and the various symbols would work, but I haven't had to use any equations so I've never tried to actually do it.

                              • 12. Re: Need some equation styling help
                                kyriosity Level 1

                                You're right. I missed the point. And I'm still missing it, because I'm afraid you've totally lost me...which isn't the fault of your explanation, I'm sure, but of my ignorance. I don't even know what a GREP query is. It's something different from find and replace? This is all new to me, and I think I've hit the pardon-me-while-my-brain-asplodes stage of the learning process. ;^)

                                 

                                ~Valerie

                                • 13. Re: Need some equation styling help
                                  Peter Spier Most Valuable Participant (Moderator)

                                  GREP stands for General Regular Expression Parsing (os something like that) and it's a language for pattern recognition that can match many different text strings that share a similar characteristic without being identical, such as finding all instances of words that end in "ing" without having to make a list and check each one individually.

                                   

                                  That means if you can establish a pattern to your symbols and spaces that is different from other text, you can use that pattern in a nested GREP style to automatically apply a character style, in this case one that applies a scaling factor to the width of the space.

                                  • 14. Re: Need some equation styling help
                                    kyriosity Level 1

                                    OK, I have already created and applied a character style with a no-break attribute to all of my equations and propositions (or at least all of the ones I've found so far). This was not done with GREP, because I couldn't figure out how to do it with GREP.

                                     

                                    I have now also created a character style with a 50% scale.

                                     

                                    But I stil don't understand how to use GREP to apply them both. "...if you can establish a pattern to your symbols and spaces that is different from other text" -- if the pattern I've established that's different from other text is the first character style, how do I create a GREP that applies the second character style only to the space character in text where the first character style is applied?

                                     

                                    ~Valerie

                                    • 15. Re: Need some equation styling help
                                      Peter Spier Most Valuable Participant (Moderator)

                                      You'll probably need to use "lookahead" and "lookbehind" matches which find your symbols (probably included in a class), then check to see if they are followed or preceeded by a space. This is going to be pretty complex stuff.

                                       

                                      I suspect you might want to get a copy of Peter Kahrel's book on GREP in InDesign to help with the learning curve. It's an eBook, and only cost abpout $10.

                                      • 16. Re: Need some equation styling help
                                        kyriosity Level 1

                                        Peter,

                                         

                                        Thanks for all of your help. Unfortunately, it's just not in the budget or in the schedule to invest any more in this one project. They're paying me by the page, and this mess is already working out to about a third-world salary. I'm going to go with my no-break style and 50% tracking for the whole character style. It won't be perfect, but I think i just have to give up trying to make it perfect.

                                         

                                        Sigh...today the only thing I hate worse than freelancing is starvation! ;^)

                                         

                                        ~Valerie