% $Id: tex4ht-jats.tex 269 2020-03-03 23:06:07Z karl $
% compile 3 times: latex tex4ht-jats
%           or   xhlatex tex4ht-jats "html,3,sections+"
%
% Copyright 2009-2020 TeX Users Group
% Copyright 2000-2009 Eitan M. Gurari
% Released under LPPL 1.3c+.
% See tex4ht-cpright.tex for license text.

%%%%%%%%%%%%%%%%%% load style files %%%%%%%%%%%%%%%%%%%%%%%%%%

\ifx \HTML\UnDef
   \def\HTML{jats}                   
   \def\CONFIG{\jobname}
   \def\MAKETITLE{\author{Eitan M. Gurari}}         
   \def\next{\input mktex4ht.4ht  \endinput}
   \expandafter\next
\fi

\input{common.tex}
\input{tex4ht-cpright.tex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Preamble}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<jats\><<<
% jats.4ht (|version), generated from |jobname.tex
% Copyright 2020 TeX Users Group
|<TeX4ht copywrite|>
>>>

  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Basic information}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

JATS support in TeX4ht is based on HTML and MathML configurations. 
Unsupported elements will be converted using make4ht DOM filters. 
Filters will be used also for the document structure, as JATS wants some
elements in the back (bibliography, etc.)

Only basic structures will be configured by hand in this configuration 
file.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{Start Here}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\<configure jats tex4ht\><<<
\special{t4ht.xml}
\Configure{VERSION}{\HCode{<?xml version="1.0" encoding="UTF-8"?>\Hnewline}}

% select JATS version
\NewConfigure{DtdVersion}{1}
\Configure{DtdVersion}{1.2}

\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}}

% XML configuratins
\edef\html:xmlns{}
\NewConfigure{xmlns}[2]{\concat:config\html:xmlns{xmlns:#1="#2"\Hnewline}}
\Configure{xmlns}{xlink}{http://www.w3.org/1999/xlink}
\Configure{xmlns}{mml}{http://www.w3.org/1998/Math/MathML}

\Configure{HTML}{\HCode{<article dtd-version="\a:DtdVersion" \html:xmlns>\Hnewline}}{\HCode{\Hnewline</article>}}
\Configure{@HEAD}{}
\Configure{HEAD}{\HCode{<front>}}{\HCode{</front>}}
% Add header structure
% Journal info in <journal-meta>. It needs to be provided fully from the user configuration
\NewConfigure{JournalMeta}{1}
% basic article meta can be reconstructed from \title and \author
% 
% Title needs to be placed at the correct place by DOM filter
\Configure{TITLE}{\HCode{<article-title>}}{\HCode{</article-title>}}
\NewConfigure{ArticleMeta}{1}
  \Configure{ArticleMeta}{
  \HCode{<article-meta>}%
    % title from \title command is placed by make4ht DOM filter. If you want more complex title, 
    % use \Configure{TitleGroup}
    \a:TitleGroup%
    \JATS:Contributors%
  \HCode{</article-meta>}%
}
% enable to configure contributors
\def\JATS:Contributors{}
\NewConfigure{Contributor}[1]{\concat:config\JATS:Contributors{#1}}
\NewConfigure{TitleGroup}

% insert metas into document header
\Configure{@HEAD}{\a:JournalMeta}
\Configure{@HEAD}{\a:ArticleMeta}



>>>




\<configure jats tex4ht\><<<
>>>

\<configure jats latex\><<<
>>>



\endinput
