]> git.lyx.org Git - features.git/commitdiff
Fixes to InsetCaption \protect-ion
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 23 Dec 2014 10:58:04 +0000 (11:58 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sat, 10 Jan 2015 18:48:56 +0000 (19:48 +0100)
* \caption does not need to be protected in general
* the contents of \caption arguments need to be protected, though.

All styles related to caoption inset have been audited and updated.

The special casing of captions in longtables has been removed, since there is no special case.

Fixes bug: #9177

lib/layouts/aastex.layout
lib/layouts/aguplus.inc
lib/layouts/apa.layout
lib/layouts/apa6.layout
lib/layouts/bicaption.module
lib/layouts/scrclass.inc
lib/layouts/stdinsets.inc
src/insets/InsetCaption.cpp
src/insets/InsetText.cpp

index 35deaa88495bd9cf0e1114509f7b21bc6c8a068f..9a93bd102e23f16345f3fe2dd2bd8d6838948f0a 100644 (file)
@@ -529,6 +529,7 @@ InsetLayout Caption:FigCaption
        LabelString          fig.
        LaTeXType            command
        LatexName            figcaption
+       # FIXME: it seems that the optional argument is actually a file name
        Argument 1
            LabelString   "Short Title|S"
            Tooltip       "The caption as it appears in the list of figures"
index 93bfc6eaa0cfbab41f11467b3ca4216f80adebe7..4e10de04c685e57a4e207c61265e6ce9940e7201 100644 (file)
@@ -207,6 +207,7 @@ InsetLayout Caption:Table
        LabelString          table
        LaTeXType            command
        LatexName            tablecaption
+       NeedProtect          1
        HTMLStyle
                div.float-caption {
                        text-align: center;
index fec180e0241d06680b15cb9199d345d9597d1d25..7a3d40d6f6e9c2c0b70211171858c9722bed3a4e 100644 (file)
@@ -251,6 +251,7 @@ InsetLayout Caption:Centered
        LabelString          standard
        LaTeXType            command
        LatexName            centeredcaption
+       NeedProtect          1
        Argument 1
                LabelString   "Short Title|S"
                Tooltip       "The caption as it appears in the list of figures/tables"
index 348a65598e615447cd97bfbaae973f2c671bbd6d..25b0082c53f7af1171264a5dd066d46c7373d843 100644 (file)
@@ -351,6 +351,7 @@ InsetLayout Caption:Centered
        LabelString          standard
        LaTeXType            command
        LatexName            centeredcaption
+       NeedProtect          1
        Argument 1
                LabelString   "Short Title|S"
                Tooltip       "The caption as it appears in the list of figures/tables"
index 87b67d259c295439555782568b2296033166d8e9..ccfc68adbb435a6c4d0160e32222d60f65c44c52 100644 (file)
@@ -40,6 +40,7 @@ InsetLayout Caption:Bicaption
        LabelString     bilingual
        LaTeXType       command
        LatexName       bicaption
+       NeedProtect     1
        Argument 1
          LabelString   "Main Language Short Title"
          Tooltip       "Short title for the main(document) language"
index 902340283dcc3e71cdd684224479b54634844e4d..4dd61d9188e611d4baa661f209ccd27224b1db4e 100644 (file)
@@ -269,6 +269,7 @@ InsetLayout Caption:Above
        LabelString          above
        LaTeXType            command
        LatexName            captionabove
+       NeedProtect          1
        Argument 1
                LabelString   "Short Title|S"
                Tooltip       "The caption as it appears in the list of figures/tables"
@@ -289,6 +290,7 @@ InsetLayout Caption:Below
        LabelString          below
        LaTeXType            command
        LatexName            captionbelow
+       NeedProtect          1
        Argument 1
                LabelString   "Short Title|S"
                Tooltip       "The caption as it appears in the list of figures/tables"
index d2e32322a8ee513ddaee173d55640cd1b9a57cb7..bd6114dfad5852cfd72850f6a71f24678789db02 100644 (file)
@@ -554,6 +554,7 @@ InsetLayout Caption:Standard
        LabelString          standard
        LaTeXType            command
        LatexName            caption
+       NeedProtect          1
        Argument 1
                LabelString   "Short Title|S"
                Tooltip       "The caption as it appears in the list of figures/tables"
index 65cddc2971a328a21aaa6652118d188558449646..8af9827b3ade32b94490b1641fbe4c67dbc6ab25 100644 (file)
@@ -264,9 +264,6 @@ void InsetCaption::latex(otexstream & os,
        // \caption{...}, later we will make it take advantage
        // of the one of the caption packages. (Lgb)
        OutputParams runparams = runparams_in;
-       // FIXME: actually, it is moving only when there is no
-       // optional argument.
-       runparams.moving_arg = !runparams.inTableCell;
        InsetText::latex(os, runparams);
        // Backwards compatibility: We always had a linebreak after
        // the caption (see #8514)
index e0cd894a4ae95ebe1ccf9cdedbe513e2caeac698..5f1eeb17252c4a281dc3c88a850101db65a3a679 100644 (file)
@@ -438,6 +438,8 @@ void InsetText::latex(otexstream & os, OutputParams const & runparams) const
        if (!il.latexname().empty()) {
                if (il.latextype() == InsetLayout::COMMAND) {
                        // FIXME UNICODE
+                       // FIXME \protect should only be used for fragile
+                       //    commands, but we do not provide this information yet.
                        if (runparams.moving_arg)
                                os << "\\protect";
                        os << '\\' << from_utf8(il.latexname());