Figures, Tables, and Sidebars

It is not necessary to have separate paragraph styles for the number of the figure, table, or box and the rest of the caption. In the XML, eXtyles will automatically separate the number from the rest of the caption paragraph, provided that the display item is referred to by a recognized name (e.g., Figure, Fig., Example, Illustration, Table, Box, Video, etc.) and a consistent character (e.g., period, colon) is used to separate the two parts (i.e., caption and label). Special allowance can be made for captions that span more than one paragraph.

In this section

Figures

The following figure caption and its associated variations (see also Figure Captions and Table Titles), styled with the FigureCaption paragraph style, will yield the subsequent XML:

<fig id="fig02" position="float" fig-type="figure">
<label>Figure 2</label><caption><p>Late Mississippian to early Permian paleogeographic evolution of the southern Inyo Mountains area. Rectangle denotes area of geologic map; range outlines are the same as on <xref ref-type="fig" rid="fig01">figure 1</xref>.</p>
<p>Dotted line is trace of Cenozoic Hunter Mountain Fault, on which 10 km of right-lateral displacement has been restored based on the interpretations of <xref ref-type="bibr" rid="r6">Burchfiel and others (1987)</xref>. See text for discussion of paleogeographic evolution.</p>
<p content-type="toc"><bold>Figure 2.</bold> Maps showing Late Mississippian to early Permian paleogeographic evolution of the southern Inyo Mountains area.</p></caption>
<long-desc>Figure 2. Maps showing Late Mississippian to early Permian paleogeographic evolution of the southern Inyo Mountains area, and any additional descriptions of the image for accessibility.</long-desc>
<graphic xlink:href="tac78-18_fig02"/>
</fig>

Figure Numbers and the <graphic> Element

In the XML eXtyles will generate a unique ID for each figure in the document, both numbered and unnumbered. It is important that this figure ID in the XML match exactly the file name of the image, which is external to the Word document, so that an automated InDesign layout system can pull in the correct image. As of April 2017, the figure naming conventions for USGS are as follows:

Numbered Figuretac17-1135_fig01
Unnumbered Figuretac17-1135_figa

where

taca three-letter PSC designation
17the last two digits of the current fiscal year
1135the last four digits of the estimate (job) number of the document
figa label indicating that the object is a figure
01the figure number, in this case, figure 1
athe letter added to identify unnumbered images; letters are added alphabetically, and then aa, bb, etc., is used for unnumbered figures 27, 28, and so on.

The three-letter PSC designations are as follows:

denDenver
lafLafayette
madMadison
menMenlo Park
pemPembroke
resReston
rolRolla
sacSacramento
tacTacoma
wtrWest Trenton

The <graphic> Tag

eXtyles will automatically generate unique figure IDs during XML export. The IDs will be placed in a <graphic> tag in the XML that looks like this:

<graphic xlink:href="tac17-1135_fig01"/>

This tag is then used to pull in and place the correct image during layout.

The information for how these IDs are constructed comes from different places in the document; specifically, the Document Information dialogue and the Word file. The prefix for the ID (tac17-1135) comes from the Object ID Prefix field in the Document Information dialogue (tac17-1135). The figure number (fig01) comes from the figure label in the caption in the Word document (e.g., Figure 1. Caption text).

Figure Caption Location in the Word File

Figure captions must be located just after the paragraph where each figure is first cited. If captions have been collected at the end of the document, they will need to be moved to the proper place within the document before you export to XML.

Similarly, in the case of unnumbered figures, the caption must be placed in the Word file just after the paragraph where the figure should appear in the PDF file or HTML page.

Tables

All tables, or content styled with the Table elements of the paragraph styles palette, must be in Word table format. Otherwise, export is likely to produce parsing errors. All content for each table should be in a single Word table. Splitting content for a single table across multiple Word tables will likely result in incorrect XML and may result in parsing errors.

Tables will be exported to XHTML format in the XML file. We recommend using the XHTML table model, because it has stronger support for borders and shading.

The more formatting you set correctly in Word, the more that formatting will be correctly reflected in the XML (cell alignment, column widths, cell borders, cell shading). Note that eXtyles supports the use of the decimal tab in Word tables, as well as left- and right-aligned and centered content.

Table Formatting Example

This relatively simple table has been set up with the following formatting options in Word:

  • column headings are centered
  • the contents of columns 1-4 are left aligned
  • column 5 is aligned on a decimal tab
  • column 6 is left aligned
  • row 2 has grey shading applied

