summaryrefslogtreecommitdiff
path: root/support/TeX4ht/source/tex4ht-jats.tex
blob: b260e3498557ab940949bc1705be99fcdcbca12a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
% $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