3 Replies Latest reply on Jun 20, 2012 5:06 AM by Willam van Weelden

    RH9 Deletes sub and sup styles from css file

    Erwin Timmerman

      In my css file I have defined an equation character style. The equations frequently use superscript and subscript. However, other styles use superscript and subscript as well.

       

      I would like the superscripts and subscripts to adapt to their parent character style (such as equation and screen_text), without resorting to creating equation_sub, screen_text_sub etc. And, without resorting to making equation and screen_text paragraph styles.

       

      Normally this could be done by nesting spans, but I have found that RH does not really like the nesting of spans. So... <sub> and <sup> to the rescue!. Or, so I thought.

       

      If I create a .css file with sup and sub styles, RH rewrites the css file, doubling the contents, deleting the sub and sup styles from the new version, and adding span.superscript and span.subscript styles.

       

      Original CSS

      BODY {

          background-color: #ffffff;

      }

      P {

          font-weight: normal;

      }

       

      sup, sub {

          font-size: 0.8em;

      }

      sup {

          vertical-align: text-top;

      }

      sub {

          vertical-align: text-bottom;

      }

       

      New CSS created by RH

      /*Created with Adobe RoboHelp 9.*/

      /*begin-old-version{{*/

      BODY {

          background-color: #ffffff;

      }

      P {

          font-weight: normal;

      }

       

      sup, sub {

          font-size: 0.8em;

      }

      sup {

          vertical-align: text-top;

      }

      sub {

          vertical-align: text-bottom;

      }

       

      /*}}end-old-version*/

      BODY {

          background-color: #ffffff;

      }

      P {

          font-weight: normal;

      }

      SPAN.Superscript {

          vertical-align: text-top;

          font-size: 0.8em;

      }

      SPAN.SubScript {

          vertical-align: text-bottom;

          font-size: 0.8em;

      }

       

      With a big css file the doubling of contents gets out of hand quite easily. Why does RH do this?

       

      I know about the debate to use vertical-align:super/sub instead of  <sup> and <sub> because some find them presentational, but especially in equations the use of these tags is very valid because they imply meaning as well. They should still be displayed correctly if the css file is not used at all. For this reason they have not been deprecated.

       

      I find it quite annoying that RH tries to force you not to use the sup and sub tags this way, and that it overwrites the css file. What harm is there in these styles being present in the css file anyway?

       

      For me, the solution has been to delete everything between the "old version" tags EXCEPT the sup and sub styles. Then RH leaves the file alone. But strange behavior, nonetheless.

       

      Any suggestions on how to deal with this in a more elegant way appreciated.