[Date Prev][Date Next] [Thread Prev][Thread Next]
[Date Index] [Thread Index] [New search]

RE: Removing Character styles (can some MIF gurus please confirm my response?)



*** The original message appeared on the FrameUsers mailing list.
*** This reply is copied only to the framers@omsys.com mailing list.
*** If this information was useful, consider copying it to FrameUsers.

> > From: Smith, Derek [mailto:DSmith@NRCan.gc.ca]
> > Is there a way to remove all of one particular character 
> > style from your document all at once and leave any others.
> 
> From: Adrian Morse
>
> Method 2. This is less complicated than it looks [...]
> i) Make a MIF file from the FM doc. 
> ii) Find all text tagged with the unwanted character tag and remove
> it (as described below). This will effectively set all occurrences
> back to the default font.
> iii) Open the MIF in FM. Delete the style from the character tag
> catalog.

Step iii) is not necessary if you delete the "<Font" block also
from the character catalog part in the MIF file (see below).
 
> So you should be able to do a Find/Replace for all instances 
> of the tag as follows:
> Find:
>    <Font 
>     <FTag `BoldTag'>
>     <FLocked No>
>    > # end of Font
> 
> (Of course BoldTag would be the tag you wanna get rid of)
> 
> Replace: with nothing.

If you find and replace the entire "<Font" block corresponding
to your tag, you'll effectively remove the tag from the catalog,
as well as any overrides (if that's what you want).
Beware of overrides: if you apply a tag "Bold" to a word and
then a tag "Italic", only one tag name will be stored, with the
other character formatting stored as an override to this tag.
You'll have to consider how to handle such overrides.

> You have to use a Find/Replace tool that can accept paragraph 
> marks. You also have to type in the exact number of spaces at
> the start of each line.

No, white space is not important in MIF. You can indent the
lines any way you want; it's just a readability issue.

> I used Word [...]

Don't :-)
The best way is to use a dedicated text-processing tool/language
like Perl or a UNIX shell with sed/awk. This can be automated
as batch runs without manual intervention.
Of course, a FrameScript may be easier to create in Windows.

> I can't say for sure that removing these lines
> is okay in all circumstances but there are plenty of MIF-aware people
> out there who can either confirm this is possible or will shriek in
> horror and tell us not to play with MIF files unless we know 
> what we're doing.

You're right on both accounts: it will work, and don't play with MIF
:-)

- - - - - - - - - - - - - - - - - - - - - -
Thomas Michanek, FrameMaker/UNIX/MIF expert
mailto:Thomas.Michanek@iar.se     (Sweden)
http://w1.133.telia.com/~u13304072/framers
- - - - - - - - - - - - - - - - - - - - - -
Join the low-volume "Free Framers" mailing list: send an email
to majordomo@omsys.com with "subscribe framers" in the body

** To unsubscribe, send a message to majordomo@omsys.com **
** with "unsubscribe framers" (no quotes) in the body.   **