#
# Detailed format description is available in the customization manual
-Format 100
+Format 101
Provides stdinsets 1
LabelString Margin
LatexType command
LatexName marginpar
+ InheritFont false
Font
Size Small
EndFont
LatexType Command
LatexName footnote
Counter footnote
+ InheritFont false
Font
Size Small
EndFont
LatexName comment
Requires verbatim
BgColor commentbg
+ InheritFont false
LabelFont
Color comment
Size Small
LatexName lyxgreyedout
Requires color,lyxgreyedout
BgColor greyedoutbg
+ InheritFont false
Font
Size Normal
Color greyedouttext
LabelString Listings[[inset]]
LatexType none
Decoration minimalistic
+ InheritFont false
Font
Color foreground
Family typewriter
End
InsetLayout Box
+ InheritFont false
LabelFont
Color foreground
Size Small
InsetLayout Float
LaTeXType environment
+ InheritFont false
LabelFont
Color collapsible
Size Small
End
InsetLayout Tabular
+ InheritFont false
HTMLStyle
table {
border-collapse: collapse;
re_trimLabelStringAppendix = re.compile(b'^(\\s*LabelStringAppendix\\s+)"\\s*(.*?)\\s*"\\s*$')
re_trimEndLabelString = re.compile(b'^(\\s*EndLabelString\\s+)"\\s*(.*?)\\s*"\\s*$')
re_trimLabelCounter = re.compile(b'^(\\s*LabelCounter\\s+)"\\s*(.*?)\\s*"\\s*$')
-
-
+ # for format 100
+ re_InsetLayout100 = re.compile(b'^\\s*InsetLayout\\s+\\"?(Box|Float|Foot|Marginal|Listings|Note:Comment|Note:Greyedout|Tabular)(:\\S*)?\\"?\\s*$', re.IGNORECASE)
+ re_InheritFont = re.compile(b'^(\\s*)InheritFont(\\s+)(\\S+)$', re.IGNORECASE)
# counters for sectioning styles (hardcoded in 1.3)
counters = {b"part" : b"\\Roman{part}",
b"chapter" : b"\\arabic{chapter}",
i += 1
continue
- if 87 <= format <= 101:
+ if format == 100:
+ # InheritFont has been introduced and defaults to true. Some insets had
+ # an hardcoded inheritFont') method returning true. We removed them, so
+ # we want to introduce the correct tag if it is not already there.
+ match = re_InsetLayout100.match(lines[i])
+ if not match:
+ i += 1
+ continue
+
+ inheritfont_found = False
+ inherited = False
+ while i < len(lines):
+ match = re_InheritFont.match(lines[i])
+ if match:
+ inheritfont_found = True
+ else:
+ match = re_CopyStyle.match(lines[i])
+ if match:
+ inherited = True
+ else:
+ match = re_End.match(lines[i])
+ if match:
+ break
+ i += 1
+ if not inheritfont_found and not inherited:
+ lines.insert(i, b"\tInheritFont false")
+
+ continue
+
+ if 87 <= format <= 99:
# nothing to do.
i += 1
continue
// You should also run the development/tools/updatelayouts.py script,
// to update the format of all of our layout files.
//
-int const LAYOUT_FORMAT = 100; // forenr: add inset label color
+int const LAYOUT_FORMAT = 101; // lasgouttes: add InheritFont tag
// Layout format for the current lyx file format. Controls which format is
///
bool neverIndent() const override { return true; }
///
- bool inheritFont() const override { return false; }
- ///
void latex(otexstream &, OutputParams const &) const override;
///
int plaintext(odocstringstream & ods, OutputParams const & op,
///
bool insetAllowed(InsetCode) const override;
///
- bool inheritFont() const override { return false; }
- ///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const override;
///
bool hasSubCaptions(ParIterator const & it) const override;
void write(std::ostream & os) const override;
///
bool insetAllowed(InsetCode) const override;
- /** returns false if, when outputting LaTeX, font changes should
- be closed before generating this inset. This is needed for
- insets that may contain several paragraphs */
- bool inheritFont() const override { return false; }
};
private:
///
bool isLabeled() const override { return true; }
- /// false is needed since listings do their own font handling.
- bool inheritFont() const override { return false; }
///
InsetCode lyxCode() const override { return LISTINGS_CODE; }
/// lstinline is inlined, normal listing is displayed
InsetCode lyxCode() const override { return NOTE_CODE; }
///
docstring layoutName() const override;
- ///
- bool inheritFont() const override { return params_.type == InsetNoteParams::Note; }
/// Is the content of this inset part of the output document?
bool producesOutput() const override
{ return params_.type == InsetNoteParams::Greyedout; }
///
bool neverIndent() const override { return true; }
///
- bool inheritFont() const override { return true; }
- ///
int plaintext(odocstringstream & ods, OutputParams const & op,
size_t max_length = INT_MAX) const override;
///
///
InsetCode lyxCode() const override { return CELL_CODE; }
///
+ docstring layoutName() const override { return from_ascii("Tabular:Cell"); }
+ ///
Inset * clone() const override { return new InsetTableCell(*this); }
///
bool getStatus(Cursor & cur, FuncRequest const & cmd,
UpdateType utype, TocBackend & backend) const override;
///
void metrics(MetricsInfo &, Dimension &) const override;
- /// Needs to be same as InsetTabular
- bool inheritFont() const override { return false; }
/// Can the cell contain several paragraphs?
bool allowMultiPar() const override { return !isMultiRow && (!isMultiColumn || isFixedWidth); }
///
///
bool canPaintChange(BufferView const &) const override { return true; }
///
- bool inheritFont() const override { return false; }
- ///
bool allowMultiPar() const override;
///
bool allowsCaptionVariation(std::string const &) const override;