Text FormattingImproper Output for HTML in Math Mode

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Improper Output for HTML in Math Mode

Post by Sundial »

Consider this example.

Code: Select all

\documentclass[a4paper,11pt] {article}
\usepackage[english]{babel}                 
\usepackage{amsmath}         
\begin{document}
$$
  \begin {array} {rl}
    \psi = & \psi_a - \dfrac{F(\psi_a)}{F'(\psi_a)}\\
      \vphantom{-}\\      
    \rm{until} & |\psi - \psi_a| < \epsilon \quad \rm{(accuracy\; desired)}      
  \end {array}              
$$
\end{document}
What happens after this command?
htlatex name "html.1.info"
The file name.html shows "accuracydesired" without space in between. Thanks for the drift.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Improper Output for HTML in Math Mode

Post by localghost »

We are in the LaTeX2e era. Hence we don't use some things any more.
  • Unnumbered displayed equations are not typeset by the TeX syntax $$ … $$, but by the correct LaTeX syntax \[ … \].
  • Roman typeface is not introduced by the switch \rm (which has no argument), but by \rmfamily. In this case the \text command from amsmath is more suitable.
The below example runs smooth with TeX4HT (which uses HTLaTeX). The output is attached.

Code: Select all

\documentclass[11pt,a4paper] {article}
\usepackage[T1]{fontenc}
\usepackage{amsmath}

\begin{document}
  \[
    \begin{array}{rl}
      \psi = & \psi_a - \dfrac{F(\psi_a)}{F'(\psi_a)}\\
      \vphantom{-} \\
      \text{until} & |\psi - \psi_a| < \epsilon \quad \text{(accuracy desired)}
    \end{array}
  \]
\end{document}
Thorsten
Attachments
example.html.gz
(504 Bytes) Downloaded 472 times
Sundial
Posts: 57
Joined: Thu Apr 19, 2012 7:28 pm

Improper Output for HTML in Math Mode

Post by Sundial »

Oh yes, pretty suggestion! With \text{...} I'm satisfied now. Thank you very much!
Post Reply