OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[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



On Nov 22, 2005, at 6:05 AM, Michael Smith wrote:

> Stephen Langer <stephen.langer@nist.gov> writes:
>
>> Yes, it works, more or less...   (The "or less" part may be due to my
>> not understanding css, but I hope it's not too far off-topic.)  The
>> space allocated for the equation title is too large, so it's not
>> drawn in-line in many cases.
>
> It'd help to have an example of one of the cases where it is not
> drawn in-line. When I test with Firefox and Opera with the exact
> HTML document and stylesheet fragment you posted, the equation
> number/title is drawn in-line as expected, as far as I can see.

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.

>
>
> One thing I notice is that in your output, the
> <div classe="equation-contents"> div is a child of the
> <p class="title"> paragraph. Why is that? Have you made some
> customization that is causing that to happen? Because with the
> stock stylesheets, the you should instead be getting
> <p class="title"><b>(1.1)</b></p> -- that is, with a closing </p>
> tag on the same line as the title.

I don't know how the extra <p>'s got there.  This example was created  
by stripping out extraneous tags and content from a larger example,  
in order to find where the problem was.  I probably make a mistake  
while stripping the file.  In any case, after sending my last message  
I noticed the misplaced <p>'s and fixed them, without any effect on  
the output.

Here's the raw html from the original file:

<div class="equation"><a name="pythagoras"></a><p class="title"><b> 
(1.1)</b></p>
       <div class="equation-contents"><span  
class="mathphrase">x<sup>2</sup> + y<sup>2</sup> = z<sup>2</sup></ 
span></div>


>
> Another thing I wanted to note is that to get the equation title
> rendered to the right of the equation, you are probably better off
> using the using the formal.title.placement param to cause the title
> div to be placed in your output after the equation-contents div.

That doesn't help, because the problem is still that the title has  
too much space allocated for it, so it gets bumped to the next line.

Here's my current html test file, with the equation title after the  
equation:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
   <head>
     <meta http-equiv="Content-Type" content="text/html;  
charset=utf-8" />
     <link rel="stylesheet" href="junk.css" type="text/css" />
   </head>
   <body>
     <div id="main">
       <div class="equation">
	    <div class="equation-contents">
	      <span class="mathphrase">
		x<sup>2</sup> + y<sup>2</sup> = z<sup>2</sup>
	      </span>
	    </div>
	  <p class="title"><b>(1.1)</b></p>
	</div>
       <br class="equation-break">
	<p>
	  This is a paragraph after an equation.
	</p>
     </div>
</body>
</html>

and here's my style sheet:

.equation-contents {
   float: left;
   background-color: lightgray
}

.equation .title {
   margin-top: 0;
   float: left;
   margin-right: 20px;
   background-color: pink
}

.equation-break {
   clear: both;
}

div#main p {
   width: 80%;
}

and here's what it looks like if I make the window narrow:

eqn.gif

GIF image


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.


>> On the other hand, if I remove the  "div#main p" style, the
>> number's width goes back down to its natural  width.  I see the
>> same behavior on Safari and Firefox.
>
> Another thing I don't understand is where that "<div id=main>"
> wrapper is coming from. What does it correspond to in your source
> document? Or is the HTML file you posted just a hand-crafter test
> document that's meant to emulate the output from the stylesheets?

<div id=main> is from a Python script that inserts the docbook html  
output into some html infrastructure for making this page look like  
the rest of the site.  <div id=main> and the css fragment referring  
to is are the only parts of that infrastructure that I've kept in the  
example.  (The actual web site is http://www.ctcms.nist.gov/~langer/ 
oof2man/index.html, if you'd like to take a look.)

Thanks again,
          Steve


--
-- EMail: stephen.langer@nist.gov                    Phone: (301)  
975-5423 --
-- WWW:  http://math.nist.gov/mcsd/Staff/SLanger/    Fax:   (301)  
990-4127 --
-- Mail: NIST; 100 Bureau Drive -- Stop 8910; Gaithersburg, Md   
20899-8910 --

-- "I don't think this will work.  That's why it's  
science."               --
--                                      Naomi Langer,  17 Feb  
2003         --




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]