Am Freitag, 1. März 2013 um 13:04:34, schrieb Kornel Benko <kor...@lyx.org> > Am Donnerstag, 28. Februar 2013 um 21:42:13, schrieb Georg Baum > <georg.b...@post.rwth-aachen.de> > > Kornel Benko wrote: > > > > > I have a solution for this. > > > > > > 1.) In lib/layouts/stdfloats.inc rename > > > Type algorithm > > > to > > > Type algorithmfloat > > > 2.) Increment lyx-format, becase now lyx-file changes entries > > > from > > > \begin_inset Float algorithm > > > to > > > \begin_inset Float algorithmfloat > > > > > > Should I proceed? > > > > I think it is a good idea, but I am not sure whether it has side effects, > > i.e. some LaTeX packages (for referencing?) or LyX modules have special > > code > > for floats named "algorithm". > > > > I am unsure about to increase the format. > > Since what we want to achieve is to omit clash in our own files (output to > latex) > we could as well change only this part. I want to try to change > LaTeXFeatures.* only. > > > Georg > Ok, I ended with with this. It works without format change. Does only affect latex output, so nothing to change for xhtml etc.
Kornel
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 10adb14..cece6d4 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -1439,7 +1439,7 @@ docstring const LaTeXFeatures::getTClassI18nPreamble(bool use_babel, bool use_po // we assume builtin floats are translated if (fl.isPredefined()) continue; - docstring const type = from_ascii(fl.floattype()); + docstring const type = from_ascii(fl.floattype() + "float"); docstring const flname = from_utf8(fl.name()); docstring name = buffer().language()->translateLayout(fl.name()); // only request translation if we have a real translation @@ -1589,7 +1589,7 @@ void LaTeXFeatures::getFloatDefinitions(odocstream & os) const // but only if builtin == false // and that have to be true at this point in the // function. - docstring const type = from_ascii(fl.floattype()); + docstring const type = from_ascii(fl.floattype() + "float"); docstring const placement = from_ascii(fl.placement()); docstring const style = from_ascii(fl.style()); if (!style.empty()) { @@ -1603,7 +1603,7 @@ void LaTeXFeatures::getFloatDefinitions(odocstream & os) const } else { // The other non builtin floats. - docstring const type = from_ascii(fl.floattype()); + docstring const type = from_ascii(fl.floattype() + "float"); docstring const placement = from_ascii(fl.placement()); docstring const ext = from_ascii(fl.ext()); docstring const within = from_ascii(fl.within()); @@ -1627,7 +1627,7 @@ void LaTeXFeatures::getFloatDefinitions(odocstream & os) const // effect. (Lgb) } if (cit->second) - os << "\n\\newsubfloat{" << from_ascii(fl.floattype()) << "}\n"; + os << "\n\\newsubfloat{" << from_ascii(fl.floattype() + "float") << "}\n"; } } diff --git a/src/insets/InsetFloat.cpp b/src/insets/InsetFloat.cpp index 333702a..8ba5949 100644 --- a/src/insets/InsetFloat.cpp +++ b/src/insets/InsetFloat.cpp @@ -348,12 +348,12 @@ void InsetFloat::latex(otexstream & os, OutputParams const & runparams_in) const runparams.inFloat = OutputParams::MAINFLOAT; FloatList const & floats = buffer().params().documentClass().floats(); - string tmptype = params_.type; + string tmptype = params_.type + "float"; if (params_.sideways) tmptype = "sideways" + params_.type; if (params_.wide && (!params_.sideways || - params_.type == "figure" || - params_.type == "table")) + params_.type == "figurefloat" || + params_.type == "tablefloat")) tmptype += "*"; // Figure out the float placement to use. // From lowest to highest:
signature.asc
Description: This is a digitally signed message part.