2

I found that tex4ebook (or tex4ht) doesn't treat well with subscripts or superscripts in \newcommand. For example,

\documentclass{amsart}

\newcommand\dotimes{{\otimes}^{\mathbb L}}
\newcommand\powerab{a^b}

\begin{document}
Let's see $M\dotimes N$.

Let's see $M{\otimes}^{\mathbb L}_RN$.

Let's see $\powerab c$.
\end{document}

The \dotimes and \powerab are rendered wrongly (for example, here \powerab is rendered as ab (b seems rendered somewhat smaller, but not as a superscript), rather than a^b) without pic-m option. Is it good to replace newcommand by something else?

1 Answer 1

4

Sub and super scripts are bit complicated. tex4ht is being activated only after \begin{document}, so the commands defined in the preamble cannot use the configurations for sub and superscripts that are used later in the document. It is possible to use the early^ and early_ options to fix that:

tex4ebook filename.tex "early_,early^"

Better solution is to use the \sp and \sb commands, which works always:

\documentclass{amsart}

\newcommand\dotimes{{\otimes}\sp{\mathbb L}}
\newcommand\powerab{a\sp{b}}

\begin{document}
Let's see $M\dotimes N$.

Let's see $M{\otimes}^{\mathbb L}_RN$.

Let's see $\powerab c$.
\end{document}

enter image description here

2
  • Can we put early^ and early_ in some way into config.cfg?
    – Yai0Phah
    Mar 29, 2019 at 11:23
  • @FrankScience it seems that it is not possible, because the .cfg file is read at the end of preamble as well
    – michal.h21
    Mar 29, 2019 at 12:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.