+2004-09-29 Andreas Vox <vox@isp.uni-luebeck.de>
+
+ * insetgraphics.C (docbook): create inlinegraphic instead of graphic.
+
+ * insetgraphics.[hC] (createDocBookAttributes): Export parameters
+ as attributes with new method for docbook.
+
2004-09-26 Lars Gullik Bjonnes <larsbj@gullik.net>
* render_preview.h: Use preferred calling of Boost.Signal
}
+string const InsetGraphics::createDocBookAttributes() const
+{
+ // Calculate the options part of the command, we must do it to a string
+ // stream since we copied the code from createLatexParams()
+
+ // FIXME: av: need to translate spec -> Docbook XSL spec (http://www.sagehill.net/docbookxsl/ImageSizing.html)
+ // Right now it only works with my version of db2latex :-)
+
+ ostringstream options;
+ if (!float_equal(params().scale, 0.0, 0.05)) {
+ if (!float_equal(params().scale, 100.0, 0.05))
+ options << " scale=\"" << params().scale / 100.0
+ << "\" ";
+ } else {
+ if (!params().width.zero())
+ options << " width=\"" << params().width.asLatexString() << "\" ";
+ if (!params().height.zero())
+ options << " depth=\"" << params().height.asLatexString() << "\" ";
+ }
+
+ if (!params().special.empty())
+ options << params().special << " ";
+
+ string opts = options.str();
+ // trailing blanks are ok ...
+ return opts;
+}
+
+
namespace {
enum CopyStatus {
if (runparams.flavor == OutputParams::XML) {
runparams.exportdata->addExternalFile("docbook-xml",
params().filename.absFilename());
- os << "<graphic fileref=\"&" << graphic_label << ";\"/>";
+ os << "<inlinegraphic fileref=\"&" << graphic_label << ";\" " + createDocBookAttributes() + "/>";
} else {
runparams.exportdata->addExternalFile("docbook",
params().filename.absFilename());
- os << "<graphic fileref=\"&" << graphic_label << ";\">";
+ os << "<inlinegraphic fileref=\"&" << graphic_label << ";\" " + createDocBookAttributes() + "/>";
}
return 0;
}
std::string const statusMessage() const;
/// Create the options for the latex command.
std::string const createLatexOptions() const;
+ /// Create the atributes for docbook export.
+ std::string const createDocBookAttributes() const;
/// Convert the file if needed, and return the location of the file.
std::string const prepareFile(Buffer const & buf, OutputParams const &) const;