I've been trying to follow a tutorial here: github.com/michal-h21/helpers4ht/wiki/tex4ht-tutorial
My MWE files below produce a valid output with the text from the command, but I was expecting the class (i.e. the document style for this text) to be assigned in accordance with the command used, similar to the way this (Customizing ODT output from mk4ht oolatex) example used environments to change the class which corresponded to a style name in the associated word file (referenced in the build instruction odttemplate). I can't, however, tell if the code is unable to interrupt the body text style or whether the style is not being assigned because of an error in the code.
Main.tex
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{testpkg}
\begin{document}
Test
Some text in English,
\SectionTitleTest{Test}
More text
\end{document}
testpkg.sty
\ProvidesPackage{testpkg}
\RequirePackage{xparse,expl3}
\DeclareDocumentCommand{\SectionTitleTest}{m}{#1}
\endinput
testpkg.cfg
\Preamble{xhtml}
% to simplify things
\def\myendpar{\ifvmode\IgnorePar\fi\EndP}
\Configure{SectionTitleTest}{\HCode{<span class="SectionTitleTest">}\NoFonts}{\EndNoFonts\HCode{</span>}}% tried without NoFonts code to no avail either
\Css{.SectionTitleTest{font-style:SectionTitleTest;}}
\begin{document}
\EndPreamble
testpkg.4ht
% provide configure for new command. we can choose any name
% but most convenient is to name hooks after redefined command
% we declare two hooks, to be inserted before and after the command
\NewConfigure{SectionTitleTest}{2}
% now we need to redefine \SectionTitleTest. save it to tmp command
% note that `:` can be part of command name in `.4ht` files.
\let\tmp:SectionTitleTest\SectionTitleTest
% now insert the hooks. they are named as \a:hook, \b:hook, ..., \h:hook
% depending on how many hooks were declared
\renewcommand\SectionTitleTest{\a:SectionTitleTest\tmp:SectionTitleTest\b:SectionTitleTest}

\section{}which I just want to remap to a style in an odt file that would be identified through the compile command--format odt+odttemplate+odttemplate=template.odt? For example, I may have\section{introduction}in latex, but my organization's document template may not expect me to useHeading-2butCustomSectionHeading -2. I'm hoping not to have to create 4ht and sty files except for custom commands separately packaged. Thanks! – EngBIRD Jul 06 '20 at 02:14.cfgfile. Look for\Configure{section}inooffice.4ht, copy it and change thetext:style-nameattribute to a new name. – michal.h21 Jul 13 '20 at 13:54\def\myendpar{\ifvmode\IgnorePar\fi\EndP} \Configure{section}{\myendpar\HCode{<text:p text:style-name="Illustration">}}{\HCode{</text:p>}}which didn't work. There are two text:style blocks so I'll play around with which I substitute before confirming my success. – EngBIRD Jul 13 '20 at 15:26\Configure{section}, not just two. – michal.h21 Jul 13 '20 at 15:45