>>> Jose Abilio Oliveira Matos <[EMAIL PROTECTED]> 21-02-2002
16:14:32 >>>
On Thursday 21 February 2002 13:33, Arnold Christensen wrote:
>
> On a line where "style" is SGML instead of standard, I've wrote the
> following, but filename needs to be absolute, or else
> Latex can not find it:
>
> <figure loc="here"><eps file="/path/to/filename/file.ps"></figure>
>
> somehow caption will not work yet...
Ok, the relevant part in the dtd is:
<!element figure - - ((eps | ph ), img*, caption?)>
<!attlist figure
loc cdata "tbp"
caption cdata "Caption">
<!-- eps attributes added by mb and td -->
<!element eps - o empty >
<!attlist eps
file cdata #required
height cdata "5cm"
angle cdata "0">
<!element ph - o empty >
<!attlist ph
vspace cdata #required>
<!element img - o empty>
<!attlist img
src cdata #required>
<!element caption - o (%inline)>
So the loc attribute in figure is the location.
I can guess what eps means, but ph?
So looking to the latex transformation file I see that ph is
transformed as:
<ph> + "\\vspace{[VSPACE]}\n\\par" +
</ph>
So this means that ph is in reality a vertical space. But why call it
ph???
One of those, eps or ph, is mandatory, then it comes the img element.
What
does it means img here, not an eps image?
Ok, reading the html transformation file I see that it is used with
html.
The last element is the caption that is optional.
Looking again to the latex transforming file I would expect it to
work.
What is the problem with it? I have been able to make it work.
So we want to output something like this:
<figure loc="here">
<eps file="/home/jamatos/lyx/devel/teste/platypus.eps">
<img src="/home/jamatos/lyx/devel/teste/platypus.png">
<caption>LyX's symbol</caption>
</figure>
The eps figure is for the print version and the img is for html.
The model used for figure is really, really weird, but I can make it
work.
If you are using 1.1.6 the file to look to modify is
src/insets/figinset.C,
the linuxdoc function.
For 1.2 I will add the code needed to the cvs to make it work like
this. Is
it ok?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Yes, I have hacked the linuxdoc function, (see end of mail, it does not
change .ps to .png for HTML though).
I very much like the walthrough, thanks.
Now I can add pictures in my docs, but I think that I need somehow to
change the docbook style,
you mentioned something about hacking a stylesheet(s) ??
--------
Arnold
src/insets/figinsts.C
int InsetFig::Linuxdoc(Buffer const *, ostream &os) const
{
os << "<figure loc=\"here\">\n<eps file=\"" << fname << "\"";
/*
switch (wtype) {
case DEF:
break;
case CM: // cm
os << " width=\""<< xwid <<"cm\"";
break;
case IN: // in
os << " width=\""<< xwid <<"in\"";
break;
case PER_PAGE: // % of page
break;
case PER_COL: // % of col
break;
}
switch (htype) {
case DEF:
//lyxerr << "This should not happen!" << endl;
break;
case CM: // cm
os << " width=\""<< xhgh <<"cm\"";
break;
case IN: // in
os << " width=\""<< xhgh <<"in\"";
break;
case PER_PAGE: // % of page
break;
case PER_COL:
// Doesn't occur; case exists to suppress
// compiler warnings.
break;
}
*/
os << ">\n";
os << "<img src=\"" << fname << "\">\n";
if (!subcaption.empty()){
os << "<caption>";
os << subcaption;
os <<"</caption>\n";
}
os << "</figure>\n";
return 0;
}