3

Running the code posted in this question, the first code shown there, posted by the accepted answer by Andrew Swann. When running the code through htlatex on texlive 2012 debian, I get the error

htlatex index.tex
This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012/Debian) restricted \write18 enabled. entering extended mode LaTeX2e <2011/06/27>

....

(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Missing $ inserted. $ l.28 \end{align*} ?

No errors when running latex nor pdflatex on the same code.

Any idea what causes this error? ps. here is a copy of the code just in case. (it will be nice if one can have a direct links at stackexchange to posted code fragments within messages, so that it is easier to point someone to a specific code on a web page).

\documentclass{article}

\usepackage{mathtools}
\usepackage{amsfonts}

\makeatletter
\newcommand{\mydmath}[1]{\( \m@th\displaystyle #1 \)}
\makeatother
\newcommand{\mydmathtowd}[2]{\hbox to #1{\mydmath{#2}}}
\newsavebox\mytmpbox

\DeclarePairedDelimiter{\abs}{\lvert}{\rvert}

\begin{document}

\sbox\mytmpbox{\mydmath{\adjustlimits\lim_{y\to\infty}\sup_{x\in\mathbb{R}}
\abs[\Big]{y^{9/2-\varepsilon}\bigl[\omega(x,y)-\omega_{\mathrm{as}}(x,y)\bigl]}}}
\begin{align*}
  \mydmathtowd{\wd\mytmpbox}{\adjustlimits\lim_{y\to\infty}\sup_{x\in\mathbb{R}}
  \abs[\Big]{y^{5/2-\varepsilon}\bigl[\vphantom{A^2}u(x,y)-u_{\mathrm{as}}(x,y)\bigr]}}
  & = 0 \\
  \mydmathtowd{\wd\mytmpbox}{\adjustlimits\lim_{y\to\infty}\sup_{x\in\mathbb{R}}
  \abs[\Big]{y^{5/2-\varepsilon}\bigl[\vphantom{A^2}v(x,y)-v_{\mathrm{as}}(x,y)\bigr]}}
  & = 0 \\
  \usebox\mytmpbox & = 0
\end{align*}

\end{document}
5
  • Works like a charm, here. Have you tried updating your packages?
    – jub0bs
    May 23, 2013 at 22:00
  • @Jubobs I am on debian system, and hence I use texlive debian. I have latest version 2012. I can't use the texlive update package tlmgr tug.org/texlive/tlmgr.html to update. I have to use debian package manager and so I am stuck until the repository there is updated to texlive 2013? I would not know how to update specific pakcages and all that with debian texlive. I need to go search to see if/when texlive 2013 can be used on my linux (it is mint/debian OS linux)
    – Nasser
    May 23, 2013 at 22:05
  • I would be very surprised if it didn't work out of the box, but I understand if you want to stick to the package manager. Besides, @Jubobs, it should be noted that the linked question received an accepted answer well before TL2013 went public, so there shouldn't be any issues. Jul 23, 2013 at 14:55
  • (And nice idea about the point-to-code-fragment feature! Might I suggest you give that a shout-out over at meta.SO?) Jul 23, 2013 at 14:57
  • 1
    I do see the issue here with a bang-up-to-date TL2013.
    – Joseph Wright
    Aug 17, 2013 at 7:32

1 Answer 1

3

Two issues:

  • \(..\) in \mydmath definition. Change into \ensuremath{..}.
  • \adjustlimits gives trouble for tex4ht. The idea is to define it as \relax for tex4ht. This can be done via configuration file, e.g.,

    foo.cfg:
    \Preamble{html}
    \let\adjustlimits\relax
    \begin{document}
    \EndPreamble
    

    Run tex4ht with configuration: htlatex index.tex "foo,html"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .