[tex4ht] [bug #241] grave accent letter ` (hex 60) changes to left single quotation mark (hex 0xE2 0x80 0x98)

Nasser M. Abbasi nma at 12000.org
Fri Jan 16 13:49:36 CET 2015


On 1/16/2015 6:17 AM, Michal Hoftich wrote:
> I will repost my answer on TeX.sx. This is not a bug, but default
> LaTeX behaviour:
>
> ------------
>
> This is the default behaviour, you will get the same result even with
> `pdflatex`. You can use `upquote` package to redefine grave and
> upright-quote to produce correct glyphs:
>
>      \documentclass[12pt]{article}
>      \usepackage{upquote}
>      \begin{document}
>      `123`
>
>      \verb|`123`|
>      \end{document}
>
> the result:
>
>      <!--l. 6--><p class="noindent" >‘123‘
>      </p><!--l. 8--><p class="indent" >   <span
> class="obeylines-h"><span class="verb"><span
>      class="cmtt-12">`123`</span></span></span> </p>
>
> ---------
>
> Best regards,
> Michal

Thanks Michal. But there is still an issue. This is what I tried:

Using \usepackage{upquote}, does indeed correct the problem for tex4ht,
but _only_ for the verbatim text in the above example, not for
the normal text.

Yes, the normal text, appears the same in the pdf as it is on the
web page, but the encoding can't be the same. I found this, when I
copied the normal text out from pdf to text file and looked at
the hex encoding using

>xxd -p foo.txt

It was the hex60, which is what I wanted, same as the input.

But when I copied the normal text from the web page, and looked at
its hex encoding, it was the left single quotation mark. which
causes problem.

So, the encoding inside pdf can't be the same as the HTML generated for
the normal text. Even though they do appear to be the same (left single
quotation) when looking at them on the screen.

For pdf, I did not even need the \usepackage{upquote}, and was able
to copy both the normal and the verbatim text, and they both came out
as grave accent.  

But for htlatex, it did fix the verbatim part. Not the normal
text part. This was the same result as when using the patched
cmtt.htf I was testing with.

So, there is still a problem, with normal text. For now, I will use
verbatim with \usepackage{upquote} to avoid this problem. But for
normal text, I think there is still a problem, since it does not
work like with pdflatex or lualatex.

Thanks for your help.

--Nasser



More information about the tex4ht mailing list