Note that the cells in the top row carry the TableHead style, while the other rows are styled as TableBody.

Site

PID

Latitude (N)

Longitude (W)

Average error (m)

Survey methodology

Mad River

LV0346

40° 51' 54"

124° 09' 00"

0.002

Base Station

San Pablo

JT0321

38° 06' 26"

122° 17' 13"

0.03

RTK Network

Bolinas

BOLYBAY01*

37° 55' 50"

122° 41' 20"

0.001

Base Station

Morro

FV1099

35° 22' 02"

120° 50' 02"

0.01

Base Station

Pt. Mugu

EW6523

34° 07' 00"

119° 05' 08"

0.06

RTK Network

Newport

AD9435

33° 39' 52"

117° 52' 31"

0.01

RTK Network

Tijuana

B899

32° 35’ 38’’

117° 07’ 21’’

0.04

Base Station

This yields the following XML. Notice the attribute align="center" for the column heads and align="left" for the other columns. For the decimal-aligned content, the formatting is preserved with the attribute align="char". Shading is indicated with the rgb values, which are captured in the style attribute, style="background-color:rgb(174,170,170)".

<table-wrap id="t01" position="float">
<table rules="groups">
<col width="12.69%"/>
<col width="17.43%"/>
<col width="14.05%"/>
<col width="15.5%"/>
<col width="18.72%"/>
<col width="21.61%"/>
<thead>
<tr>
<td valign="top" align="center" scope="col" style="border-top: solid 0.50pt; border-bottom: solid 0.50pt">Site</td>
<td valign="top" align="center" scope="col" style="border-top: solid 0.50pt; border-bottom: solid 0.50pt">PID</td>
<td valign="top" align="center" scope="col" style="border-top: solid 0.50pt; border-bottom: solid 0.50pt">Latitude (N)</td>
<td valign="top" align="center" scope="col" style="border-top: solid 0.50pt; border-bottom: solid 0.50pt">Longitude (W)</td>
<td valign="top" align="center" scope="col" style="border-top: solid 0.50pt; border-bottom: solid 0.50pt">Average error (m)</td>
<td valign="top" align="center" scope="col" style="border-top: solid 0.50pt; border-bottom: solid 0.50pt">Survey methodology</td>
</tr>
</thead>
<tbody>
<tr>
<td valign="top" align="left" style="border-top: solid 0.50pt" scope="row">Mad River</td>
<td valign="top" align="left" style="border-top: solid 0.50pt">LV0346</td>
<td valign="top" align="left" style="border-top: solid 0.50pt">40° 51' 54"</td>
<td valign="top" align="left" style="border-top: solid 0.50pt">124° 09' 00"</td>
<td valign="top" align="char" char="." style="border-top: solid 0.50pt">0.002</td>
<td valign="top" align="left" style="border-top: solid 0.50pt">Base Station</td>
</tr>
<tr>
<td valign="top" align="left" style="background-color:rgb(174,170,170)" scope="row">San Pablo</td>
<td valign="top" align="left" style="background-color:rgb(174,170,170)">JT0321</td>
<td valign="top" align="left" style="background-color:rgb(174,170,170)">38° 06' 26"</td>
<td valign="top" align="left" style="background-color:rgb(174,170,170)">122° 17' 13"</td>
<td valign="top" align="char" char="." style="background-color:rgb(174,170,170)">0.03</td>
<td valign="top" align="left" style="background-color:rgb(174,170,170)">RTK Network</td>
</tr>
<tr>
<td valign="top" align="left" scope="row">Bolinas</td>
<td valign="top" align="left">BOLYBAY01*</td>
<td valign="top" align="left">37° 55' 50"</td>
<td valign="top" align="left">122° 41' 20"</td>
<td valign="top" align="char" char=".">0.001</td>
<td valign="top" align="left">Base Station</td>
</tr>
<tr>
<td valign="top" align="left" scope="row">Morro</td>
<td valign="top" align="left">FV1099</td>
<td valign="top" align="left">35° 22' 02"</td>
<td valign="top" align="left">120° 50' 02"</td>
<td valign="top" align="char" char=".">0.01</td>
<td valign="top" align="left">Base Station</td>
</tr>
<tr>
<td valign="top" align="left" scope="row">Pt. Mugu</td>
<td valign="top" align="left">EW6523</td>
<td valign="top" align="left">34° 07' 00"</td>
<td valign="top" align="left">119° 05' 08"</td>
<td valign="top" align="char" char=".">0.06</td>
<td valign="top" align="left">RTK Network</td>
</tr>
<tr>
<td valign="top" align="left" scope="row">Newport</td>
<td valign="top" align="left">AD9435</td>
<td valign="top" align="left">33° 39' 52"</td>
<td valign="top" align="left">117° 52' 31"</td>
<td valign="top" align="char" char=".">0.01</td>
<td valign="top" align="left">RTK Network</td>
</tr>
<tr>
<td valign="top" align="left" style="border-bottom: solid 0.50pt" scope="row">Tijuana</td>
<td valign="top" align="left" style="border-bottom: solid 0.50pt">B899</td>
<td valign="top" align="left" style="border-bottom: solid 0.50pt">32° 35’ 38’’</td>
<td valign="top" align="left" style="border-bottom: solid 0.50pt">117° 07’ 21’’</td>
<td valign="top" align="char" char="." style="border-bottom: solid 0.50pt">0.04</td>
<td valign="top" align="left" style="border-bottom: solid 0.50pt">Base Station</td>
</tr>
</tbody></table></table-wrap>

