#include "LaTeXFeatures.h"
-#include "BufferParams.h"
#include "Color.h"
+#include "BufferParams.h"
#include "debug.h"
#include "Encoding.h"
#include "Floating.h"
#include "FloatList.h"
#include "Language.h"
+#include "Layout.h"
#include "Lexer.h"
#include "LyXRC.h"
+#include "TextClass.h"
#include "support/docstream.h"
#include "support/filetools.h"
-#include "frontends/controllers/frontend_helpers.h"
-
using std::endl;
using std::find;
using std::string;
"\\newcommand{\\lyxadded}[3]{#3}\n"
"\\newcommand{\\lyxdeleted}[3]{}\n";
+static string const textgreek_def =
+ "\\DeclareRobustCommand{\\greektext}{%\n"
+ " \\fontencoding{LGR}\\selectfont\n"
+ " \\def\\encodingdefault{LGR}}\n"
+ "\\DeclareRobustCommand{\\textgreek}[1]{\\leavevmode{\\greektext #1}}\n"
+ "\\DeclareFontEncoding{LGR}{}{}\n";
+
+static string const textcyr_def =
+ "\\DeclareRobustCommand{\\cyrtext}{%\n"
+ " \\fontencoding{T2A}\\selectfont\n"
+ " \\def\\encodingdefault{T2A}}\n"
+ "\\DeclareRobustCommand{\\textcyr}[1]{\\leavevmode{\\cyrtext #1}}\n"
+ "\\DeclareFontEncoding{T2A}{}{}\n";
+
/////////////////////////////////////////////////////////////////////
//
"latexsym",
"pifont",
"subfigure",
- "floatflt",
"varioref",
"prettyref",
+ /*For a successful cooperation of the `wrapfig' package with the
+ `float' package you should load the `wrapfig' package *after*
+ the `float' package. See the caption package documentation
+ for explanation.*/
"float",
+ "wrapfig",
"booktabs",
"dvipost",
"fancybox",
"calc",
- "nicefrac",
+ "units",
"tipa",
"framed",
"pdfcolmk",
"txfonts",
"mathrsfs",
"ascii",
+ "url",
};
int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
}
// shadecolor for shaded
if (mustProvide("framed") && mustProvide("color")) {
- RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg));
+ RGBColor c = rgbFromHexName(lcolor.getX11Name(Color_shadedbg));
//255.0 to force conversion to double
//NOTE As Jürgen Spitzmüller pointed out, an alternative would be
//to use the xcolor package instead, and then we can do
params_.use_esint != BufferParams::package_off)
packages << "\\usepackage{esint}\n";
- // url.sty
- if (mustProvide("url"))
- packages << "\\IfFileExists{url.sty}{\\usepackage{url}}\n"
- " {\\newcommand{\\url}{\\texttt}}\n";
-
// natbib.sty
if (mustProvide("natbib")) {
packages << "\\usepackage[";
macros << '\n';
FeaturesList::const_iterator pit = preamble_snippets_.begin();
FeaturesList::const_iterator pend = preamble_snippets_.end();
- for (; pit != pend; ++pit) {
+ for (; pit != pend; ++pit)
macros << *pit << '\n';
- }
if (mustProvide("LyX"))
macros << lyx_def << '\n';
if (mustProvide("lyxarrow"))
macros << lyxarrow_def << '\n';
+ if (mustProvide("textgreek"))
+ macros << textgreek_def << '\n';
+
+ if (mustProvide("textcyr"))
+ macros << textcyr_def << '\n';
+
// quotes.
if (mustProvide("quotesinglbase"))
macros << quotesinglbase_def << '\n';
getFloatDefinitions(macros);
// change tracking
- if (mustProvide("ct-dvipost")) {
+ if (mustProvide("ct-dvipost"))
macros << changetracking_dvipost_def;
- }
+
if (mustProvide("ct-xcolor-soul")) {
int const prec = macros.precision(2);
- RGBColor cadd = RGBColor(lcolor.getX11Name(Color::addedtext));
+ RGBColor cadd = rgbFromHexName(lcolor.getX11Name(Color_addedtext));
macros << "\\providecolor{lyxadded}{rgb}{"
<< cadd.r / 255.0 << ',' << cadd.g / 255.0 << ',' << cadd.b / 255.0 << "}\n";
- RGBColor cdel = RGBColor(lcolor.getX11Name(Color::deletedtext));
+ RGBColor cdel = rgbFromHexName(lcolor.getX11Name(Color_deletedtext));
macros << "\\providecolor{lyxdeleted}{rgb}{"
<< cdel.r / 255.0 << ',' << cdel.g / 255.0 << ',' << cdel.b / 255.0 << "}\n";
macros << "\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\n"
<< "\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\st{#3}}}\n";
}
- if (mustProvide("ct-none")) {
+
+ if (mustProvide("ct-none"))
macros << changetracking_none_def;
- }
return macros.str();
}