#include "Mover.h"
#include "OutputParams.h"
#include "output_xhtml.h"
-#include "sgml.h"
+#include "xml.h"
#include "texstream.h"
#include "TocBackend.h"
namespace {
/// Find the most suitable image format for images in \p format
-/// Note that \p format may be unknown (i. e. an empty string)
+/// Note that \p format may be unknown (i.e. an empty string)
string findTargetFormat(string const & format, OutputParams const & runparams)
{
// Are we latexing to DVI or PDF?
InsetGraphics::InsetGraphics(Buffer * buf)
- : Inset(buf), graphic_label(sgml::uniqueID(from_ascii("graph"))),
+ : Inset(buf), graphic_label(xml::uniqueID(from_ascii("graph"))),
graphic_(new RenderGraphic(this))
{
}
InsetGraphics::InsetGraphics(InsetGraphics const & ig)
: Inset(ig),
- graphic_label(sgml::uniqueID(from_ascii("graph"))),
+ graphic_label(xml::uniqueID(from_ascii("graph"))),
graphic_(new RenderGraphic(*ig.graphic_, this))
{
setParams(ig.params());
// 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 :-)
-
odocstringstream options;
double const scl = convert<double>(params().scale);
if (!params().scale.empty() && !float_equal(scl, 0.0, 0.05)) {
{
// No conversion is needed. LaTeX can handle the graphic file as is.
// This is true even if the orig_file is compressed.
- string const to_format = theFormats().getFormat(to)->extension();
+ Format const * f = theFormats().getFormat(to);
+ if (!f)
+ return latex_path(file, EXCLUDE_EXTENSION);
+ string const to_format = f->extension();
string const file_format = getExtension(file);
// for latex .ps == .eps
if (to_format == file_format ||
if (!uncodable.empty() && !runparams.silent) {
// issue a warning about omitted characters
// FIXME: should be passed to the error dialog
- frontend::Alert::warning(_("Uncodable characters in file path"),
+ frontend::Alert::warning(_("Uncodable character in file path"),
bformat(_("The following characters in one of the graphic paths are\n"
"not representable in the current encoding and have been omitted: %1$s.\n"
"You need to adapt either the encoding or the path."),
{
if (runparams.flavor != OutputParams::XML)
os << "<![ %output.print." << format
- << "; [" << endl;
+ << "; [" << endl;
os <<"<imageobject><imagedata fileref=\"&"
- << graphic_label
- << ";."
- << format
- << "\" "
- << attributes;
+ << graphic_label
+ << ";."
+ << format
+ << "\" "
+ << attributes;
if (runparams.flavor == OutputParams::XML)
os << " role=\"" << format << "\"/>" ;
}
-docstring InsetGraphics::xhtml(XHTMLStream & xs, OutputParams const & op) const
+docstring InsetGraphics::xhtml(XMLStream & xs, OutputParams const & op) const
{
string const output_file = op.dryrun ? string() : prepareHTMLFile(op);
<< params().filename << "' for output. File missing?");
string const attr = "src='" + params().filename.absFileName()
+ "' alt='image: " + output_file + "'";
- xs << html::CompTag("img", attr);
+ xs << xml::CompTag("img", attr);
return docstring();
}
string const attr = imgstyle + "src='" + output_file + "' alt='image: "
+ output_file + "'";
- xs << html::CompTag("img", attr);
+ xs << xml::CompTag("img", attr);
return docstring();
}
if (contains(rel_file, "."))
features.require("lyxdot");
}
+ if (features.inDeletedInset()) {
+ features.require("tikz");
+ features.require("ct-tikz-object-sout");
+ }
}