#LyX 2.0.0svn created this file. For more info see http://www.lyx.org/
-\lyxformat 404
+\lyxformat 410
\begin_document
\begin_header
\textclass scrbook
\font_sans default
\font_typewriter default
\font_default_family default
-\use_xetex false
+\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\html_math_output 0
\html_be_strict true
\author 1 "Jean-Marc Lasgouttes"
+\author 223010757 "Richard Heck" rgheck@brown.edu
\end_header
\begin_body
\end_inset
+
+\change_inserted 223010757 1290981996
+ or
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted 223010757 1290981998
+Paragraph
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+
+\change_unchanged
.
\end_layout
}
lex.popTable();
// make sure we only have inpreamble = true for commands
- if (inpreamble && latextype != LATEX_COMMAND) {
- LYXERR0("InPreamble not permitted except with Command-type layouts.");
+ if (inpreamble && latextype != LATEX_COMMAND && latextype != LATEX_PARAGRAPH) {
+ LYXERR0("InPreamble not permitted except with command and paragraph layouts.");
LYXERR0("Layout name: " << name());
inpreamble = false;
}
void Paragraph::Private::validate(LaTeXFeatures & features) const
{
if (layout_->inpreamble && inset_owner_) {
+ bool const is_command = layout_->latextype == LATEX_COMMAND;
Buffer const & buf = inset_owner_->buffer();
BufferParams const & bp = buf.params();
Font f;
// output is wrong if this paragraph contains content
// that needs to switch encoding.
odocstringstream ods;
- ods << '\\' << from_ascii(layout_->latexname());
- // we have to provide all the optional arguments here, even though
- // the last one is the only one we care about.
- // Separate handling of optional argument inset.
- if (layout_->optargs != 0 || layout_->reqargs != 0)
- latexArgInsets(*owner_, ods, features.runparams(),
- layout_->reqargs, layout_->optargs);
- else
- ods << from_ascii(layout_->latexparam());
+ if (is_command) {
+ ods << '\\' << from_ascii(layout_->latexname());
+ // we have to provide all the optional arguments here, even though
+ // the last one is the only one we care about.
+ // Separate handling of optional argument inset.
+ if (layout_->optargs != 0 || layout_->reqargs != 0)
+ latexArgInsets(*owner_, ods, features.runparams(),
+ layout_->reqargs, layout_->optargs);
+ else
+ ods << from_ascii(layout_->latexparam());
+ }
docstring::size_type const length = ods.str().length();
// this will output "{" at the beginning, but not at the end
owner_->latex(bp, f, ods, tr, features.runparams(), 0, -1, true);
if (ods.str().length() > length) {
- ods << '}';
+ if (is_command)
+ ods << '}';
string const snippet = to_utf8(ods.str());
features.addPreambleSnippet(snippet);
}