% The following Bg5 encoded text cannot be processed as is by latex.
\end_layout
+\begin_layout Plain Layout
+
+\end_layout
+
\end_inset
% It needs to be preprocessed by bg5conv or bg5latex needs to be used.
\end_layout
+\begin_layout Plain Layout
+
+\end_layout
+
\end_inset
% The following SJIS encoded text cannot be processed as is by latex.
\end_layout
+\begin_layout Plain Layout
+
+\end_layout
+
\end_inset
% It needs to be preprocessed by sjisconv or sjislatex needs to be used.
\end_layout
+\begin_layout Plain Layout
+
+\end_layout
+
\end_inset
}
+void output_comment(Parser & p, ostream & os, string const & s,
+ Context & context)
+{
+ if (p.next_token().cat() == catNewline)
+ output_ert_inset(os, '%' + s, context);
+ else
+ output_ert_inset(os, '%' + s + '\n', context);
+}
+
+
Layout const * findLayout(TextClass const & textclass, string const & name, bool command)
{
Layout const * layout = findLayoutWithoutModule(textclass, name, command);
// LyX puts a % after the end of the minipage
if (p.next_token().cat() == catNewline && p.next_token().cs().size() > 1) {
// new paragraph
- //output_ert_inset(os, "%dummy", parent_context);
+ //output_comment(p, os, "dummy", parent_context);
p.get_token();
p.skip_spaces();
parent_context.new_paragraph(os);
}
else if (p.next_token().cat() == catSpace || p.next_token().cat() == catNewline) {
- //output_ert_inset(os, "%dummy", parent_context);
+ //output_comment(p, os, "dummy", parent_context);
p.get_token();
p.skip_spaces();
// We add a protected space if something real follows
LASSERT(t.cat() == catComment, return);
if (!t.cs().empty()) {
context.check_layout(os);
- output_ert_inset(os, '%' + t.cs(), context);
+ output_comment(p, os, t.cs(), context);
if (p.next_token().cat() == catNewline) {
// A newline after a comment line starts a new
// paragraph
context.check_layout(os);
// FIXME: This is a hack to prevent paragraph
// deletion if it is empty. Handle this better!
- output_ert_inset(os,
- "%dummy comment inserted by tex2lyx to "
+ output_comment(p, os,
+ "dummy comment inserted by tex2lyx to "
"ensure that this paragraph is not empty",
context);
// Both measures above may generate an additional