summaryrefslogtreecommitdiff
path: root/support/tex4ebook/tex4ebook.sty
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-11-02 03:01:48 +0000
committerNorbert Preining <norbert@preining.info>2019-11-02 03:01:48 +0000
commit3479a92321ed7fe7e2133d3daec2d4f5fd53fbc6 (patch)
treef81c77e1742124279f68e41484d9e53ad40248ff /support/tex4ebook/tex4ebook.sty
parent61b8d58232b999b6cc966aee9152fb86bbb759cd (diff)
CTAN sync 201911020301
Diffstat (limited to 'support/tex4ebook/tex4ebook.sty')
-rw-r--r--support/tex4ebook/tex4ebook.sty45
1 files changed, 34 insertions, 11 deletions
diff --git a/support/tex4ebook/tex4ebook.sty b/support/tex4ebook/tex4ebook.sty
index c3726ee167..27a46b756e 100644
--- a/support/tex4ebook/tex4ebook.sty
+++ b/support/tex4ebook/tex4ebook.sty
@@ -1,10 +1,10 @@
-% Package odsfile. Author Michal Hoftich <michal.h21@gmail.com>
+% Package tex4ebook. Author Michal Hoftich <michal.h21@gmail.com>
% This package is subject of LPPL license, version 1.3
\ProvidesPackage{tex4ebook}[2016/03/31 version 0.1d]
\RequirePackage{etoolbox}
\RequirePackage{kvoptions}
\RequirePackage{graphicx}
-% Command for generating NCX file. Hard work is odne in the file
+% Command for generating NCX file. The hard work is done in the file
% tex4ebook.4ht
\def\ncxtable{}
% Command for generating OPF file
@@ -122,18 +122,41 @@
\def\Author{Anonymous}
% We need to save values of title, author etc.
-%\AtBeginDocument{
-\let\origtitle\title
-\renewcommand\title[1]{%
- \origtitle{#1}
- \let\Title\@title
+\let\tf@orig@title\title
+
+% normal \title
+\newcommand\tf@title[1]{%
+ \tf@orig@title{#1}%
+ \let\Title\@title%
+}
+
+% \title with optional argument
+\newcommand\tf@opttitle[2][]{%
+ \tf@orig@title[#1]{#2}%
+ \let\Title\@title%
+}
+
+% some classes (amsart) define \title command with optional argument
+\renewcommand\title{%
+\@ifnextchar[\tf@opttitle\tf@title%
}
-\let\origauthor\author
-\renewcommand\author[1]{%
- \origauthor{#1}%
- \let\Author\@author
+\let\tf@orig@author\author
+\newcommand\tf@author[1]{%
+ \tf@orig@author{#1}%
+ \let\Author\@author%
}
+
+\newcommand\tf@optauthor[2][]{%
+ \tf@orig@author[#1]{#2}%
+ \let\Author\@author%
+}
+
+% support optiona argument for \author as well
+\renewcommand\author{%
+\@ifnextchar[\tf@optauthor\tf@author%
+}
+
%\let\Author\@author
\let\Date\today
\let\origdate\date