From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1PfxUS-0007oG-6d for garchives@archives.gentoo.org; Thu, 20 Jan 2011 16:36:04 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DCD1CE09DE; Thu, 20 Jan 2011 16:35:53 +0000 (UTC) Received: from a1iwww1.kph.uni-mainz.de (a1iwww1.kph.uni-mainz.de [134.93.134.1]) by pigeon.gentoo.org (Postfix) with ESMTP id 74F5CE09DE for ; Thu, 20 Jan 2011 16:35:53 +0000 (UTC) Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1iwww1.kph.uni-mainz.de (8.14.0/8.13.4) with ESMTP id p0KGZgD7003133; Thu, 20 Jan 2011 17:35:42 +0100 Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.4/8.14.2) with ESMTP id p0KGZgVn019694; Thu, 20 Jan 2011 17:35:42 +0100 Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.4/8.14.4/Submit) id p0KGZgsS019693; Thu, 20 Jan 2011 17:35:42 +0100 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Package Manager Specification discussions X-BeenThere: gentoo-pms@gentoo.org X-BeenThere: gentoo-pms@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19768.25694.360270.679006@a1i15.kph.uni-mainz.de> Date: Thu, 20 Jan 2011 17:35:42 +0100 To: CC: Christian Faulhammer Subject: [gentoo-pms] [PATCH] Fixups for TeX4ht. X-Mailer: VM 8.1.1 under 23.2.1 (x86_64-pc-linux-gnu) From: Ulrich Mueller X-Archives-Salt: X-Archives-Hash: 447bb5cfce7d48518107a5b6a8a6311a Hi, Generation of HTML output for PMS currently doesn't work very well. There are two problems: 1. All bold texts are transformed into PNG images. The obvious solution for this is to postpone redefinition of the \b command, as we already did for \i and \t. 2. The resulting pms.html contains many spurious image references, like PICT where NNN runs from 0 to about 500. The first of these is even inserted before the ?xml and !DOCTYPE lines. None of these PNG files is created. The reason is that TeX4ht is being broken by pdfpages.sty, or rather by eso-pic.sty and atbegshi.sty (included from it) which mess around with \shipout. Since it doesn't make much sense to convert the cheat sheet (for which pdfpages is required for) to HTML, I've skipped that include in the TeX4ht case, and added a hyperlink instead. Patch is included below. Please review. @Fauli: Do you still read the gentoo-pms ML? Ulrich Postpone definition of \b command, in order not to confuse TeX4ht. Don't load pdfpages.sty when processing with TeX4ht. --- pms.cls | 11 ++++++----- pms.tex | 7 ++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/pms.cls b/pms.cls index 32a48b9..d96d35e 100644 --- a/pms.cls +++ b/pms.cls @@ -33,7 +33,6 @@ marginnote, % Typeset a paragraph in the page margin paralist, % Additional list environments parskip, % Space between paragraps instead of intendation - pdfpages, % Insert whole PDF documents as separate pages verbatim % Extend the print-as-is functionality } @@ -44,7 +43,7 @@ float, % More control over float environments hyperref, % Support for hyperlinks algorithm, % - algorithmic % Set algorithms + algorithmic % Set algorithms } } \ClassInfo{pms}{Capsulation of LaTeX stuff for the Package Manager @@ -56,8 +55,10 @@ % Make processing with TeX4HT possible \newboolean{TEX4HT-HACKS} \ifx\HCode\undefined - \RequirePackage{mathptmx, - courier + \RequirePackage{% + mathptmx, + courier, + pdfpages % Insert whole PDF documents as separate pages } \RequirePackage[scaled=.90]{helvet} \setboolean{TEX4HT-HACKS}{false} @@ -88,11 +89,11 @@ % Some shorthands for the lazy ones. % tex4ht workaround: this needs to happen after loading hyperref \g@addto@macro\@documentclasshook{ + \renewcommand{\b}[1]{\textbf{#1}} \renewcommand{\i}[1]{\textit{#1}} \renewcommand{\t}[1]{\texttt{#1}} } \newcommand{\e}[1]{\emph{#1}} -\renewcommand{\b}[1]{\textbf{#1}} \newcommand{\note}[1]{\paragraph{Note:} #1} % Because we are lazy, we define a table environment to fullfil our diff --git a/pms.tex b/pms.tex index 8d57eb1..6531e1c 100644 --- a/pms.tex +++ b/pms.tex @@ -47,7 +47,12 @@ \bibliography{pms} -\includepdf[pages=-,landscape,addtotoc={1,chapter,0,Desk Reference,cheatsheet}]{eapi-cheatsheet} +\ifthenelse{\boolean{TEX4HT-HACKS}}{% + \chapter{Desk Reference} + \href{eapi-cheatsheet.pdf}{EAPI Cheat Sheet} +}{% + \includepdf[pages=-,landscape,addtotoc={1,chapter,0,Desk Reference,cheatsheet}]{eapi-cheatsheet} +} \end{document} -- 1.7.4.rc2