sam QC

Check the following to confirm the quality of a .sam file:

Order (general)

Pay special attention to boxes, captions, images, and tables.

Page IDs

When a decorative image or logo appears at the top of a page, as often happens on copyright pages, the page id (e.g., <page id="piv"/>) should be placed immediately after the opening tag of the image’s paragraph.

If an image occurred at the top of a printed page but now occurs after the paragraph it interrupted, the page ID should be placed with the paragraph content, and the page locator with the image.


In addition to having all images included, check that no extra images have been added.

For best placement, images should follow their first in-text reference without interrupting other text elements that should be kept together.

If a logo image is part of the title page, compose it as bkpub (or bkpub1, if necessary) rather than fig.

If a logo image is part of the copyright page, compose it as crtf (or a different crt style, if necessary) rather than fig.

Special Characters

Review the stats in the Digital Hub to obtain a list of special characters.

Check the file for combining Unicode characters. There should be no combining Unicode, and ligatures should be converted to the corresponding individual letters.

If necessary, find special characters locally and run the following Find All search, then copy and paste the selected characters into a new document. Permute the file to sort by unique characters, removing duplicates.

TOC Page Numbers


If proceeding to an ePub, delete unnecessary tabs, such as those preceding list numbers. Replace necessary tabs with a single space or, in some special cases, a series of nonbreaking spaces.

Tabs can remain if proceeding to a Word document.

Note Counts

For endnotes: The en, ennum, and enref counts should match.

For footnotes: The fn, fnnum, and fnref counts should match.

“Continued” Lines

For “continued” index entries the page IDs should be retained and paragraphs recombined.

For “continued” table entries, all page IDs should be retained, duplicate table heads and table column heads removed, and content recombined into a single table.

Tag Cleanup

Examples: <p/> and <i></i>


Usually, there should not be a space after an opening tag or before a closing tag.

The search is not exhaustive. In order to exclude ellipses, it skips any nonbreaking space next to a period.

There should be none.


If necessary, the following expression can be used to replace en dashes or em dashes with hyphens: \1-\3-\5-\7-\9


The following search is inclusive and might find some abbreviations or file names in addition to URLs.

Examples: em dashes, en dashes, or spaces.

Validating the File

A .sam file can be validated locally or by uploading to the Digital Hub.