Figures/Graphics/Media

JATS provides several elements related to the still graphic images and the multimedia objects contained within an article. These elements do not contain the image or object; they point to an external file that contains the image or object. The primary ones are:
  • Graphic, Inline (<inline-graphic>) — inline still images such as logos,
  • Graphic (<graphic>) — block-level still images such as drawings and photographs,
  • Media, Inline (<inline-media>) — inline moving images, sound files (such as pronunciation files), and other media that cannot be represented in print, and
  • Media (<media>) — block-level moving images, sound files, and other media that cannot be represented in print.
Inline Graphic
The simplest graphic object is the <inline-graphic>, which is used when the image should appear inline with surrounding text. Inline graphics may contain no labels, titles, or captions. A typical inline graphic is an empty element (except for Accessibility elements), using an attribute to point to a logo or to a special math or chemistry symbol that is used inside a paragraph or a title. (Best Practice: If the image represents a special private character, the <private-char> element should be used instead of <inline-graphic>.)
Graphic
Still images that do not appear inline are tagged with the <graphic> element, often inside a figure (<fig>), which holds associated information such as a figure number, title, caption, etc. (see below). When an image in an article has no associated information (title, figure number, etc.), a <graphic> element should not be embedded in a <fig> element.
Most <graphic> elements are empty (except for Accessibility elements), used only to point to the external file. A <graphic> element may contain a <label> or <caption>, but <graphic> elements that are block-level objects in the text rather than inside a larger object such as a figure rarely do. When a <graphic> is within a figure (<fig>), the associated <label> or <caption> is typically within the <fig>, not within the <graphic>. A <label> within a <graphic> is typically used only when a single figure (<fig><label>Fig 4.</label>...</fig>) contains 3 or 4 graphics, each with a separate label such as:
    ...<graphic ...><label>Part A</label>...</graphic>...
or
    ...<graphic ...><label>Part B</label>...</graphic>...
Accessibility: A <graphic> that is not inside a <fig> or <table-wrap> should contain several sub-elements, including <alt-text> and <long-desc>, which are especially important to enable access for visually impaired users. For graphics inside another element (such as a <fig>), the containing element typically holds the accessibility information, although in rare cases the accessibility elements may need to be in both places.
Media
Objects such as an MP3 sound clip accompanying an article are tagged with the <media> element, typically inside a figure (<fig>), which holds associated information such as a figure number, title, caption, etc. (see below). When a media object in an article has no associated information (title, figure number, etc.), a <media> element should be not be embedded in a <fig> element.
Accessibility: A <media> object that is not inside a <fig> or <table-wrap> should contain several sub-elements, including <alt-text> and <long-desc>, which are especially important to enable access for visually impaired users. For objects inside another element (such as a <fig>), the containing element typically holds the accessibility information, although in rare cases the accessibility elements may need to be in both places.
Figures and Figure Groups
JATS also contains two elements typically used for associating a graphic or media object with related information (such as a caption, label, title, or credits and other attribution) or with other graphic, media, or textual objects.
  • Figure (<fig>) — typically, a labeled wrapper for images and media and their metadata
  • Figure Group (<fig-group>) — A grouping of several <fig> elements
