summaryrefslogtreecommitdiff
path: root/support/TeX4ht/source/tex4ht-jats.tex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-02-24 03:01:46 +0000
committerNorbert Preining <norbert@preining.info>2024-02-24 03:01:46 +0000
commitf325bd88d1d4db13f51277bc59c8ff8814e937bc (patch)
treee39af6619c91d812dd93cb57d25149da5a84d801 /support/TeX4ht/source/tex4ht-jats.tex
parente7a321bba289c40f39563c19bbeac355f7c0eeeb (diff)
CTAN sync 202402240301
Diffstat (limited to 'support/TeX4ht/source/tex4ht-jats.tex')
-rw-r--r--support/TeX4ht/source/tex4ht-jats.tex94
1 files changed, 79 insertions, 15 deletions
diff --git a/support/TeX4ht/source/tex4ht-jats.tex b/support/TeX4ht/source/tex4ht-jats.tex
index dc9ae8e5b9..071826a31e 100644
--- a/support/TeX4ht/source/tex4ht-jats.tex
+++ b/support/TeX4ht/source/tex4ht-jats.tex
@@ -1,8 +1,8 @@
-% $Id: tex4ht-jats.tex 269 2020-03-03 23:06:07Z karl $
+% $Id: tex4ht-jats.tex 1472 2024-02-22 22:12:22Z karl $
% compile 3 times: latex tex4ht-jats
% or xhlatex tex4ht-jats "html,3,sections+"
%
-% Copyright 2009-2022 TeX Users Group
+% Copyright 2009-2024 TeX Users Group
% Copyright 2000-2009 Eitan M. Gurari
% Released under LPPL 1.3c+.
% See tex4ht-cpright.tex for license text.
@@ -26,7 +26,7 @@
\<jats\><<<
% jats.4ht (|version), generated from |jobname.tex
-% Copyright 2022 TeX Users Group
+% Copyright 2022-2024 TeX Users Group
|<TeX4ht copywrite|>
>>>
@@ -223,7 +223,9 @@ Configurations that are shared only for article and report
\NewConfigure{DtdVersion}{1}
\Configure{DtdVersion}{1.3}
-\Configure{DOCTYPE}{\HCode{<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Publishing DTD v\a:DtdVersion\space 20130915//EN" "http://jats.nlm.nih.gov/archiving/\a:DtdVersion/JATS-archivearticle1-mathml3.dtd">\Hnewline}}
+\def\:DTD{jats} % this is necessary to prevent html-mml from overriding DOCTYPE
+%
+\Configure{DOCTYPE}{\HCode{<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v\a:DtdVersion\space 20210610//EN" "JATS-archivearticle1-3.dtd">\Hnewline}}
% XML configuratins
\edef\html:xmlns{}
@@ -587,7 +589,7 @@ This macro is used to print zeropaded days and months in the ISO date attribute
\Configure{chapter}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\TitleMark\HCode{<title>}\space\HtmlParOff}
+ {\TitleMark\space\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
\ConfigureMark{chapter}
@@ -598,7 +600,7 @@ This macro is used to print zeropaded days and months in the ISO date attribute
\Configure{appendix}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\TitleMark\HCode{<title>}\space\HtmlParOff}
+ {\TitleMark\space\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
\ConfigureMark{appendix}{\HCode{<label>}%
@@ -609,7 +611,7 @@ This macro is used to print zeropaded days and months in the ISO date attribute
\Configure{likechapter}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\HCode{<title>}\space\HtmlParOff}
+ {\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
>>>
@@ -622,7 +624,7 @@ This macro is used to print zeropaded days and months in the ISO date attribute
\Configure{section}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\TitleMark\HCode{<title>}\space\HtmlParOff}
+ {\TitleMark\space\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
\ConfigureMark{section}
@@ -635,7 +637,7 @@ This macro is used to print zeropaded days and months in the ISO date attribute
\Configure{subsection}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\TitleMark\HCode{<title>}\space\HtmlParOff}
+ {\TitleMark\space\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
\ConfigureMark{subsection}
@@ -648,7 +650,7 @@ This macro is used to print zeropaded days and months in the ISO date attribute
\Configure{subsubsection}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\TitleMark\HCode{<title>}\space\HtmlParOff}
+ {\TitleMark\space\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
\ConfigureMark{subsubsection}
@@ -661,7 +663,7 @@ This macro is used to print zeropaded days and months in the ISO date attribute
\Configure{paragraph}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\HCode{<title>}\space\HtmlParOff}
+ {\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
>>>
@@ -670,25 +672,25 @@ This macro is used to print zeropaded days and months in the ISO date attribute
\Configure{likesection}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\HCode{<title>}\space\HtmlParOff}
+ {\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
\Configure{likesubsection}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\HCode{<title>}\space\HtmlParOff}
+ {\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
\Configure{likesubsubsection}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\HCode{<title>}\space\HtmlParOff}
+ {\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
\Configure{likeparagraph}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{<sec>\Hnewline}}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{</sec>\Hnewline}}
- {\HCode{<title>}\space\HtmlParOff}
+ {\HCode{<title>}\HtmlParOff}
{\HCode{</title>}\HtmlParOn \ShowPar\par}
>>>
@@ -837,6 +839,8 @@ them separatelly.
\chapter{Packages}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\section{Hyperref}
+
\<configure jats url\><<<
|<url links|>
>>>
@@ -845,4 +849,64 @@ them separatelly.
|<hyperref links|>
>>>
+\section{Bibliographies}
+
+\<configure jats biblatex\><<<
+|<biblatex environment|>
+|<biblatex fields|>
+>>>
+
+
+\<biblatex environment\><<<
+ \def\bibConfigure{%
+ \ConfigureList{thebibliography}
+ {\ifvmode \IgnorePar \fi \EndP \EndP
+ \HCode{<ref-list>}\HtmlParOff%
+ \immediate\write\@auxout{%
+ \string\providecommand\string\BibFileName[2][]{}
+ }%
+ \immediate\write\@auxout{%
+ \string\BibFileName[\therefsection]{\FileName}}%
+ \PushMacro \end:itm \global \let \end:itm =\empty}%
+ {\ifvmode \IgnorePar \fi \EndP
+ \PopMacro \end:itm \global \let \end:itm \end:itm \EndP
+ \HCode {</mixed-citation></ref></ref-list>}\HtmlParOn\ShowPar}%
+ {\ifvmode \IgnorePar \fi \EndP \gHAdvance \bibN by 1
+ \end:itm \global \def \end:itm {\EndP \HCode{</mixed-citation></ref>}}%
+ \Tag{X\therefsection-\abx@field@entrykey}{bibitem-\bibN}
+ \HCode {<ref id="bibitem-\bibN"><label>}}%
+ {\ifvmode \IgnorePar \fi \EndP
+ \HCode {</label><mixed-citation publication-type="\thefield{entrytype}" id="bib-\bibN">}}%
+}
+>>>
+
+We use BibLaTeX's formatting commands to add JATS elements around some bibliographic
+fields.
+
+\<biblatex fields\><<<
+\DeclareFieldFormat{title}{\HCode{<source>}#1\HCode{</source>}}
+\DeclareFieldFormat{booktitle}{\HCode{<source>}#1\HCode{</source>}}
+\DeclareFieldFormat{maintitle}{\HCode{<source>}#1\HCode{</source>}}
+\DeclareFieldFormat{journaltitle}{\HCode{<source>}#1\HCode{</source>}}
+\DeclareFieldFormat[article]{title}{\HCode{<article-title>}#1\HCode{</article-title>}}
+\DeclareFieldFormat[incollection]{title}{\HCode{<part-title>}#1\HCode{</part-title>}}
+\DeclareFieldFormat[inbook]{title}{\HCode{<part-title>}#1\HCode{</part-title>}}
+\DeclareFieldFormat{year}{\HCode{<year>}#1\HCode{</year>}}
+\DeclareFieldFormat{date}{\HCode{<date-in-citation content-type="published">}#1\HCode{</date-in-citation>}}
+\DeclareFieldFormat{pages}{\HCode{<page-range>}#1\HCode{</page-range>}}
+\DeclareListFormat{publisher}{\usebibmacro{list:delim}{#1}\HCode{<publisher-name>}#1\HCode{</publisher-name>}\isdot\usebibmacro{list:andothers}}
+\DeclareListFormat{location}{\usebibmacro{list:delim}{#1}\HCode{<publisher-loc>}#1\HCode{</publisher-loc>}\isdot\usebibmacro{list:andothers}}
+\DeclareNameFormat{author}{%
+ \nameparts{#1}% This command initializes commands used in the following bibmacro
+ \HCode{<string-name>}% use
+ \usebibmacro{name:family-given}%
+ {\namepartfamily}%
+ {\namepartgiveni}%
+ {\namepartprefix}%
+ {\namepartsuffix}%
+ \HCode{</string-name>}%
+ \usebibmacro{name:andothers}%
+}
+>>>
+
\endinput