summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2022-11-28 21:49:52 +0000
committerKarl Berry <karl@freefriends.org>2022-11-28 21:49:52 +0000
commit1129747fa4dab86f7460ecfcb46c82fcbbb13e29 (patch)
treedd6636959a1afb9249c6eaf0e60b6aa8a974b7ac
parent13c21a7d28314ccd114931580b7e6e2364377856 (diff)
support musicography package, tex4ht r1253; remove \fixmathjaxsec, tex4ht r1254; provide \RestoreMathJaxEnvironments, tex4ht r1255; restore math at beginning of tikz, tex4ht r1256
git-svn-id: svn://tug.org/texlive/trunk@65134 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog21
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex3
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex88
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex49
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/glossaries.4ht52
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht6
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht40
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/musicography.4ht84
8 files changed, 300 insertions, 43 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
index 0730a3684ec..596ecd23402 100644
--- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog
+++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
@@ -1,3 +1,24 @@
+2022-11-28 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): restore math
+ environments automatically at the beginning of TikZ environments.
+ https://tex.stackexchange.com/a/666771/2891
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): provided the
+ \RestoreMathJaxEnvironments command.
+ https://tex.stackexchange.com/a/666771/2891
+
+ * tex4ht-mathjax.tex (mathjax-latex-4ht.4ht): removed the
+ \fixmathjaxsec command, robust commands should be used instead.
+ https://tex.stackexchange.com/q/666705/2891
+
+ * tex4ht-4ht.tex (musicography.4ht): added support for the
+ Musicography package.
+
+2022-11-27 Karl Berry <karl@freefriends.org>
+
+ * tex4ht-4ht.tex (imakeidx.4ht): copyright 2022.
+
2022-11-25 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-4ht.tex (imakeidx.4ht): fixed error in
diff --git a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex
index 7d3c09146e5..2b108f81c1b 100644
--- a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex
@@ -1,4 +1,4 @@
-% $Id: mktex4ht-cnf.tex 1251 2022-11-25 14:09:11Z michal_h21 $
+% $Id: mktex4ht-cnf.tex 1253 2022-11-28 09:54:31Z michal_h21 $
% Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex.
% Read by tex4ht-cond4ht.
%
@@ -381,6 +381,7 @@
\AddFile{9}{xskak}
\AddFile{9}{texmate}
\AddFile{9}{menukeys}
+\AddFile{9}{musicography}
\AddFile{9}{animate}
\AddFile{9}{sectionbreak}
\AddFile{9}{subfiles}
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
index dbc95f32722..e55a7e212e9 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-4ht.tex 1251 2022-11-25 14:09:11Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1253 2022-11-28 09:54:31Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
% Copyright 2009-2022 TeX Users Group
@@ -31110,7 +31110,7 @@ multind.sty\EndLink
\<imakeidx.4ht\><<<
% imakeidx.4ht (|version), generated from |jobname.tex
-% Copyright 2019 TeX Users Group
+% Copyright 2019-2022 TeX Users Group
|<TeX4ht license text|>
|<imakeidx.sty|>
@@ -33749,6 +33749,90 @@ because
\endinput
>>> \AddFile{9}{menukeys}
+\<musicography.4ht\><<<
+% musicography.4ht (|version), generated from |jobname.tex
+% Copyright 2022 TeX Users Group
+|<TeX4ht license text|>
+|<musicography symbols|>
+\Hinput{musicography}
+\endinput
+>>>\AddFile{9}{musicography}
+
+We convert most of the musicography symbols to pictures.
+It isn't optiomal, but I found that corresponding Unicode characters
+are either missing, or produce weird overlapping with the following
+character.
+
+The biggest issue with pictures is that it can produce a huge number
+of images for repeated use of the each command. It could be
+better to use specific image for each symbol only once. And
+also to better handle the vertical alignment to the baseline,
+similarly how the \''\PicMath' command does. But my tests
+in this area failed so far, so I will leave it as it is now.
+
+\<musicography symbols\><<<
+\NewConfigure{musSymbol}{2}
+\NewDocumentCommand{\:musSymbol}{ O{\musFont} m m m m }{%
+ \a:musSymbol\o:musSymbol:[#1]{#2}{#3}{#4}{#5}\b:musSymbol%
+}
+
+\NewConfigure{musFlaggedNote}{2}
+\NewDocumentCommand{\:musFlaggedNote}{ m m }{%
+ \a:musFlaggedNote\o:musFlaggedNote:{#1}{#2}\b:musFlaggedNote
+}
+\HLet\musFlaggedNote\:musFlaggedNote
+
+
+\NewConfigure{musStemmedNote}{2}
+\NewDocumentCommand{\:musStemmedNote}{ m }{%
+ \a:musStemmedNote\o:musStemmedNote:{#1}\b:musStemmedNote%
+}
+
+\HLet\musStemmedNote\:musStemmedNote
+
+
+\NewConfigure{musDottedNote}{2}
+\NewDocumentCommand{\:musDottedNote}{ m }{%
+ \a:musDottedNote\o:musDottedNote:{#1}\b:musDottedNote%
+}
+
+\HLet\musDottedNote\:musDottedNote
+
+
+\NewConfigure{musStack}{2}
+\NewDocumentCommand{\:musStack}{ O{\musNumFont} m }{%
+ \a:musStack\o:musStack:[#1]{#2}\b:musStack%
+}
+
+\HLet\musStack\:musStack
+
+\NewConfigure{meterCplus}{2}
+\NewDocumentCommand{\:meterCplus}{ m }{\a:meterCplus\o:meterCplus:{#1}\b:meterCplus}
+\HLet\meterCplus\:meterCplus
+
+
+\Configure{musStack}{\Picture+{}}{\EndPicture}
+\Css{.mustack{display:block-inline}}
+\Configure{musDottedNote}{\Picture+{}}{\EndPicture}
+\Configure{musStemmedNote}{\Picture+{}}{\EndPicture}
+\Configure{musFlaggedNote}{\Picture+{}}{\EndPicture}
+\Configure{musSymbol}{\Picture+{}}{\EndPicture}
+\Configure{meterCplus}{\Picture+{}}{\EndPicture}
+
+
+% \def\:tempa#1#2{%
+% \def\:tempb{\x:unicode{#2}}%
+% \HLet#1\:tempb%
+% }
+% these characters are strange, they seems to overlap with the following character, and they are too small
+% it is probably better to use images
+% \:tempa\musEighth{1D160}
+% \:tempa\musSixteenth{1D161}
+% \:tempa\musThirtySecond{1D162}
+% \:tempa\musSixtyFourth{1D163}
+
+>>>
+
%%%%%%%%%%%%%%%%%%%%%%%%
\Section{vanilla.sty}
%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex
index e93531455a2..0e62cc872e2 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-mathjax.tex
@@ -1,4 +1,4 @@
-% $Id: tex4ht-mathjax.tex 1215 2022-10-17 13:58:09Z michal_h21 $
+% $Id: tex4ht-mathjax.tex 1256 2022-11-28 15:50:18Z michal_h21 $
% compile: latex tex4ht-mathjax
%
% Copyright 2018-2022 TeX Users Group
@@ -26,6 +26,7 @@
\AtBeginDocument{%
|<configurations|>
|<mhchem configurations|>
+|<restore environments|>
}
\endinput
>>>
@@ -114,6 +115,32 @@ environments. They will then keep the LaTeX code unchanged.
}
>>>
+In pictures, we want to use the original version of the math environments. Because we use
+an agressive verbatim method for the environments, we cannot use the usual \verb'\HLet' method.
+Instead, we save the original meaning, and user needs to restore it manually, using
+the \verb'\RestoreMathJaxEnvironments' command.
+
+\<defined commands\><<<
+\ExplSyntaxOn
+\seq_new:N\:savedmathjaxenvs
+
+\newcommand\:savemathjaxenv[1]{%
+ \seq_gput_right:Nn\:savedmathjaxenvs{#1}
+ \expandafter\let\csname mathjax-#1\expandafter\endcsname\csname #1\endcsname%
+ \expandafter\let\csname mathjax-end#1\expandafter\endcsname\csname end#1\endcsname%
+}
+
+\newcommand\RestoreMathJaxEnvironment[1]{%
+ \expandafter\let\csname #1\expandafter\endcsname\csname mathjax-#1\endcsname%
+ \expandafter\let\csname end#1\expandafter\endcsname\csname mathjax-end#1\endcsname%
+}
+
+\newcommand\RestoreMathJaxEnvironments{%
+ \seq_map_function:NN\:savedmathjaxenvs\RestoreMathJaxEnvironment%
+}
+\ExplSyntaxOff
+>>>
+
The \verb|\VerbMath| command redefines environments to pass their content
verbatim to the HTML output.
@@ -129,6 +156,7 @@ numbers them consecutively. In these cases, other mechanisms may be necessary.
\cs_generate_variant:Nn \regex_extract_once:nnNTF {nV}
\newcommand\VerbMath[2][]{%
\cs_if_exist:cTF{#2}{
+ \:savemathjaxenv{#2}%
\RenewDocumentEnvironment{#2}{+!b}{%
\NoFonts\expandafter\VerbMathToks\expandafter{\detokenize{##1}}{#2}\EndNoFonts%
\ifx\relax#1\relax\else%
@@ -148,10 +176,13 @@ keep their verbatim appearance in the TOC
\def\fixmathjaxtoc#1{\Configure{writetoc}{\def#1{\detokenize{#1}}}}
>>>
-Some math commands cause issues when used in sections, so we will deactivate them.
+This was meant to fix some commands in sectioning commands, but it is not
+a good solution. Better is to define the problematic commands as robust.
-\<defined commands\><<<
+\<not defined commands\><<<
\def\fixmathjaxsec#1{\def#1{\detokenize{#1}}}
+\fixmathjaxsec\right
+\fixmathjaxsec\left
>>>
Require verbatim math environments.
@@ -207,8 +238,6 @@ them into pictures.
Fixes for tables of contents.
\<configurations\><<<
-\fixmathjaxsec\left
-\fixmathjaxsec\right
\fixmathjaxtoc\int
\fixmathjaxtoc\,
\fixmathjaxtoc\sin
@@ -241,4 +270,14 @@ Fixes for tables of contents.
}{}
>>>
+Restore environments redefined to produce verbatim output to their
+original meaning in the picture mode. Otherwise math cannot work
+inside TikZ etc.
+
+\<restore environments\><<<
+\@ifpackageloaded{tikz}{%
+\tikzset{every picture/.append code={\RestoreMathJaxEnvironments}}
+}{}
+>>>
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/tex4ht/glossaries.4ht b/Master/texmf-dist/tex/generic/tex4ht/glossaries.4ht
index c5476ebbfae..43cf42c0fb5 100644
--- a/Master/texmf-dist/tex/generic/tex4ht/glossaries.4ht
+++ b/Master/texmf-dist/tex/generic/tex4ht/glossaries.4ht
@@ -1,31 +1,23 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% glossaries.4ht 2009-05-21-09:32 %
-% Copyright (C) 2008--2009 Eitan M. Gurari %
-% %
-% This work may be distributed and/or modified under the %
-% conditions of the LaTeX Project Public License, either %
-% version 1.3c of this license or (at your option) any %
-% later version. The latest version of this license is %
-% in %
-% http://www.latex-project.org/lppl.txt %
-% and version 1.3c or later is part of all distributions %
-% of LaTeX version 2005/12/01 or later. %
-% %
-% This work has the LPPL maintenance status "maintained".%
-% %
-% This Current Maintainer of this work %
-% is Eitan M. Gurari. %
-% %
-% If you modify this program your changing its signature %
-% with a directive of the following form will be %
-% appreciated. %
-% \message{signature} %
-% %
-% gurari@cse.ohio-state.edu %
-% http://www.cse.ohio-state.edu/~gurari %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\immediate\write-1{version 2009-05-21-09:32}
-
+% glossaries.4ht 2022-11-25-13:16 %
+% Copyright (C) 2008-2009 Eitan M. Gurari %
+% Copyright 2009-2022 TeX Users Group
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any
+% later version. The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions
+% of LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work
+% is the TeX4ht Project <http://tug.org/tex4ht>.
+%
+% If you modify this program, changing the
+% version identification would be appreciated.
\def\:tempc#1#2{\Link{#1}{}#2\EndLink}
\HLet\@glslink\:tempc
\def\:tempc#1#2{\Link{}{#1}\EndLink#2}
@@ -47,6 +39,12 @@
}
\HLet\@gls@removespaces\:tempc
+\Configure{@begin}{theglossary}{
+ \Configure{theindex}{}{}{}{}{}{}{}{}{}{}
+ \def\idx:item{\SaveEverypar\ht:everypar{}}
+ \let\end:theidx\empty
+}
+
\Hinput{glossaries}
\endinput
diff --git a/Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht b/Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht
index 572384b574a..16af14dc0ea 100644
--- a/Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht
+++ b/Master/texmf-dist/tex/generic/tex4ht/imakeidx.4ht
@@ -1,5 +1,5 @@
-% imakeidx.4ht (2022-11-25-13:16), generated from tex4ht-4ht.tex
-% Copyright 2019 TeX Users Group
+% imakeidx.4ht (2022-11-27-07:50), generated from tex4ht-4ht.tex
+% Copyright 2019-2022 TeX Users Group
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -16,7 +16,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2022-11-25-13:16}
+\immediate\write-1{version 2022-11-27-07:50}
\def\:temp#1#2#3{\html:addr%
diff --git a/Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht b/Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht
index a933cf25226..f4b4e99b2d9 100644
--- a/Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht
+++ b/Master/texmf-dist/tex/generic/tex4ht/mathjax-latex-4ht.4ht
@@ -1,4 +1,4 @@
-% mathjax-latex-4ht.4ht (2022-10-17-13:57), generated from tex4ht-mathjax.tex
+% mathjax-latex-4ht.4ht (2022-11-28-13:11), generated from tex4ht-mathjax.tex
% Copyright 2018-2022 TeX Users Group
%
% This work may be distributed and/or modified under the
@@ -16,7 +16,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2022-10-17-13:57}
+\immediate\write-1{version 2022-11-28-13:11}
\ExplSyntaxOn
@@ -54,9 +54,28 @@
\end{#2}}%
}
\ExplSyntaxOn
+\seq_new:N\:savedmathjaxenvs
+
+\newcommand\:savemathjaxenv[1]{%
+ \seq_gput_right:Nn\:savedmathjaxenvs{#1}
+ \expandafter\let\csname mathjax-#1\expandafter\endcsname\csname #1\endcsname%
+ \expandafter\let\csname mathjax-end#1\expandafter\endcsname\csname end#1\endcsname%
+}
+
+\newcommand\RestoreMathJaxEnvironment[1]{%
+ \expandafter\let\csname #1\expandafter\endcsname\csname mathjax-#1\endcsname%
+ \expandafter\let\csname end#1\expandafter\endcsname\csname mathjax-end#1\endcsname%
+}
+
+\newcommand\RestoreMathJaxEnvironments{%
+ \seq_map_function:NN\:savedmathjaxenvs\RestoreMathJaxEnvironment%
+}
+\ExplSyntaxOff
+\ExplSyntaxOn
\cs_generate_variant:Nn \regex_extract_once:nnNTF {nV}
\newcommand\VerbMath[2][]{%
\cs_if_exist:cTF{#2}{
+ \:savemathjaxenv{#2}%
\RenewDocumentEnvironment{#2}{+!b}{%
\NoFonts\expandafter\VerbMathToks\expandafter{\detokenize{##1}}{#2}\EndNoFonts%
\ifx\relax#1\relax\else%
@@ -68,7 +87,6 @@
}
\ExplSyntaxOff
\def\fixmathjaxtoc#1{\Configure{writetoc}{\def#1{\detokenize{#1}}}}
-\def\fixmathjaxsec#1{\def#1{\detokenize{#1}}}
\AtBeginDocument{%
\VerbMath{subarray}
@@ -108,8 +126,6 @@
\ConfigureEnv{gather*}{}{}{}{}
\ConfigureEnv{multline}{}{}{}{}
\ConfigureEnv{multline*}{}{}{}{}
-\fixmathjaxsec\left
-\fixmathjaxsec\right
\fixmathjaxtoc\int
\fixmathjaxtoc\,
\fixmathjaxtoc\sin
@@ -139,6 +155,10 @@
\def\ce#1{\texttt{\detokenize{\(\ce{#1}\)}}}
}{}
+\@ifpackageloaded{tikz}{%
+\tikzset{every picture/.append code={\RestoreMathJaxEnvironments}}
+}{}
+
}
\endinput
@@ -618,5 +638,15 @@
+
+
+
+
+
+
+
+
+
+
\endinput
diff --git a/Master/texmf-dist/tex/generic/tex4ht/musicography.4ht b/Master/texmf-dist/tex/generic/tex4ht/musicography.4ht
new file mode 100644
index 00000000000..48dde27ac71
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/tex4ht/musicography.4ht
@@ -0,0 +1,84 @@
+% musicography.4ht (2022-11-28-13:11), generated from tex4ht-4ht.tex
+% Copyright 2022 TeX Users Group
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either
+% version 1.3c of this license or (at your option) any
+% later version. The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions
+% of LaTeX version 2005/12/01 or later.
+%
+% This work has the LPPL maintenance status "maintained".
+%
+% The Current Maintainer of this work
+% is the TeX4ht Project <http://tug.org/tex4ht>.
+%
+% If you modify this program, changing the
+% version identification would be appreciated.
+\immediate\write-1{version 2022-11-28-13:11}
+
+\NewConfigure{musSymbol}{2}
+\NewDocumentCommand{\:musSymbol}{ O{\musFont} m m m m }{%
+ \a:musSymbol\o:musSymbol:[#1]{#2}{#3}{#4}{#5}\b:musSymbol%
+}
+
+\NewConfigure{musFlaggedNote}{2}
+\NewDocumentCommand{\:musFlaggedNote}{ m m }{%
+ \a:musFlaggedNote\o:musFlaggedNote:{#1}{#2}\b:musFlaggedNote
+}
+\HLet\musFlaggedNote\:musFlaggedNote
+
+
+\NewConfigure{musStemmedNote}{2}
+\NewDocumentCommand{\:musStemmedNote}{ m }{%
+ \a:musStemmedNote\o:musStemmedNote:{#1}\b:musStemmedNote%
+}
+
+\HLet\musStemmedNote\:musStemmedNote
+
+
+\NewConfigure{musDottedNote}{2}
+\NewDocumentCommand{\:musDottedNote}{ m }{%
+ \a:musDottedNote\o:musDottedNote:{#1}\b:musDottedNote%
+}
+
+\HLet\musDottedNote\:musDottedNote
+
+
+\NewConfigure{musStack}{2}
+\NewDocumentCommand{\:musStack}{ O{\musNumFont} m }{%
+ \a:musStack\o:musStack:[#1]{#2}\b:musStack%
+}
+
+\HLet\musStack\:musStack
+
+\NewConfigure{meterCplus}{2}
+\NewDocumentCommand{\:meterCplus}{ m }{\a:meterCplus\o:meterCplus:{#1}\b:meterCplus}
+\HLet\meterCplus\:meterCplus
+
+
+\Configure{musStack}{\Picture+{}}{\EndPicture}
+\Css{.mustack{display:block-inline}}
+\Configure{musDottedNote}{\Picture+{}}{\EndPicture}
+\Configure{musStemmedNote}{\Picture+{}}{\EndPicture}
+\Configure{musFlaggedNote}{\Picture+{}}{\EndPicture}
+\Configure{musSymbol}{\Picture+{}}{\EndPicture}
+\Configure{meterCplus}{\Picture+{}}{\EndPicture}
+
+
+% \def\:tempa#1#2{%
+% \def\:tempb{\x:unicode{#2}}%
+% \HLet#1\:tempb%
+% }
+% these characters are strange, they seems to overlap with the following character, and they are too small
+% it is probably better to use images
+% \:tempa\musEighth{1D160}
+% \:tempa\musSixteenth{1D161}
+% \:tempa\musThirtySecond{1D162}
+% \:tempa\musSixtyFourth{1D163}
+
+
+\Hinput{musicography}
+\endinput
+