Inside a figure (<fig>), the most commonly occurring related information is a figure number (<label>) and a caption (<caption>). Some publishers consider the display of a figure number definitive for deciding when to use a <fig> element; others depend more on whether the image ought to be listed in a List of Figures. Usually the two criteria match up, but there may be exceptions where numbered figures do not appear in the list, or vice versa.
Like tables, figures typically contain titles and captions. In JATS, the <title> element is included inside the <caption> element. A <caption> may contain many kinds of text associated with its figure, typically a <title> (which acts as a heading for the figure) and one or more descriptive paragraphs (<p>). Previous versions of this Tag Library put any legend inside the <caption>, tagged as a list within a <p>. The element <legend> now follows the <caption> inside the <fig>.
Figures do not always contain pictures. While many <fig> elements contain graphic objects (<graphic> or <media>), a <fig> element may also contain a variety of display and textual objects, such as formulas, chemical structures, poetry, tables, bulleted or numbered lists, simple paragraphs, definition lists, or a mixture of any of these items as well as one or more graphic objects.
A Figure Group element (<fig-group>) contains one or more Figure elements (<fig>), placed in one container for editorial or production convenience. Specifically, a <fig-group> contains two or more labeled, possibly captioned <fig> elements that form a logical group, perhaps with an overall <label>, <caption>, or other information on the <fig-group> element that applies to all of the figures inside it.
Multi-language Figures
JATS provides several ways to assist users who wish to tag the same figure in more than one language. The techniques are the same whether the whole article is in multiple languages or the article is mono-lingual with figures in multiple languages.
  • Multi-lingual Attributes — The figure can be repeated, once for each language, using the attribute @xml:lang on each figure to name the language and the multi-lingual attributes to provide additional language metadata. For example, the @lang-group attribute can associate the same-content figures into one language group, each figure representing the figure in a different language. This is probably the technique of choice in a multi-language article.
  • Block Alternatives — The figure can be repeated, once for each language, inside a <block-alternatives> element. This is probably the technique of choice in an article that is basically mono-lingual, but contains figures repeated in several languages (for example, a Korean article with English and Korean tables or a Spanish article with tables in Spanish, English, and Portuguese.)
  • While it is not recommended, publishers do produce JATS figures in which only the <label> and <caption> elements within a single figure repeat, once for each language. JATS tagging allows for this multi-lingual mechanism.
Spanish and English Figure Using Multi-lingual Attributes
This example shows two same-content figures differing only in language: one figure is the original (in Spanish) and one figure is a translation (in English). The figure element has been repeated, placed into an attribute-named language group using the @lang-group attribute. One variant has been marked as the original and the other as a translation using the @lang-variant attribute. One variant has been marked as primary and the other as secondary using the @lang-focus attribute. The figures need not be co-located in the article, and may be presented in any order.
...
<fig id="f0001" lang-group="f0001"
  position="float" fig-type="scatter-graph" 
  xml:lang="en" lang-variant="translation" 
  lang-source="translator" lang-focus="secondary">
 <label>Figure 1.</label>
 <caption><p>Evolution of the repetition rate in all sequences</p></caption>
 <graphic xlink:href="RIYA_A_1889289_F0001_OC-en.jpg" 
    content-type="color" specific-use="web-only"/>
</fig>

<fig id="f0005" lang-group="f0001"  
  position="float" fig-type="scatter-graph" 
  xml:lang="es" lang-variant="original" 
  lang-source="author" lang-focus="primary">
 <label>Figura 1.</label>
 <caption><p>Evolución de la tasa de repetición en  
  todas las secuencias</p></caption>
  <graphic xlink:href="RIYA_A_1889289_F0005_OC-es.jpg" 
    content-type="color" specific-use="web-only"/> 
</fig>
...
Block Alternatives
The major use for <block-alternatives> is typically a figure provided in multiple languages. The element <block-alternatives> element holds two or more versions of the same figure, each in a different language. The <fig> content (graphic, list, whatever) could be the same, differing only in external structures such as labels and captions, etc. Or the entire narrative or graphic content of the figure may be in a different language. The appropriate figure can be chosen at display or production time, based on language attributes or other criteria.
  <block-alternatives>
  <fig xml:lang="es">...</table-wrap>
  <fig xml:lang="en">...</table-wrap>
  <fig xml:lang="de">...</table-wrap>
