commit 002c19250b8f6153b34d751248b7590127438957
Author: Juergen Spitzmueller <[email protected]>
Date: Sun Nov 9 15:38:07 2025 +0100
amend e837fe8a4f56
It escaped to me that this method also covered special chars
outside of InsetSpecialChar
---
src/tex2lyx/text.cpp | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index b7615d621a..e7e35d0309 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -320,6 +320,14 @@ char const * const known_text_font_shapes[] = { "textit",
"textsl", "textsc",
char const * const known_coded_font_shapes[] = { "italic", "slanted",
"smallcaps", "up", 0};
+/// Known special characters which need skip_spaces_braces() afterwards
+char const * const known_special_chars[] = { "textasciitilde",
"textasciicircum",
+"textbackslash", 0};
+
+/// the same as known_special_chars with .lyx names
+char const * const known_coded_special_chars[] = {"~", "^", "\n\\backslash\n",
0};
+
+
/*!
* Graphics file extensions known by the dvips driver of the graphics package.
* These extensions are used to complete the filename of an included
@@ -5474,6 +5482,15 @@ void parse_text(Parser & p, ostream & os, unsigned
flags, bool outer,
continue;
}
+ if (is_known(t.cs(), known_special_chars)) {
+ // LyX sometimes puts a \protect in front, so we have
to ignore it
+ where = is_known(t.cs(), known_special_chars);
+ context.check_layout(os);
+ os << known_coded_special_chars[where -
known_special_chars];
+ skip_spaces_braces(p);
+ continue;
+ }
+
if ((t.cs() == "nobreakdash" && p.next_token().asInput() ==
"-") ||
(t.cs() == "protect" && p.next_token().asInput() ==
"\\nobreakdash" &&
p.next_next_token().asInput() == "-") ||
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs