[tex4ht-commits] [SCM] tex4ht updated: r399 - trunk/lit

michal_h21 at gnu.org.ua michal_h21 at gnu.org.ua
Tue May 8 12:59:58 CEST 2018


Author: michal_h21
Date: 2018-05-08 13:59:58 +0300 (Tue, 08 May 2018)
New Revision: 399

Modified:
   trunk/lit/ChangeLog
   trunk/lit/mktex4ht-cnf.tex
   trunk/lit/tex4ht-4ht.tex
   trunk/lit/tex4ht-sty.tex
Log:
Fixed XeTeX support

Modified: trunk/lit/ChangeLog
===================================================================
--- trunk/lit/ChangeLog	2018-05-07 18:08:03 UTC (rev 398)
+++ trunk/lit/ChangeLog	2018-05-08 10:59:58 UTC (rev 399)
@@ -1,3 +1,9 @@
+2018-05-08  Michal Hoftich  <michal.h21 at gmail.com>
+
+	* tex4ht-4ht.tex (usepackage.4ht): patch for expl3 package
+	* tex4ht-4ht.tex (usepackage-fontspec.4ht, tuenc-xetex.4ht,
+	tuenc-xetex-input.4ht): fixed XeTeX support.
+
 2018-05-04  Michal Hoftich  <michal.h21 at gmail.com>
 
 	* tex4ht-html5.tex (html5.4ht): added declarations for
@@ -2,2 +8,4 @@
 	additional languages supported by Polyglossia.
+	* tex4ht-sty.tex (tex4ht.sty): load XeTeX encoding support code if XeTeX is
+	active in order to support Unicode characters in the preamble.
 

Modified: trunk/lit/mktex4ht-cnf.tex
===================================================================
--- trunk/lit/mktex4ht-cnf.tex	2018-05-07 18:08:03 UTC (rev 398)
+++ trunk/lit/mktex4ht-cnf.tex	2018-05-08 10:59:58 UTC (rev 399)
@@ -326,6 +326,7 @@
 \AddFile{9}{fontspec-xetex}
 \AddFile{9}{fontspec-luatex}
 \AddFile{9}{tuenc-xetex}
+\AddFile{9}{tuenc-xetex-input}
 \AddFile{9}{tuenc-luatex}
 \AddFile{9}{framed}
 \AddFile{9}{mdframed}

Modified: trunk/lit/tex4ht-4ht.tex
===================================================================
--- trunk/lit/tex4ht-4ht.tex	2018-05-07 18:08:03 UTC (rev 398)
+++ trunk/lit/tex4ht-4ht.tex	2018-05-08 10:59:58 UTC (rev 399)
@@ -3475,7 +3475,24 @@
 \fi
 >>>
 
+%%%%%%%%%%%%%%%%%
+\Section{expl3.sty}
+%%%%%%%%%%%%%%%%%
 
+Expl3 package makes some unicode characters active. This clashes
+with out active characters for XeTeX, so we must deactivate them 
+temporarily.
+
+\<use package\><<<
+expl3,>>>
+
+\<add to usepackage\><<<
+\def\:temp{expl3}\ifx \@currname\:temp
+\xenunidelblock{Latin-expl3}%
+\AtEndOfPackage{\xeuniuseblock{Latin-expl3}}
+\fi
+>>>
+
 %%%%%%%%%%%%%%%%%%
 \Section{savetrees.sty}
 %%%%%%%%%%%%%%%%%%
@@ -3583,7 +3600,13 @@
 % Copyright 2017 TeX Users Group
 |<TeX4ht license text|>
 \:dontusepackage{fontenc}
