#include "Buffer.h"
#include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
#include "Encoding.h"
#include "InsetList.h"
#include "Language.h"
#include "Paragraph.h"
#include "paragraph_funcs.h"
#include "ParagraphParameters.h"
+#include "TextClass.h"
#include "TexRow.h"
#include "VSpace.h"
odocstream & os, TexRow & texrow,
OutputParams const & runparams)
{
- LYXERR(Debug::LATEX) << "TeXDeeper... " << &*pit << endl;
+ LYXERR(Debug::LATEX, "TeXDeeper... " << &*pit);
ParagraphList::const_iterator par = pit;
while (par != paragraphs.end() &&
os, texrow, runparams);
}
}
- LYXERR(Debug::LATEX) << "TeXDeeper...done " << endl;
+ LYXERR(Debug::LATEX, "TeXDeeper...done ");
return par;
}
odocstream & os, TexRow & texrow,
OutputParams const & runparams)
{
- LYXERR(Debug::LATEX) << "TeXEnvironment... " << &*pit << endl;
+ LYXERR(Debug::LATEX, "TeXEnvironment... " << &*pit);
BufferParams const & bparams = buf.params();
lyxrc.language_command_end,
"$$lang",
prev_par_language->babel()))
- << '\n';
+ // the '%' is necessary to prevent unwanted whitespace
+ << "%\n";
texrow.newline();
}
lyxrc.language_command_begin,
"$$lang",
par_language->babel()))
- << '\n';
+ // the '%' is necessary to prevent unwanted whitespace
+ << "%\n";
texrow.newline();
}
}
texrow.newline();
}
- if (par != paragraphs.end()) {
- LYXERR(Debug::LATEX) << "TeXEnvironment...done " << &*par << endl;
- }
+ if (par != paragraphs.end())
+ LYXERR(Debug::LATEX, "TeXEnvironment...done " << &*par);
+
return par;
}
OutputParams const & runparams_in,
string const & everypar)
{
- LYXERR(Debug::LATEX) << "TeXOnePar... " << &*pit << " '"
- << everypar << "'" << endl;
+ LYXERR(Debug::LATEX, "TeXOnePar... " << &*pit << " '"
+ << everypar << "'");
BufferParams const & bparams = buf.params();
LayoutPtr style;
if (runparams_in.verbatim) {
- Font const outerfont =
- outerFont(std::distance(paragraphs.begin(), pit),
- paragraphs);
+ int const dist = std::distance(paragraphs.begin(), pit);
+ Font const outerfont = outerFont(dist, paragraphs);
+
+ // No newline if only one paragraph in this lyxtext
+ if (dist > 0) {
+ os << '\n';
+ texrow.newline();
+ }
/*bool need_par = */ pit->latex(buf, bparams, outerfont,
os, texrow, runparams_in);
- os << '\n';
- texrow.newline();
return ++pit;
}
Language const * const par_language = pit->getParLanguage(bparams);
// The document's language
Language const * const doc_language = bparams.language;
- // The language that was in effect when the environemnt this paragraph is
+ // The language that was in effect when the environment this paragraph is
// inside of was opened
Language const * const outer_language =
(runparams.local_font != 0) ?
os << from_ascii(subst(lyxrc.language_command_end,
"$$lang",
prev_language->babel()))
- << '\n';
+ // the '%' is necessary to prevent unwanted whitespace
+ << "%\n";
texrow.newline();
}
lyxrc.language_command_begin,
"$$lang",
par_language->babel()))
- << '\n';
+ // the '%' is necessary to prevent unwanted whitespace
+ << "%\n";
texrow.newline();
}
}
if (encoding->package() == Encoding::inputenc && enc_switch.first) {
runparams.encoding = encoding;
if (enc_switch.second > 0) {
- os << '\n';
+ // the '%' is necessary to prevent unwanted whitespace
+ os << "%\n";
texrow.newline();
}
}
texrow.newline();
}
- if (boost::next(pit) != paragraphs.end()) {
- LYXERR(Debug::LATEX) << "TeXOnePar...done " << &*boost::next(pit) << endl;
- }
+ if (boost::next(pit) != paragraphs.end())
+ LYXERR(Debug::LATEX, "TeXOnePar...done " << &*boost::next(pit));
return ++pit;
}
|| newEnc.package() == Encoding::none)
return make_pair(false, 0);
- LYXERR(Debug::LATEX) << "Changing LaTeX encoding from "
- << oldEnc.name() << " to "
- << newEnc.name() << endl;
+ LYXERR(Debug::LATEX, "Changing LaTeX encoding from "
+ << oldEnc.name() << " to " << newEnc.name());
os << setEncoding(newEnc.iconvName());
if (bparams.inputenc == "default")
return make_pair(true, 0);
- docstring const inputenc(from_ascii(newEnc.latexName()));
+ docstring const inputenc = from_ascii(newEnc.latexName());
switch (newEnc.package()) {
case Encoding::none:
// shouldn't ever reach here, see above
}
os << "\\inputencoding{" << inputenc << '}';
return make_pair(true, count + 16);
- }
+ }
case Encoding::CJK: {
int count = inputenc.length();
if (oldEnc.package() == Encoding::CJK) {