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;
}
// all paper sizes except of A4, A5, B5 and the US sizes need the
// geometry package
- bool nonstandard_papersize = papersize != PAPER_USLETTER
+ bool nonstandard_papersize = papersize != PAPER_DEFAULT
+ && papersize != PAPER_USLETTER
&& papersize != PAPER_USLEGAL
&& papersize != PAPER_USEXECUTIVE
&& papersize != PAPER_A4
// XeTeX works without fontenc
if (font_encoding() != "default" && language->lang() != "japanese"
&& !useXetex) {
+ size_t fars = language_options.str().find("farsi");
+ size_t arab = language_options.str().find("arabic");
if (language->lang() == "arabic_arabi"
- || language->lang() == "farsi") {
+ || language->lang() == "farsi" || fars != string::npos
+ || arab != string::npos) {
os << "\\usepackage[" << from_ascii(font_encoding())
<< ",LFE,LAE]{fontenc}\n";
texrow.newline();
os << '[' << g_options << ']';
os << "{geometry}\n";
texrow.newline();
- os << "\\geometry{verbose";
- if (!topmargin.empty())
- os << ",tmargin=" << from_ascii(Length(topmargin).asLatexString());
- if (!bottommargin.empty())
- os << ",bmargin=" << from_ascii(Length(bottommargin).asLatexString());
- if (!leftmargin.empty())
- os << ",lmargin=" << from_ascii(Length(leftmargin).asLatexString());
- if (!rightmargin.empty())
- os << ",rmargin=" << from_ascii(Length(rightmargin).asLatexString());
- if (!headheight.empty())
- os << ",headheight=" << from_ascii(Length(headheight).asLatexString());
- if (!headsep.empty())
- os << ",headsep=" << from_ascii(Length(headsep).asLatexString());
- if (!footskip.empty())
- os << ",footskip=" << from_ascii(Length(footskip).asLatexString());
- if (!columnsep.empty())
- os << ",columnsep=" << from_ascii(Length(columnsep).asLatexString());
- os << "}\n";
- texrow.newline();
- } else if (orientation == ORIENTATION_LANDSCAPE) {
+ // output this if only use_geometry is true
+ if (use_geometry) {
+ os << "\\geometry{verbose";
+ if (!topmargin.empty())
+ os << ",tmargin=" << from_ascii(Length(topmargin).asLatexString());
+ if (!bottommargin.empty())
+ os << ",bmargin=" << from_ascii(Length(bottommargin).asLatexString());
+ if (!leftmargin.empty())
+ os << ",lmargin=" << from_ascii(Length(leftmargin).asLatexString());
+ if (!rightmargin.empty())
+ os << ",rmargin=" << from_ascii(Length(rightmargin).asLatexString());
+ if (!headheight.empty())
+ os << ",headheight=" << from_ascii(Length(headheight).asLatexString());
+ if (!headsep.empty())
+ os << ",headsep=" << from_ascii(Length(headsep).asLatexString());
+ if (!footskip.empty())
+ os << ",footskip=" << from_ascii(Length(footskip).asLatexString());
+ if (!columnsep.empty())
+ os << ",columnsep=" << from_ascii(Length(columnsep).asLatexString());
+ os << "}\n";
+ texrow.newline();
+ }
+ } else if (orientation == ORIENTATION_LANDSCAPE
+ || papersize != PAPER_DEFAULT) {
features.require("papersize");
}
// 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