html_be_strict = false;
html_math_output = MathML;
html_math_img_scale = 1.0;
- html_latex_start = "<span class='latex'>";
- html_latex_end = "</span>";
+
+ output_sync = false;
}
} else if (token == "\\html_math_img_scale") {
lex >> html_math_img_scale;
} else if (token == "\\html_latex_start") {
- lex >> html_latex_start;
+ lex.eatLine();
+ html_latex_start = lex.getString();
} else if (token == "\\html_latex_end") {
- lex >> html_latex_end;
+ lex.eatLine();
+ html_latex_end = lex.getString();
+ } else if (token == "\\output_sync") {
+ lex >> output_sync;
+ } else if (token == "\\output_sync_macro") {
+ lex >> output_sync_macro;
} else {
lyxerr << "BufferParams::readToken(): Unknown token: " <<
token << endl;
}
os << "\n\\graphics " << graphicsDriver << '\n';
os << "\\default_output_format " << defaultOutputFormat << '\n';
+ os << "\\output_sync " << output_sync << '\n';
+ if (!output_sync_macro.empty())
+ os << "\\output_sync_macro \"" << output_sync_macro << "\"\n";
os << "\\bibtex_command " << bibtex_command << '\n';
os << "\\index_command " << index_command << '\n';
os << "\\tracking_changes " << convert<string>(trackChanges) << '\n'
<< "\\output_changes " << convert<string>(outputChanges) << '\n'
<< "\\html_math_output " << html_math_output << '\n'
- << "\\html_be_strict " << convert<string>(html_be_strict) << '\n'
- << "\\html_math_img_scale " << convert<string>(html_math_img_scale) << '\n'
- << "\\html_latex_start \"" << html_latex_start << "\"\n"
- << "\\html_latex_end \"" << html_latex_end << "\"\n";
+ << "\\html_be_strict " << convert<string>(html_be_strict) << '\n';
+
+ if (html_math_img_scale != 1.0)
+ os << "\\html_math_img_scale " << convert<string>(html_math_img_scale) << '\n';
+ if (!html_latex_start.empty())
+ os << "\\html_latex_start " << html_latex_start << '\n';
+ if (!html_latex_end.empty())
+ os << "\\html_latex_end " << html_latex_end << '\n';
os << pimpl_->authorlist;
}
// LFE encoding
// XeTeX works without fontenc
if (font_encoding() != "default" && language->lang() != "japanese"
- && !useXetex) {
+ && !useXetex) {
size_t fars = language_options.str().find("farsi");
size_t arab = language_options.str().find("arabic");
if (language->lang() == "arabic_arabi"
// Now insert the LyX specific LaTeX commands...
docstring lyxpreamble;
+ if (output_sync) {
+ if (!output_sync_macro.empty())
+ lyxpreamble += from_utf8(output_sync_macro) +"\n";
+ else if (features.runparams().flavor == OutputParams::LATEX)
+ lyxpreamble += "\\usepackage[active]{srcltx}\n";
+ else if (features.runparams().flavor == OutputParams::PDFLATEX)
+ lyxpreamble += "\\synctex=-1\n";
+ }
+
// due to interferences with babel and hyperref, the color package has to
// be loaded (when it is not already loaded) before babel when hyperref
// is used with the colorlinks option, see