% $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-2022 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.4ht (|version), generated from |jobname.tex % Copyright 2022 TeX Users Group | >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \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{Package configurations} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Basic system} \<<< \special{t4ht.xml} | | | | | | >>> \<<< | >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Classes} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< | | >>> \<<< | | >>> \<<< | | | >>> Shared configurations for base LaTeX classes. \<<< | >>> Configurations that are shared only for article and report \<<< | >>> \<<< | >>> \section{Configurations for Koma Script} \<<< | | >>> \<<< | | >>> \<<< | | | >>> \<<< | >>> \<<< | >>> \<<< | >>> \section{Configurations for AMS classes} \<<< | | >>> \<<< | | | >>> \<<< | | >>> |<<< >>> \<<< | >>> \<<< | | | | | >>> \section{Configurations for Memoir} \<<< | | | >>> \section{Shared class configurations} \<<< | | | | >>> \<<< | >>> \<<< | >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Basic system configurations} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{VERSION}{\HCode{\Hnewline}} % select JATS version \NewConfigure{DtdVersion}{1} \Configure{DtdVersion}{1.3} \Configure{DOCTYPE}{\HCode{\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{
\Hnewline}}{\HCode{\Hnewline
}} \Configure{@HEAD}{} \Configure{HEAD}{\HCode{}}{\HCode{}} % Add header structure % Journal info in . 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{}}{\HCode{}} \NewConfigure{ArticleMeta}{1} \Configure{ArticleMeta}{ \HCode{}% % title from \title command is placed by make4ht DOM filter. If you want more complex title, % use \Configure{TitleGroup} \a:TitleGroup% \JATS:Contributors% \HCode{}% } % enable to configure contributors \def\JATS:Contributors{} \NewConfigure{Contributor}[1]{\concat:config\JATS:Contributors{#1}} \NewConfigure{TitleGroup}{1} % insert metas into document header \Configure{@HEAD}{\a:JournalMeta} \Configure{@HEAD}{\a:ArticleMeta} >>> \<<< \def\Declare:Language#1#2{% \expandafter\gdef\csname rfclang#1\endcsname{#2}% } \def\Get:Language{% \ifx\bbl@main@language\@undefined en-US% \else% \expandafter\ifdefined\csname rfclang\bbl@main@language\endcsname \csname rfclang\bbl@main@language\endcsname\fi% \fi% } \Declare:Language{UKenglish}{en} \Declare:Language{USenglish}{en} \Declare:Language{latex}{en} \Declare:Language{acadian}{fr} \Declare:Language{albanian}{sq} \Declare:Language{american}{en} \Declare:Language{amharic}{am} \Declare:Language{arabic}{ar} \Declare:Language{armenian}{hy} \Declare:Language{australian}{en} \Declare:Language{austrian}{de} \Declare:Language{basque}{eu} \Declare:Language{bengali}{bn} \Declare:Language{brazilian}{pt} \Declare:Language{brazil}{pt} \Declare:Language{breton}{br} \Declare:Language{british}{en} \Declare:Language{bulgarian}{bg} \Declare:Language{canadian}{en} \Declare:Language{canadien}{fr} \Declare:Language{catalan}{ca} \Declare:Language{croatian}{hr} \Declare:Language{czech}{cs} \Declare:Language{danish}{da} \Declare:Language{divehi}{dv} \Declare:Language{dutch}{nl} \Declare:Language{english}{en} \Declare:Language{esperanto}{eo} \Declare:Language{estonian}{et} \Declare:Language{finnish}{f\/i} \Declare:Language{francais}{fr} \Declare:Language{french}{fr} \Declare:Language{galician}{gl} \Declare:Language{germanb}{de} \Declare:Language{german}{de} \Declare:Language{greek}{el} \Declare:Language{hebrew}{he} \Declare:Language{hindi}{hi} \Declare:Language{hungarian}{hu} \Declare:Language{icelandic}{is} \Declare:Language{interlingua}{ia} \Declare:Language{irish}{ga} \Declare:Language{italian}{it} \Declare:Language{kannada}{kn} \Declare:Language{khmer}{km} \Declare:Language{korean}{ko} \Declare:Language{lao}{lo} \Declare:Language{latin}{la} \Declare:Language{latvian}{lv} \Declare:Language{lithuanian}{lt} \Declare:Language{lowersorbian}{dsb} \Declare:Language{magyar}{hu} \Declare:Language{malayalam}{ml} \Declare:Language{marathi}{mr} \Declare:Language{naustrian}{de} \Declare:Language{newzealand}{en} \Declare:Language{ngerman}{de} \Declare:Language{norsk}{no} \Declare:Language{norwegiannynorsk}{nn} \Declare:Language{nynorsk}{no} \Declare:Language{occitan}{oc} \Declare:Language{oldchurchslavonic}{cu} \Declare:Language{persian}{fa} \Declare:Language{polish}{pl} \Declare:Language{polutonikogreek}{el} \Declare:Language{portuges}{pt} \Declare:Language{portuguese}{pt} \Declare:Language{romanian}{ro} \Declare:Language{romansh}{rm} \Declare:Language{russian}{ru} \Declare:Language{samin}{se} \Declare:Language{sanskrit}{sa} \Declare:Language{scottish}{gd} \Declare:Language{serbian}{sr} \Declare:Language{serbo-croatian}{sh} \Declare:Language{slovak}{sk} \Declare:Language{slovene}{sl} \Declare:Language{slovenian}{sl} \Declare:Language{spanish}{es} \Declare:Language{swedish}{sv} \Declare:Language{tamil}{ta} \Declare:Language{telugu}{te} \Declare:Language{thai}{th} \Declare:Language{tibetan}{bo} \Declare:Language{turkish}{tr} \Declare:Language{turkmen}{tk} \Declare:Language{ukrainian}{uk} \Declare:Language{uppersorbian}{hsb} \Declare:Language{urdu}{ur} \Declare:Language{vietnamese}{vi} \Declare:Language{welsh}{cy} >>> \<<< \Configure{HtmlPar} {\EndP\HCode{|

}} {\EndP\HCode{|

}} {\Tg

}% {\Tg

}% >>> \<<< % >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Hyperlinks} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{Link}{xref}{rid=}{id=}{\empty} \LinkCommand\ExternalLink{ext-link,xlink:href,id} >>> \<<< \Configure{url}% {\tmp:toks{#1}\ExternalLink[\noexpand\the\tmp:toks]{}{}{\let\UrlBigBreaks\empty \let\UrlBreaks\empty #1}\EndExternalLink} >>> \<<< >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Math} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% MathML in JATS must use the mml: prefix \<<< \Configure{mathml}{mml:} >>> Inline and display math should use different elements for their inclusion. We need to keep stack of the opened elements, as math can be nested. For some reason, this configuration is called too early, resulting in compilation error. We thus use AtBeginDocument to postpone it. \<<< \edef\math:type:inline{display="inline" } \ifdefined\AtBeginDocument \AtBeginDocument{ \Configure{DviMathML}{% \ifx\a:@math\math:type:inline% \PushStack\math:types{inline-formula}% \HCode{}% \else% \HCode{}% \PushStack\math:types{disp-formula}% \fi% }{\PopStack\math:types\:temp\HCode{}}% }% \fi >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Fonts} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% JATS doesn't support any attributes for fonts, so the information about font name and size is lost. \<<< \Configure{htf}{0}{+}{}{} \Configure{htf}{4}{+}{}{} \Configure{htf}{6}{+}{}{} >>> \<<< \Configure{textit}{\Protect\HCode{}\NoFonts}{\EndNoFonts\Protect\Tg} \Configure{textbf}{\Protect\HCode{}\NoFonts}{\EndNoFonts\Protect\Tg} \Configure{textsc}{\Protect\HCode{}\NoFonts}{\EndNoFonts\Protect\Tg} \Configure{textrm}{\Protect\HCode{}\NoFonts} {\EndNoFonts\Protect\HCode{}} \Configure{textup}{\Protect\HCode{}\NoFonts} {\EndNoFonts\Protect\HCode{}} \Configure{textsf}{\Protect\HCode{}\NoFonts} {\EndNoFonts\Protect\HCode{}} \Configure{textsl}{\Protect\HCode{}\NoFonts} {\EndNoFonts\Protect\HCode{}} \Configure{texttt}{\Protect\HCode{}\NoFonts} {\EndNoFonts\Protect\HCode{}} \Configure{emph}{\Protect\HCode{}\NoFonts} {\EndNoFonts\Protect\HCode{}} \Configure{underline} {\HCode{}\:gobble} {\HCode{}} \Configure{textsuperscript} {\HCode{}} {\HCode{}} \Configure{textsubscript} {\HCode{}} {\HCode{}} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Document structure} %%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Sections} %%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< | | >>> \<<< \Configure{chapter} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\TitleMark\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} \ConfigureMark{chapter} {\if@mainmatter \HCode{}\fi} \Configure{appendix} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\TitleMark\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} \ConfigureMark{appendix}{\HCode{}} >>> \<<< \Configure{likechapter} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} >>> \<<< | | >>> \<<< \Configure{section} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\TitleMark\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} \ConfigureMark{section} {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble \else \HCode{}\fi } \Configure{subsection} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\TitleMark\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} \ConfigureMark{subsection} {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble \else \HCode{}\fi } \Configure{subsubsection} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\TitleMark\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} \ConfigureMark{subsubsection} {\ifnum \c:secnumdepth>\c@secnumdepth \expandafter\:gobble \else \HCode{}\fi } \Configure{paragraph} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} >>> \<<< \Configure{likesection} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} \Configure{likesubsection} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} \Configure{likesubsubsection} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} \Configure{likeparagraph} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\IgnorePar\HCode{\Hnewline}} {\HCode{}\space\HtmlParOff} {\HCode{}\HtmlParOn \ShowPar\par} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Abstracts} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \ConfigureEnv{abstract} {\ifvmode\IgnorePar\fi\EndP\HCode{\Hnewline}} {\ifvmode\IgnorePar\fi\EndP\HCode{}\par}{}{} \Configure{abstracttitle}{\ifvmode\IgnorePar\fi\EndP\HCode{}\EndNoFonts\HtmlParOn\par} >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Floats} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< \Configure{float} {\ifOption{refcaption}{}{\csname par\endcsname\ShowPar \leavevmode}} {\IgnorePar\EndP\HCode{}} {\ifvmode \IgnorePar \fi\EndP \HCode{}\csname par\endcsname\ShowPar} \ConfigureEnv{figure} {\IgnorePar\EndP\HCode{\Hnewline}% \bgroup \Configure{float}{\ShowPar}{}{}% } {\egroup \IgnorePar\EndP\HCode{}|\par} {}{} \Configure{caption}{\IgnorePar\EndP\HCode{}\noindent\ShowPar} {\HCode{}\HCode{}% } >>> %%%%%%%%%%%%%%%%%%% \section{Tables} %%%%%%%%%%%%%%%%%%% \<<< \ConfigureEnv{table} {\ifvmode \IgnorePar\fi \EndP \HCode{} \Configure{float}{}{}{}{} } {\ifvmode \IgnorePar\fi \EndP \HCode{}\par\ShowPar} {}{} \ConfigureEnv{tabular} {\Configure{noalign}% {\f:tabular\d:tabular \HCode{}} {\HCode{}\pend:def\TableNo{0}\c:tabular\e:tabular}% % \IgnorePar\ifvmode\else\HCode{}\fi \EndP\PushStack\Col:Marg\AllColMargins } {\PopStack\Col:Marg\AllColMargins\ShowPar \Configure{noalign}{}{}% % \ShowPar % }{}{} >>> %%%%%%%%%%%%%%%%%%%%% \section{Footnotes} %%%%%%%%%%%%%%%%%%%%% \<<< \Configure{footnotemark}{\bgroup\NoFonts\HCode{}\EndNoFonts\egroup} % suppress footnote number in footnotext, it was already used in footnotemark \Configure{footnotetext}{\NoFonts\ShowPar\setbox0=\vbox\bgroup} {\egroup\EndNoFonts\SaveEndP\par\ShowPar\normalsize}% force new paragraph and normal font size {\EndP\RecallEndP\HCode{}}% >>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \chapter{Packages} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \<<< | >>> \<<< | >>> \endinput