]> 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>
Tue, 10 Feb 2015 08:52:22 +0000 (09:52 +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/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
status.21x

index 508c0234bc95eb5ccac6e666e4f09d8fb599fed4..fd8624d94a6df58f1a67f7274dc6f2d43b02f53b 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 578918c07af6abbfb05c6f1b286755ed38b07850..e4a4799ebc302e4dabbe63efd1450ede528b1871 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 f8c22f96c8efa674c5d35bb648af6ea645c5e236..b0f20af2b22569583f050a7aef8ba46918bcd3d9 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 41379fc32cfab811d9d189e4c7e15d8f4c1493ec..f0e0c3cb0849683349e8978a0ac453cbaafa62be 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 fc52fddb1e495e9cf9a10a9245a77b9b8956d08e..95aa4f0183518b3c5d8e928d5c0be4bbdca13375 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 383da773cc0c740b7521ff05f826974759c25449..635dfdbe1fe00f654fff3599fe68a54215c73d24 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 f6b24672e46e221a0844659fc509ad2a2473dbf1..a6b8dfadfd7b3a25d9b5aca067e2e4aac630da17 100644 (file)
@@ -265,9 +265,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 346e00797961cd9134dfc9e55c9a6b6d9544c7b6..f0b2be77a906e6bfba7382aa9b88e3f5e44d7473 100644 (file)
@@ -437,6 +437,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());
index 863ce4778cee52846521b8dec3d57a5d263af02f..e708d76e17dce9105de426c1082922c012e76243 100644 (file)
@@ -53,6 +53,7 @@ What's new
 
 * DOCUMENT INPUT/OUTPUT
 
+- Do not output \protect unnecessarily before \caption (bug 9177).
 
 
 * LYX2LYX
@@ -61,7 +62,7 @@ What's new
 
 * USER INTERFACE
 
-- Fix name and hint of figure captions in documents using the class aastex. 
+- Fix name and hint of figure captions in documents using the class aastex.