summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2023-01-12 22:40:10 +0000
committerKarl Berry <karl@freefriends.org>2023-01-12 22:40:10 +0000
commite72757fe2be6de55d81c066e10e46e5ef837c1bc (patch)
tree3297a0a96c31b056e00ff4d90b499a15d7dcf5e8
parent3ae03fa84b4c5f2d6c824681ff415633aa9a6090 (diff)
embedfile support, tex4ht r1285; avoid embedfile error, tex4ht r1286
git-svn-id: svn://tug.org/texlive/trunk@65529 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/ChangeLog10
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex3
-rw-r--r--Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex61
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/embedfile-hooks.4ht22
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/embedfile.4ht39
-rw-r--r--Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht5
6 files changed, 135 insertions, 5 deletions
diff --git a/Master/texmf-dist/source/generic/tex4ht/ChangeLog b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
index d1cb7c2edcb..46df45ccfe0 100644
--- a/Master/texmf-dist/source/generic/tex4ht/ChangeLog
+++ b/Master/texmf-dist/source/generic/tex4ht/ChangeLog
@@ -1,3 +1,13 @@
+2023-01-12 Michal Hoftich <michal.h21@gmail.com>
+
+ * tex4ht-4ht.tex (embedfile-hooks.4ht, usepackage.4ht): declared
+ error printing command, to prevent actual error message.
+ https://github.com/ho-tex/embedfile/pull/7
+
+ * tex4ht-4ht.tex (embedfile.4ht): added support for the embedfile
+ package.
+ https://github.com/michal-h21/tex4ebook/issues/99
+
2023-01-10 Michal Hoftich <michal.h21@gmail.com>
* tex4ht-html5.tex (html5.4ht): added default CSS style for sections
diff --git a/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex b/Master/texmf-dist/source/generic/tex4ht/mktex4ht-cnf.tex
index 3143a5b33dd..66173731138 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 1282 2023-01-08 15:27:15Z karl $
+% $Id: mktex4ht-cnf.tex 1285 2023-01-12 13:43:41Z michal_h21 $
% Manually-maintained file, listing *.4ht files created by tex4ht-4ht.tex.
% Read by tex4ht-cond4ht.
%
@@ -386,6 +386,7 @@
\AddFile{9}{animate}
\AddFile{9}{sectionbreak}
\AddFile{9}{subfiles}
+\AddFile{9}{embedfile}
\AddFile{9}{fontawesome5}
\AddFile{9}{mhchem}
% \AddFile{9}{mktex4ht}
diff --git a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
index 8a63480c63c..b26c68c2cf7 100644
--- a/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
+++ b/Master/texmf-dist/source/generic/tex4ht/tex4ht-4ht.tex
@@ -1,7 +1,7 @@
-% $Id: tex4ht-4ht.tex 1280 2022-12-30 23:31:42Z michal_h21 $
+% $Id: tex4ht-4ht.tex 1286 2023-01-12 21:20:42Z michal_h21 $
% tex tex4ht-4ht or ht tex tex4ht-4ht
%
-% Copyright 2009-2022 TeX Users Group
+% Copyright 2009-2023 TeX Users Group
% Copyright 1996-2009 Eitan M. Gurari
% Released under LPPL 1.3c+.
% See tex4ht-cpright.tex for license text.
@@ -5045,6 +5045,63 @@ which will prevent the stop of the processing.
>>>
+%%%%%%%%%%%%%%%%%%%%%%%
+\Section{embedfile.sty}
+%%%%%%%%%%%%%%%%%%%%%%%
+
+\<embedfile.4ht\><<<
+% embedfile.4ht (|version), generated from |jobname.tex
+% Copyright 2023 TeX Users Group
+|<TeX4ht license text|>
+|<embedfile file|>
+|<embedfile dummy commands|>
+\Hinput{embedfile}
+\endinput
+
+>>> \AddFile{9}{embedfile}
+
+The embedfile command included a file to PDF. We cannot do that in the
+HTML output, but we can at least register the file, so it will be for
+example copied to the output directory.
+
+\<embedfile file\><<<
+\NewConfigure{embedfile}{1}
+\Configure{embedfile}{{\Configure{Needs}{File: \embed:file}\Needs{}}}
+\newcommand\embedfile[2][]{
+ \edef\embed:file{#2}%
+ \a:embedfile%
+}
+>>>
+
+These commands are defined just that we don't get error messages that
+they don't exist. We don't try to emulate them.
+
+\<embedfile dummy commands\><<<
+% dummy commands that can be used in the document
+\newcommand\embedfilefinish{}
+\newcommand\embedfilesetup[1]{}
+\newcommand\embedfilesort[1]{}
+\newcommand\embedfilefield[2]{}
+\newcommand\embedfileifobjectexists[4]{}
+\newcommand\embedfilegetobject[2]{}
+>>>
+
+The embedfile stops it's loading once it finds that we use engine that
+doesn't output PDF. We need to declare a command that prints an error
+message before the package quits.
+
+\<add to usepackage\><<<
+\Configure{PackageHooks}{embedfile.sty}{embedfile-hooks.4ht}
+>>>
+
+\<embedfile-hooks.4ht\><<<
+% embedfile-hooks.4ht (|version), generated from |jobname.tex
+% Copyright 2023 TeX Users Group
+|<TeX4ht license text|>
+\def\EmFi@Error#1#2{}
+>>> \AddFile{9}{embedfile-hooks}
+
+
\Section{url.sty}
%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/tex/generic/tex4ht/embedfile-hooks.4ht b/Master/texmf-dist/tex/generic/tex4ht/embedfile-hooks.4ht
new file mode 100644
index 00000000000..a9267137e5d
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/tex4ht/embedfile-hooks.4ht
@@ -0,0 +1,22 @@
+% embedfile-hooks.4ht (2023-01-12-14:08), generated from tex4ht-4ht.tex
+% Copyright 2023 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 2023-01-12-14:08}
+
+\def\EmFi@Error#1#2{}
+
diff --git a/Master/texmf-dist/tex/generic/tex4ht/embedfile.4ht b/Master/texmf-dist/tex/generic/tex4ht/embedfile.4ht
new file mode 100644
index 00000000000..7366db2f6ba
--- /dev/null
+++ b/Master/texmf-dist/tex/generic/tex4ht/embedfile.4ht
@@ -0,0 +1,39 @@
+% embedfile.4ht (2023-01-12-14:08), generated from tex4ht-4ht.tex
+% Copyright 2023 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 2023-01-12-14:08}
+
+\NewConfigure{embedfile}{1}
+\Configure{embedfile}{{\Configure{Needs}{File: \embed:file}\Needs{}}}
+\newcommand\embedfile[2][]{
+ \edef\embed:file{#2}%
+ \a:embedfile%
+}
+
+% dummy commands that can be used in the document
+\newcommand\embedfilefinish{}
+\newcommand\embedfilesetup[1]{}
+\newcommand\embedfilesort[1]{}
+\newcommand\embedfilefield[2]{}
+\newcommand\embedfileifobjectexists[4]{}
+\newcommand\embedfilegetobject[2]{}
+
+\Hinput{embedfile}
+\endinput
+
+
diff --git a/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht b/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht
index 719a9ba96fe..e7a37aaccff 100644
--- a/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht
+++ b/Master/texmf-dist/tex/generic/tex4ht/usepackage.4ht
@@ -1,4 +1,4 @@
-% usepackage.4ht (2023-01-10-13:30), generated from tex4ht-4ht.tex
+% usepackage.4ht (2023-01-12-14:08), generated from tex4ht-4ht.tex
% Copyright 2003-2009 Eitan M. Gurari
% Copyright 2009-2023 TeX Users Group
%
@@ -17,7 +17,7 @@
%
% If you modify this program, changing the
% version identification would be appreciated.
-\immediate\write-1{version 2023-01-10-13:30}
+\immediate\write-1{version 2023-01-12-14:08}
\def\:temp{tex4ht}\ifx \:temp\@currname
\:warning{\string\usepackage{tex4ht} again?}
@@ -68,6 +68,7 @@
\Configure{PackageHooks}{pdfx.sty}{pdfx-hooks.4ht}
\Configure{PackageHooks}{lua-widow-control.sty}{lua-widow-control-hooks.4ht}
\Configure{PackageHooks}{tagpdf.sty}{tagpdf-hooks.4ht}
+\Configure{PackageHooks}{embedfile.sty}{embedfile-hooks.4ht}
\Configure{PackageHooks}{breakurl.sty}{breakurl-hooks.4ht}
\Configure{PackageHooks}{hyperref.sty}{hyperref-hooks.4ht}
\Configure{PackageHooks}{bookmark.sty}{bookmark-hooks.4ht}