(sorry, looking at the oasis digest archives of this list, I see lots  of
encoding issues.  Rather than address those issues, I'm just going to
enclose my reply in an attached text file made with notebook++. Maybe that
will work -- fingers crossed!

-- 
Robert Nagle
5115 Sandyfields Ln Katy, TX 77494
(Cell) 832-251-7522
isl...@luxsci.me


For the first question, it's usually pretty easy to solve this problem. 
In many cases, in the XML you can just add a role="red" attribute to the 
docbook element, ex. 
<para role="red">This is red </para>
and then use this: p {color: red} in the css. 


If I want all the text in a chapter to be a certain color, I'll assign a value 
to xml:id inside  CHAPTER 
<chapter xmlns="http://docbook.org/ns/docbook"; 
xmlns:xlink="http://www.w3.org/1999/xlink";
    version="5.0" xml:id="red">

then use this css: section#red {
color: #red;
        margin: 0em 2em 0em 2em;}

_______________________________________________________
The second problem is more difficult, and my solution has worked for me but 
with a limitation. By the way, in my example I am using MEDIAOBJECT instead of 
INLINEMEDIAOBJECT, but I am assuming they are functionally equivalent. 

First, it looks like if you use the width as an attribute in imagedata, docbook 
xsl  outputs  a table containing the image. I can't remember if that throws an 
epub error, but if probably isn't supported on kindle especially. 

Instead  I use a xml:id  on the chapter  element. That lets me write css 
specific to the div container  for any image in the chapter.  
  
<chapter xmlns="http://docbook.org/ns/docbook"; 
xmlns:xlink="http://www.w3.org/1999/xlink";
    version="5.0" xml:id="dogchapter">  
...
   <mediaobject role="dog">
        <imageobject>
            <imagedata fileref="images-epub/1200dog.jpg"/>
        </imageobject>
        <textobject>
            <phrase> Illustration: Dog Orientation</phrase>
        </textobject>
    </mediaobject>

The output will look like this:

 <div class="mediaobject"><img src="images-epub/1200dog.jpg" alt="Illustration: 
Dog Orientation"/></div>

That allows the css to reference the chapter's unique ID which is dogchapter to 
customize the DIV --> MEDIAOBJECT.  


 section#dogchapter  div.mediaobject {
 width: 95%;
        display: block;
  margin-left: auto;
  margin-right: auto;     
}

 img {
        display: block;
  margin-left: auto;
  margin-right: auto;  
}

This css code works very well on Kindle -- adjust your percent as needed. 

But here's the catch -- Even though the mediaobject in my example  has 
role="dog", the output DIV doesn't contain this reference at all. (Apparently 
Docbook XSL converts the MEDIAOBJECT to DIV class=mediaobject" I can only use 
chapter xml:id="dogchapter". 

As long as I have no more than one image per chapter -- or use the same css for 
every image in the chapter, I'm fine. But if it's more than one with different 
widths, then I'm stuck.

I'd appreciate any ideas about how to allow for different css for several 
images in a single chapter.  
---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

Reply via email to