You can try to suppress both those tags using CSS in an included .css
file (or inserting in the HTML code between <style>
and </style>
):
span.titlemark, span.titlemark + br {
display: none;
}
But you would have to test that on all devices to see if their renderers correctly handle it.¹
If you don't want to go into the effort of testing this, it is better to remove both nodes altogether, with appropriate parsing of the input. Using python (2.x) and the BeautifulSoup package², you can do:
import sys
import io
from bs4 import BeautifulSoup
with io.open(sys.argv[1]) as fp:
soup = BeautifulSoup(fp)
for node in soup.select("span.titlemark"):
print node.get_text()
sibling = node.find_next_sibling()
if sibling and sibling.name == 'br' and not sibling.get_text():
sibling.extract()
node.extract()
with io.open(sys.argv[1], 'w') as fp:
fp.write(unicode(soup))
to get rid of both.³ BeautifulSoup supports several html/xml parser, depending on the type and quality of the output of htlatex
, you might need to experiment with the alternatives to get better/faster results.
htlatex
is a shell script, so you could make a copy (/usr/local/bin/htlatexstrip
) and add calling the python script as a postprocessing step in there.
¹ The X + Y suppresses the sibling <br />
node
² install with pip install beautifulsoup4
or easy_install beautifulsoup4
³ I am sure you can do something like that easily in PERL (or Ruby) as well, I just don't know how
latexht
, but am a bit of newbie with it. For now I have usedsed
to remove it, but thought perhaps there was a better way. Eventually will have to figure out how to eliminate in the first place.latexht
instead ofhtlatex
in your previous comment got me of to the wrong tangent. Google search is not smart enough to see through that (and neither am I).