\end_layout
+\begin_layout Description
+
+\change_inserted -712698321 1723455721
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455730
+EscapeChars
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455616
+string
+\end_layout
+
+\end_inset
+
+]
+\family typewriter
+
+\family default
+Defines individual characters that should be escaped in the context of this paragraph.
+ Not that the first character in the string denotes the escape character,
+ so
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455696
+%!@
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ will escape
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455704
+!
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455712
+@
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ with
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455721
+%
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
\begin_layout Description
\begin_inset Flex Code
status collapsed
\end_inset
declarations.
+\change_inserted -712698321 1723455878
+
+\end_layout
+
+\begin_layout Description
+
+\change_inserted -712698321 1723455890
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455884
+EscapeChars
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455884
+string
+\end_layout
+
+\end_inset
+
+]
+\family typewriter
+
+\family default
+Defines individual characters that should be escaped in the context of this inset.
+\change_unchanged
+
\end_layout
\begin_layout Description
\end_inset
] describes the rendering style used for the inset's frame and buttons.
+\change_inserted -712698321 1723455759
+
+\end_layout
+
+\begin_layout Itemize
+
+\change_inserted -712698321 1723455909
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455760
+EscapeChars
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455760
+string
+\end_layout
+
+\end_inset
+
+]
+\family typewriter
+
+\family default
+Defines individual characters that should be escaped in the context of this paragraph.
+ Note that the first character in the string denotes the escape character,
+ so
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455760
+%!@
+\end_layout
+
+\end_inset
+
+ will escape
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455760
+!
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455760
+@
+\end_layout
+
+\end_inset
+
+ with
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1723455760
+%
+\end_layout
+
+\end_inset
+
+.
+ Note that this needs to be explicitly defined for arguments.
+ That is,
+ arguments do not inherit EscapeChars from their parent inset or layout.
+\change_unchanged
+
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
+\begin_layout Plain Layout
+EscapeChars
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+]
+\family typewriter
+
+\family default
+Definiert Zeichen,
+ die im Kontext dieses Absatzes maskiert werden müssen.
+ Beachten Sie,
+ dass das erste Zeichen in der Kette das Maskierungszeichen selbst ist.
+ Das heißt,
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%!@
+\end_layout
+
+\end_inset
+
+ maskiert
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+!
+\end_layout
+
+\end_inset
+
+ und
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+@
+\end_layout
+
+\end_inset
+
+ mit
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%
+\end_layout
+
+\end_inset
+
+.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex Code
+status collapsed
+
\begin_layout Plain Layout
Font
\end_layout
\begin_inset Flex Code
status collapsed
+\begin_layout Plain Layout
+EscapeChars
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+]
+\family typewriter
+
+\family default
+Definiert Zeichen,
+ die im Kontext dieses Absatzes maskiert werden müssen.
+ Beachten Sie,
+ dass das erste Zeichen in der Kette das Maskierungszeichen selbst ist.
+ Das heißt,
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%!@
+\end_layout
+
+\end_inset
+
+ maskiert
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+!
+\end_layout
+
+\end_inset
+
+ und
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+@
+\end_layout
+
+\end_inset
+
+ mit
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%
+\end_layout
+
+\end_inset
+
+.
+ Beachten Sie,
+ dass ein Wert für Argumente explizit spezifiziert werden muss.
+ Argumente übernehmen also nicht die
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+EscapeChars
+\end_layout
+
+\end_inset
+
+ des zugehörigen Absatzstils oder der zugehörigen Einfügung.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex Code
+status collapsed
+
\begin_layout Plain Layout
Font
\end_layout
\begin_inset Flex Code
status collapsed
+\begin_layout Plain Layout
+PassThruChars
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+Buchstabenkette
+\end_layout
+
+\end_inset
+
+]
+\family typewriter
+
+\family default
+bestimmt einzelne Zeichen,
+ für die der Inhalt dieses Arguments in unbearbeiteter Form,
+ ohne spezifische Bearbeitung,
+ die \SpecialChar LaTeX
+ verlangen würde,
+ ausgegeben wird.
+ Beachten Sie,
+ dass anders als bei
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+PassThru
+\end_layout
+
+\end_inset
+
+ ein Wert für Argumente explizit spezifiziert werden muss.
+ Argumente übernehmen also nicht die
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+PassThruChars
+\end_layout
+
+\end_inset
+
+ des zugehörigen Absatzstils oder der zugehörigen Einfügung.
+\end_layout
+
+\begin_layout Description
+\begin_inset Flex Code
+status collapsed
+
\begin_layout Plain Layout
Preamble
\end_layout
\begin_inset Flex Code
status collapsed
+\begin_layout Plain Layout
+EscapeChars
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+string
+\end_layout
+
+\end_inset
+
+]
+\family typewriter
+
+\family default
+Definiert Zeichen,
+ die im Kontext dieses Absatzes maskiert werden müssen.
+ Beachten Sie,
+ dass das erste Zeichen in der Kette das Maskierungszeichen selbst ist.
+ Das heißt,
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%!@
+\end_layout
+
+\end_inset
+
+ maskiert
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+!
+\end_layout
+
+\end_inset
+
+ und
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+@
+\end_layout
+
+\end_inset
+
+ mit
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+%
+\end_layout
+
+\end_inset
+
+.
+ Beachten Sie,
+ dass ein Wert für Argumente explizit spezifiziert werden muss.
+ Argumente übernehmen also nicht die
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+EscapeChars
+\end_layout
+
+\end_inset
+
+ des zugehörigen Absatzstils oder der zugehörigen Einfügung.
+\end_layout
+
+\begin_layout Itemize
+\begin_inset Flex Code
+status collapsed
+
\begin_layout Plain Layout
PassThru
\end_layout
# This script will update a .layout file to current format
# The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 106
+currentFormat = 107
# Incremented to format 4, 6 April 2007, lasgouttes
# Incremented to format 106, 7 July 2024 by spitz
# New CiteEngine type "notes"
+# Incremented to format 107, 12 August 2023 by spitz
+# New InsetLayout and Layout tags "EscapeChars"
+
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
i += 1
continue
- if 101 <= format <= 105:
+ if 101 <= format <= 106:
# nothing to do.
i += 1
continue
LT_DEPENDSON,
LT_OBSOLETEDBY,
LT_END,
+ LT_ESCAPE_CHARS,
LT_FONT,
LT_FREE_SPACING,
LT_PASS_THRU,
{ "end", LT_END },
{ "endlabelstring", LT_ENDLABELSTRING },
{ "endlabeltype", LT_ENDLABELTYPE },
+ { "escapechars", LT_ESCAPE_CHARS },
{ "font", LT_FONT },
{ "forcelocal", LT_FORCELOCAL },
{ "freespacing", LT_FREE_SPACING },
lex >> pass_thru;
break;
+ case LT_ESCAPE_CHARS:
+ lex >> escape_chars;
+ break;
+
case LT_PASS_THRU_CHARS:
lex >> pass_thru_chars;
break;
arg.font = lyxRead(lex, arg.font);
} else if (tok == "labelfont") {
arg.labelfont = lyxRead(lex, arg.labelfont);
+ } else if (tok == "escapechars") {
+ lex.next();
+ arg.escape_chars = lex.getDocString();
} else if (tok == "passthruchars") {
lex.next();
arg.pass_thru_chars = lex.getDocString();
os << "\t\tPassThru inherited\n";
break;
}
+ if (!arg.escape_chars.empty())
+ os << "\t\tEscapeChars \"" << to_utf8(arg.escape_chars) << "\"\n";
if (!arg.pass_thru_chars.empty())
os << "\t\tPassThruChars \"" << to_utf8(arg.pass_thru_chars) << "\"\n";
if (arg.free_spacing)
os << "\tLabelCounter \"" << to_utf8(counter) << "\"\n";
os << "\tFreeSpacing " << free_spacing << '\n';
os << "\tPassThru " << pass_thru << '\n';
+ if (!escape_chars.empty())
+ os << "\tEscapeChars " << to_utf8(escape_chars) << '\n';
if (!pass_thru_chars.empty())
os << "\tPassThruChars " << to_utf8(pass_thru_chars) << '\n';
os << "\tParbreakIsNewline " << parbreak_is_newline << '\n';
bool insertcotext = false;
bool insertonnewline = false;
ArgPassThru passthru = PT_INHERITED;
+ docstring escape_chars;
docstring pass_thru_chars;
bool is_toc_caption = false;
bool free_spacing = false;
bool free_spacing;
///
bool pass_thru;
+ /// Individual chars to be escaped
+ docstring escape_chars;
/// Individual chars to be passed verbatim
docstring pass_thru_chars;
/// Individual characters that must not be
/// Should we output verbatim or escape LaTeX's special chars?
bool pass_thru = false;
+ /// Should we escape specific chars?
+ docstring escape_chars;
+
/// Should we output verbatim specific chars?
docstring pass_thru_chars;
return;
}
+ if (!style.escape_chars.empty() && contains(style.escape_chars.substr(1), c)){
+ os << style.escape_chars.substr(0,1);
+ os.put(c);
+ return;
+ }
+ if (!runparams.escape_chars.empty() && contains(runparams.escape_chars.substr(1), c)){
+ os << runparams.escape_chars.substr(0,1);
+ os.put(c);
+ return;
+ }
+
if ((style.pass_thru || runparams.pass_thru || runparams.find_effective()
|| contains(style.pass_thru_chars, c)
|| contains(runparams.pass_thru_chars, c))
// You should also run the development/tools/updatelayouts.py script,
// to update the format of all of our layout files.
//
-int const LAYOUT_FORMAT = 106; // spitz: CiteEngineType notes
+int const LAYOUT_FORMAT = 107; // spitz: EscapeChars
// Layout format for the current lyx file format. Controls which format is
: InsetCollapsible(buf), name_(name), labelstring_(docstring()),
font_(inherit_font), labelfont_(inherit_font), decoration_(string()),
pass_thru_context_(false), pass_thru_local_(false), pass_thru_(false),
- free_spacing_(false), pass_thru_chars_(docstring()), is_toc_caption_(false),
- newline_cmd_(string())
+ free_spacing_(false), escape_chars_(docstring()), pass_thru_chars_(docstring()),
+ is_toc_caption_(false), newline_cmd_(string())
{}
font_ = (*lait).second.font;
labelfont_ = (*lait).second.labelfont;
decoration_ = (*lait).second.decoration;
+ escape_chars_ = (*lait).second.escape_chars;
pass_thru_chars_ = (*lait).second.pass_thru_chars;
newline_cmd_ = (*lait).second.newlinecmd;
free_spacing_ = (*lait).second.free_spacing;
{
otexstringstream ots;
OutputParams runparams = runparams_in;
+ if (!escape_chars_.empty())
+ runparams.escape_chars = escape_chars_;
if (!pass_thru_chars_.empty())
runparams.pass_thru_chars += pass_thru_chars_;
if (!newline_cmd_.empty())
///
bool free_spacing_;
///
+ docstring escape_chars_;
+ ///
docstring pass_thru_chars_;
/// Does this argument provide content for the TOC?
bool is_toc_caption_;
IL_DOCBOOKINNERATTR,
IL_DOCBOOKNOFONTINSIDE,
IL_DOCBOOKRENDERASIMAGE,
+ IL_ESCAPE_CHARS,
IL_INHERITFONT,
IL_INTOC,
IL_ISTOCCAPTION,
{ "docbookwrappertagtype", IL_DOCBOOKWRAPPERTAGTYPE },
{ "editexternal", IL_EDITEXTERNAL },
{ "end", IL_END },
+ { "escapechars", IL_ESCAPE_CHARS },
{ "fixedwidthpreambleencoding", IL_FIXEDWIDTH_PREAMBLE_ENCODING },
{ "font", IL_FONT },
{ "forcelocalfontswitch", IL_FORCE_LOCAL_FONT_SWITCH },
lex >> forceplain_;
readCustomOrPlain = true;
break;
+ case IL_ESCAPE_CHARS:
+ lex >> escape_chars_;
+ break;
case IL_PASSTHRU:
lex >> passthru_;
break;
arg.font = lyxRead(lex, arg.font);
} else if (tok == "labelfont") {
arg.labelfont = lyxRead(lex, arg.labelfont);
+ } else if (tok == "escapechars") {
+ lex.next();
+ arg.escape_chars = lex.getDocString();
} else if (tok == "passthruchars") {
lex.next();
arg.pass_thru_chars = lex.getDocString();
///
bool allowParagraphCustomization() const { return custompars_; }
///
+ docstring escapeChars() const { return escape_chars_; }
+ ///
bool isPassThru() const { return passthru_; }
///
docstring passThruChars() const { return passthru_chars_; }
///
bool forceplain_ = false;
///
+ docstring escape_chars_;
+ ///
bool passthru_ = false;
///
docstring passthru_chars_;
rp.moving_arg = true;
if (il.isNeedMBoxProtect())
++rp.inulemcmd;
+ if (!il.escapeChars().empty())
+ rp.escape_chars = il.escapeChars();
if (!il.passThruChars().empty())
rp.pass_thru_chars += il.passThruChars();
if (!il.noPassThruChars().empty())