Copy link to clipboard
Copied
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.
BODY {
background-color: #ffffff;
}
P {
font-weight: normal;
}
sup, sub {
font-size: 0.8em;
}
sup {
vertical-align: text-top;
}
sub {
vertical-align: text-bottom;
}
/*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.
Copy link to clipboard
Copied
What happens when you run your generated help output through your customized CSS at the time of generation (done in the SSL recipe)? Does RH still try and modify it?
Copy link to clipboard
Copied
No, it does not modify the css file in that case. Actually, it also does not modify the file if you only set the properties of a topic to use the css file (I just tried that). It only alters the css file as soon as you open a topic using that css in the RH editor. So if I never edit any topics, I'll be fine
Copy link to clipboard
Copied
Hi,
This CSS rewriting is an annoying habit of RoboHelp. Nothing to do about it that I know of. Personally, I use a script to always copy the CSS from an external location into the output whenever I generate.
You can leave sub and sup out of the css since all browsers will display them correctly aligned in a smaller font. Only the RoboHelp WYSIWYG will show the sub/sup with the regular font size.
Greet,
Willam