From: Jean-Marc Lasgouttes Date: Mon, 10 Jan 2011 17:27:56 +0000 (+0000) Subject: When hyperref is active, define the \LyX macro in a way that does X-Git-Tag: 2.0.0~1143 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5d2cddfaca941d610f0a0db308738749bfeebb26;p=features.git When hyperref is active, define the \LyX macro in a way that does 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 --- diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index ca9dc3ab90..6593960241 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -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';