Skip to content

either allow text in ltx:rawhtml or strip its spaces #2744

@xworld21

Description

@xworld21

(Essentially a BookML-only issue, since plain LaTeXML does not offer a way to generate ltx:rawhtml. I am going to ship a workaround momentarily, so it's not even a serious problem.)

According to the schema, ltx:rawhtml cannot contain text nodes, so the generated XML contains extra indentation whitespace. The stylesheet however does not strip the space.

Minimal example:

\documentclass{article}
\usepackage{bookml/bookml}
\begin{document}
  no-\bmlRawHTML{<span>white</span>}-space
\end{document}

XML output:

<para xml:id="p1">
  <p>no-<rawhtml>
      <xhtml:span>white</xhtml:span>
    </rawhtml>-space</p>
</para>

The two solutions are

  1. either update the schema to allow text nodes in ltx:rawhtml (simplifying the example to \bmlRawHTML{white})
  2. or add a strip-space rule in the stylesheet (equivalently, use copy-foreign on select="*")

I marginally prefer solution 1, because I abuse \bmlRawHTML to enter arbitrary Unicode characters using XML entities, and to some extent 'raw html' can be just text. I can make BookML work as intended either way.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions