[jats-list] inline code vs monospace in JATS

Subject: [jats-list] inline code vs monospace in JATS
From: "Castedo Ellerman castedo@xxxxxxxxxxx" <jats-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 4 Sep 2025 14:36:26 -0000
Good day JATS party,

Is there existing practice for a JATS element/attribute that makes a distinction in an inline context for the distinction made in a block context by JATS <preformat> vs JATS <code>?

I am researching existing practice on how JATS <monospace>, <preformat>, and <code> are presented. My main sources are:

* jats.nlm.nih.gov,

* testing XML in the PMC Article Previewer, and

* searching XML in the PMC Open Access Subset to see how interesting XML cases are presented by PubMed Central in HTML.

Based on my sources, it seems that JATS <code> is presented as a block element, unlike HTML <code>. So JATS <code> can not appear inline, but only as a block element (unlike HTML <code>).

My current plan is to make this distinction using the <monospace specific-use="code"> element and attribute value, but I have not seen that be used. I have only seen <monospace specific-use="wrap"> and specific-use="no-wrap" so far in my ~100K sample from the PMC Open Access Subset.

Is there any reason to do something other than <monospace specific-use="code">?

In PMC HTML, the JATS <preformat> and JATS <monospace> present in matching minimal HTML styling (just monospace) for block and inline HTML, respectively. The idea in my application is that JATS <code> and JATS <monospace specific-use="code"> also present in matching HTML styling for block and inline HTML, respectively. This "code" styling is optionally "heavier" (more "ink") than just monospace and can vary to be like the styling of code text in applications like Wikipedia, GitHub, and Bootstrap CSS (change of background, color, and/or border).

Thank you,
\xA0 Castedo

Current Thread