commit 59f6f06900cd73d073aee55a346ca51144c05a33
Author: Juergen Spitzmueller <[email protected]>
Date: Fri Jan 2 11:01:27 2026 +0100
Fix handling of \# in indexes
These must remain escaped in the sort part, otherwise
LaTeX breaks
---
src/insets/InsetIndex.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp
index 83406e6776..e0348be87a 100644
--- a/src/insets/InsetIndex.cpp
+++ b/src/insets/InsetIndex.cpp
@@ -328,6 +328,8 @@ void InsetIndex::processLatexSorting(otexstream & os,
OutputParams const & runpa
// Plain quotes need to be escaped, however (#10649), as this
// is the default escape character
ppart = subst(ppart, from_ascii("\""), from_ascii("\\\""));
+ // Also escape hashes, as this is a special character in LaTeX
+ ppart = subst(ppart, from_ascii("#"), from_ascii("\\#"));
// Now insert the sortkey, separated by '@'.
os << ppart;
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs