When you import Word RTF files the styles used in the file are retained and automatically added to your project styles, which you can access and edit in
The situation is different when you import formatted text from other sources like CHM or HTML files. Then the formatting is retained but the text does not have any styles. Effectively, it is all manually formatted. You can use the Replace Styles function to integrate this formatting into the stylesheet of your project, either by applying existing styles or by creating new styles and applying them.
This topic illustrates this by walking you through the steps of a typical example. For details on how to perform the individual operations see the topics in this chapter on replacing font and paragraph styles and formatting.
Tip: Converting imported HTML formatting with Premium Pack Toolbox
Provided style classes were used in the original HTML you can globally strip out inline formatting imported from HTML and convert it to style references with the powerful Toolbox utility included in the Premium Pack style pack. See Integrating imported formatting with Toolbox for details.
Example: Applying the Normal style to imported body text
Let's assume that you want to apply the Normal style to all your imported unstyled body text. At the same time you also want to apply named styles to inline-formatted text within your body text, some of which has different font settings to that of the body text (for example menu names and other items formatted with different fonts etc).
If you want to use the style of the imported text in your project you first need to use formatting from your imported text as a model to update your project's style definitions.
1.Update the Normal style on the basis of the imported text.
Click in a plain area of the imported body text and select Styles> Create Style from Selection in the tab. Then select Change existing style, select Normal in the style list and activate Assign paragraph attributes.
2.Update or create text styles for additional formatting.
If special formatting is used for text within other paragraphs click in examples of this formatting in your imported text. Then use Styles> Create Style from Selection in the tab to update or create a new text styles for this formatting. Repeat for all different formatting types used within paragraphs.
See Defining styles for more details on using the Create Style from Selection function.
|
Next you want to apply the modified Normal font style attributes to the text of the body paragraphs in your imported text.
Click on the individual steps below to display more detailed instructions.
1.Select multiple topics if you want to replace only in some topics
If you only want to replace styles in specific topics select those topics in the Project Explorer first, using Shift+Click or Ctrl+Click. Select the topic containing the example of the style you want to replace last, so that you can select the style example in the next step.
|
2.Select an example of the body text in the editor, then select Replace Styles and Font mode
Click inside some text formatted with the style you want to replace, then select Styles > Replace Styles in the tab. Then select the Font Styles mode at the top of the dialog that appears.
|
3.In the left column, set the Font Style Name to (Unstyled text only)
Set Font Style Name in the left column to (Unstyled text only) and leave all other attributes unchanged. This will find all text with the attributes of the current paragraph and will make sure that any paragraphs in your project that already have named styles remain unaffected.
|
4.Select Normal in the right column
Select Normal in the drop-down list directly below the Change to Format/Style: heading on the right. This will apply the Normal style to all matching text.
|
5.Leave the inline formatting settings unchanged
The exact settings in the left column will only match the unchanged body text, so any text within paragraphs with different formatting will be ignored. This makes the Inline Formatting: options irrelevant – you can leave the default setting of Remove inline formatting as it is.
|
6.Click on Replace Styles to execute
A dialog will be displayed allowing you to choose where you want to replace: In the entire project, the main topics, the invisible topics or selected topics only. You can also perform a test run to check how many styles would be found and replaced before actually applying the changes.
Note that any changes in the current topic will only be visible in the editor after you close the dialog.
|
|
Now you want to apply the text styles created in step 1 to the differently formatted sub-texts within the body text. This must be repeated for each sub-text type.
Click on the individual steps below to display more detailed instructions.
1.Select multiple topics if you want to replace only in some topics
If you only want to replace styles in specific topics select those topics in the Project Explorer first, using Shift+Click or Ctrl+Click. Select the topic containing the example of the style you want to replace last, so that you can select the style example in the next step.
|
2.Click in an example of the sub-text in the editor, then select Replace Styles and Font mode
Click inside one of the formatted texts that you want to style, then select Styles > Replace Styles in the tab. Then select the Font Styles mode at the top of the dialog that appears.
|
3.Select (Unstyled text only) or (Any text) in the left column
If you know that none of the sub-texts have styles applied to them select (Unstyled text only), otherwise select (Any text) to make sure that you find all of them.
|
4.Select the target style in the right column and execute
In the right column select the appropriate text style in the Change to Format/Style list and then click on Replace Styles to replace all the styles.
|
Repeat the above procedure for every text style in your project.
|
Finally, you also want to apply the paragraph attributes of the Normal style to your imported body text so that it is fully integrated in your stylesheet.
Click on the individual steps below to display more detailed instructions.
1.Select multiple topics if you want to replace only in some topics
If you only want to replace styles in specific topics select those topics in the Project Explorer first, using Shift+Click or Ctrl+Click. Select the topic containing the example of the style you want to replace last, so that you can select the style example in the next step.
|
2.Click in a body paragraph editor, then select Replace Styles and Paragraph mode
Click in one of your body text paragraphs, then select Styles > Replace Styles in the tab. Then select the Paragraph Styles mode at the top of the dialog that appears.
|
3.Select (Unstyled text only) for the Para Style Name
If a style name is displayed in the Para Style Name: field in the left column change it to (Unstyled text only). This will ensure that only paragraphs that do not yet have styles applied to them will be found. This will reduce the possibility of errors and will protect any styled paragraphs in your project with the same settings. Leave all other settings in the left column unchanged!
|
4.Select Normal in the right column
Select the Normal style in the Change to Format/Style column. Leave all other settings in this column unchanged. The inline formatting settings are irrelevant because you are performing an exact search.
|
5.Click on Replace Styles to execute
A dialog will be displayed allowing you to choose where you want to replace: In the entire project, the main topics, the invisible topics or selected topics only. You can also perform a test run to check how many styles would be found and replaced before actually applying the changes.
Note that any changes in the current topic will only be visible in the editor after you close the Replace Styles dialog.
|
|
See also:
Importing Data
Text Formatting and Styles
Dynamic Styles