8 Replies Latest reply: May 17, 2011 6:44 AM by ashtangakasha RSS

    Boxed characters within regular body text paragraphs?

    Ed Roseman Community Member

      I would appreciate any ideas on how I could efficiently make boxed characters in the midst of body text. (I need to refer to musical rehearsal marks (such as A or B25) which are centered in rectangles, so I want boxed characters for clarity).

       

      Specifically:

      • I'd like the rectangular box to grow/shrink depending on the number of characters inside it. This auto-resizing ideal is what has me stumped.

      • It needs to work within a justified paragraph.

       

      It seems that the best way would be a character style that has an auto-resizing rectangle as part of the characters style, for one to three characters.

       

      So far, the best way I’ve found is to define an object style w/1 pt stroke, and the font I want, centered. But that means resizing it individually for 1-, 2-, or 3-character rehearsal numbers--not ideal.

       

      I’ve also tried using square brackets before and after, with extreme low and high, respectively, tracking values, but the justified paragraph throws the alignment of those off.

       

      I even tried messing with a high strike-through and low underline combination, but I’d prefer an actual box, which would require no explanation to readers.

      I suppose, if there’s a font that has boxed letters, I could use that, but would prefer to use the same font as the actual music’s rehearsal numbers.

      I’d think there’d be a better way, but I’ll be darned if I can think of it. I can use my object style technique above if necessary, but would love suggestions for a better way. Thanks to anyone who takes the time to offer ideas!

        • 1. Re: Boxed characters within regular body text paragraphs?
          John Hawkinson CommunityMVP

          I hesitate to suggest it, but you could make them hyperlinks and turn on boxing of hyperlinks.

          • 2. Re: Boxed characters within regular body text paragraphs?
            P Spier CommunityMVP

            I don't think ID really does what you want. I was hopeful that a Hyperlink to nowhere with a visible rectangle might be a way to cheat, but alas the rectangle is non-printing even when visible it seems.

            • 3. Re: Boxed characters within regular body text paragraphs?
              peter at knowhowpro Community Member

              Ed Roseman wrote:

               

               

              I would appreciate any ideas on how I could efficiently make boxed characters in the midst of body text. (I need to refer to musical rehearsal marks (such as A or B25) which are centered in rectangles, so I want boxed characters for clarity).

               

              Specifically:

              • I'd like the rectangular box to grow/shrink depending on the number of characters inside it. This auto-resizing ideal is what has me stumped.

              • It needs to work within a justified paragraph.

               

              It seems that the best way would be a character style that has an auto-resizing rectangle as part of the characters style, for one to three characters.

               

              So far, the best way I’ve found is to define an object style w/1 pt stroke, and the font I want, centered. But that means resizing it individually for 1-, 2-, or 3-character rehearsal numbers--not ideal.

               

              I’ve also tried using square brackets before and after, with extreme low and high, respectively, tracking values, but the justified paragraph throws the alignment of those off.

               

              I even tried messing with a high strike-through and low underline combination, but I’d prefer an actual box, which would require no explanation to readers.

              I suppose, if there’s a font that has boxed letters, I could use that, but would prefer to use the same font as the actual music’s rehearsal numbers.

              I’d think there’d be a better way, but I’ll be darned if I can think of it. I can use my object style technique above if necessary, but would love suggestions for a better way. Thanks to anyone who takes the time to offer ideas!

               

              This could be a good candidate for an ambitious scripter. You could try posting on the scripting forum.

               

              Or, on the infinite-number-of-typing-monkeys theory, because there are a finite number of rehearsal numbers, and an even smaller finite number of character widths the one-, two-, and three-character rehearsal numbers would require, you could create a collection of the boxes that suit the numbers. Keep them handy in their own file, open and ready, on the pasteboard, in a library, on a master page outside the page boundaries, copy/paste them into the text, and type the number. Perhaps some numbers are so common, you could use pre-filled boxes. For boxes stored on a master page, you'd need to Shift+click to release them then copy/paste.

               

              HTH

               

              Regards,

               

              Peter

              _______________________

              Peter Gold

              KnowHow ProServices

              • 4. Re: Boxed characters within regular body text paragraphs?
                John Hawkinson CommunityMVP

                I was hopeful that a Hyperlink to nowhere with a visible rectangle might be a way to cheat, but alas the rectangle is non-printing even when visible it seems.

                Huh. I was so optimistic that they were visible in Acrobat, but even then they are non-printing. I spent far too much time mucking around with preflight fixups in Acrobat to change make the annotation visible, etc., but to no avail. I guess fundamentally it is because annotations are not objects.

                 

                This could be a good candidate for an ambitious scripter. You could try posting on the scripting forum.

                Well, it really wouldn't have to be ambitious... the larger question would be the desired workflow, I think...

                • 5. Re: Boxed characters within regular body text paragraphs?
                  ashtangakasha Community Member

                  Here's an approach that's not quite what you're asking for, but which might serve...and it's totally automatic.

                   

                  You can create a character style that produces a solid tint behind whatever it is assigned to. Simply specify an underline that's as thick as your font, and an offset that positions it squarely behind the text. Experiment with leading/trailing characters to set it off from the adjacent word spaces.

                   

                  Alternatively, use a combination of underline and strikethru to generate an overbar and underbar. You might also find you can align these effectively with the OR (vertical bar) glyph in the font you're using, to produce an actual box.

                   

                  Thanks to Jongware for this kind of delightful mis-use of rules. Paragraph rules can be used in this way to hide running heads, or force chapter titles down on the page (using paragraph rules settings).

                   

                  Allen

                  • 6. Re: Boxed characters within regular body text paragraphs?
                    Ed Roseman Community Member

                    Thanks, Peter, for your reply. I'd thought of the saved-box-templates idea, and had it as a last-ditch fallback. I have no experience with scripting inside ID (Filemaker Pro, yes; ID, no), so am trying other things first.

                     

                    Edly

                    • 7. Re: Boxed characters within regular body text paragraphs?
                      Ed Roseman Community Member

                      Hi Allen.

                       

                      Thanks so much to you, and to the others who posted replies. Much appreciated! And sorry for the time lag in responding. I spent more hours yesterday than I'd like to admit messing around with the different ideas posted here, and a few others that these posts led me to. Here's what I came up with, in case any of this might be of use to anyone else:

                       

                      1. Your idea below works quite well. A thick, offset underline is the way to go, as strike-through puts the strikethrough in FRONT of the character, thus obliterating it when made tall. So, a thick offset underline with a punctuation space, or other space, before and after works okay. Oddly, even when I use a non-breaking fixed-width space, the space size does indeed change depending on how things fall in a justified paragraph, which seems odd, given how I'd think a fixed-width space is supposed to behave. So, a good idea, although not quite a box-around-one-or-more-characters.

                       

                      2. Square brackets before and after the character(s), with the characters underlined, and a strike-through offset to be above the characters. With sufficient finagling, including font size, vertical offset, and horizontal tracking contraction, this works convincingly. A nested style looking for this character combination formats it automatically, and is quick and easy (and intuitive) to input.

                       

                      3. A hair space with a (black) full-height strikethrough, followed by a thin space, rehearsal number characters and another thin space, all with underline below and strikethrough above, followed finally by a last hair space with a full-height strikethrough, all programmed into a nested style, and then a Quickeys macro to automatically type "hair space, thin space, thin space, hair space, move cursor back two spaces" makes this quick to input. Not as intuitive to input without the macro, but with the macro, okay.

                       

                      With all of these, I have yet to experiment fully with the ramifications of the rehearsal mark being moved around inside a justified paragraph, so that remains to be seen. So I'm trying them all out for now to see. Whew, this little thing has taken a lot of time!!!

                       

                      Thanks again to all those who responded. Much appreciated! If anyone has any further ideas, I'd love to hear them, so I can put yet MORE time into this tiny little requirement in my current project!

                       

                      Edly

                      • 8. Re: Boxed characters within regular body text paragraphs?
                        ashtangakasha Community Member

                        I'm glad this outside-the-box technique for boxes was helpful.

                         

                        I especially liked your elaborate microtweaks in technique #3.

                         

                        I also love when an app reaches a level of feature-richness that there are so many ways to get something done.

                         

                        Allen