% compile 3 times: latex tex4ht-ooimpress
%      htlatex tex4ht-ooimpress "xhtml,4,sections+"
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% tex4ht-ooimpress.tex                                   %
% Copyright (C) 2001--            Eitan M. Gurari        %
%                                                        %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3 of this license or (at your option) any    %
% later version. The latest version of this license is   %
% in                                                     %
%   http://www.latex-project.org/lppl.txt                %
% and version 1.3 or later is part of all distributions  %
% of LaTeX version 2003/12/01 or later.                  %
%                                                        %
% This work has the LPPL maintenance status "maintained".%
%                                                        %
% This Current Maintainer of this work                   %
% is Eitan M. Gurari.                                    %
%                                                        %
% If you modify this file your changing the signature    %
% in \message{(signature)} below will be appreciated.    %
%                                                        %
%                             gurari@cse.ohio-state.edu  %
%                 http://www.cse.ohio-state.edu/~gurari  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%   
\message{(<signature>)}


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

\ifx \HTML\UnDef
   \def\HTML{ooimpress}%,ooimpress-mml}                   
   \def\PREAMBLE{%
      \usepackage{url}%
      \usepackage{hyperref}%
   }
   \def\OPTIONS{html,sections+,3}%
   \def\CONFIG{\jobname}
   \def\MAKETITLE{\author{Eitan M. Gurari, 
                          James Naughton, and Maarten Wisse}}         
   \def\next{\input mktex4ht.4ht  \endinput}
   \expandafter\next
\fi



%%%%%%%%%%%%%%%%%%%%% definitions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newcount\tmpcnt  \tmpcnt\time  \divide\tmpcnt  60
\edef\temp{\the\tmpcnt}
\multiply\tmpcnt  -60 \advance\tmpcnt  \time

\edef\version{\the\year-\ifnum \month<10 0\fi
  \the\month-\ifnum \day<10 0\fi\the\day
   -\ifnum \temp<10 0\fi \temp
   :\ifnum \tmpcnt<10 0\fi\the\tmpcnt}

\def\CopyYear.#1.{%
   \ifnum #1=\year #1\space\space\space\space\space\space
    \else          #1--\the\year\fi
}






See ch 7 of \cite{odbook}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\chapter{The Code}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{The Root}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Imported Configurations}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\<configure ooimpress tex4ht\><<<
\if:latex  |<Hinclude latex|>
\else      |<Hinclude plain|>  \fi
>>>


\<configure ooimpress plain\><<<
|<Hinclude plain lib|>
|<Hinclude plain + latex lib|>
>>>

