bugtex4ht - Bugs: bug #307, make4ht removes spaces in \href in...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #307: make4ht removes spaces in \href in LUA mode when using mathdesign package

Submitted by:  Nasser M. Abbasi <nma123>
Submitted on:  Sun May 29 04:55:10 2016  
 
Category: NonePriority: 5 - Normal
Severity: 5 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: Open

Tue May 31 21:44:35 2016, comment #4:

running tftopl md-chr8y.tfm /tmp/foo.pl shows that md-chr8y has no fontdimen parameters at all, thus the interword space in that font is zero. (and the font is useless for normal typesetting.)

i don't know what the intent was. maybe it was intended only for use with some other virtual fonts that did have normal fontdimens. just a guess.

Karl Berry <karl>
Project Administrator
Tue May 31 15:28:28 2016, comment #3:

> first: use of dvi's w vs. right commands is not related to kerns vs. glue.
> the two are equivalent. w is simply more efficient (it reuses the given value
> instead of repeating it).


>
> second: what dvi command is used, and/or whether kerns or glue are in use at
> the tex level (interword space can't be a kern item, anyway), is not up to the
> font. the engine determines this. luatex implements dvi output differently than
> the rest. for example, take this one-line plain tex file: \nopagenumbers x y
> z.\end run through tex foo.tex && dvitype foo.dvi >/tmp/pl.typ, compare to
> luatex --output-format=dvi foo.tex && dvitype foo.dvi >/lu.typ. You'll see
> that luatex does uses dvi "right" commands where the original tex uses "w"
> commands, even with CMR. Neither is wrong.
>


Ah, you are right, it seems that DVI export from pdftex and luatex differs in
this thing. And it tex4ht recognizes `right` commands as spaces with other
fonts, so it must be issue with this particular one.

> third: it is not surprising that pdf(la)tex and lua(la)tex would find different
> fonts. i've never understood lualatex font lookup, and can't help there.
> furthermore, the actions taken by the two engines after a font is found are
> different. so little can be said there.


It is different when OpenType fonts are involved, but it should be identical
for TFM fonts. I think either Mathdesign or Hyperref must select the different
fonts with different engines. I grepped the whole Mathdesign source tree and
can't find any `lua` string, so it seems to be caused rather by Hyperref.

> fourth: neverthless, what is true is that part of the definition of a (tex)
> math font is that the interword space parameter (\fontdimen2) is set to zero.
> (that parameter is for text setting, and math spacing is totally different.)
>
> therefore, my wild guess is that whatever font is being found by lualatex as a
> result of lualatex+tex4ht interpreting
> \usepackage[bitstream-charter]{mathdesign}
>
> is, at some level, a math font. I cannot guess whether it's an issue with the
> wrong font being found by lualatex, or tex4ht wrongly considering the font a
> math font, or a bug in tex4ht's .htf file, or ... something else entirely ...


The md-chr8y doesn't seem to be math font:

md-chr8y CharterBT-Roman "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <bchr8a.pfb

it doesn't have the .htf file, but the space doesn't show even when I created
one using Htfgen.

Michal Hoftich <michal_h21>
Project Member
Mon May 30 23:25:29 2016, comment #2:

first: use of dvi's w vs. right commands is not related to kerns
vs. glue. the two are equivalent. w is simply more efficient (it
reuses the given value instead of repeating it).

second: what dvi command is used, and/or whether kerns or glue are in
use at the tex level (interword space can't be a kern item, anyway), is
not up to the font. the engine determines this. luatex implements dvi
output differently than the rest. for example, take this one-line plain
tex file:
\nopagenumbers x y z.\end
run through tex foo.tex && dvitype foo.dvi >/tmp/pl.typ, compare to
luatex --output-format=dvi foo.tex && dvitype foo.dvi >/lu.typ.
You'll see that luatex does uses dvi "right" commands
where the original tex uses "w" commands, even with CMR.
Neither is wrong.

third: it is not surprising that pdf(la)tex and lua(la)tex would find
different fonts. i've never understood lualatex font lookup, and can't
help there. furthermore, the actions taken by the two engines after a
font is found are different. so little can be said there.
fourth: neverthless, what is true is that part of the definition of a
(tex) math font is that the interword space parameter (\fontdimen2) is
set to zero. (that parameter is for text setting, and math spacing is
totally different.)

therefore, my wild guess is that whatever font is being found by
lualatex as a result of lualatex+tex4ht interpreting
\usepackage[bitstream-charter]{mathdesign}

is, at some level, a math font. I cannot guess whether it's an issue
with the wrong font being found by lualatex, or tex4ht wrongly
considering the font a math font, or a bug in tex4ht's .htf file, or
... something else entirely ...

-------------

p.s. please ignore, completely unrelated to tex4ht, just testing out a
feature of puszcza's ticket system:

a verbatim line.
no verbatim-ending tag.
 
Karl Berry <karl>
Project Administrator
Mon May 30 11:47:10 2016, comment #1:

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?

Michal Hoftich <michal_h21>
Project Member
Sun May 29 04:55:10 2016, original submission:

I am not sure if this is an issue tex4ht or lua or who is at fault. But something is not right. Please see screen shot here

http://tex.stackexchange.com/questions/312040/tex4ht-removes-spaces-in-href-description-in-lua-mode-when-using-mathdesign-pack

Compiling

---------------------------------
\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}
--------------------

Produces a link with all the spaces removed from the href description. Compiling without --lua produces correct result.

ALso compiling without mathdesign but keeping --lua produces the above correct result. May be this is tex4ht not having full support for mathdesign package? It only shows up in lua mode.

Nasser M. Abbasi <nma123>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by karl (Posted a comment)
  • -unavailable- added by michal_h21 (Posted a comment)
  • -unavailable- added by nma123 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup+gray