View Single Post
Old 08-02-2013, 01:25 PM   #18
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,801
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Just now I read your post. I don't know if you've already solved your problem but if you're still looking for a solution, this is mine:

1. In your .css stylesheet, write the following:

Code:
.container {
  display: block;
  margin: 1.5em 0;
  text-indent: 0;
  text-align: center;
}

.formula {
    font-family: serif; /* feel free to change this property */
    font-size: 1.2em; /* feel free to change this size */
    font-weight: normal; /* use bold here if you wish */
    font-style: italic; /* use normal here if you wish */
    padding: 0.25em 0.5em;
    background: #FFFFBF; /* change the color if you wish */
}

.number {
  float: right;
  font-family: serif; /* feel free to change this property */
  font-size: 1.2em; /* feel free to change this size */
  font-weight: bold; /* use normal here if you wish */
  padding: 0 16px 0px 10px;
  margin: 0 0 0 -0.2em;
}

p {
  font-family: sans-serif; /* feel free to change this property */
  font-size: 1em;
  margin: 0;
  text-align: justify;
  text-indent: 0;
}

p + p {
  text-indent: 1em;
}
2. In your .html file, write the following:

Code:
<p>...Some text here ... </p>

<p class="container"><span class="number">(1)</span><span class="formula">C = π r˛</span></p>

<p>...Some text here ... </p>
Of course, your formulas will be different

VERY IMPORTANT: The class "number" MUST BE FIRST than class "formula". That is the key in order that the number and the formula are in a same line.

Below you can see a screenshot of my ADE and the respective epub.

Regards
Rubén
Attached Thumbnails
Click image for larger version

Name:	Formula in one line.jpg
Views:	197
Size:	71.2 KB
ID:	108831  
Attached Files
File Type: epub Formula in one line.epub (2.6 KB, 171 views)
RbnJrg is offline   Reply With Quote