View Single Post
Old 02-05-2013, 09:20 AM   #7
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 688
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by Toxaris View Post
Calibre conversion will give you other HTML issues. This is really a case of the source not being of good quality. There is an extension for OpenOffice, perhaps that one could be used also on LibreOffice.
yes, quite often the key is to clean up the source document. I work with .doc or .rtf files from individual authors who all seem to have their own idiosyncratic ways of formatting paragraph indents, space afterward, not to mention bold, or italic words here and there. After applying styles to the formatting I want to preserve, in Libre Office, I select all text, right-click and choose "clear direct formatting." This gets rid of lots of hidden problems such as the OP may have encountered with varying font sizes, etc.

Then, using the writer2xhtml export extension one gets fairly clean, rational code. For example,

Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
<!-- This file was converted to xhtml by Writer2xhtml ver. 1.2. See http://writer2latex.sourceforge.net for more info. -->

<head>
  <title>Thorne</title>
  <link href="../Styles/styles1.css" rel="stylesheet" type="text/css" />
</head>

<body dir="ltr">
  <h1 id="toc0" style="page-break-before:always">DAY ONE</h1>

  <p class="ttb-bodytext">Addison Thorne stood outside the unimposing apartment building and looked up. Lights were on in the corner apartment on the fourth floor, which meant Carl Foster was home and still awake. Thorne knew Foster was home in any event, but it was better he didn't have to wake the man.</p>

  <p class="ttb-bodytext">He walked up the short flight of steps and entered the complex. It lacked a security system, which was a minor relief, but not insurmountable even if one existed. If necessary, he could have climbed up the side of the building. No one was in the hallway this late in the evening, although the drone of late night television seeped through several doors as he walked down the hall, then up more stairs. Thorne wasn't concerned about waking curious neighbors, but it was best no one see him arrive and leave.</p>

  <p class="ttb-bodytext">The halls on the fourth floor were empty as well. Thorne walked to the door at the end on the right, knocked softly and whispered, "Foster."</p>

  <p class="ttb-bodytext">No one in the neighboring apartments could hear him, but Foster would. He had no choice. Thorne heard the volume from the television dim, then approaching footsteps. "Yes?" Foster asked as he opened the door.</p>

  <p class="ttb-bodytext">Even though Foster outweighed him by over one hundred pounds, Thorne pushed him back with one finger, then closed and locked the door behind him. "You alone?"</p>

  <p class="ttb-bodytext">The accountant's eyes grew large as he nodded.</p>
Compare this to the example shown in the OP.
st_albert is offline   Reply With Quote