[LyX/master] Fixup 858b076ab7ae

Juergen Spitzmueller spitz at lyx.org
Sat Aug 12 09:32:42 UTC 2023


commit fc3b4cc8d1d43e6956cb58b5192b35d3fa897200
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Aug 12 12:47:32 2023 +0200

    Fixup 858b076ab7ae
    
    Patch by Udi
---
 src/LaTeXFeatures.cpp |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 0e678ea..3461f97 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -1289,7 +1289,18 @@ string const LaTeXFeatures::getPackages() const
 	if (!runparams_.isFullUnicode() && useBabel()
 	    && mustProvide("prettyref") && contains(getActiveChars(), ':')) {
 		packages << "% Make prettyref compatible with babel active colon\n"
-			 << "\\def\\prettyref#1{\\expandafter\\@prettyref\\detokenize{#1:}}\n";
+			    "\\bgroup\n"
+			    "\\makeatletter\n"
+			    "\\catcode`:=13\n"
+			    "\\gdef\\prettyref#1{\\@prettyref#1:}\n"
+			    "\\gdef\\@prettyref#1:#2:{%\n"
+			    " 	\\expandafter\\ifx\\csname pr@#1\\endcsname\\relax\n"
+			    "		\\PackageWarning{prettyref}{Reference format #1\\space undefined}%\n"
+			    "		\\ref{#1:#2}%\n"
+			    "	\\else\n"
+			    "		\\csname pr@#1\\endcsname{#1:#2}%\n"
+			    "	\\fi}\n"
+			    "\\egroup\n";
 	}
 
 	if (mustProvide("changebar")) {


More information about the lyx-cvs mailing list