Reply to topic  [ 3 posts ] 
Swapping italics and normal 
Author Message

Joined: 2010-11-07 22:45:46
Posts: 7
I have a style in italics where I emphasize using normal type. Now I would like to try out moving to normal, and therefore use italics for emphasis. Italics to normal, normal to italics.

Is there a way to do this automatically? Otherwise I need to go through a 400 page document by hand.


2015-08-22 23:07:39
Profile

Joined: 2014-02-08 12:57:03
Posts: 170
Location: Australia
G’day, Purpendicular et al

There is almost always a way to do things automatically. Here is one approach to your problem. Make sure you work on a duplicate of your document, in case of mishap.

I assume that your current style (which I shall refer to as “CurrentStyle”) applies to both italicized and non-italicized (emphasized) text. That is, by default, application of the style italicizes text, and you have simply changed italicized (styled) text to non-italicized (but still styled) text to indicate emphasis.

First create a new set of styles:–

MyStyle: your base style
MyStyle Normal: based on MyStyle but with text italicized
MyStyle Emphasis: based on MyStyle but with text non-italicized (your current “normal”)
MyStyle Temporary: based on MyStyle

Next, Find All occurrences of text in your document having the style CurrentStyle.

[In case anyone is not sure how to do this, insert “.+” (without the quotes) in the “Find what:” field of the PowerFind Pro Find/Replace dialog box. Select All, apply your style (from the Format menu — Character Style or Paragraph Style, as appropriate) and ensure the “Attribute Sensitive” checkbox is ticked. Then Find All.]

Now de-italicize the “.+” in the Find/Replace dialog box, choose “In Selection” from the “Where:” drop-down menu and Find All. This should find all occurrences of emphasized text amongst your currently styled text.

Apply the style MyStyle Emphasis to the selection.

Go back to the Find/Replace dialog box, re-italicize the “.+”, choose “Entire File” from the “Where:” drop-down menu and Find All. This will find all occurrences of non-emphasized text amongst your currently styled text.

Apply the style MyStyle Normal to the selection.

You now want to toggle between the MyStyle Normal and MyStyle Emphasis styles. But you cannot just change all your MyStyle Normal text to MyStyle Emphasis text because then you will no longer be able to distinguish what was previously MyStyle Emphasis text in order to convert it to MyStyle Normal text. Gottit? Hence the need for an intermediary style, MyStyle Temporary.

So you would Find All text with the style MyStyle Normal and apply the style MyStyle Temporary to it. Then Find All text with the style MyStyle Emphasis and apply the style MyStyle Normal to it. Finally, Find All text with the style MyStyle Temporary and apply the style MyStyle Emphasis to it.

If the steps in the previous paragraph were put into a macro, each run of it would toggle the styles, as desired.

_________________
MacBook Pro (mid-2014)
macOS Sierra 10.12.6
Nisus Writer user since 1996


2015-08-23 02:05:59
Profile

Joined: 2010-11-07 22:45:46
Posts: 7
Thanks, I will try this out!

I would suggest that this was turned into a feature of Nisus. One can never know if a publisher wants italics or not for quotes. And I don't have a publisher yet for this work.


2015-08-23 03:38:39
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 7 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software