View Single Post
Old 04-27-2013, 02:13 PM   #10
rplantz
Member
rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.rplantz ought to be getting tired of karma fortunes by now.
 
Posts: 21
Karma: 493474
Join Date: Mar 2011
Location: Northern California
Device: Acer A500
Quote:
Originally Posted by Tex2002ans View Post
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 &lt;stdio.h&gt;</span>
<span class="cp">#include &lt;unistd.h&gt;</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">&quot;Enter an integer in hexadecimal: &quot;</span><span class="p">);</span>
    <span class="n">fflush</span><span class="p">(</span><span class="n">stdout</span><span class="p">);</span>
...
rplantz is offline   Reply With Quote