#include "BufferParams.h"
#include "Counters.h"
#include "Language.h"
+#include "LaTeXFeatures.h"
#include "Layout.h"
#include "OutputParams.h"
#include "ParIterator.h"
namespace lyx {
InsetFoot::InsetFoot(Buffer * buf)
- : InsetFootlike(buf), intitle_(false)
+ : InsetFootlike(buf), intitle_(false), infloattable_(false)
{}
docstring InsetFoot::layoutName() const
{
- return intitle_ ? from_ascii("Foot:InTitle") : from_ascii("Foot");
+ if (intitle_)
+ return from_ascii("Foot:InTitle");
+ else if (infloattable_)
+ return from_ascii("Foot:InFloatTable");
+ return from_ascii("Foot");
}
}
intitle_ = false;
- for (size_type sl = 0 ; sl < it.depth() ; ++ sl) {
+ infloattable_ = false;
+ bool intable = false;
+ if (it.innerInsetOfType(TABULAR_CODE) != 0)
+ intable = true;
+ if (it.innerInsetOfType(FLOAT_CODE) != 0)
+ infloattable_ = intable;
+ for (size_type sl = 0 ; sl < it.depth() ; ++sl) {
if (it[sl].text() && it[sl].paragraph().layout().intitle) {
intitle_ = true;
break;
return i;
}
+
+void InsetFoot::validate(LaTeXFeatures & features) const
+{
+ if (!features.saveNoteEnv().empty()) {
+ features.require("footnote");
+ features.addPreambleSnippet(
+ from_ascii("\\makesavenoteenv{"
+ + features.saveNoteEnv()
+ + "}\n"));
+ }
+
+ InsetText::validate(features);
+}
+
} // namespace lyx