commit e3891513039d4fdd1d55a376c1a2a420a32584b6
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun May 4 10:38:53 2025 +0200

    Amend prettyref definitions
---
 src/LaTeXFeatures.cpp | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index a1c8ac606c..8b3452ebf1 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -2235,15 +2235,15 @@ docstring const LaTeXFeatures::getThmI18nDefs(Layout 
const & lay) const
        if (params_.xref_package == "prettyref-l7n") {
                odocstringstream ods;
                if (lay.refprefix == "part")
-                       ods << "\\newrefformat{" << lay.refprefix << "}{_(Part) 
\\ref{#1}}\n";
+                       ods << "\\newrefformat{" << lay.refprefix << 
"}{_(Part)~\\ref{#1}}\n";
                if (lay.refprefix == "cha")
-                       ods << "\\newrefformat{" << lay.refprefix << 
"}{_(Chapter) \\ref{#1}}\n";
+                       ods << "\\newrefformat{" << lay.refprefix << 
"}{_(Chapter)~\\ref{#1}}\n";
                if (lay.refprefix == "sec" || lay.refprefix == "subsec" || 
lay.refprefix == "sub")
-                       ods << "\\newrefformat{" << lay.refprefix << 
"}{_(Section) \\ref{#1}}\n";
+                       ods << "\\newrefformat{" << lay.refprefix << 
"}{_(Section)~\\ref{#1}}\n";
                if (lay.refprefix == "par")
-                       ods << "\\newrefformat{alg}{_(Paragraph[[Sectioning]]) 
\\ref{#1}}\n";
+                       ods << 
"\\newrefformat{alg}{_(Paragraph[[Sectioning]])~\\ref{#1}}\n";
                if (lay.refprefix == "fn")
-                       ods << "\\newrefformat{alg}{_(Footnote) \\ref{#1}}\n";
+                       ods << "\\newrefformat{alg}{_(Footnote)~\\ref{#1}}\n";
                if (!ods.str().empty())
                        return ods.str();
        }
@@ -2345,15 +2345,16 @@ docstring const 
LaTeXFeatures::getTClassI18nPreamble(bool use_babel,
                        docstring prettyreffloatdefs;
                        if (params_.xref_package == "prettyref-l7n") {
                                odocstringstream ods;
-                               if (fl.refPrefix() == "alg")
-                                       ods << "\\newrefformat{" << 
from_ascii(fl.refPrefix()) << "}{_(Algorithm) \\ref{#1}}\n";
+                               if (fl.refPrefix() == "alg") {
+                                       ods << "\\newrefformat{" << 
from_ascii(fl.refPrefix()) << "}{_(Algorithm)~\\ref{#1}}\n";
+                                       prettyreffloatdefs = ods.str();
+                               }
                                if (fl.refPrefix() == "fig")
-                                       ods << "\\newrefformat{" << 
from_ascii(fl.refPrefix()) << "}{_(Figure) \\ref{#1}}\n";
+                                       ods << "\\newrefformat{" << 
from_ascii(fl.refPrefix()) << "}{\\figurename~\\ref{#1}}\n";
                                if (fl.refPrefix() == "tab")
-                                       ods << "\\newrefformat{" << 
from_ascii(fl.refPrefix()) << "}{_(Table) \\ref{#1}}\n";
-                               prettyreffloatdefs = ods.str();
-                               if (!prettyreffloatdefs.empty())
-                                       
snippets.insert(i18npreamble(prettyreffloatdefs,
+                                       ods << "\\newrefformat{" << 
from_ascii(fl.refPrefix()) << "}{\\tablename~\\ref{#1}}\n";
+                               if (!ods.str().empty())
+                                       snippets.insert(i18npreamble(ods.str(),
                                                                     
buffer().language(),
                                                                     
buffer().params().encoding(),
                                                                     
use_polyglossia, false));
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to