]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Buffer: Rename function names:
[lyx.git] / src / LaTeXFeatures.cpp
index c9216c6042b93514f181cc05e600d06839ac0927..172dfdadca7363001753443f0f2d66be106f4ccf 100644 (file)
@@ -60,11 +60,6 @@ namespace lyx {
 static docstring const lyx_def = from_ascii(
        "\\providecommand{\\LyX}{L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}");
 
-static docstring const lyxline_def = from_ascii(
-       "\\newcommand{\\lyxline}[1][1pt]{%\n"
-       "  \\par\\noindent%\n"
-       "  \\rule[.5ex]{\\linewidth}{#1}\\par}");
-
 static docstring const noun_def = from_ascii(
        "\\newcommand{\\noun}[1]{\\textsc{#1}}");
 
@@ -261,6 +256,25 @@ static docstring const ogonek_def = from_ascii(
        "  \\mathchar\"0\\hexnumber@\\symtipasymb0C}{#2}}\n"
        "\\newcommand{\\ogonek}[1]{\\mathpalette\\doogonek{#1}}\n");
 
+static docstring const lyxref_def = from_ascii(
+       "\\makeatletter\n"
+       "\\def\\lyxref#1{\\@lyxref#1:@@@@@:}\n"
+       "\\def\\@lyxref#1:#2:{%\n"
+       "\\ifthenelse{\\equal{#2}{@@@@@}}%\n"
+       "       {\\ref{#1}}%\n"
+       "       {\\@@lyxref#1:#2:}%\n"
+       "}\n"
+       "\\def\\@@lyxref#1:#2:@@@@@:{%\n"
+       "       \\RS@ifundefined{#1ref}%\n"
+       "       {\\ref{#1:#2}}%\n"
+       "       {\\RS@nameuse{#1ref}{#2}}%\n"
+       "}\n"
+       "\\RS@ifundefined{\thmref}\n"
+       "  {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n"
+       "  {}\n"
+       "\\makeatother\n"
+       );
+
 /////////////////////////////////////////////////////////////////////
 //
 // LaTeXFeatures
@@ -512,6 +526,7 @@ char const * simplefeatures[] = {
        // subfig is handled in BufferParams.cpp
        "varioref",
        "prettyref",
+       "refstyle",
        /*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
@@ -751,6 +766,9 @@ string const LaTeXFeatures::getPackages() const
        if (mustProvide("xy"))
                packages << "\\usepackage[all]{xy}\n";
 
+       if (mustProvide("feyn"))
+               packages << "\\usepackage{feyn}\n"; //Diagram
+
        if (mustProvide("ulem"))
                packages << "\\PassOptionsToPackage{normalem}{ulem}\n"
                            "\\usepackage{ulem}\n";
@@ -805,9 +823,6 @@ docstring const LaTeXFeatures::getMacros() const
        if (mustProvide("LyX"))
                macros << lyx_def << '\n';
 
-       if (mustProvide("lyxline"))
-               macros << lyxline_def << '\n';
-
        if (mustProvide("noun"))
                macros << noun_def << '\n';
 
@@ -905,6 +920,9 @@ docstring const LaTeXFeatures::getMacros() const
 
        // floats
        getFloatDefinitions(macros);
+       
+       if (mustProvide("refstyle"))
+               macros << lyxref_def << '\n';
 
        // change tracking
        if (mustProvide("ct-dvipost"))