#LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 566
+\lyxformat 567
\begin_document
\begin_header
\save_transient_properties true
\begin_layout Description
-\change_inserted -712698321 1523696969
+\change_inserted -712698321 1552395557
\begin_inset Flex Code
status collapsed
cprotect
\family default
) if necessary and thus allows (some) verbatim stuff in macros.
+\end_layout
+
+\begin_layout Description
+
+\change_inserted -712698321 1552395844
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395561
+NeedMBoxProtect
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395557
+
+\emph on
+0
+\end_layout
+
+\end_inset
+
+,
+\begin_inset space \thinspace{}
+\end_inset
+
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395557
+1
+\end_layout
+
+\end_inset
+
+] Whether specific commands in this style (such as
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395655
+
+\backslash
+cite
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395661
+
+\backslash
+ref
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+) should be protected in an
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395631
+
+\backslash
+mbox
+\change_unchanged
+
+\end_layout
+
+\end_inset
+
+.
+ This is particularly needed for styles that draw on
+\family sans
+ulem
+\family default
+ or
+\family sans
+soul
+\family default
+ commands which parse their content in complex ways.
\change_unchanged
\end_layout
\begin_layout Description
-\change_inserted -712698321 1523634088
+\change_inserted -712698321 1552395786
\begin_inset Flex Code
status collapsed
\family default
) if necessary and thus allows (some) verbatim stuff in macros.
Default is false.
+\end_layout
+
+\begin_layout Description
+
+\change_inserted -712698321 1552395824
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395787
+NeedMBoxProtect
+\end_layout
+
+\end_inset
+
+ [
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395787
+
+\emph on
+0
+\end_layout
+
+\end_inset
+
+,
+\begin_inset space \thinspace{}
+\end_inset
+
+
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395787
+1
+\end_layout
+
+\end_inset
+
+] Whether specific commands in this inset (such as
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395787
+
+\backslash
+cite
+\end_layout
+
+\end_inset
+
+ and
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395787
+
+\backslash
+ref
+\end_layout
+
+\end_inset
+
+) should be protected in an
+\begin_inset Flex Code
+status collapsed
+
+\begin_layout Plain Layout
+
+\change_inserted -712698321 1552395787
+
+\backslash
+mbox
+\end_layout
+
+\end_inset
+
+.
+ This is particularly needed for insets that draw on
+\family sans
+ulem
+\family default
+ or
+\family sans
+soul
+\family default
+ commands which parse their content in complex ways.
+ Default is false.
\change_unchanged
\end_layout
# Author: Juergen Spitzmueller <spitz@lyx.org>
# Uwe Stöhr <uwestoehr@lyx.org>
-Format 70
+Format 71
#
# helper commands
CopyStyle "Flex:PDF-Margin"
LabelString "PDF (Markup)"
LatexName pdfmarkupcomment
+ NeedMBoxProtect 1
Argument post:1
LabelString "Comment"
Mandatory 1
CopyStyle "Flex:PDF-Markup"
LabelString "PDF (Tooltip)"
LatexName pdftooltip
+ NeedMBoxProtect 0
LabelFont
Color red
Size Small
# This script will update a .layout file to current format
# The latest layout format is also defined in src/TextClass.cpp
-currentFormat = 70
+currentFormat = 71
# Incremented to format 4, 6 April 2007, lasgouttes
# Incremented to format 69, 16 August 2018 by spitz
# New argument type "listpreamble"
-# Incremented to format 69, 5 June 2018 by rkh
+# Incremented to format 70, 5 June 2018 by rkh
# New InsetLayout tag EditExternal
+# Incremented to format 71, 12 March 2019 by spitz
+# New [Inset]Layout tag NeedMBoxProtect
+
# Do not forget to document format change in Customization
# Manual (section "Declaring a new text class").
i += 1
continue
- if format >= 65 and format <= 69:
+ if format >= 65 and format <= 70:
# nothing to do.
i += 1
continue
LT_LEFTDELIM,
LT_LEFTMARGIN,
LT_NEED_CPROTECT,
+ LT_NEED_MBOXPROTECT,
LT_NEED_PROTECT,
LT_NEWLINE,
LT_NEXTNOINDENT,
inpreamble = false;
needprotect = false;
needcprotect = false;
+ needmboxprotect = false;
keepempty = false;
font = inherit_font;
labelfont = inherit_font;
{ "leftmargin", LT_LEFTMARGIN },
{ "margin", LT_MARGIN },
{ "needcprotect", LT_NEED_CPROTECT },
+ { "needmboxprotect", LT_NEED_MBOXPROTECT },
{ "needprotect", LT_NEED_PROTECT },
{ "newline", LT_NEWLINE },
{ "nextnoindent", LT_NEXTNOINDENT },
lex >> needcprotect;
break;
+ case LT_NEED_MBOXPROTECT:
+ lex >> needmboxprotect;
+ break;
+
case LT_KEEPEMPTY:
lex >> keepempty;
break;
writeArgument(os, it->first, it->second);
os << "\tNeedProtect " << needprotect << "\n"
"\tNeedCProtect " << needcprotect << "\n"
+ "\tNeedMBoxProtect " << needmboxprotect << "\n"
"\tKeepEmpty " << keepempty << '\n';
if (labelfont == font)
lyxWrite(os, font, "Font", 1);
/** true when the verbatim stuff of this layout needs to be
\cprotect'ed. */
bool needcprotect;
+ /** true when specific commands in this paragraph need to be
+ protected in an \mbox. */
+ bool needmboxprotect;
/// true when empty paragraphs should be kept.
bool keepempty;
/// Type of LaTeX object
bool intitle;
/** inulemcmd > 0 means that the environment in which the
- inset is typeset is part of a ulem command (\uline, \uuline,
- \uwave, \sout or \xout). Insets that output latex commands relying
- on local assignments (such as \cite) should enclose such
+ inset is typeset is part of a ulem or soul command (e.g., \uline,
+ \uuline, \uwave, \sout or \xout). Insets that output latex commands
+ relying on local assignments (such as \cite) should enclose such
commands in \mbox{} in order to avoid breakage.
*/
mutable int inulemcmd;
// You should also run the development/tools/updatelayouts.py script,
// to update the format of all of our layout files.
//
-int const LAYOUT_FORMAT = 70; // rkh: InsetLayout EditExternal
+int const LAYOUT_FORMAT = 71; // spitz: NeedMBoxProtect
// Layout format for the current lyx file format. Controls which format is
rp.pass_thru = true;
if (il.isNeedProtect())
rp.moving_arg = true;
+ if (il.isNeedMBoxProtect())
+ ++rp.inulemcmd;
rp.par_begin = 0;
rp.par_end = paragraphs().size();
forceplain_(false), passthru_(false), parbreakisnewline_(false),
freespacing_(false), keepempty_(false), forceltr_(false),
forceownlines_(false), needprotect_(false), needcprotect_(false),
- intoc_(false), spellcheck_(true), resetsfont_(false), display_(true),
- forcelocalfontswitch_(false), add_to_toc_(false), is_toc_caption_(false),
- edit_external_(false)
+ needmboxprotect_(false), intoc_(false), spellcheck_(true),
+ resetsfont_(false), display_(true), forcelocalfontswitch_(false),
+ add_to_toc_(false), is_toc_caption_(false), edit_external_(false)
{
labelfont_.setColor(Color_error);
}
IL_KEEPEMPTY,
IL_MULTIPAR,
IL_NEEDCPROTECT,
+ IL_NEEDMBOXPROTECT,
IL_NEEDPROTECT,
IL_PASSTHRU,
IL_PASSTHRU_CHARS,
{ "lyxtype", IL_LYXTYPE },
{ "multipar", IL_MULTIPAR },
{ "needcprotect", IL_NEEDCPROTECT },
+ { "needmboxprotect", IL_NEEDMBOXPROTECT },
{ "needprotect", IL_NEEDPROTECT },
{ "obsoletedby", IL_OBSOLETEDBY },
{ "parbreakisnewline", IL_PARBREAKISNEWLINE },
case IL_NEEDCPROTECT:
lex >> needcprotect_;
break;
+ case IL_NEEDMBOXPROTECT:
+ lex >> needmboxprotect_;
+ break;
case IL_CONTENTASLABEL:
lex >> contentaslabel_;
break;
bool isNeedProtect() const { return needprotect_; }
///
bool needsCProtect() const { return needcprotect_; }
+ /// Protection of some elements such as \ref and \cite
+ /// in \mbox (needed by commands building on soul or ulem)
+ bool isNeedMBoxProtect() const { return needmboxprotect_; }
///
bool isFreeSpacing() const { return freespacing_; }
///
bool needprotect_;
///
bool needcprotect_;
+ ///
+ bool needmboxprotect_;
/// should the contents be written to TOC strings?
bool intoc_;
/// check spelling of this inset?
rp.pass_thru = true;
if (il.isNeedProtect())
rp.moving_arg = true;
+ if (il.isNeedMBoxProtect())
+ ++rp.inulemcmd;
if (!il.passThruChars().empty())
rp.pass_thru_chars += il.passThruChars();
rp.par_begin = 0;
}
runparams.moving_arg |= style.needprotect;
+ if (style.needmboxprotect)
+ ++runparams.inulemcmd;
Encoding const * const prev_encoding = runparams.encoding;
bool const useSetSpace = bparams.documentClass().provides("SetSpace");