commit 2bd9ba1060519ab60d78c20b9bdbc34cffe60fa2
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Aug 29 11:16:09 2025 +0200
Fox footnote crossref def for prettyref
This is an InsetLayout, not a Layout
---
src/LaTeXFeatures.cpp | 27 ++++++++++++++++++++++++---
src/LaTeXFeatures.h | 2 ++
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index f0f12450ce..7d522b7e94 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -2368,8 +2368,6 @@ docstring const LaTeXFeatures::getXRefI18nDefs(Layout
const & lay) const
ods << "\\newrefformat{" << lay.refprefix <<
"}{_(Section)~\\ref{#1}}\n";
else if (lay.refprefix == "par")
ods <<
"\\newrefformat{par}{_(Paragraph[[Sectioning]])~\\ref{#1}}\n";
- else if (lay.refprefix == "fn")
- ods << "\\newrefformat{fn}{_(Footnote)~\\ref{#1}}\n";
else if (lay.refprefix == "enu")
ods <<
"\\newrefformat{enu}{_(Item[[enumerate]])~\\ref{#1}}\n";
if (!ods.str().empty())
@@ -2397,6 +2395,17 @@ docstring const LaTeXFeatures::getXRefI18nDefs(Layout
const & lay) const
}
+docstring const LaTeXFeatures::getXRefI18nDefs(InsetLayout const & lay) const
+{
+ odocstringstream ods;
+ if (params_.xref_package == "prettyref-l7n" && isRequired("prettyref"))
{
+ if (lay.refprefix() == "fn")
+ ods << "\\newrefformat{fn}{_(Footnote)~\\ref{#1}}\n";
+ }
+ return ods.str();
+}
+
+
docstring const LaTeXFeatures::getTClassI18nPreamble(bool use_babel,
bool use_polyglossia, bool use_minted) const
{
@@ -2539,6 +2548,12 @@ docstring const
LaTeXFeatures::getTClassI18nPreamble(bool use_babel,
buffer().language(),
buffer().params().encoding(),
use_polyglossia,
need_fixedwidth));
+ docstring const xxref = getXRefI18nDefs(it->second);
+ if (!xxref.empty())
+ snippets.insert(i18npreamble(xxref,
+ buffer().language(),
+
buffer().params().encoding(),
+ use_polyglossia, false));
// commands for language changing (for multilanguage documents)
if ((use_babel || use_polyglossia) && !UsedLanguages_.empty()) {
snippets.insert(i18npreamble(
@@ -2546,12 +2561,18 @@ docstring const
LaTeXFeatures::getTClassI18nPreamble(bool use_babel,
buffer().language(),
buffer().params().encoding(),
use_polyglossia,
need_fixedwidth));
- for (lang_it lit = lbeg; lit != lend; ++lit)
+ for (lang_it lit = lbeg; lit != lend; ++lit) {
snippets.insert(i18npreamble(
it->second.babelpreamble(),
*lit,
buffer().params().encoding(),
use_polyglossia,
need_fixedwidth));
+ if (!xxref.empty())
+
snippets.insert(i18npreamble("\\addto\\captions$$lang{" + rtrim(xxref, "\n") +
"}\n",
+ *lit,
+
buffer().params().encoding(),
+ use_polyglossia,
false));
+ }
}
}
diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h
index bb7d510b34..f420c3286a 100644
--- a/src/LaTeXFeatures.h
+++ b/src/LaTeXFeatures.h
@@ -93,6 +93,8 @@ public:
docstring const getThmI18nDefs(Layout const &) const;
/// Localizations for extra reference defs
docstring const getXRefI18nDefs(Layout const &) const;
+ /// Localizations for extra reference defs
+ docstring const getXRefI18nDefs(InsetLayout const &) const;
/// The language dependent definitions needed by the document's
textclass
docstring const getTClassI18nPreamble(bool use_babel,
bool use_polyglossia, bool use_minted) const;
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs