[tex4ht] Why tex4ht changes apostrophe to Right Single Quotation Mark?

Nasser M. Abbasi nma at 12000.org
Tue Jan 9 06:42:11 CET 2018


On 1/8/2018 11:33 PM, Nasser M. Abbasi wrote:
> In Matlab, a string is something with apostrophe around it:
> 
> x='this is string'
> 
> Using '  character (the thing below " on standard keyboard).
> 
> When I compile this, even inside verbatim, the HTML comes
> out looking like
> 
> x=’this is string’
> 
> This is a problem. Since now when I copy the above from
> the HTML page to Matlab, it gives error. Since now it is
> no longer a string.
> 
> The problem seems to be that ' has unicode ’ but
> this is also the same code for Right Single Quotation Mark?
> 
> So why does it appear as ’ on the web page, when inside
> the plain text file it appears as '   ?
> 
> And what should one do to keep '  showing as ' in HTML?
> 
> Here is MWE
> 
> ------------------------------------------
> \documentclass[11pt]{article}
> \begin{document}
> 
> Why make4ht changes ' to  Right Single Quotation Mark \verb’|?
> It also does it in \verb|'| and verbatim:
> 
> \begin{verbatim}
> x='this is string'
> \end{verbatim}
> 
> \end{document}
> ---------------------
> 
> Compiled using make4ht foo.tex
> 
> This is what the HTML looks like
> 
> --------------
> <?xml version="1.0" encoding="iso-8859-1" ?>
> ....
> x=’this&#x00A0;is&#x00A0;string’
> --------------
> 
> Even when I compile using
> 
> make4ht -u foo.tex
> 
> The problem is still there
> -----------
> <?xml version="1.0" encoding="utf-8" ?>
> 
> </p>
>      <div class="verbatim" id="verbatim-1">
> x=’this is string’
> </div>
> -----------------
> 
> What do I need to do to keep apostrophe as apostrophe
> in the HTML?
> 
> Using tex4ht 2017 on Linux.
> 
> Thanks
> --Nasser
> 
> 
> 


Sorry, I meant to also send link to this web page which has
the codes

https://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html

But it says above that "U+0027	APOSTROPHE" and then it says
later

"U+2019	RIGHT SINGLE QUOTATION MARK ’
this is the preferred character to use for apostrophe"

This is all so confusing to me.  I just need ' to remain
' in the HTML.

Thanks
--Nasser


More information about the tex4ht mailing list