1 |
Hi, |
2 |
|
3 |
Generation of HTML output for PMS currently doesn't work very well. |
4 |
There are two problems: |
5 |
|
6 |
1. All bold texts are transformed into PNG images. |
7 |
|
8 |
The obvious solution for this is to postpone redefinition of the \b |
9 |
command, as we already did for \i and \t. |
10 |
|
11 |
2. The resulting pms.html contains many spurious image references, |
12 |
like <img src="pmsNNNx.png" alt="PICT" /> where NNN runs from 0 to |
13 |
about 500. The first of these is even inserted before the ?xml and |
14 |
!DOCTYPE lines. None of these PNG files is created. |
15 |
|
16 |
The reason is that TeX4ht is being broken by pdfpages.sty, or rather |
17 |
by eso-pic.sty and atbegshi.sty (included from it) which mess around |
18 |
with \shipout. |
19 |
|
20 |
Since it doesn't make much sense to convert the cheat sheet (for which |
21 |
pdfpages is required for) to HTML, I've skipped that include in the |
22 |
TeX4ht case, and added a hyperlink instead. |
23 |
|
24 |
Patch is included below. Please review. |
25 |
|
26 |
@Fauli: Do you still read the gentoo-pms ML? |
27 |
|
28 |
Ulrich |
29 |
|
30 |
|
31 |
Postpone definition of \b command, in order not to confuse TeX4ht. |
32 |
Don't load pdfpages.sty when processing with TeX4ht. |
33 |
--- |
34 |
pms.cls | 11 ++++++----- |
35 |
pms.tex | 7 ++++++- |
36 |
2 files changed, 12 insertions(+), 6 deletions(-) |
37 |
|
38 |
diff --git a/pms.cls b/pms.cls |
39 |
index 32a48b9..d96d35e 100644 |
40 |
--- a/pms.cls |
41 |
+++ b/pms.cls |
42 |
@@ -33,7 +33,6 @@ |
43 |
marginnote, % Typeset a paragraph in the page margin |
44 |
paralist, % Additional list environments |
45 |
parskip, % Space between paragraps instead of intendation |
46 |
- pdfpages, % Insert whole PDF documents as separate pages |
47 |
verbatim % Extend the print-as-is functionality |
48 |
} |
49 |
|
50 |
@@ -44,7 +43,7 @@ |
51 |
float, % More control over float environments |
52 |
hyperref, % Support for hyperlinks |
53 |
algorithm, % |
54 |
- algorithmic % Set algorithms |
55 |
+ algorithmic % Set algorithms |
56 |
} |
57 |
} |
58 |
\ClassInfo{pms}{Capsulation of LaTeX stuff for the Package Manager |
59 |
@@ -56,8 +55,10 @@ |
60 |
% Make processing with TeX4HT possible |
61 |
\newboolean{TEX4HT-HACKS} |
62 |
\ifx\HCode\undefined |
63 |
- \RequirePackage{mathptmx, |
64 |
- courier |
65 |
+ \RequirePackage{% |
66 |
+ mathptmx, |
67 |
+ courier, |
68 |
+ pdfpages % Insert whole PDF documents as separate pages |
69 |
} |
70 |
\RequirePackage[scaled=.90]{helvet} |
71 |
\setboolean{TEX4HT-HACKS}{false} |
72 |
@@ -88,11 +89,11 @@ |
73 |
% Some shorthands for the lazy ones. |
74 |
% tex4ht workaround: this needs to happen after loading hyperref |
75 |
\g@addto@macro\@documentclasshook{ |
76 |
+ \renewcommand{\b}[1]{\textbf{#1}} |
77 |
\renewcommand{\i}[1]{\textit{#1}} |
78 |
\renewcommand{\t}[1]{\texttt{#1}} |
79 |
} |
80 |
\newcommand{\e}[1]{\emph{#1}} |
81 |
-\renewcommand{\b}[1]{\textbf{#1}} |
82 |
\newcommand{\note}[1]{\paragraph{Note:} #1} |
83 |
|
84 |
% Because we are lazy, we define a table environment to fullfil our |
85 |
diff --git a/pms.tex b/pms.tex |
86 |
index 8d57eb1..6531e1c 100644 |
87 |
--- a/pms.tex |
88 |
+++ b/pms.tex |
89 |
@@ -47,7 +47,12 @@ |
90 |
|
91 |
\bibliography{pms} |
92 |
|
93 |
-\includepdf[pages=-,landscape,addtotoc={1,chapter,0,Desk Reference,cheatsheet}]{eapi-cheatsheet} |
94 |
+\ifthenelse{\boolean{TEX4HT-HACKS}}{% |
95 |
+ \chapter{Desk Reference} |
96 |
+ \href{eapi-cheatsheet.pdf}{EAPI Cheat Sheet} |
97 |
+}{% |
98 |
+ \includepdf[pages=-,landscape,addtotoc={1,chapter,0,Desk Reference,cheatsheet}]{eapi-cheatsheet} |
99 |
+} |
100 |
|
101 |
\end{document} |
102 |
|
103 |
-- |
104 |
1.7.4.rc2 |