Table Locations in the Word File

Numbered tables can be located in the Word file either just after the paragraph where the table is first cited or collected at the end of the document (which may be useful placement for very large tables). Numbered tables that have been collected at the end of the document will be moved by the eXtyles export process to their proper place in the XML (immediately after the paragraph in which the table is first cited).

In the case of unnumbered and/or uncited tables, the table must be placed in the Word file just after the paragraph where it should appear in the PDF file or HTML page.

Note

If a numbered table is not cited in the text or has not been successfully color coded during eXtyles citation matching, the export process will not know where to place the table in the XML. Because of this, you may get a parsing error if you have placed a numbered table at the end of the Word document and have not correctly cited it in the body of the document.

Retaining Tables/Figures at the End of the Document

At times, it may be preferred to place long tables at the end of the document even though they are cited in the body. Because during XML export eXtyles will automatically move tables to the spot of their first citation (in the XML), an override will need to be used to prevent this default behavior. The cite_tbl_nomove character style can be used to ensure that tables that need to remain at the end of the document are not moved to where they are cited in the body.

This character style is not automatically applied by eXtyles Advanced Processes (such as Citation Matching), and so it will need to be hand-applied when necessary. To do this, simply open the Word style pane (not the eXtyles style palette), locate the cite_tbl_nomove character style, highlight the table citation in the text, and apply the style. The character style will need to be applied to every citation to the table, not just the first one.

There is also a cite_fig_nomove character style that can be used to achieve the same behavior for figures.

Sidebars

Sidebar content must be carefully styled in the Word document so that correct XML can be exported. Sidebar content can span one or more pages and can contains images, lists, display quotes, or other types of content. It can also be only a few paragraphs long and may include only a header and text paragraphs.

It is critical that the correct styles from the eXtyles palette be used to properly style sidebar content so that correct XML will be exported (see also the section USGS Styles). Because sidebars can contain a variety of content (e.g., lists, display quotes, headings), and to avoid cluttering the style palette with a library of sidebar-specific paragraph styles, eXtyles uses "begin" and "end" styles to mark the start and end of the sidebar. This allows you to use, with few exceptions, regular text paragraph styles within the sidebar and still get correct XML.

The following sample of sidebar text shows the proper use of styles. This sidebar includes a title, a first-level heading, body text, a numbered list, and a figure caption.

Note

Although USGS commonly refers to such content as Sidebars, the BITS DTD against which the XML is being validated during XML export uses the tag name <box>; thus, in the eXtyles workflow, the labels "box" and "sidebar" are effectively synonymous, which is also why you  may see both terms used in the Word paragraph styles. 


Note the use of the sidebar start and end paragraphs (i.e., Begin Feature Box 4 and End Feature Box 4), which are required so that eXtyles knows what content should be included in the sidebar. If the sidebar has a title, as this one does, the Sidebar Title paragraph style should be used. Likewise, if the sidebar has subheadings (in this example, the first-level head “Other Procyonids”) the Box Head styles on the Back tab of the eXtyles style palette should be used, and Sidebar Text should be used for the sidebar body.

All other content type should be styled with the same paragraph styles used to style the rest of the document. This sample yields the following XML.

