[tex4ht-commits] [SCM] tex4ht updated: r1467 - trunk/lit

Michal Hoftich INVALID.NOREPLY at gnu.org.ua
Thu Feb 22 15:55:46 CET 2024


Author: michal_h21
Date: 2024-02-22 14:55:46 +0000 (Thu, 22 Feb 2024)
New Revision: 1467

Modified:
   trunk/lit/ChangeLog
   trunk/lit/tex4ht-jats.tex
Log:
Added support for biblatex in jats

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2024-02-21 20:19:42 UTC (rev 1466)
+++ trunk/lit/ChangeLog	2024-02-22 14:55:46 UTC (rev 1467)
@@ -1,3 +1,7 @@
+2024-02-22  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-jats.tex (jats.4ht): added support for BibLaTeX.
+
 2024-02-21  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-jats.tex (jats.4ht): removed \space commands from inside of

Modified: trunk/lit/tex4ht-jats.tex
===================================================================
--- trunk/lit/tex4ht-jats.tex	2024-02-21 20:19:42 UTC (rev 1466)
+++ trunk/lit/tex4ht-jats.tex	2024-02-22 14:55:46 UTC (rev 1467)
@@ -837,6 +837,8 @@
 \chapter{Packages}
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
+\section{Hyperref}
+
 \<configure jats url\><<<
 |<url links|>
 >>>
@@ -845,4 +847,63 @@
 |<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>}%
+   \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>}\ShowPar}%
+  {\ifvmode \IgnorePar \fi \EndP \gHAdvance \bibN by 1
+    \end:itm \global \def \end:itm {\EndP \HCode{</mixed-citation></ref>}}%
+    \HCode {<ref id="X\therefsection-\abx at field@entrykey"><label>}}%
+  {\ifvmode \IgnorePar \fi \EndP
+    \HCode {</label><mixed-citation 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{<year>}#1\HCode{</year>}}
+\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



More information about the tex4ht-commits mailing list.