Any idea why this MWE

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath,mathtools}
\usepackage[bitstream-charter]{mathdesign}
\usepackage[utf8]{inputenc} %DO NOT USE WIT LUALATEX, only with pdflatex
\usepackage{hyperref}

\begin{document}
\href{foo}{what happened to the spaces between the words}
\end{document}

When compiled using make4ht --lua foo.tex produces this HTML

Mathematica graphics

Compiling without --lua produces this

Mathematica graphics

ALso compiling without mathdesign but keeping --lua produces the above correct result.

So there seems to be a conflict between lua and mathdesign package?

Is there a way to correct this? Am I doing something I should not be doing? TL 2015.

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
 fontenc.sty
   t1enc.def    2005/09/27 v1.99g Standard LaTeX file
 amsmath.sty    2013/01/14 v2.14 AMS math features
 amstext.sty    2000/06/29 v2.01
  amsgen.sty    1999/11/30 v2.0
  amsbsy.sty    1999/11/29 v1.2d
  amsopn.sty    1999/12/14 v2.01 operator names
mathtools.sty    2015/11/12 v1.18 mathematical typesetting tools
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
    calc.sty    2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
 mhsetup.sty    2010/01/21 v1.2a programming setup (MH)
inputenc.sty    2015/03/17 v1.2c Input encoding file
    utf8.def    2015/09/07 v1.1p UTF-8 support for inputenc
   t1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  ot1enc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
  omsenc.dfu    2015/09/07 v1.1p UTF-8 support for inputenc
hyperref.sty    2012/11/06 v6.83m Hypertext links for LaTeX
hobsub-hyperref.sty    2012/05/28 v1.13 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty    2012/05/28 v1.13 Bundle oberdiek, subset generic (HO)
  hobsub.sty    2012/05/28 v1.13 Construct package bundles (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
  ifvtex.sty    2010/03/01 v1.5 Detect VTeX and its facilities (HO)
 intcalc.sty    2007/09/27 v1.1 Expandable calculations with integers (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
pdfescape.sty    2011/11/25 v1.13 Implements pdfTeX's escape features (HO)
bigintcalc.sty    2012/04/08 v1.3 Expandable calculations on big integers (HO)
  bitset.sty    2011/01/30 v1.1 Handle bit-vector datatype (HO)
uniquecounter.sty    2011/01/30 v1.2 Provide unlimited unique counter (HO)
letltxmacro.sty    2010/09/02 v1.4 Let assignment for LaTeX macros (HO)
 hopatch.sty    2012/05/28 v1.2 Wrapper for package hooks (HO)
xcolor-patch.sty    2011/01/30 xcolor patch
atveryend.sty    2011/06/30 v1.8 Hooks at the very end of document (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
refcount.sty    2011/10/16 v3.4 Data extraction from label references (HO)
 hycolor.sty    2011/01/30 v1.7 Color options for hyperref/bookmark (HO)
 ifxetex.sty    2010/09/12 v0.6 Provides ifxetex conditional
 auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
  pd1enc.def    2012/11/06 v6.83m Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg    2002/06/06 v1.2 hyperref configuration of TeXLive
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
 hpdftex.def    2012/11/06 v6.83m Hyperref driver for pdfTeX
rerunfilecheck.sty    2011/04/15 v1.7 Rerun checks for auxiliary files (HO)
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
supp-pdf.mkii
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
 nameref.sty    2012/10/27 v2.43 Cross-referencing by name of section
gettitlestring.sty    2010/12/03 v1.4 Cleanup title references (HO)
 ***********
  • it seems that different fonts are selected by mathdesign under lualatex and pdflatex. I would include mathdesign optionally only when tex4ht isn't used – michal.h21 May 29 '16 at 8:30
  • if you are using that document with luatex you shouldn't have \usepackage[T1]{fontenc}, or as it says in your comment use inputenc – David Carlisle May 29 '16 at 8:42

The strange issue is that different fonts are selected when compiled with pdftex and luatex. I cannot figure out how the selection works from the mathdesign source code, anyway, when I took a look at the DVI code, there is a difference:

pdftex:

   set: 'what'
      w: 2.678421pt
      set: 'happened'
      w0:
      set: 'to'
      w0:
      set: 'the'
      w0:
      set: 'spaces'
      w0:
      set: 'between'
      w0:
      set: 'the'
      w0:
      set: 'words'

luatex:

  set: 'what'
  right: 2.678421pt
  set: 'happened'
  right: 2.678421pt
  set: 'to'
  right: 2.678421pt
  set: 'the'
  right: 2.678421pt
  set: 'spaces'
  right: 2.678421pt
  set: 'between'
  right: 2.678421pt
  set: 'the'
  right: 2.678421pt
  set: 'words'

I am not expert on the DVI format, but I guess that font selected by luatex uses kerns instead of spaces. So maybe it is a font isssue? Can anybody confirm that?

Anyway, as the font changing in this case affects only PDF form, in HTML it doesn't matter, I would use conditional compilation and include the mathdesign only when the document is compiled with pdflatex:

\ifdefined\HCode
\else
   \usepackage[bitstream-charter]{mathdesign}
\fi

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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