Am Dienstag, den 09.08.2016, 14:52 +0000 schrieb Bernt Lie: > Q: Insert Box with shaded background, settings: Inner Box -> None > > Preliminaries: > · Windows 10 + LyX 2.2.1 > > I write a document with lots of examples. If I set the entire > examples in the Example environment, this reduces somewhat the > possibilities for typesetting. So I have planned to do the following: > · insert the examples in a box with shaded background (Insert > Box/Shaded Background. Apply Settings... Inner Box: None.) > · Let the *first* paragraph of the box be an Example > environment – this makes sure that the example is numbered, and I can > define labels to the example. > · Let the subsequent paragraphs be of type Standard. > > I sometimes include floats, e.g., figures, in these shaded boxes. > *HOWEVER*, it seems like I get *error messages* because of this; some > figures are not shown (or appear, say, 10 pages after they *should* > normally appear), and references to the figures appear to not work. > > Question: Is there a problem with inserting floats in such Boxes?
Do you really need floats or just the captions? If the latter, you should use the nonfloat package which provides the \figcaption command: Preamble: \usepackage{nonfloat} In the box: Image (not in a float) \figcaption{The image's caption} If you want to have the images floating, you need to define a specific float type similar to the boxedfloat type here: http://wiki.lyx.org/Layouts/Modules You might also want to have a look at the tcolorbox package, which provides possibilities to produce all sorts of highly complex boxes (that also allow for floats and captions): http://mirror.easyname.at/ctan/macros/latex/contrib/tcolorbox/tcolorbox .pdf This package is partially supported by LyX via the "Fancy Colored Boxes" module (see Help > Specific Manuals > Colored Boxes). HTH Jürgen > > Thanks! > > -Bernt L.
signature.asc
Description: This is a digitally signed message part