</block-alternatives>
Another typical <block-alternatives> use is multiple language versions of a figure that are used for different purposes. For example, an article in a printed journal contains a figure in Portuguese, and for the same article presented online, the figure is shown in English (identical figures). The equivalent Portuguese and English figures are placed into the same <block-alternatives> element, with the attribute @xml:lang providing the language of the figure and the @specific-use attribute indicating the print or online usage.
Comparison to Figure Group: The element <fig-group> is defined as a collection of related figures, rather than as multiples of the same figure. A group of logically identical but differently marked-up figures is not a figure group, but it can be enclosed in a <block-alternatives> element. A figure group containing 6 figures counts as 6 figures; a <block-alternatives> element containing 6 figures would count as a single figure, with 6 processing alternatives.
Comparison to Alternatives: A group of processing alternatives inside a single figure does not use <block-alternatives>. The element <alternatives> holds different processing versions of the contents of a figure (like three graphics in different resolutions), inside a single <fig> element. The element <block-alternatives> holds multiple processing versions of a complete figure (multiple <fig> elements), each different in some aspect.
Multiple Labels and Captions inside One Figure
While it is not considered best practice, multiple <label> and <caption> elements in different languages can be placed within a single figure (<fig>). Typically, there is one label and caption for each language, differentiated by @xml:lang attributes:
<fig>
  <label xml:lang="pt">...</label>
  <label xml:lang="en">...</label>

  <caption xml:lang="pt"><title>...</title></caption>
  <caption xml:lang="en"><title>...</title></caption>

  <graphic id="graphicid" xlink:href="..."/>
</fig>
Processing Implications: To associate the related language caption and label more closely, for example, to place them on the same line for display, a processing system would need to match on the @xml:lang attributes (or other selectors as needed).
Positioning Graphic Objects
In common with other block-level display objects, figures, graphics, and media objects may take the @position attribute, which is used to indicate where the object should be displayed. The values for this attribute are slightly overloaded, as two values indicate the position of the object (such as a graphic) in relation to the text:
anchor
Object should appear exactly where it is found in the narrative flow.
float
Object should appear near its position in the narrative flow, but it may float to the top of a page or column, or into another window.
and two indicate the relationship between the object (such as a graphic) and the page:
background
Object, typically a decorative graphic, should appear behind the narrative. This does not displace the narrative; ideally, both the graphic and the narrative are visible, and the narrative is legible through the graphic. Accessibility: Best practice is to mark all purely decorative graphics with an empty @alt attribute, so that screen readers and other accessibility devices know that they may be ignored.
margin
Object should appear beside the text that contains it in the narrative flow, as though it were in the margin of a printed page. Accessibility: Best practice is to mark all purely decorative graphics with an empty @alt attribute, so that screen readers and other accessibility devices know that they may be ignored.
Figure and Graphic Examples
Here is a typical figure with a label, caption, and graphic inside. As is usually the case, the <graphic> element is empty (except for Accessibility elements), only used to point to the external file.
...
<fig id="fg-012">
 <label>Figure 12.</label>
 <caption>
  <title>My Dog</title>
  <p>He is so sweet! This is his best pose.</p>
 </caption>
 <graphic xlink:href="frontView.png">
  <alt-text>Small spotted dog face, nose forward</alt-text> 
 </graphic>
</fig>
...
Here is a figure that contains no graphics at all, but encloses some bulleted items in a <list>. Note: The prefix word attribute has been used in the example below to generate a more complicated label; each label will have the prefix “Pet” to display as “Pet 1. Poodle”, “Pet 2. Persian Cat”, etc.
<fig id="fg-012">
 <label>Figure 3.</label>
 <caption><title>Pet Show and Tell Order</title></caption>
 <list list-type="order" prefix-word="Pet ">
  <list-item><label>1.</label><p>Poodle</p></list-item>
  <list-item><label>2.</label><p>Persian Cat</p></list-item>
  <list-item><label>3.</label><p>Weaver Finches</p></list-item>
  <list-item><label>4.</label><p>Gecko</p></list-item>
 </list>
</fig>
Here is a figure with three graphics inside. The <fig> element also contains a <label> and <title> that apply to all the graphics. In this example, the <graphic> elements are not empty; each <graphic> has its own <label>, <caption>, and Accessibility <alt-text>.
...
<fig id="fg-012">
 <label>Figure 12.</label>
 <caption><title>Three Perspectives on My Dog</title></caption>
 <graphic xlink:href="frontView.png">
  <label>a.</label>
  <caption><p>View A: From the Front, Laughing</p></caption>
  <alt-text>golden retriever, face forward, lips lifted at corners</alt-text>
 </graphic>
    
 <graphic xlink:href="sideView.png">
  <label>b.</label>
  <caption><p>View B: From the Side, Best Profile</p></caption>
  <alt-text>golden retriever, view of right side</alt-text>
 </graphic>
    
 <graphic xlink:href="motionView.png">
  <label>c.</label>
  <caption><p>View C: In Motion, A Blur on Feet</p></caption>
  <alt-text>blurry image of running dog from the side</alt-text>
 </graphic>