\<configure ooimpress latex\><<<
|<Hinclude latex lib|>
|<Hinclude plain + latex lib|>
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\subsection{Common Code Fragments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\<par del\><<<
!*?: >>>

\<tag of Tag\><<<
 cw:>>>

\<tail\><<<
tail>>>

\<addr for Tag and Ref of Sec\><<<
\xdef\:cursec{|<section html addr|>}%
>>>

\<utilities\><<<
\newif\ifHCond
\def\:gobbleM#1->{}
>>>


\<try env inline par\><<<
\ShowPar
>>>

\<try inline par\><<<
\ShowPar\par{\HCondtrue\noindent}%
>>>



%%%%%%%%%%%%%%%%%%%%%%
\subsection{Copyright}
%%%%%%%%%%%%%%%%%%%%%%

\<ooimpress\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ooimpress.4ht                         |version %
|<copy right notice|>  >>>

\<ooimpress-math\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ooimpress-math.4ht                    |version %
|<copy right notice|>  >>>


\<ooimpress-mml\><<<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  
% ooimpress-mml.4ht                     |version %
|<copy right notice|>  >>>



\<copy right notice\><<<
% Copyright (C) |CopyYear.2009.     Eitan M. Gurari         %
%                                                        %
% This work may be distributed and/or modified under the %
% conditions of the LaTeX Project Public License, either %
% version 1.3 of this license or (at your option) any    %
% later version. The latest version of this license is   %
% in                                                     %
%   http://www.latex-project.org/lppl.txt                %
% and version 1.3 or later is part of all distributions  %
% of LaTeX version 2003/12/01 or later.                  %
%                                                        %
% This work has the LPPL maintenance status "maintained".%
%                                                        %
% This Current Maintainer of this work                   %
% is Eitan M. Gurari.                                    %
%                                                        %
% If you modify this program your changing its signature %
% with a directive of the following form will be         %
% appreciated.                                           %
%            \message{signature}                         %
%                                                        %
%                              gurari@cse.ohio-state.edu %
%                  http://www.cse.ohio-state.edu/~gurari %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\immediate\write-1{version |version}
>>>

\<configure ooimpress tex4ht\><<<
|<utilities|>
>>>

%%%%%%%%%%%%%%%%%%%%%%
\section{The XML Files}
%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%
\subsection{content.xml (= jobname.xml)}
%%%%%%%%%%%%%%%%%%%%%%

\<configure ooimpress foils\><<<
\Configure{BODY}
  {\HCode{<office:body><office:presentation>}%   
   \let\end:rootslide\empty
   \start:slide 
   \gdef\end:rootslide{\end:slide \global\let\end:rootslide=\empty}%
   \par\ShowPar}
  {\IgnorePar\EndP
   \end:rootslide
   \HCode{</office:presentation></office:body>\Hnewline}}
>>>


\<configure ooimpress foils\><<<
\Configure{maketitle}
   {\bgroup  
       \Configure{newpage}{}%
       \IgnorePar\EndP\HCode{<!--begin maketitle-->}
       \Configure{tabular}{}{}{}{}{\ifnum \HRow>1
               \HCode{<text:line-break\Hnewline/>}\fi}{}%
       \ConfigureEnv{tabular}{}{}{}{}%
   }
   {\ifvmode \IgnorePar\fi \EndP
    \HCode{|<end page body|><!--end maketitle-->}\egroup \par}
   {\ifvmode \IgnorePar\fi \EndP
    \HCode{|<start document title|>%
           <text:p text:style-name="Title|<cond rtl class|>" >}}
   {\HCode{</text:p>|<end document title|>|<start maketitle page body|>}}
>>>

\<start maketitle page body\><<<
<draw:frame presentation:style-name="pr1"  
            draw:layer="layout" 
            svg:width="25.199cm"  
%             svg:height="3.256cm" 
            svg:x="1.4cm"  
            svg:y="6.0cm" 
            presentation:class="notes"> 
  <draw:text-box>\Hnewline
>>>



\<start page body\><<<
<draw:frame presentation:style-name="pr1"  
            draw:layer="layout" 
            svg:width="25.199cm"  
%             svg:height="3.256cm" 
            svg:x="1.4cm"  
            svg:y="2.0cm" 
            presentation:class="notes"> 
  <draw:text-box>\Hnewline
>>>


\<end page body\><<<
  </draw:text-box> 
</draw:frame>\Hnewline         
>>>



\<start document title\><<<
<draw:frame presentation:style-name="pr1"  
            draw:layer="layout" 
            svg:width="25.199cm"  
%             svg:height="3.256cm" 
            svg:x="1.4cm"  
            svg:y="3.0cm" 
            presentation:class="title"> 
  <draw:text-box>\Hnewline
>>>

\<end document title\><<<
  </draw:text-box> 
</draw:frame>\Hnewline         
>>>



\<configure ooimpress foils\><<<
\HAssign\PageN=0
\Configure{foilhead}
   {\IgnorePar\EndP \start:slide }
   {\IgnorePar\EndP 
    \HCode{|<end page body|>}\end:slide }
   {\HCode{|<start foilhead title|>%
           <text:p text:style-name="|<cond rtl class|>" >}%
    \IgnoreIndent}
   {\HCode{</text:p>\Hnewline
           |<end foilhead title|>|<start page body|>}\par\ShowPar}

\def\start:slide{\end:rootslide
    \HAdvance\PageN by 1
    \HCode{<!--start of foilhead-->
    <draw:page draw:name="page\PageN" 
                 draw:style-name="dp1" 
                 draw:master-page-name="Default"> \Hnewline}}
\def\end:slide{\HCode{
    </draw:page> 
    <!--end of foilhead-->}}
>>>


\<cond rtl class\><<<
\if@rl-rtl\fi
>>>



\<start foilhead title\><<<
<draw:frame presentation:style-name="pr1"  
            draw:layer="layout" 
            svg:width="25.199cm"  
%             svg:height="3.256cm" 
            svg:x="1.4cm"  
            svg:y="0.962cm" 
            presentation:class="subtitle"> 
  <draw:text-box>\Hnewline
>>>

\<end foilhead title\><<<
  </draw:text-box> 
</draw:frame>\Hnewline         
>>>

\<configure ooimpress foils NO\><<<
\NewConfigureOO{slide}
\ConfigureOO{slide}{%
<style:style style:name="dp1" style:family="drawing-page"> 
   <style:drawing-page-properties 
       presentation:background-visible="true" 
       presentation:background-objects-visible="true" 
       presentation:display-footer="true" 
       presentation:display-page-number="false" 
       presentation:display-date-time="true"/> 
</style:style> 
<style:style style:name="gr1" 
       style:family="graphic" 
       style:parent-style-name="standard"> 
   <style:graphic-properties  
       draw:stroke="none"  
       svg:stroke-color="\#000000" 
       draw:fill="none"  
       draw:fill-color="\#ffffff" 
       draw:textarea-horizontal-align="left" 
       draw:auto-grow-height="true"  
       draw:auto-grow-width="true" 
       fo:min-height="0cm"  
       fo:min-width="0cm"/> 
</style:style> 
}
>>>




\<configure ooimpress foils\><<<
\ConfigureOO{foilhead}{\Hnewline
<style:style style:name="foilhead"
                  style:family="paragraph"
   >\Hnewline
<\style:par:properties fo:font-size="12pt"
                  fo:font-weight="bold"
                  style:font-size-asian="14pt"
                  style:font-weight-asian="bold"
                  style:font-size-complex="14pt"
                  style:font-weight-complex="bold"
                  fo:margin-top="0.42cm"
                  fo:margin-bottom="0.51cm"
                  fo:text-align="center"
                  style:justify-single-word="false"
/>
</style:style>
}
>>>


\<configure ooimpress foils\><<<
\ConfigureOO{title}{%
<style:style style:name="Title"
             style:family="paragraph"
  >\Hnewline
<\style:par:properties fo:margin-top="0.42cm"
                  fo:margin-bottom="0.51cm"
                  fo:font-size="20pt"
                  fo:font-weight="normal"
                  style:font-size-asian="18pt"
                  style:font-weight-asian="bold"
                  style:font-size-complex="18pt"
                  style:font-weight-complex="bold"
                  fo:text-align="center"
                  style:justify-single-word="false"/>
</style:style> \Hnewline
 }
>>>



\<configure ooimpress foils\><<<
\Configure{thank}
   {\setbox\tmp:bx=\hbox\bgroup}
   {\egroup}
   {\NoFonts   \leavevmode   \bgroup \protect\Configure{$}{}{}{}%
    \hbox{\HCode{<!--text:note\Hnewline text:note-class="footnote"
                  text:id="}|<thank id|>%
               \HCode{"><text:note-citation>}}%
   }
   {\egroup \EndNoFonts
    \HCode{</text:note-citation><text:note-body>
    <text:p\Hnewline text:style-name="Footnote" ><text:s/>}}
   {\HCode{</text:p></text:note-body></text:note-->}}   
>>>





%%%%%%%%%%%%%
\subsection{Undo ooffice}
%%%%%%%%%%%%%


\<configure ooimpress tex4ht\><<<
\def\media:type{application/vnd.oasis.opendocument.presentation}
>>>

%%%%%%%%%%%%%%%%%%
\subsection{Remove `reference-mark'}
%%%%%%%%%%%%%%%%%%

Introduced in xtpipes for \verb=\Link=


\<configure ooimpress latex\><<<
\Odef\Link[#1]#2#3{}
\let\EndLink\empty
>>>


%%%%%%%%%%%%%%%%%%
\subsection{Remove `style:columns'}
%%%%%%%%%%%%%%%%%%


OpenOffice impress chocks on `style:columns' (why?)

\<configure ooimpress latex\><<<
\ConfigureOO{Sect1}{\Hnewline
   <style:style style:name="Sect1"
                style:family="section">
   <\style:sectionproperties>
      <!--style:columns fo:column-count="1"
                   fo:column-gap="0cm">
         <style:column fo:margin-top="0.5cm"
                      fo:margin-left="0cm"
                      fo:margin-right="0cm"
         />
      </style:columns-->
   </\style:sectionproperties>
   </style:style>
\Hnewline }
>>>


\<configure ooimpress latex\><<<
\ConfigureOO{Sect2}{\Hnewline
<style:style    style:name="Sect2"
   style:family="section">
   <\style:sectionproperties>
      <!--style:columns fo:column-count="0" fo:column-gap="0cm"/-->
   </\style:sectionproperties>
</style:style>
\Hnewline }
>>>

\<configure ooimpress tex4ht\><<<
\Configure{figure-style}{%
   <style:style style:name="Figure" style:family="section">\Hnewline
     <style:section-properties 
                               fo:margin-left="0.25in" 
                               fo:margin-right="0.25in" 
                               style:editable="true">\Hnewline
         <!--style:columns fo:column-count="0" 
                        fo:column-gap="0in"/--> 
     </style:section-properties> 
   </style:style>\Hnewline 
}
>>>


\<configure ooimpress g-brief\><<<
\ConfigureOO{g-brief-header}{\Hnewline
<style:style style:name="header-style" style:family="section">\Hnewline
   <\style:properties text:dont-balance-text-columns="false"
                     fo:margin-bottom="2cm">\Hnewline
      <!--style:columns    fo:column-count="2"
                        fo:column-gap="1in">\Hnewline
          <style:column fo:margin-left="0in"
                        fo:margin-right="0in"/>\Hnewline
          <style:column fo:margin-left="0in"
                        fo:margin-right="0in"/>\Hnewline
      </style:columns-->\Hnewline      
   </\style:properties>\Hnewline
</style:style>\Hnewline
}
>>>

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{thebibliography}{9} 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\bibitem{odbook}
OASIS OpenDocument Essentials,
Using OASIS OpenDocument XML
\url{http://books.evc-cit.info/odbook/book.html}


\end{thebibliography} 


\endinput