]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Improve how add_to_preamble and insert_to_preamble work, and audit the
[lyx.git] / src / LaTeXFeatures.cpp
index 172dfdadca7363001753443f0f2d66be106f4ccf..94745c344f751e94ac9e862e81012215b43b6711 100644 (file)
@@ -257,23 +257,13 @@ static docstring const ogonek_def = from_ascii(
        "\\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"
-       );
+               "\\RS@ifundefined{thmref}\n"
+               "  {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n" 
+               "  {}\n"
+               "\\RS@ifundefined{lemref}\n"
+               "  {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n" 
+               "  {}\n");
+
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -921,13 +911,13 @@ docstring const LaTeXFeatures::getMacros() const
        // floats
        getFloatDefinitions(macros);
        
-       if (mustProvide("refstyle"))
-               macros << lyxref_def << '\n';
-
+       if (mustProvide("refstyle")) 
+               macros << lyxref_def << '\n';   
+       
        // change tracking
        if (mustProvide("ct-dvipost"))
                macros << changetracking_dvipost_def;
-
+       
        if (mustProvide("ct-xcolor-ulem")) {
                int const prec = macros.precision(2);