#\DeclareLyXModule[algorithm2e.sty]{Algorithm2e}
#DescriptionBegin
# Use the algorithm2e package for algorithm floats rather
-# than LyX's home-brewed algorithm floats.
+# than LyX's home-brewed algorithm floats. Use the Algorithm
+# style to enter and indent the algorithm.
#DescriptionEnd
#
#Author: Jürgen Spitzmüller
RefPrefix alg
End
+Style Algorithm
+ Category List
+ Margin Static
+ LatexType Environment
+ NextNoIndent 1
+ ParbreakIsNewline 1
+ ToggleIndent Never
+ KeepEmpty 1
+ LeftMargin MM
+ Align Left
+End
data.leftindent_open = true;
}
- if (style.isEnvironment()) {
+ if (style.isEnvironment())
state->nest_level_ += 1;
+
+ if (style.isEnvironment() && !style.latexname().empty()) {
os << "\\begin{" << from_ascii(style.latexname()) << '}';
if (!style.latexargs().empty()) {
OutputParams rp = runparams;
}
}
state->nest_level_ -= 1;
- os << "\\end{" << from_ascii(data.style->latexname()) << "}\n";
+ string const & name = data.style->latexname();
+ if (!name.empty())
+ os << "\\end{" << from_ascii(name) << "}\n";
state->prev_env_language_ = data.par_language;
if (runparams.encoding != data.prev_encoding) {
runparams.encoding = data.prev_encoding;