Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-pms
Navigation:
Lists: gentoo-pms: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-pms@g.o
From: David Leverton <levertond@...>
Subject: [PATCH] Work around TeX4ht being weird
Date: Wed, 15 Apr 2009 20:03:12 +0100
---
 pms.cls |   61 ++++++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 38 insertions(+), 23 deletions(-)

On Tuesday 14 April 2009 09:32:28 Christian Faulhammer wrote:
>  Or you use \AtEndOfClass{} to do your magic.

That's still too early, but \g@addto@macro\@documentclasshook (the
same mechanism TeX4ht itself uses) seems to work.  Do you think it's
safe to rely on this being true in future versions?  Obviously it's
not a disaster if it doesn't, but I'd rather not go looking for
trouble.

diff --git a/pms.cls b/pms.cls
index 90e8584..d7ef774 100644
--- a/pms.cls
+++ b/pms.cls
@@ -16,25 +16,31 @@
   fontenc,
   isodate,
   typearea,
-  caption,
   inputenc,
   appendix,
   booktabs,
   color,
   enumitem,
-  float,
   fullpage,
   graphicx,
-  hyperref,
   ifthen,
   longtable,
   lscape,
   marginnote,
   paralist,
   parskip,
-  verbatim,
-  algorithm,
-  algorithmic
+  verbatim
+}
+
+% tex4ht workaround: hyperref needs to be loaded /after/ tex4ht injects itself
+\g@addto@macro\@documentclasshook{
+  \RequirePackage{
+    caption,
+    float,
+    hyperref,
+    algorithm,
+    algorithmic
+  }
 }
 \ClassInfo{pms}{Capsulation of LaTeX stuff for the Package Manager
   Specification, loaded baseclass: \ClassToLoad\MessageBreak}
@@ -51,9 +57,12 @@
     \setboolean{TEX4HT-HACKS}{true}
 \fi
 
-\floatstyle{plaintop}
-\newfloat{listing}{tbp}{lol}[chapter]
-\floatname{listing}{Listing}
+% tex4ht workaround: these need to happen after loading the float package
+\g@addto@macro\@documentclasshook{
+  \floatstyle{plaintop}
+  \newfloat{listing}{tbp}{lol}[chapter]
+  \floatname{listing}{Listing}
+}
 \newcommand{\listoflistings}{\listof{listing}{Listings}}
 \newcommand{\featureref}[1]{\textsc{#1} on page~\pageref{feat:#1}}
 \newcommand{\compactfeatureref}[1]{#1~p\pageref{feat:#1}}
@@ -61,7 +70,10 @@
 \bibliographystyle{plainurl}
 
 \renewcommand{\t}[1]{\texttt{#1}}
-\renewcommand{\i}[1]{\textit{#1}}
+% tex4ht workaround: this needs to happen after loading hyperref
+\g@addto@macro\@documentclasshook{
+  \renewcommand{\i}[1]{\textit{#1}}
+}
 \newcommand{\e}[1]{\emph{#1}}
 \renewcommand{\b}[1]{\textbf{#1}}
 \newcommand{\note}[1]{\paragraph{Note:} #1}
@@ -108,19 +120,22 @@
   \end{table}
 }
 
-\hypersetup{%
-  urlcolor=black,
-  colorlinks=true,
-  citecolor=black,
-  linkcolor=black,
-  pdftitle={Package Manager Specification},
-  pdfauthor={Stephen P. Bennett, Ciaran McCreesh},
-  pdfcreator={pdfLaTeX and hyperref},
-  pdfsubject={Defining a feature set for package managers in the
-    Gentoo world},
-  pdflang={en},
-  pdfkeywords={Gentoo, package manager, specification},
-  pdfproducer={pdfLaTeX and hyperref},
+% tex4ht workaround: this needs to happen after loading hyperref
+\g@addto@macro\@documentclasshook{
+  \hypersetup{%
+    urlcolor=black,
+    colorlinks=true,
+    citecolor=black,
+    linkcolor=black,
+    pdftitle={Package Manager Specification},
+    pdfauthor={Stephen P. Bennett, Ciaran McCreesh},
+    pdfcreator={pdfLaTeX and hyperref},
+    pdfsubject={Defining a feature set for package managers in the
+      Gentoo world},
+    pdflang={en},
+    pdfkeywords={Gentoo, package manager, specification},
+    pdfproducer={pdfLaTeX and hyperref},
+  }
 }
 \title{Package Manager Specification}
 \author{Stephen P. Bennett\\\url{spb@...}
-- 
1.6.2.3



Replies:
[PATCH 1/2] Work around TeX4ht being weird
-- David Leverton
Re: [PATCH] Work around TeX4ht being weird
-- Christian Faulhammer
References:
Re: [PATCH] Work around TeX4ht being weird
-- Christian Faulhammer
Navigation:
Lists: gentoo-pms: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: [PATCH] Work around TeX4ht being weird
Next by thread:
Re: [PATCH] Work around TeX4ht being weird
Previous by date:
Re: Patches for your reviewing pleasure: Various improvements, including cheat sheet
Next by date:
Re: Patches for your reviewing pleasure: Various improvements, including cheat sheet


Updated Jul 18, 2012

Summary: Archive of the gentoo-pms mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.