Re: [EXTERNAL] [jats-list] inline code vs monospace in JATS

Subject: Re: [EXTERNAL] [jats-list] inline code vs monospace in JATS
From: "Lizzi, Vincent vincent.lizzi@xxxxxxxxxxxxxxxxxxxx" <jats-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 5 Sep 2025 04:07:52 -0000
Hi Castedo,

I see your point about the <code> element typically being treated as a block
for rendering and the desire to use <code> as an inline element sometimes. It
may sometimes be possible to infer from the context or the content whether
block or inline display is preferable, but not always.

Would you consider using an attribute on the <code> element to specify when it
is intended to be inline? For example:

<code specific-use="inline">

This would ballow specifying inline when needed, and assuming block as the
default.

You can, if you wish, submit a comment to the JATS Standing Committee to
consider suggestions for improving this in a future version of JATS. The
comment form is at
https://groups.niso.org/higherlogic/ws/public/document?document_id=31409

Thank you,
Vincent


_____________________________________________

Vincent M. Lizzi

Head of Information Standards | Taylor & Francis Group

vincent.lizzi@xxxxxxxxxxxxxxxxxxxx<mailto:vincent.lizzi@xxxxxxxxxxxxxxxxxxxx>

Time zone: US Eastern

[cid:ae804053-3d7a-427a-b3b6-28d4cf399e60]<https://outlook.office.com/bookwit
hme/user/aa80d42cbb5b46dba06a5ad241d7665b@xxxxxxxxxxxxxxxxxxxx?anonymous&ep=o
waSlotsEmailSignature>
Book time to meet with
me<https://outlook.office.com/bookwithme/user/aa80d42cbb5b46dba06a5ad241d7665
b@xxxxxxxxxxxxxxxxxxxx?anonymous&ep=owaSlotsEmailSignature>
________________________________
From: Randall, Laura (NIH/NLM/NCBI) [E] laura.randall@xxxxxxx
<jats-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, September 4, 2025 12:34 PM
To: jats-list@xxxxxxxxxxxxxxxxxxxxxx <jats-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [EXTERNAL] [jats-list] inline code vs monospace in JATS

Hi, Castedo.
This sounds like an interesting project, though I would encourage you to
broaden your sources. The coding samples in the tag libraries offer examples
of how things are coded but not rendered and the other two sources of the PMC
article previewer and PMC article rendering are basically one and the same.

It seems you have a good handle on what PMC is doing, but basing any decisions
with PMC as a single source might not serve your project in the long run.

Cheers,
Laura

___________________________________
Laura Randall
Technical Information Specialist
National Library of Medicine
National Institutes of Health
NIHBC-45 Natcher 5AN38D12
Phone: 301-435-0467
Email: laura.randall@xxxxxxx

-----Original Message-----
From: Castedo Ellerman castedo@xxxxxxxxxxx
<jats-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, September 4, 2025 10:37 AM
To: jats-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [EXTERNAL] [jats-list] inline code vs monospace in JATS

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


CAUTION: This email originated from outside of the organization. Do not click
links or open attachments unless you recognize the sender and are confident
the content is safe.

[demime 1.01d removed an attachment of type image/png which had a name of image.png]

Current Thread