-\RequirePackage{expl3}
+\ifdefined\XeTeXversion%
+\xenunidelblock{Latin-expl3}% expl3 package makes some characters active
+\RequirePackage{expl3}% we need to disable them before loading
+\xeuniuseblock{Latin-expl3}% and define again
+\else%
+\RequirePackage{expl3}%
+\fi%
 \PassOptionsToPackage{no-math}{fontspec}
 \ExplSyntaxOn
 \AtEndOfPackage{%
@@ -3591,9 +3614,15 @@
   \tl_gset:Nx \g_fontspec_encoding_tl {T1}
   \seq_new:N \fontspec_ht_scripts
   \seq_new:N \fontspec_ht_fontfamilies
+  \ifdefined\XeTeXversion
   \keys_define:nn {fontspec4ht}{
+    Script .code:n = \xeuniuseblock{#1}
+  }
+  \else
+  \keys_define:nn {fontspec4ht}{
     Script .code:n = \seq_put_right:Nn \fontspec_ht_scripts {#1}
   }
+  \fi
 \cs_set:Nn \fontspec_set_family:Nnn
  {
   % \tl_set:Nn \l__fontspec_family_label_tl { #1 }
@@ -5181,8 +5210,19 @@
 
 \<tuenc-xetex.4ht\><<<
 % tuenc-xetex.4ht, generated from |jobname.tex
-% Copyright 2017 TeX Users Group
+% Copyright 2018 TeX Users Group
 |<TeX4ht license text|>
+\ifdefined\xeuniuseblock\else
+\input tuenc-xetex-input.4ht
+\fi
+\Hinput{tuenc-xetex}
+\endinput
+>>> \AddFile{9}{tuenc-xetex}
+
+\<tuenc-xetex-input.4ht\><<<
+% tuenc-xetex.4ht, generated from |jobname.tex
+% Copyright 2018 TeX Users Group
+|<TeX4ht license text|>
 \input binhex
 
 % the code is inspited with newunicodechar.sty
@@ -5193,8 +5233,12 @@
   % the code inside \special will be converted back to utf8 by tex4ht
   \lowercase{\endgroup\protected\def~}{\special{t4ht at +&{35}x\hex{#1}{59}}x}
 }
-% \pokus{64}
 
+% remove character definition
+\newcommand\xeuniunregisterchar[1]{%
+  \global\catcode#1=11%
+}
+
 \newcount\xeuniblock
 
 % register unicode range #1 - #2
@@ -5220,6 +5264,8 @@
 % declarations multiple times
 \newcommand\xeuniuseblock[1]{\@nameuse{block:#1}\@namedef{block:#1}{\relax}}
 
+% disable active characters of given block
+\newcommand\xenunidelblock[1]{\bgroup\let\xeuniregisterchar\xeuniunregisterchar\@nameuse{block:#1}\egroup}
 
 % Unicode blocks definitions
 \xeuniblockdef{Latin}{%
@@ -5262,6 +5308,27 @@
   \xeuniregisterblockhex{2A00}{2AFF}%
   \xeuniregisterblockhex{2B00}{2BFF}%
 }
+% this block is used for temporarily disabling some characters
+% which are made active by expl3
+\xeuniblockdef{Latin-expl3}{
+  \xeuniregisterchar{"00CB}
+  \xeuniregisterchar{"00CC}
+  \xeuniregisterchar{"00CD}
+  \xeuniregisterchar{"0126}
+  \xeuniregisterchar{"0128}
+  \xeuniregisterchar{"012E}
+  \xeuniregisterchar{"012F}
+  \xeuniregisterchar{"0120}
+  \xeuniregisterchar{"0130}
+  \xeuniregisterchar{"0131}
+  \xeuniregisterchar{"0300}
+  \xeuniregisterchar{"0301}
+  \xeuniregisterchar{"0303}
+  \xeuniregisterchar{"0307}
+  \xeuniregisterchar{"1E9C}
+  \xeuniregisterchar{"1E9E}
+  \xeuniregisterchar{"1EA0}
+}
 \xeuniblockdef{Greek}{
   \xeuniregisterblockhex{0370}{03FF}
   \xeuniregisterblockhex{1F00}{1FFF}
@@ -5528,9 +5595,8 @@
 % load default latin block and blocks requested through Script option in fontspec's font 
 % selection commands
 \xeuniuseblock{Latin}
-\Hinput{tuenc-xetex}
 \endinput
->>> \AddFile{9}{tuenc-xetex}
+>>> \AddFile{9}{tuenc-xetex-input}
 
 
 \<tuenc-luatex.4ht\><<<

Modified: trunk/lit/tex4ht-sty.tex
===================================================================
--- trunk/lit/tex4ht-sty.tex	2018-05-07 18:08:03 UTC (rev 398)
+++ trunk/lit/tex4ht-sty.tex	2018-05-08 10:59:58 UTC (rev 399)
@@ -561,6 +561,7 @@
    |<early latex subs/sups|> 
 \fi
 |<block package loading|>
+|<xetex active characters|>
 |<hook at usepackage|>
 >>>
 
@@ -579,6 +580,16 @@
 }
 >>>
 
+Input definitions for Unicode blocks in XeLaTeX. It loads full Latin by default,
+others must be activated using \xeuniuseblock{blockname}
+
+\<xetex active characters\><<<
+\ifx\XeTeXversion\@undefined\else
+\ifx\xeuniuseblock\@undefined
+\input tuenc-xetex-input.4ht
+\fi\fi
+>>>
+
 \<hook at usepackage\><<<
 \let\:onefilewithoptions\@onefilewithoptions
 \def\@onefilewithoptions#1[#2]{%



More information about the tex4ht-commits mailing list