commit 023e98a50e0afbe8c3e8390149e52c5c0c563922
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
    
    (cherry picked from commit 59f6f06900cd73d073aee55a346ca51144c05a33)
---
 src/insets/InsetIndex.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp
index e1d61bb43f..1a4e8cdb91 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

Reply via email to