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: Equation number on same line as equation contents



On Nov 21, 2005, at 5:12 AM, Michael Smith wrote:

> Stephen Langer <stephen.langer@nist.gov> writes:
>
>> [...]
>> On a related topic, is it possible to put the title of an equation on
>> the same line, but to the right?  I'd really like to have an just
>> automatically generated equation number, like this:
>>
>>     x^2 + y^2 = z^2               (1.1)
>
> There are two separate requirements that need to be satisfied to
> enable what you describe.
>
>   1. Output the equation title in the form "(1.1") instead of in
>      the default "Equation 1.1. Foo" form.
>
>   2. Cause the equation title to be rendered on the same line as
>      equation contents.

[details omitted...]

> Anyway, please give it a try and let me know if it works for you.

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.

Here's a distilled example...

html file:

<!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">
       <p>
       <div class="equation">
	  <p class="title"><b>(1.1)</b>
	    <div class="equation-contents">
	      <span class="mathphrase">
		x<sup>2</sup> + y<sup>2</sup> = z<sup>2</sup>
	      </span>
	    </div>
	</div>
       </p>
       <br class="equation-break"/>
	<p>
	  This is a paragraph after an equation.
	</p>
     </div>
</body>
</html>

And this style sheet:

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

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

.equation-break {
   clear: both;
}

div#main p {
   width: 80%;
}

I added colors to the .equation-contents and title so that I could  
see their actual sizes.  What I see is that the equation number  
(title) takes up most of the width of the browser window, even if I  
add "width: 20%;" to its style.  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.

Thanks..  This list has been extremely helpful.

  -- 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]