OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

[solved] highlighting in a paragraph style

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
escapee
General User
General User


Joined: 07 Mar 2007
Posts: 10

PostPosted: Wed Mar 07, 2007 3:57 pm    Post subject: [solved] highlighting in a paragraph style Reply with quote

Greetings!

I've just installed OOo2.1 on my new Vista machine and am largely very happy with the transition from using MSOffice. I've already discovered a few things that I can't figure out how to do, though. I'm hoping someone can help!

Is it possible to include highlighting text as a characteristic of a paragraph style? Many of the other "character attributes" (bold, italic, font color, etc.) can be applied automatically to all text encompassed by a paragraph style from the Font Effects tab, but I don't see an easy way to do it with highlighting. (Changing the background color of the entire paragraph is possible, but doesn't achieve the result I desire--I want only the text itself to have a background of a different color, not the surrounding whitespace as well.)

Thanks for your help!


Last edited by escapee on Thu Mar 08, 2007 8:38 am; edited 1 time in total
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Wed Mar 07, 2007 6:39 pm    Post subject: Reply with quote

The highlighting is a character style property; the highlighting is the character background color.
Back to top
View user's profile Send private message
escapee
General User
General User


Joined: 07 Mar 2007
Posts: 10

PostPosted: Thu Mar 08, 2007 7:23 am    Post subject: Reply with quote

I understand that highlighting is a character style property. I don't think your reply answers my question, though--I'll try to clarify.

A variety of things which appear to be character style properties (for example, italic, bold, double wave underline, and embossed relief) can be applied universally to all the text within a paragraph style under either the Font tab or the Font Effects tab. However, highlighting, which can be added to a character style under the Background tab, doesn't appear to be something that can be included in a paragraph style. Am I incorrect?

Hmm...a related question comes to mind (which may be a way to solve this). Is there a way to include as one of the attributes of a paragraph style a command to "apply all the attributes of character style X to all characters in this paragraph"? That would be one (but certainly not the only) way to resolve the situation I'm dealing with, and it seems like there would be plenty of other contexts within which these "nested styles" would be useful. Thoughts?
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Thu Mar 08, 2007 7:57 am    Post subject: Reply with quote

Your understanding is correct. The "character background color" is a property that is not available at the paragraph level. There are many other such character-level properties.

There is no way AFAIK to link a character style to a paragraph style.

You may be able to use Find & Replace with a pattern search (or a search for a particular pp style) to select the paragraphs you want to apply the character style to.

Maybe if you describe what you're trying to accomplish, someone could suggest a good workaround or maybe a different approach.
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Thu Mar 08, 2007 8:04 am    Post subject: Reply with quote

No to your related question.

How about:
Select text area.
Find & Replace with Search = .[^ ]* (there is a space after ^)
Check Current Selection Only and Regular Expressions then Find All.
Click the Highlight icon.

All but the selection of text can probably be recorded as a macro.


Last edited by JohnV on Thu Mar 08, 2007 8:09 am; edited 1 time in total
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Thu Mar 08, 2007 8:08 am    Post subject: Reply with quote

Ok, I was wrong (again!).

I don't understand how this happens, but if you apply a character property (e.g. background color) to an entire pp, then in the Stylist, use the "Create new style from selection" and create a new pp style, that style will also include the character background. There is apparently no way to do this from the style dialogs.

I learned this reading Issue 20692: Want to link character style to paragraph style.


Last edited by acknak on Thu Mar 08, 2007 8:09 am; edited 1 time in total
Back to top
View user's profile Send private message
BillP
Super User
Super User


Joined: 07 Jan 2006
Posts: 2703

PostPosted: Thu Mar 08, 2007 8:09 am    Post subject: Reply with quote

Doesn't the "character" setting on the Background tab of the Paragraph Style Dialog do what you want?
Back to top
View user's profile Send private message
escapee
General User
General User


Joined: 07 Mar 2007
Posts: 10

PostPosted: Thu Mar 08, 2007 8:38 am    Post subject: Reply with quote

@BillP:
What you proposed is exactly what I thought I was looking for--thanks! Unfortunately, in actually trying it, I see that it's not quite perfect due to the idiosyncrasies of the style I'm using. The paragraph style has a 1.2" hanging indent (which took me a while to figure out in OOo: for the record, in case any other MSWord user is stumbling through looking for how to do this, I indented the paragraph 1.2" and the first line -1.2"). I'm doing this hanging indent so that the first 1.2" of the first line can have a person's name, and the remainder of that row (and only that space in succeeding rows within the paragraph) has what that person is saying (as I explain below, I'm putting together a script). This works out fine except in cases where what the person is saying is broken up into more than one paragraph--when that happens, I generally don't include their name at the beginning of the second and subsequent paragraphs, but due to the hanging indent, that first 1.2" is still highlighted. <sigh> The good news is I can think of a couple of easy solutions: the one I'm going with (unless anyone has a better suggestion) is a "subsequent paragraph same speaker" style which is simply indented 1.2" (i.e., no negative indent on the first line).

