mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 02:14:50 +00:00
Fix captions, in accord with observations by Abdel and JMarc.
Note that we will sometimes use the "caption trick", still in listings, for example. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30194 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
1ef0168dd4
commit
83a89711b0
@ -26,7 +26,7 @@ OutputParams::OutputParams(Encoding const * enc)
|
||||
inComment(false), inTableCell(NO), inFloat(NONFLOAT),
|
||||
inDeletedInset(0), changeOfDeletedInset(Change::UNCHANGED),
|
||||
par_begin(0), par_end(0), isLastPar(false),
|
||||
dryrun(false), verbatim(false)
|
||||
dryrun(false), verbatim(false), disable_captions(false)
|
||||
{
|
||||
// Note: in PreviewLoader::Impl::dumpPreamble
|
||||
// OutputParams runparams(0);
|
||||
|
@ -198,6 +198,8 @@ public:
|
||||
bool dryrun;
|
||||
/// Should we output verbatim or escape LaTeX's special chars?
|
||||
bool verbatim;
|
||||
/// Should we output captions? (Used in HTML output.)
|
||||
bool disable_captions;
|
||||
};
|
||||
|
||||
|
||||
|
@ -256,10 +256,15 @@ int InsetCaption::docbook(odocstream & os,
|
||||
}
|
||||
|
||||
|
||||
docstring InsetCaption::xhtml(odocstream &,
|
||||
OutputParams const &) const
|
||||
docstring InsetCaption::xhtml(odocstream & os,
|
||||
OutputParams const & rp) const
|
||||
{
|
||||
return docstring();
|
||||
if (rp.disable_captions)
|
||||
return docstring();
|
||||
os << "<div class='float-caption'>\n";
|
||||
docstring def = getCaptionAsHTML(os, rp);
|
||||
os << "</div>\n";
|
||||
return def;
|
||||
}
|
||||
|
||||
int InsetCaption::getArgument(odocstream & os,
|
||||
|
@ -70,7 +70,7 @@ private:
|
||||
int plaintext(odocstream & os, OutputParams const & runparams) const;
|
||||
///
|
||||
int docbook(odocstream & os, OutputParams const & runparams) const;
|
||||
/// This does nothing here. Instead, it is handled inside the float.
|
||||
///
|
||||
docstring xhtml(odocstream & os, OutputParams const & runparams) const;
|
||||
///
|
||||
void setCustomLabel(docstring const & label);
|
||||
|
@ -297,11 +297,7 @@ docstring InsetFloat::xhtml(odocstream & os, OutputParams const & rp) const
|
||||
|
||||
odocstringstream out;
|
||||
|
||||
docstring caption = getCaptionHTML(rp);
|
||||
out << otag;
|
||||
if (!caption.empty())
|
||||
out << "<div class='float-caption'>" << caption << "</div>\n";
|
||||
|
||||
docstring def = InsetText::xhtml(out, rp);
|
||||
out << ctag;
|
||||
|
||||
|
@ -288,7 +288,9 @@ docstring InsetListings::xhtml(odocstream & os, OutputParams const & rp) const
|
||||
}
|
||||
|
||||
out << "<pre>\n";
|
||||
docstring def = InsetText::xhtml(out, rp);
|
||||
OutputParams newrp = rp;
|
||||
newrp.disable_captions = true;
|
||||
docstring def = InsetText::xhtml(out, newrp);
|
||||
out << "\n</pre>\n";
|
||||
|
||||
if (isInline) {
|
||||
|
Loading…
Reference in New Issue
Block a user