Fonts & Character Sets"ff" and "fi" produce other characters

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
rplantz
Posts: 16
Joined: Mon Jan 21, 2008 12:35 am

"ff" and "fi" produce other characters

Post by rplantz »

I get odd characters in the .dvi file when I use "ff" or "fi" in my text. "ff" shows up as the Greek phi, and "fi" shows up as the combined oe. Processing the .dvi file with dvipdfm or dvips gives me the correct results. The problem is that tex4ht works from the .dvi file and produces null characters for these two character combinations.

This is a book. I've provided all the preamble stuff here but replaced the book content with an example that illustrates my problem.

What am I doing wrong?

Edit: I forgot to say that I'm using Document Viewer 3.14.1 to view the .dvi file.

I'm using:

Code: Select all

bob@ubuntu-desktop:~/LaTeX_HTML_problem$ latex -v
pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014/Debian)
kpathsea version 6.2.0
Copyright 2014 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.10; using libpng 1.6.10
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.26.2
My .tex code:

Code: Select all

\documentclass[openany]{book}
\usepackage[latin9]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage{microtype}
\usepackage{emptypage}
\usepackage{etex}
\usepackage{boxdims,tikz}
\usepackage{color}
\usepackage{geometry}
%%\geometry{
%%      paperwidth=467pt,paperheight=700pt,
%%      includeall=true,centering=true,
%%      nomarginpar=true,
%%      lmargin=14pt,rmargin=14pt,tmargin=7pt,bmargin=9pt
%%}
\geometry{
      paperwidth=612pt,paperheight=792pt,
      includeall=true,centering=true,
      nomarginpar=true,
      lmargin=108pt,rmargin=65pt,tmargin=53pt,bmargin=55pt
}
\usepackage{dejavu}
\usepackage{sectsty}
\allsectionsfont{\bfseries\sffamily}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{fancybox} \setlength{\shadowsize}{2pt}
\usepackage{multicol}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage[algochapter,ruled,linesnumbered,vlined]{algorithm2e}
\usepackage{makeidx}
\usepackage{epic}
\usepackage{fancyhdr}
\usepackage{listings}
\usepackage[format=hang]{caption}
\usepackage{calc}
\usepackage{ifthen}
\usepackage{alltt}
\usepackage{afterpage}
\usepackage{layout}
\usepackage{mparhack}
\usepackage{array}
\usepackage{plantz}
\usepackage{pstricks}
%%\usepackage[active,tightpage]{preview}
%%\PreviewEnvironment{equation}
\lstloadlanguages{C,C++,[gnu]assembler}
\lstset{%
    numberstyle=\tiny,        %
    numbers=left,             %
    numbersep=5pt,            %
    basicstyle=\ttfamily,     %
    showstringspaces=false,   %
    frame=tb,                 %
    language=[gnu]assembler,  %
    captionpos=b,             %
    emphstyle=\textit}
\newcounter{exer}
\newcounter{exersub}[exer]
\newcounter{examp}
\makeindex
\makeatletter
\let\mph@orig@picture\@picture
\renewcommand\@picture{\let\hb@xt@\mph@orig@hb@xt@\mph@orig@picture}
\renewcommand\l@lstlisting[2]{\@dottedtocline{1}{1.5em}{2.9em}{#1}{#2}}

\makeatother
\begin{document}
%%  \include{title}
%% The following four lines save \unitlength, prints the
%% layout (which changes \unitlength), then restores \unitlength.
%% \newlength{\myunit}
%% \setlength{\myunit}{\unitlength}
%% \layout
%% \setlength{\unitlength}{\myunit}
  \pagestyle{fancy}
  \fancyheadoffset[LE,RO]{0.3in}
  \fancyfoot{}
  \fancyhead[RO,LE]{\thepage}
  \fancyhead[LO]{\rightmark}
  \fancyhead[RE]{\leftmark}
  \setcounter{page}{1}

\section{Letters}
\subsection{Valid Letters}
AA Aa aA aa\\
BB Bb bB bb\\
CD Cd cD cd\\
\subsection{Invalid Letters}
FF Ff fF ff\\
FI Fi fI fi\\

\section{Strings}
a string of text\\
a fine string of text\\
a definition of an efficient and fine string of text\\
finally, the problem is solved!\\

\end{document}

Recommended reading 2024:

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

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

rplantz
Posts: 16
Joined: Mon Jan 21, 2008 12:35 am

"ff" and "fi" produce other characters

Post by rplantz »

Well, I found a solution. I deleted the line

Code: Select all

%%\usepackage{dejavu}
and the "ff" and "fi" ligatures are gone. It's strange, because they came up in text that was not in that font. (Edit: I was wrong here. The text was in the dejavu font.)

tex4ht no longer gets choked by these character combinations. Now I can move on to other issues with producing HTML from LaTeX.
Post Reply