[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Re: Equation number on same line as equation contents
Stephen Langer <stephen.langer@nist.gov> writes: [...] > It's drawn in-line as long as the browser window is wide enough, but > when I shrink the window (to simulate a real document where there is > a lot more content and the text can't spread out over the whole width > of the window), then the extra space required by the equation number > forces it out of line. OK, I tried with your stylesheet and with resizing the browser window and did manage to reproduce the behavior you describe. [...] > If I get rid of "div#main p { width: 80%; }" in the style sheet, then > the results are just like the image you sent -- the equation number's > box contains no extra space, so it fits on the line. That "width: 80%" property definitely make things difficult. I think you could simplify thinks a lot if you could figure out a way to do without it. But assuming that you really need it there, the following stylesheet fragment ought to give you the rendering you need. .equation-contents { float: left; width: 75%; overflow: auto; margin-left: 4em; background-color: lightgray; } .equation .title { margin-top: 0; margin-left: 5px; background-color: pink; } .equation-break { clear: both; } div#main p { width: 80%; overflow: auto; } I did a lot of trial-and-error with changing various CSS properties, and the above is the only thing I could manage to find that worked reasonably, and worked in both Firefox and Opera. It may be that it doesn't work correctly in IE; I haven't had a chance to test it out on Windows yet. The "margin-left: 4em" part causes some extra indenting in Firefox, but it is necessary for getting it to render in Opera, because Opera insists on moving the title div all the way over to the left, despite the "float: left" on the contents div. Also, as a result of that, in Opera, the equation label/number displays at the left of the equation, instead of the right. Anyway, that is the best I think I can do from the CSS side. And can't see that there is anything more I can do from the XSLT stylesheet side, short of switching to using table markup instead of nested divs. Which I would really rather not do unless it's certain that we can't get the same effect using CSS. So please give the CSS stylesheet above a try and let me know if it works OK with your output. --Mike -- Michael Smith http://sideshowbarker.net/
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]