LyX file-format changes
-----------------------
LyX file-format changes
-----------------------
+2008-04-18 Bo Peng <ben.bob@gmail.com>
+ * Format incremented to 328: Revert the support for embedding
+
2008-04-16 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 327: support for Mexican Spanish.
2008-04-16 Uwe Stöhr <uwestoehr@web.de>
* Format incremented to 327: support for Mexican Spanish.
("1_3", [221], minor_versions("1.3" , 7)),
("1_4", range(222,246), minor_versions("1.4" , 5)),
("1_5", range(246,277), minor_versions("1.5" , 2)),
("1_3", [221], minor_versions("1.3" , 7)),
("1_4", range(222,246), minor_versions("1.4" , 5)),
("1_5", range(246,277), minor_versions("1.5" , 2)),
- ("1_6", range(277,328), minor_versions("1.6" , 0))] # Uwe: support for Spanish(Mexico)
+ ("1_6", range(277,329), minor_versions("1.6" , 0))] # Uwe: support for Spanish(Mexico)
-def revert_external_embedding(document):
- ' Remove embed tag from external inset '
+def revert_inset_embedding(document, type):
+ ' Remove embed tag from certain type of insets'
- i = find_token(document.body, "\\begin_inset External", i)
+ i = find_token(document.body, "\\begin_inset %s" % type, i)
if i == -1:
return
j = find_end_of_inset(document.body, i)
if i == -1:
return
j = find_end_of_inset(document.body, i)
i = i + 1
continue
k = find_token(document.body, "\tembed", i, j)
i = i + 1
continue
k = find_token(document.body, "\tembed", i, j)
+ if k == -1:
+ k = find_token(document.body, "embed", i, j)
if k != -1:
del document.body[k]
i = i + 1
if k != -1:
del document.body[k]
i = i + 1
+def revert_external_embedding(document):
+ ' Remove embed tag from external inset '
+ revert_inset_embedding(document, 'External')
+
+
def convert_subfig(document):
" Convert subfigures to subfloats. "
i = 0
def convert_subfig(document):
" Convert subfigures to subfloats. "
i = 0
+def remove_embedding(document):
+ ' Remove embed tag from all insets'
+ revert_inset_embedding(document, 'Graphics')
+ revert_inset_embedding(document, 'External')
+ revert_inset_embedding(document, 'CommandInset include')
+ revert_inset_embedding(document, 'CommandInset bibtex')
+
+
[324, [convert_linebreaks]],
[325, [convert_japanese_plain]],
[326, []],
[324, [convert_linebreaks]],
[325, [convert_japanese_plain]],
[326, []],
+ [327, []],
+ [328, [remove_embedding, remove_extra_embedded_files, remove_inzip_options]],
-revert = [[326, [revert_mexican]],
+revert = [[327, []],
+ [326, [revert_mexican]],
[325, [revert_pdfpages]],
[324, []],
[323, [revert_linebreaks]],
[325, [revert_pdfpages]],
[324, []],
[323, [revert_linebreaks]],
-int const LYX_FORMAT = 327; // Uwe: support for Spanish(Mexico)
+int const LYX_FORMAT = 328;
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
else
os << "\\author " << Author() << "\n";
}
else
os << "\\author " << Author() << "\n";
}
-
- vector<string>::const_iterator e_it = extraEmbeddedFiles().begin();
- vector<string>::const_iterator e_end = extraEmbeddedFiles().end();
- os << "\\extra_embedded_files \"";
- bool first = true;
- for (; e_it != e_end; ++e_it) {
- if (!first)
- os << ",";
- else
- first = false;
- os << *e_it;
- }
- os << "\"\n";
if (param_info_.empty()) {
param_info_.add("btprint", ParamInfo::LATEX_OPTIONAL);
param_info_.add("bibfiles", ParamInfo::LATEX_REQUIRED);
if (param_info_.empty()) {
param_info_.add("btprint", ParamInfo::LATEX_OPTIONAL);
param_info_.add("bibfiles", ParamInfo::LATEX_REQUIRED);
- param_info_.add("embed", ParamInfo::LYX_INTERNAL);
param_info_.add("options", ParamInfo::LYX_INTERNAL);
}
return param_info_;
param_info_.add("options", ParamInfo::LYX_INTERNAL);
}
return param_info_;
embed += from_utf8(it->inzipName());
}
setParam("bibfiles", bibfiles);
embed += from_utf8(it->inzipName());
}
setParam("bibfiles", bibfiles);
- setParam("embed", embed);
os << "External\n"
<< "\ttemplate " << templatename() << '\n';
os << "External\n"
<< "\ttemplate " << templatename() << '\n';
- if (!filename.empty()) {
os << "\tfilename " << filename.outputFilename(buf.filePath()) << '\n';
os << "\tfilename " << filename.outputFilename(buf.filePath()) << '\n';
- os << "\tembed " << (filename.embedded() ? filename.inzipName() : "\"\"") << '\n';
- }
if (display != defaultDisplayType)
os << "\tdisplay "
<< external::displayTranslator().find(display)
if (display != defaultDisplayType)
os << "\tdisplay "
<< external::displayTranslator().find(display)
void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
{
// Do not write the default values
void InsetGraphicsParams::Write(ostream & os, Buffer const & buffer) const
{
// Do not write the default values
- if (!filename.empty()) {
os << "\tfilename " << filename.outputFilename(buffer.filePath()) << '\n';
os << "\tfilename " << filename.outputFilename(buffer.filePath()) << '\n';
- os << "\tembed " << (filename.embedded() ? filename.inzipName() : "\"\"") << '\n';
- }
if (lyxscale != 100)
os << "\tlyxscale " << lyxscale << '\n';
if (display != graphics::DefaultDisplay)
if (lyxscale != 100)
os << "\tlyxscale " << lyxscale << '\n';
if (display != graphics::DefaultDisplay)