Michal Hoftich <michal....@gmail.com> writes:

> On Mon, Feb 19, 2018 at 12:06 AM, Karl Berry <k...@freefriends.org> wrote:
>> Does anyone know if there is an easy way to make htlatex generate a
>> plain text "TeX" for \TeX, ditto "LaTeX" for \LaTeX?  I mean, a "native"
>> way at the tex4ht level, rather than redefining the macros in TeX or
>> postprocessing the HTML with sed, etc.  --thanks, karl.
. . .

> \Preamble{xhtml}
> \def\LaTeX{LaTeX}
> \begin{document}
> \EndPreamble

There's a way, originating for me from David Carlisle some
years ago, to do this so that one gets the typeset emulation
when CSS is effective and otherwise just "LaTeX" when CSS is
not available, as in a terminal window browser like "lynx"
or "w3m".

For that:

\def\LaTeX{<span class="ltxn">L<span class="ltxna">a</span>T<span 

along with the insertion of the following CSS in some appropriate place:

  display: inline-block;
  text-indent: 0;
  display: inline-block;
  font-size: 75%;
  text-transform: uppercase;
  vertical-align: .5ex;
  margin-left: -.48em;
  margin-right: -.2em;
  display: inline-block;
  text-transform: uppercase;
  margin-left: -.18em;
  margin-right: -.12em;
  margin-bottom: -0.5ex;

With slightly more advanced CSS one can omit the class names
on the sub-spans and use "child" specs.

                                    -- Bill

Reply via email to