Web Site
Developers

Line Spacing Problem

Seeing the Problem

Examine the code below for this pretty routine paragraph:

  The first article will deal with the delay of the GE announced 
  implementation of <a href="<link location>">hybrid railway 
  locomotive</a> that recovers a fraction of its energy loses.  
  This was first announced in the Spring of 2005 and to date no sight 
  has been seen of this locomotive type from GE.  The core problem is 
  that currently the railway companies are in a very conservative mind
  set.  The railway companies are opting for the known and seemingly 
  safe diesel<sup>1</sup> technology they know over a 
  already running electric hybrid<sup>2</sup>. That 
  includes the Union Pacific that was known to experiment on their own 
  with risky technology, <i>e.g.</i> a coal gas turbine 
  (a failure) and gas turbines (they had two separate fleets) until the 
  fuel costs<sup>3</sup> over overwhelmed their other 
  advantages.<p> 

really nothing exceptional. It just includes a few superscripts and an italics that I expected to print out without any problem. However, when rendered in the first test the result was less than pleasing. I am including a second paragraph to show the line spacing I expected the first paragraph to resemble:

Two Paragraphs

The first article will deal with the delay of the GE announced implementation of hybrid railway locomotive that recovers a fraction of its energy loses. This was first announced in the Spring of 2005 and to date no sight has been seen of this locomotive type from GE. The core problem is that currently the railway companies are in a very conservative mind set. The railway companies are opting for the known and seemingly safe diesel1 technology they know over a already running electric hybrid2. That includes the Union Pacific that was known to experiment on their own with risky technology, e.g. a coal gas turbine (a failure) and gas turbines (they had two separate fleets) until the fuel costs3 over overwhelmed their other advantages.

A real, operational prototype locomotive has to be out there now showing proving its durability as well as its mostly theoretical fuel consumption advantages. Even if the hoped for fuel savings are there, railways are loath to trust untested technology that might break down too often. A few of these failure incidents on limited capacity routes would sour railway managers' views on this type of locomotive years into the future. The major western roads are furiously trying to build capacity on their over stressed routes, anything that adds to congestion is their enemy.

... End of Text Sample

Upon seeing this inexplicable, errant line spacing, I reverted to the irrational harking back to my experiences with hidden formatting codes in DOS based word processors. Despite my more rational thoughts that this was unlikely to be true in emacs I used some of the techniques I had employed long ago to rid myself of this non-existent beast. I even posted on the emacs maillist. It took time, but during one strange result experiment the break point moved. That created the extra line spacing that had a differing appearance. I finally saw it matched the the positioning of the superscripts. Then it was obvious what the true problem lay.

Two "Solutions"

I thought almost immediately of a method to improve the looks of the page by adjusting the line spacing where paragraphs included superscripts. The first step was creating a paragraph class that preceded the affected text:

 <p class="superscript"> 

but getting the spacing right took more effort than expected. If too little space were allotted the line spacing differences were still obvious and jarring. Too much given, why bother? In a few words, I remain less than pleased. Nonetheless, here is the class I created in the css file:

  .superscript  {
        line-height: 26px;
  } 

This gives a file with paragraphs that appear uniformly double spaced. Look at it: Why Pick on Jeffrey Immelt and GE? from the Letters to C.E.O.s, that works ... sorta, kind of. Hence, I was on the lookout for something better. Upon reading a web reference from a previous age, I inserted the formatting used in a mid-nineties, that is a number in brackets: [1.] as an example used in another page. While Txt. seems satisfied, I am not.

If you know of a better method I would like to hear: HowTo Guy, if that does not work for you use: hcohen [- At -] bst-softwaredevs.com. Thanks.

     © Herschel Cohen, All Rights Reserved

Return Home or Problems Page

    * Originally published on the Open Source Today site July 03, 2007. Content may have been altered prior to being moved onto Web Site Developers.