Quote:
Originally Posted by Tex2002ans
The format is just not suited for this sort of thing (reflowable text + extremely precise layouts for code sections). You say that the HTML version looks fine, but the EPUB looks horrible (on Android)... Mind giving a sample of the HTML code that looks nice? It could be that the way that the HTML is laid out is something that does not work in EPUB at all.
|
Ah, I see what it's doing, creating a table for the line numbering:
Code:
<div class="highlight-c"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41</pre></div></td><td class="code"><div class="highlight"><pre><span class="cm">/*</span>
<span class="cm"> * convertHex.c</span>
<span class="cm"> * Asks user to enter a number in hexadecimal</span>
<span class="cm"> * then echoes it in hexadecimal and in decimal.</span>
<span class="cm"> * Assumes that user does not make mistakes.</span>
<span class="cm"> * Bob Plantz - 4 June 2009</span>
<span class="cm"> */</span>
<span class="cp">#include <stdio.h></span>
<span class="cp">#include <unistd.h></span>
<span class="kt">int</span> <span class="nf">main</span><span class="p">(</span><span class="kt">void</span><span class="p">)</span>
<span class="p">{</span>
<span class="kt">int</span> <span class="n">x</span><span class="p">;</span>
<span class="kt">unsigned</span> <span class="kt">char</span> <span class="n">aChar</span><span class="p">;</span>
<span class="n">printf</span><span class="p">(</span><span class="s">"Enter an integer in hexadecimal: "</span><span class="p">);</span>
<span class="n">fflush</span><span class="p">(</span><span class="n">stdout</span><span class="p">);</span>
...