@acknak:
Thanks for digging deeper--looks like your solution would work just as well as BillP's, and I think it could be useful to me in other contexts in the future. I won't bore you with the whole thing, but here's the project that brought it up, in case anyone is curious.

I'm working up a script for use in a church service. In addition to default paragraph styles in use (all Heading styles, plus Title), I've created three more: Rubric (for directions), Speaker (for things that somebody says aloud), and Graphic (for maps, music scores, and other things that need to be included in some pictorial way).

Our pastor tends to do best finding his spoken parts on the script when they're identified as clearly as possible--for example, he has in the past requested that his parts be printed larger and be set off from the rest of the text with more whitespace. What I'd like to do is add a Speaker_Pastor style so that his text can be presented in whichever manner he prefers on his script, but I can still print scripts for the other people speaking where his part is not made more prominent than the others (i.e., on their scripts, I'd just tweak the Speaker_Pastor style to be identical to the Speaker style; in fact, if I want, I suppose I could create other styles for the other speakers and make their parts stand out on their scores...). This much is sufficiently straightforward. The challenge comes from my idea (unsolicited) that perhaps highlighting his parts rather than making them larger and set off more from the rest of the text will increase his ease in finding his place without making the page, well, less appealing to look at. Smile From what I know about styles, this is the kind of situation where one would hope to be able to make the change in a few simple clicks by changing a style, rather than having to do a find-and-replace (t would work, but it would take time and effort in a not particularly rewarding way, which is exactly why styles are preferable to direct formatting, right?).
Back to top
View user's profile Send private message
acknak
Moderator
Moderator


Joined: 13 Aug 2004
Posts: 4295
Location: ~ 40°N,75°W

PostPosted: Thu Mar 08, 2007 8:58 am    Post subject: Reply with quote

Quote:
Doesn't the "character" setting on the Background tab of the Paragraph Style Dialog do what you want?

Yow! Where'd that come from--never noticed that before.

Ok I see now, it's a recent enhancement. Cool. Thanks BillP.

Quote:
I'm doing this hanging indent so that the first 1.2" of the first line can have a person's name, and the remainder of that row (and only that space in succeeding rows within the paragraph) has what that person is saying (as I explain below, I'm putting together a script).

I wanted to format a nice copy of some Shakespeare and initially started out like this. I quickly ran into the kind of roadblocks you're encountering. I changed over to a table layout and never looked back.

[edit: Snipped clip]

You can still use all your pp styles to modify spacing and so forth for specific purposes.


Last edited by acknak on Fri Mar 09, 2007 7:16 am; edited 1 time in total
Back to top
View user's profile Send private message
BillP
Super User
Super User


Joined: 07 Jan 2006
Posts: 2703

PostPosted: Thu Mar 08, 2007 9:47 am    Post subject: Reply with quote

escapee wrote:
@BillP:
What you proposed is exactly what I thought I was looking for--thanks! Unfortunately, in actually trying it, I see that it's not quite perfect due to the idiosyncrasies of the style I'm using. The paragraph style has a 1.2" hanging indent (which took me a while to figure out in OOo: for the record, in case any other MSWord user is stumbling through looking for how to do this, I indented the paragraph 1.2" and the first line -1.2"). I'm doing this hanging indent so that the first 1.2" of the first line can have a person's name, and the remainder of that row (and only that space in succeeding rows within the paragraph) has what that person is saying (as I explain below, I'm putting together a script). This works out fine except in cases where what the person is saying is broken up into more than one paragraph--when that happens, I generally don't include their name at the beginning of the second and subsequent paragraphs, but due to the hanging indent, that first 1.2" is still highlighted. <sigh> The good news is I can think of a couple of easy solutions: the one I'm going with (unless anyone has a better suggestion) is a "subsequent paragraph same speaker" style which is simply indented 1.2" (i.e., no negative indent on the first line).


You could apply a character style which removes the highlight from the hanging indent. Assuming that you have tabbed to bypass the hanging indent, you could use Find and Replace to find all tab characters at the beginning of paragraphs, then apply the character style to all those tab characters at one time.
Back to top
View user's profile Send private message
escapee
General User
General User


Joined: 07 Mar 2007
Posts: 10

PostPosted: Thu Mar 08, 2007 11:15 am    Post subject: Reply with quote

BillP wrote:

You could apply a character style which removes the highlight from the hanging indent. Assuming that you have tabbed to bypass the hanging indent, you could use Find and Replace to find all tab characters at the beginning of paragraphs, then apply the character style to all those tab characters at one time.


Hmm...it's not immediately clear to me which of these options is more work in the long run. Think I'll play with both and find out. Thanks for your help!
Back to top
View user's profile Send private message
ftack
Moderator
Moderator


Joined: 27 Jan 2003
Posts: 3102
Location: Belgium

PostPosted: Fri Mar 09, 2007 4:33 am    Post subject: Reply with quote

In my opinion, the "subsequent paragraph same speaker" approach is the best. The good thing in Writer is that paragraph styles are hierarchic. It only needs to specify: first line indent:0. Any changes you later would want to make to the initial paragraph style (that one with the negative indent) will automatically propagate to the "subsequent paragraph same speaker" style.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group