Gentoo Archives: gentoo-pms

From: David Leverton <levertond@××××××××××.com>
To: gentoo-pms@l.g.o
Cc: David Leverton <levertond@××××××××××.com>
Subject: [gentoo-pms] [PATCH] Work around TeX4ht being weird
Date: Wed, 15 Apr 2009 19:03:17
Message-Id: 1239822192-20527-1-git-send-email-levertond@googlemail.com
In Reply to: Re: [gentoo-pms] [PATCH] Work around TeX4ht being weird by Christian Faulhammer
1 ---
2 pms.cls | 61 ++++++++++++++++++++++++++++++++++++++-----------------------
3 1 files changed, 38 insertions(+), 23 deletions(-)
4
5 On Tuesday 14 April 2009 09:32:28 Christian Faulhammer wrote:
6 > Or you use \AtEndOfClass{} to do your magic.
7
8 That's still too early, but \g@addto@macro\@documentclasshook (the
9 same mechanism TeX4ht itself uses) seems to work. Do you think it's
10 safe to rely on this being true in future versions? Obviously it's
11 not a disaster if it doesn't, but I'd rather not go looking for
12 trouble.
13
14 diff --git a/pms.cls b/pms.cls
15 index 90e8584..d7ef774 100644
16 --- a/pms.cls
17 +++ b/pms.cls
18 @@ -16,25 +16,31 @@
19 fontenc,
20 isodate,
21 typearea,
22 - caption,
23 inputenc,
24 appendix,
25 booktabs,
26 color,
27 enumitem,
28 - float,
29 fullpage,
30 graphicx,
31 - hyperref,
32 ifthen,
33 longtable,
34 lscape,
35 marginnote,
36 paralist,
37 parskip,
38 - verbatim,
39 - algorithm,
40 - algorithmic
41 + verbatim
42 +}
43 +
44 +% tex4ht workaround: hyperref needs to be loaded /after/ tex4ht injects itself
45 +\g@addto@macro\@documentclasshook{
46 + \RequirePackage{
47 + caption,
48 + float,
49 + hyperref,
50 + algorithm,
51 + algorithmic
52 + }
53 }
54 \ClassInfo{pms}{Capsulation of LaTeX stuff for the Package Manager
55 Specification, loaded baseclass: \ClassToLoad\MessageBreak}
56 @@ -51,9 +57,12 @@
57 \setboolean{TEX4HT-HACKS}{true}
58 \fi
59
60 -\floatstyle{plaintop}
61 -\newfloat{listing}{tbp}{lol}[chapter]
62 -\floatname{listing}{Listing}
63 +% tex4ht workaround: these need to happen after loading the float package
64 +\g@addto@macro\@documentclasshook{
65 + \floatstyle{plaintop}
66 + \newfloat{listing}{tbp}{lol}[chapter]
67 + \floatname{listing}{Listing}
68 +}
69 \newcommand{\listoflistings}{\listof{listing}{Listings}}
70 \newcommand{\featureref}[1]{\textsc{#1} on page~\pageref{feat:#1}}
71 \newcommand{\compactfeatureref}[1]{#1~p\pageref{feat:#1}}
72 @@ -61,7 +70,10 @@
73 \bibliographystyle{plainurl}
74
75 \renewcommand{\t}[1]{\texttt{#1}}
76 -\renewcommand{\i}[1]{\textit{#1}}
77 +% tex4ht workaround: this needs to happen after loading hyperref
78 +\g@addto@macro\@documentclasshook{
79 + \renewcommand{\i}[1]{\textit{#1}}
80 +}
81 \newcommand{\e}[1]{\emph{#1}}
82 \renewcommand{\b}[1]{\textbf{#1}}
83 \newcommand{\note}[1]{\paragraph{Note:} #1}
84 @@ -108,19 +120,22 @@
85 \end{table}
86 }
87
88 -\hypersetup{%
89 - urlcolor=black,
90 - colorlinks=true,
91 - citecolor=black,
92 - linkcolor=black,
93 - pdftitle={Package Manager Specification},
94 - pdfauthor={Stephen P. Bennett, Ciaran McCreesh},
95 - pdfcreator={pdfLaTeX and hyperref},
96 - pdfsubject={Defining a feature set for package managers in the
97 - Gentoo world},
98 - pdflang={en},
99 - pdfkeywords={Gentoo, package manager, specification},
100 - pdfproducer={pdfLaTeX and hyperref},
101 +% tex4ht workaround: this needs to happen after loading hyperref
102 +\g@addto@macro\@documentclasshook{
103 + \hypersetup{%
104 + urlcolor=black,
105 + colorlinks=true,
106 + citecolor=black,
107 + linkcolor=black,
108 + pdftitle={Package Manager Specification},
109 + pdfauthor={Stephen P. Bennett, Ciaran McCreesh},
110 + pdfcreator={pdfLaTeX and hyperref},
111 + pdfsubject={Defining a feature set for package managers in the
112 + Gentoo world},
113 + pdflang={en},
114 + pdfkeywords={Gentoo, package manager, specification},
115 + pdfproducer={pdfLaTeX and hyperref},
116 + }
117 }
118 \title{Package Manager Specification}
119 \author{Stephen P. Bennett\\\url{spb@×××××××.org}
120 --
121 1.6.2.3

Replies

Subject Author
Re: [gentoo-pms] [PATCH] Work around TeX4ht being weird Christian Faulhammer <fauli@g.o>
[gentoo-pms] [PATCH 1/2] Work around TeX4ht being weird David Leverton <levertond@××××××××××.com>