Sidebar XML sample
<boxed-text id="b04">
<label>Box 4</label><caption><title>Other Hosts of Adult <italic>Baylisascaris procyonis</italic></title></caption>
<sec>
<title>Other Procyonids</title>
<p>As a group, members of the <bold>taxonomic</bold> family Procyonidae (procyonids) are relatively small, <bold>omnivorous</bold> mammals, including raccoons, coatis, <bold>ringtails, cacomistles</bold>, kinkajous, and olingos (<italic>A</italic>). </p>
<list id="L2" list-type="order">
<list-item><label>1</label>Like the raccoon, most other procyonids have distinct masklike facial markings and banded tails.</list-item>
<list-item><label>2</label><p>The primary definitive host of <italic>B. procyonis</italic> is the common raccoon.</p></list-item></list>
<p>The extent of cross infectivity of <italic>B. procyonis</italic> for other procyonids and the exact species involved in some cases of infection remain to be determined by molecular and other methods.</p>
<fig id="figa" position="float" fig-type="figure"><caption><p><italic>A</italic>. 1. Crab-eating raccoon (Photo by Steven G. Johnson), 2. Cozumel raccoon (Photo by Camazine).</p></caption><graphic xlink:href="ofr2015_figa"/></fig>
<p><bold>Patent</bold> intestinal infections with <italic>Baylisascaris</italic> sp. have been documented multiple times in kinkajous, one captured in Colombia, South America (<xref ref-type="bibr" rid="r-2-251">Overstreet, 1970</xref>).</p>
</sec>
</boxed-text>

Sidebar Locations in the Word File

Similar to tables and figures, if possible sidebar content should be placed in the Word document near where it is intended to be positioned in the PDF or HTML. This will ensure that is correctly placed during layout.

However, some sidebar content can be several pages long, and it would be disruptive to place it in the body of the document. These long sidebars can be collected at the end of the Word document to avoid such disruption of the narrative. However, if sidebars are collected at the end of the document the following steps must be followed, in order, to ensure proper XML export.

1. Placement instructions must be added to the body, indicating where the sidebar, or sidebars, should be placed during layout (see also the section USGS Styles).

For this instruction, use the paragraph style Sidebar Layout Instruction from the Body tab of the eXtyles style palette, as in the following example:

2. Sidebars must be numbered so that eXtyles can identify where to place the content in the XML (see the section “Sidebar Numbering” for more detailed information).

3. Citation Matching must be run and all warnings addressed before XML export. Successful citation matching will result in the lavendar-shaded cite_box character style being applied to the Sidebar Layout Instruction for each sidebar, as shown in step 1.

Sidebar Numbering

Sidebar Layout Instructions indicate the correct placement of sidebars that are positioned at the end of the Word document for ease of editing. In the XML that eXtyles generates, the sidebar content will be moved from the end of the document to its correct position based on the layout instructions. But during XML export, how does eXtyles know where to place the sidebar and where to place specific sidebars if there are more than one in a document?

In these cases, eXtyles will rely on the links that are generated during Citation Matching, and Citation Matching can only generate links if there is a matching numbered label in both the layout instruction and the sidebar title. For example:

Then, during XML export, eXtyles will move the sidebar content to the spot in the body indicated by the layout instruction.

Unnumbered Sidebars

Sidebars placed at the end of the Word document in this way must have an associated number and label to produce correct XML. So, how should sidebars that are not numbered (i.e., just the title will appear in the PDF) be formatted in the Word document? Two options exist for unnumbered sidebars:

1. Assign a temporary number to the sidebars that are placed at the end of the Word document to facilitate Citation Matching and proper placement of the sidebar during XML export.

2. Place the sidebars in the body of the Word document near where they should appear in the PDF.

Option 1 is recommended if the document contains numerous long sidebars that would be disruptive to include in the body. In this scenario, however, the temporary number would be present in the XML; for example,

<boxed-text id="b04">
<label>Box 4</label><caption><title>Other Hosts of Adult <italic>Baylisascaris procyonis</italic></title></caption>
<sec>
<title>Other Procyonids</title>
<p>As a group, members of the…</p>
</sec>
</boxed-text>

The “Box 4” label content can then be manually removed from the PDF.

Option 2 is recommended if the sidebars are short and can easily be placed in the document body without being disruptive. In that case, no numbering is required, and the XML would look like this:

<boxed-text id="bd">
<caption><title>Other Hosts of Adult <italic>Baylisascaris procyonis</italic></title></caption>
<sec>
<title>Other Procyonids</title>
<p>As a group, members of the…</p>
</sec>
</boxed-text>