2

I am using the following code to change the typeface to Helvetica in the entire document:

\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault} 
\usepackage[T1]{fontenc}

This works throughout all environments in the DVI, but not in the xhtml output, where all the tables and their text elements are in \rm. I checked the suspect tables and am not using \small, \scriptsize, or \tiny, after \begin{table}, which will reset everything to \rm.

Is there a switch setting I need for this, or a package?

2

If you want to modify the overall appearance of your document, you need to use CSS. tex4ht doesn't keep information about the basic document font. It only saves information about font size, shape or font family when you use font switches like \itshape, \large, etc.

The following configuration changes the main document font to Helvetica or some of its clones:

\Preamble{xhtml}
\Css{body{ font-family: "Helvetica Neue", Helvetica, "Nimbus Sans", Arial, sans-serif;}}
\begin{document}
\EndPreamble

Sample:

\documentclass{article}
\usepackage[scaled]{helvet}
\renewcommand\familydefault{\sfdefault} 
\usepackage[T1]{fontenc}
\begin{document}
\section{section}

test \itshape italic

\begin{tabular}{l}
  hello table
\end{tabular}

\end{document}

Result:

enter image description here

|improve this answer|||||

Your Answer

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