]> git.lyx.org Git - lyx.git/commitdiff
When hyperref is active, define the \LyX macro in a way that does
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 10 Jan 2011 17:27:56 +0000 (17:27 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 10 Jan 2011 17:27:56 +0000 (17:27 +0000)
not break in PDF table of contents (using texorpdfstring).

Uwe, this should allow you to remove some ERT from the documentation.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37164 a592a061-630c-0410-9148-cb99ea01b6c8

src/LaTeXFeatures.cpp

index ca9dc3ab90620537f98d6dca244a90f2c622326e..6593960241658de5b8969f8ffcee7ca5315d4adc 100644 (file)
@@ -60,6 +60,11 @@ namespace lyx {
 static docstring const lyx_def = from_ascii(
        "\\providecommand{\\LyX}{L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}");
 
+static docstring const lyx_hyperref_def = from_ascii(
+       "\\providecommand{\\LyX}{\\texorpdfstring%\n"
+       "  {L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}\n"
+        "  {LyX}}");
+
 static docstring const noun_def = from_ascii(
        "\\newcommand{\\noun}[1]{\\textsc{#1}}");
 
@@ -844,8 +849,12 @@ docstring const LaTeXFeatures::getMacros() const
                        macros << papersizepdf_def << '\n';
        }
 
-       if (mustProvide("LyX"))
-               macros << lyx_def << '\n';
+       if (mustProvide("LyX")) {
+               if (isRequired("hyperref"))
+                       macros << lyx_hyperref_def << '\n';
+               else
+                       macros << lyx_def << '\n';
+       }
 
        if (mustProvide("noun"))
                macros << noun_def << '\n';