</fig>
...
Here is a figure group, with three figures inside, each of which contains a graphic. The <fig-group> element also contains a <label> and a <title> that apply to all the <fig> elements in the group. Each figure also has its own <label> and descriptive <caption>.
...
<fig-group id="dogpix4">
 <label>Figures 12-14 Bonnie Lassie</label>
 <caption><title>Three perspectives on My Dog</title></caption>

 <fig id="fg-12">
  <label>a.</label>
  <caption><p>View A: From the Front, Laughing</p></caption>
  <graphic xlink:href="frontView.png">
   <alt-text>golden retriever, face forward, lips lifted at corners</alt-text>
  </graphic>
 </fig>

 <fig id="fg-13">
  <label>b.</label>
  <caption><p>View B: From the Side, Best Profile</p></caption>
  <graphic xlink:href="sideView.png">
    <alt-text>golden retriever, view of right side</alt-text>
  </graphic>
 </fig>

 <fig id="fg-14">
  <label>c.</label>
  <caption><p>View C: In Motion, A Blur on Feet</p></caption>
  <graphic xlink:href="motionView.png">
    <alt-text>blurry image of running dog from the side</alt-text>
  </graphic>
 </fig>
</fig-group>
...
Associating Data with a Figure or Table
In the years since JATS was developed, it has become more important to enable the reader to see the data behind a figure or table. For example, a figure containing a graphic of a pie chart might point to the numerical data visually summarized by the chart.
In JATS, best practice is to use an internal cross-reference (<xref>) to point to the data, if the data resides in the article, or (more typically) to make an external connection using one or more <ext-link> elements within the figure or table tagging. The data behind an object may be integral or supplementary.
The <ext-link> element may be used directly within:
Supplementary Display Objects
Supplementary material is content added to an article to add detail, background, or context by providing, for example, optional multimedia objects such as audio clips and applets; additional XML-tagged sections, tables, or figures that expand on the article; raw data in a spreadsheet; or a software application in a repository. Supplementary material is considered as ancillary to the article rather than integral to the article. The definition of “supplementary material” is both subjective and publisher-dependent. JATS is agnostic on how such material should be supplied to the user, rendered, labeled, or counted.
Supplementary material should be tagged as regular JATS content is tagged and identified (by the @supplemental attribute) as being supplementary. Other than the @supplemental attribute, there is no distinction between the content of a supplementary object and an integral object.
  • If a supplemental structure can be tagged as a JATS element, it should be tagged as one, with the attribute @supplemental set to "yes". For example, if the supplemental object is a figure, it should be tagged as a JATS <fig> element (<fig supplemental="yes" ...>).
  • If a link in the text of an article points to an external supplementary object, such as a video or a .jpeg image, the link should be tagged using a <graphic> or <media> element, with the attribute @supplemental set to "yes". For example, if the supplemental object is a still image, it should be tagged as a <graphic> element (<graphic supplemental="yes" .../>).
Note: An object that cannot be fully represented in print or static HTML page (such as a movie, sound file, or animation) should not automatically be considered supplemental. If the object is necessary for understanding the article (in other words, the object is “integral” to the article, it should be tagged at the appropriate location in the text using one of the <graphic>, <media>, or <ext-link> elements, without a @supplemental attribute.
Context for Graphics and Media
Several other block-level elements may contain graphic objects, for example, see <boxed-text> and <disp-formula>. For specifics, see the Context Table for where the specific graphic/media objects (<graphic>, <inline-graphic>, <media>, and <inline-media>) may be used.
Accessibility Related Resources
For information on providing Accessibility information for figures, graphics, and media, see Accessibility