]> git.lyx.org Git - features.git/commitdiff
Use braces for listings caption
authorEnrico Forestieri <forenr@lyx.org>
Tue, 5 Feb 2019 18:04:12 +0000 (19:04 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 18 Jun 2020 12:39:57 +0000 (14:39 +0200)
Commit [3366c49f/lyxgit] intended to strip braces only for minted
but was actually stripping them also for listings. As the braces
are necessary for the listings package, reintroduce them.
This is a master-only issue.

src/insets/InsetInclude.cpp

index 121b1ad8a9a93e8fa866d225206f166d354e342f..dba295636c9c2849eb049184d4b92b4ce66346c7 100644 (file)
@@ -666,7 +666,7 @@ void InsetInclude::latex(otexstream & os, OutputParams const & runparams) const
                                                                  ParamInfo::HANDLING_LATEXIFY);
                                opts.erase(opts.begin() + i--);
                                if (!use_minted)
-                                       latexed_opts.push_back(from_ascii("caption=") + caption);
+                                       latexed_opts.push_back(from_ascii("caption={") + caption + "}");
                        } else if (prefixIs(opts[i], from_ascii("label="))) {
                                label = params().prepareCommand(runparams, trim(opts[i].substr(6), "{}"),
                                                                ParamInfo::HANDLING_ESCAPE);