White Space Cleanup: Excluding Paragraphs in a Specified Font

In some documents, you might wish to run white space–related Cleanup features but exclude certain paragraphs from this type of cleanup. For instance, programming code often has intentional blank lines and intentional leading spaces on lines within it that should not be removed during Cleanup, although the rest of the document should have no blank lines. The same is true for verse and poetry, in which white space is often intentional and should be retained.

So that users don’t have to forgo use of the white space Cleanup features entirely, eXtyles allows users to specify that paragraphs in a specified font should not be affected by some of the white space–related Cleanup options. That is, you can set computer code in Courier and specify that paragraphs in Courier should not be affected by white space Cleanup operations; you can set verse in a font such as Garamond and specify that paragraphs in Garamond should not be affected by white space Cleanup operations.

To exclude or not to exclude:

The ability to exclude paragraphs from white space–related Cleanup features is optional. You may still run all Cleanup features on all paragraphs in your documents if you prefer, by leaving the Exclude Text in Font checkbox unchecked.

How to use White Space (font-sensitive) Cleanup

The following subset of white space Cleanup options may (optionally) be set to not run on paragraphs in a specified font:

  • Convert Tabs to Spaces
  • Remove Multiple Spaces
  • Remove Start and End Paragraph Spaces
  • Remove Blank Paragraphs

To use this feature, first check your document for elements that eXtyles should skip when performing these Cleanup options. After Activation, eXtyles will automatically protect paragraphs that are in a constant-width font or that are correctly tagged with a paragraph style that is set in a constant-width font. You should check any verse/poetry paragraphs to make sure they’re in a font that isn’t used elsewhere in the document and apply such a font if necessary.

In addition, the paragraphs in question must be entirely in the excluded font: paragraphs in a mix of fonts will not be excluded from these Cleanup operations. For instance, if you have programming code paragraphs that contain both Courier and Courier New, select the whole code block and change the font to one of these fonts and then specify that font as the excluded font in the Cleanup dialog. Similarly, set the font of any verse or poetry sections that should not be affected by these options to a font that doesn’t appear elsewhere in the document, and then specify the chosen font as the excluded font in the Cleanup dialog.

eXtyles will then not apply the white space–related Cleanup functions to paragraphs in the specified font, which means that tabs, extra spaces, leading and trailing spaces, and blank paragraphs will be retained for paragraphs that are in the specified font.

When you use the new feature and exclude paragraphs in the specified font, the Cleanup features Normalize Document and Auto-Style will also automatically skip paragraphs in the specified font, so that code or verse or otherwise protected paragraphs will not be tagged with your base paragraph style.

Monospace fonts

Authors sometimes apply a code (monospace) font instead of using a monospaced paragraph style. eXtyles protects these paragraphs from white space Cleanup as well.

During Activation, eXtyles checks the document for paragraphs that are in a monospace font but not a monospace-font paragraph style. eXtyles then applies a monospace-font paragraph style (HTML Preformatted) to exclude these paragraphs from the subset of white space operations during Cleanup. The HTML Preformatted paragraphs can then be styled as usual during the Style Paragraphs stage.

© 2021 Atypon Systems. All Rights Reserved.

Icons made by Freepik from Flaticon are licensed under CC 3.0 BY