1.2.2 styles.xml (jobname-styles.xml)

The contents.xml file can contain only styles that are known ahead of time, before starting the processing of the content.

The styles.xml file allows us

  1. To collect styles as we go along the body of the document, and
  2. Introduce default built in styles that user may override

The content.xml must get the style information at the start of the compilation, before the body is processed.

\OOstyles immediatey sends it content to the styles.xml file. In the case of \ConfigureOO, the last assignment to the hook is sent to the file upon reaching the end of the source.

<..utilities..>+
 \let\:OOstyles=\empty
 \def\OOstyles#1{\edef\:OOstyles{\:OOstyles #1}}
 \OOstyles{<.oo2 styles.xml.>}
-_-_-

<..switch to main body OOstlyles..>
 \def\OOstyles##1{%
 \ht:special{t4ht><.styles file name.>}%
   \ht:special{t4ht=##1}%
   \ht:special{t4ht*>}%
 }
 \OOstyles{\:OOstyles}
 \ht:special{t4ht*><.styles file name.>}%
 \let\:OOstyles=\:UnDef
-_-_-

<..styles file name..>
 \jobname-styles.4oy
-_-_-

<..oo2 styles at /@BODY..>
 \OOstyles{%
   \oo:style
   </office:styles>\Hnewline
      <office:automatic-styles>
         <.styles.xml: automatic-styles.>\Hnewline
      </office:automatic-styles>
      <office:master-styles>\Hnewline
         <.styles.xml: master-styles.>\Hnewline
      </office:master-styles>\Hnewline
   </office:document-styles>\Hnewline
 }%
-_-_-

Writer2LaTeX (w2l) doesn’t currently allow line breaks with DOCTYPE

<..oo2 styles.xml..>
 <.VERSION.>%
 <!DOCTYPE office:document-styles PUBLIC
     "-//OpenOffice.org//DTD OfficeDocument \oo:dtd:ver//<.dtd lang.>"
     "office.dtd">\Hnewline
 <office:document-styles \Hnewline
        <.xml styles name spaces 2.0.>\Hnewline
        office:version="1.0">\Hnewline
    <office:font-face-decls>
       <.oo2 fonts.>%
    </office:font-face-decls>
    <office:styles>\Hnewline
-_-_-

[dirty trick for fonts]

<..utilities..>+
 \let\oo:style=\empty
 \def\NewConfigureOO#1{%
   \expandafter\ifx \csname c:#1:oo:style:\endcsname\relax
      \append:def\oo:style{\csname a:#1:oo:style\endcsname}%
      \:CheckOption{info}\if:Option
          \Log:Note{\string\NewConfigureOO{#1}}%
      \fi
   \fi
   \NewConfigure{#1:oo:style}{1}}
 \def\ConfigureOO#1#2{%
   \edef\:temp{\noexpand\Configure{#1:oo:style}{#2}}\:temp
   \:CheckOption{info-oo}\if:Option
     \Log:Note{\string\ConfigureOO{#1}{%
        \expandafter\expandafter\expandafter\:gobbleM
        \expandafter\meaning\csname a:#1:oo:style\endcsname
      }}
   \fi
 }
-_-_-

<..utilities..>+
 \:CheckOption{info}\if:Option
     \Log:Note{For tracing of oo configurations,
        use the ‘info-oo’ option}%
 \fi
-_-_-