mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-12 22:14:35 +00:00
Change the LaTeXBuiltin tag to a NeedsFloatPkg tag. Discussion on the
list revealed that the former is confusing to people. The latter indicates more clearly what the tag does. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33626 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
75dcff81ab
commit
b64e2d4103
@ -12545,72 +12545,6 @@ HTML*
|
|||||||
\begin_inset Flex CharStyle:Code
|
\begin_inset Flex CharStyle:Code
|
||||||
status collapsed
|
status collapsed
|
||||||
|
|
||||||
\begin_layout Plain Layout
|
|
||||||
LaTeXBuiltin
|
|
||||||
\end_layout
|
|
||||||
|
|
||||||
\end_inset
|
|
||||||
|
|
||||||
[
|
|
||||||
\begin_inset Flex CharStyle:Code
|
|
||||||
status collapsed
|
|
||||||
|
|
||||||
\begin_layout Plain Layout
|
|
||||||
|
|
||||||
\emph on
|
|
||||||
0
|
|
||||||
\end_layout
|
|
||||||
|
|
||||||
\end_inset
|
|
||||||
|
|
||||||
,
|
|
||||||
\begin_inset Flex CharStyle:Code
|
|
||||||
status collapsed
|
|
||||||
|
|
||||||
\begin_layout Plain Layout
|
|
||||||
1
|
|
||||||
\end_layout
|
|
||||||
|
|
||||||
\end_inset
|
|
||||||
|
|
||||||
] Set to
|
|
||||||
\begin_inset Flex CharStyle:Code
|
|
||||||
status collapsed
|
|
||||||
|
|
||||||
\begin_layout Plain Layout
|
|
||||||
1
|
|
||||||
\end_layout
|
|
||||||
|
|
||||||
\end_inset
|
|
||||||
|
|
||||||
if the float is already defined by the LaTeX document class.
|
|
||||||
If this is set to
|
|
||||||
\begin_inset Flex CharStyle:Code
|
|
||||||
status collapsed
|
|
||||||
|
|
||||||
\begin_layout Plain Layout
|
|
||||||
0
|
|
||||||
\end_layout
|
|
||||||
|
|
||||||
\end_inset
|
|
||||||
|
|
||||||
, the float will be defined using the LaTeX package
|
|
||||||
\begin_inset Flex CharStyle:Code
|
|
||||||
status collapsed
|
|
||||||
|
|
||||||
\begin_layout Plain Layout
|
|
||||||
float
|
|
||||||
\end_layout
|
|
||||||
|
|
||||||
\end_inset
|
|
||||||
|
|
||||||
.
|
|
||||||
\end_layout
|
|
||||||
|
|
||||||
\begin_layout Description
|
|
||||||
\begin_inset Flex CharStyle:Code
|
|
||||||
status collapsed
|
|
||||||
|
|
||||||
\begin_layout Plain Layout
|
\begin_layout Plain Layout
|
||||||
ListName
|
ListName
|
||||||
\end_layout
|
\end_layout
|
||||||
@ -12646,6 +12580,84 @@ string
|
|||||||
\begin_inset Flex CharStyle:Code
|
\begin_inset Flex CharStyle:Code
|
||||||
status collapsed
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
NeedsFloatPkg
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
[
|
||||||
|
\begin_inset Flex CharStyle:Code
|
||||||
|
status open
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
0
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
,
|
||||||
|
\begin_inset Flex CharStyle:Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
|
||||||
|
\emph on
|
||||||
|
1
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
] Indicates whether the float is already defined in the document class or
|
||||||
|
if we instead need to load
|
||||||
|
\begin_inset Flex CharStyle:Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
float.sty
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
and use what it provides.
|
||||||
|
The default is
|
||||||
|
\begin_inset Flex CharStyle:Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
1
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
, which means: use
|
||||||
|
\begin_inset Flex CharStyle:Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
float.sty
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
.
|
||||||
|
It should be set to
|
||||||
|
\begin_inset Flex CharStyle:Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
|
\begin_layout Plain Layout
|
||||||
|
0
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\end_inset
|
||||||
|
|
||||||
|
if the float is already defined by the LaTeX document class.
|
||||||
|
\end_layout
|
||||||
|
|
||||||
|
\begin_layout Description
|
||||||
|
\begin_inset Flex CharStyle:Code
|
||||||
|
status collapsed
|
||||||
|
|
||||||
\begin_layout Plain Layout
|
\begin_layout Plain Layout
|
||||||
NumberWithin
|
NumberWithin
|
||||||
\end_layout
|
\end_layout
|
||||||
|
@ -84,6 +84,9 @@ import os, re, string, sys
|
|||||||
# Incremented to format 23, 13 February 2010 by spitz
|
# Incremented to format 23, 13 February 2010 by spitz
|
||||||
# Added Spellcheck tag.
|
# Added Spellcheck tag.
|
||||||
|
|
||||||
|
# Incremented to format 24, 5 March 2010 by rgh
|
||||||
|
# Changed LaTeXBuiltin tag to NeedsFloatPkg.
|
||||||
|
|
||||||
# Do not forget to document format change in Customization
|
# Do not forget to document format change in Customization
|
||||||
# Manual (section "Declaring a new text class").
|
# Manual (section "Declaring a new text class").
|
||||||
|
|
||||||
@ -91,7 +94,7 @@ import os, re, string, sys
|
|||||||
# development/tools/updatelayouts.sh script to update all
|
# development/tools/updatelayouts.sh script to update all
|
||||||
# layout files to the new format.
|
# layout files to the new format.
|
||||||
|
|
||||||
currentFormat = 23
|
currentFormat = 24
|
||||||
|
|
||||||
|
|
||||||
def usage(prog_name):
|
def usage(prog_name):
|
||||||
@ -171,6 +174,8 @@ def convert(lines):
|
|||||||
re_TocLevel = re.compile(r'^(\s*)(TocLevel)(\s+)(\S+)', re.IGNORECASE)
|
re_TocLevel = re.compile(r'^(\s*)(TocLevel)(\s+)(\S+)', re.IGNORECASE)
|
||||||
re_I18nPreamble = re.compile(r'^(\s*)I18nPreamble', re.IGNORECASE)
|
re_I18nPreamble = re.compile(r'^(\s*)I18nPreamble', re.IGNORECASE)
|
||||||
re_EndI18nPreamble = re.compile(r'^(\s*)EndI18nPreamble', re.IGNORECASE)
|
re_EndI18nPreamble = re.compile(r'^(\s*)EndI18nPreamble', re.IGNORECASE)
|
||||||
|
re_Builtin = re.compile(r'^(\s*)LaTeXBuiltin\s+(\w*)', re.IGNORECASE)
|
||||||
|
re_True = re.compile(r'^\s*(?:true|1)\s*$', re.IGNORECASE)
|
||||||
|
|
||||||
# counters for sectioning styles (hardcoded in 1.3)
|
# counters for sectioning styles (hardcoded in 1.3)
|
||||||
counters = {"part" : "\\Roman{part}",
|
counters = {"part" : "\\Roman{part}",
|
||||||
@ -259,6 +264,19 @@ def convert(lines):
|
|||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if format == 23:
|
||||||
|
match = re_Builtin.match(lines[i])
|
||||||
|
if match:
|
||||||
|
ws = match.group(1)
|
||||||
|
arg = match.group(2)
|
||||||
|
newarg = ""
|
||||||
|
if re_True.match(arg):
|
||||||
|
newarg = "false"
|
||||||
|
else:
|
||||||
|
newarg = "true"
|
||||||
|
lines[i] = ws + "NeedsFloatPkg " + newarg
|
||||||
|
|
||||||
|
|
||||||
# This just involved new features, not any changes to old ones
|
# This just involved new features, not any changes to old ones
|
||||||
if format >= 14 and format <= 22:
|
if format >= 14 and format <= 22:
|
||||||
i += 1
|
i += 1
|
||||||
|
@ -31,9 +31,9 @@ Floating::Floating(string const & type, string const & placement,
|
|||||||
string const & style, string const & name,
|
string const & style, string const & name,
|
||||||
string const & listName, string const & htmlTag,
|
string const & listName, string const & htmlTag,
|
||||||
string const & htmlAttrib, string const & htmlStyle,
|
string const & htmlAttrib, string const & htmlStyle,
|
||||||
bool builtin)
|
bool needsfloat)
|
||||||
: floattype_(type), placement_(placement), ext_(ext), within_(within),
|
: floattype_(type), placement_(placement), ext_(ext), within_(within),
|
||||||
style_(style), name_(name), listname_(listName), builtin_(builtin),
|
style_(style), name_(name), listname_(listName), needsfloatpkg_(needsfloat),
|
||||||
html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle)
|
html_tag_(htmlTag), html_attrib_(htmlAttrib), html_style_(htmlStyle)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
///
|
///
|
||||||
std::string const & listName() const { return listname_; }
|
std::string const & listName() const { return listname_; }
|
||||||
///
|
///
|
||||||
bool builtin() const { return builtin_; }
|
bool needsFloatPkg() const { return needsfloatpkg_; }
|
||||||
/// style information, for preamble
|
/// style information, for preamble
|
||||||
std::string const & htmlStyle() const { return html_style_; }
|
std::string const & htmlStyle() const { return html_style_; }
|
||||||
/// class, for css, defaults to "float-" + type()
|
/// class, for css, defaults to "float-" + type()
|
||||||
@ -74,7 +74,7 @@ private:
|
|||||||
///
|
///
|
||||||
std::string listname_;
|
std::string listname_;
|
||||||
///
|
///
|
||||||
bool builtin_;
|
bool needsfloatpkg_;
|
||||||
///
|
///
|
||||||
mutable std::string html_tag_;
|
mutable std::string html_tag_;
|
||||||
///
|
///
|
||||||
|
@ -432,7 +432,7 @@ void LaTeXFeatures::useFloat(string const & name, bool subfloat)
|
|||||||
// use the "H" modifier. This includes modified table and
|
// use the "H" modifier. This includes modified table and
|
||||||
// figure floats. (Lgb)
|
// figure floats. (Lgb)
|
||||||
Floating const & fl = params_.documentClass().floats().getType(name);
|
Floating const & fl = params_.documentClass().floats().getType(name);
|
||||||
if (!fl.floattype().empty() && !fl.builtin()) {
|
if (!fl.floattype().empty() && fl.needsFloatPkg()) {
|
||||||
require("float");
|
require("float");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1156,7 +1156,7 @@ void LaTeXFeatures::getFloatDefinitions(odocstream & os) const
|
|||||||
Floating const & fl = floats.getType(cit->first);
|
Floating const & fl = floats.getType(cit->first);
|
||||||
|
|
||||||
// For builtin floats we do nothing.
|
// For builtin floats we do nothing.
|
||||||
if (fl.builtin())
|
if (!fl.needsFloatPkg())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// We have to special case "table" and "figure"
|
// We have to special case "table" and "figure"
|
||||||
|
@ -66,7 +66,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Keep the changes documented in the Customization manual.
|
// Keep the changes documented in the Customization manual.
|
||||||
int const FORMAT = 23;
|
int const FORMAT = 24;
|
||||||
|
|
||||||
|
|
||||||
bool layout2layout(FileName const & filename, FileName const & tempfile)
|
bool layout2layout(FileName const & filename, FileName const & tempfile)
|
||||||
@ -856,7 +856,7 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
FT_WITHIN,
|
FT_WITHIN,
|
||||||
FT_STYLE,
|
FT_STYLE,
|
||||||
FT_LISTNAME,
|
FT_LISTNAME,
|
||||||
FT_BUILTIN,
|
FT_NEEDSFLOAT,
|
||||||
FT_HTMLSTYLE,
|
FT_HTMLSTYLE,
|
||||||
FT_HTMLATTR,
|
FT_HTMLATTR,
|
||||||
FT_HTMLTAG,
|
FT_HTMLTAG,
|
||||||
@ -870,8 +870,8 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
{ "htmlattr", FT_HTMLATTR },
|
{ "htmlattr", FT_HTMLATTR },
|
||||||
{ "htmlstyle", FT_HTMLSTYLE },
|
{ "htmlstyle", FT_HTMLSTYLE },
|
||||||
{ "htmltag", FT_HTMLTAG },
|
{ "htmltag", FT_HTMLTAG },
|
||||||
{ "latexbuiltin", FT_BUILTIN },
|
|
||||||
{ "listname", FT_LISTNAME },
|
{ "listname", FT_LISTNAME },
|
||||||
|
{ "needsfloatpkg", FT_NEEDSFLOAT },
|
||||||
{ "numberwithin", FT_WITHIN },
|
{ "numberwithin", FT_WITHIN },
|
||||||
{ "placement", FT_PLACEMENT },
|
{ "placement", FT_PLACEMENT },
|
||||||
{ "style", FT_STYLE },
|
{ "style", FT_STYLE },
|
||||||
@ -890,7 +890,7 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
string style;
|
string style;
|
||||||
string type;
|
string type;
|
||||||
string within;
|
string within;
|
||||||
bool builtin = false;
|
bool needsfloat = true;
|
||||||
|
|
||||||
bool getout = false;
|
bool getout = false;
|
||||||
while (!getout && lexrc.isOK()) {
|
while (!getout && lexrc.isOK()) {
|
||||||
@ -913,7 +913,7 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
style = fl.style();
|
style = fl.style();
|
||||||
name = fl.name();
|
name = fl.name();
|
||||||
listName = fl.listName();
|
listName = fl.listName();
|
||||||
builtin = fl.builtin();
|
needsfloat = fl.needsFloatPkg();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FT_NAME:
|
case FT_NAME:
|
||||||
@ -942,9 +942,9 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
lexrc.next();
|
lexrc.next();
|
||||||
listName = lexrc.getString();
|
listName = lexrc.getString();
|
||||||
break;
|
break;
|
||||||
case FT_BUILTIN:
|
case FT_NEEDSFLOAT:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
builtin = lexrc.getBool();
|
needsfloat = lexrc.getBool();
|
||||||
break;
|
break;
|
||||||
case FT_HTMLATTR:
|
case FT_HTMLATTR:
|
||||||
lexrc.next();
|
lexrc.next();
|
||||||
@ -967,7 +967,7 @@ void TextClass::readFloat(Lexer & lexrc)
|
|||||||
// Here if have a full float if getout == true
|
// Here if have a full float if getout == true
|
||||||
if (getout) {
|
if (getout) {
|
||||||
Floating fl(type, placement, ext, within, style, name,
|
Floating fl(type, placement, ext, within, style, name,
|
||||||
listName, htmltag, htmlattr, htmlstyle, builtin);
|
listName, htmltag, htmlattr, htmlstyle, needsfloat);
|
||||||
floatlist_.newFloat(fl);
|
floatlist_.newFloat(fl);
|
||||||
// each float has its own counter
|
// each float has its own counter
|
||||||
counters_.newCounter(from_ascii(type), from_ascii(within),
|
counters_.newCounter(from_ascii(type), from_ascii(within),
|
||||||
|
@ -119,7 +119,7 @@ int InsetFloatList::latex(odocstream & os, OutputParams const &) const
|
|||||||
FloatList::const_iterator cit = floats[to_ascii(getParam("type"))];
|
FloatList::const_iterator cit = floats[to_ascii(getParam("type"))];
|
||||||
|
|
||||||
if (cit != floats.end()) {
|
if (cit != floats.end()) {
|
||||||
if (cit->second.builtin()) {
|
if (!cit->second.needsFloatPkg()) {
|
||||||
// Only two different types allowed here:
|
// Only two different types allowed here:
|
||||||
string const type = cit->second.floattype();
|
string const type = cit->second.floattype();
|
||||||
if (type == "table") {
|
if (type == "table") {
|
||||||
@ -163,7 +163,7 @@ docstring InsetFloatList::xhtml(XHTMLStream &, OutputParams const &) const {
|
|||||||
|
|
||||||
string toctype;
|
string toctype;
|
||||||
docstring toclabel;
|
docstring toclabel;
|
||||||
if (cit->second.builtin()) {
|
if (!cit->second.needsFloatPkg()) {
|
||||||
// Only two different types allowed here:
|
// Only two different types allowed here:
|
||||||
string const type = cit->second.floattype();
|
string const type = cit->second.floattype();
|
||||||
if (type == "table") {
|
if (type == "table") {
|
||||||
|
Loading…
Reference in New Issue
Block a user