[Tex/LaTex] Package sidecap not working with Lyx 2.0.4

lyxsidecap

I tryed to use the package sidecap to put the caption beside the immage,
I didnt found any other (working ^^) way to do that apart sidecap,
but it is not working.

I tried to make a new file, article, add

\usepackage{sidecap}

in the preamble, and did the following:

  • add a float figure,
  • insert an image inside the box "float figure"
  • write down a caption on the box labelled as "figure 1".

When I compile, the caption and the string "figure 1:" is just under the image.

Idk where I'm wrong.

Best Answer

Sidecap module

There is a module that uses the sidecap package available from http://theorie.physik.uni-konstanz.de/jrioux/lyx/ (via http://wiki.lyx.org/Layouts/Modules). Download the sidecap.module file and follow the instructions on the that site for installing.

In LyX, go to Document --> Settings --> Modules, and add the Sidecap module which now should be available. To add a figure with a side caption, simply choose Insert --> Float --> Figure (side caption). Similarly for tables.

Original answer -- without modules

I'm afraid sidecap doesn't change the behaviour of normal figures, it only defines new environments where the caption will be placed on the side. To use sidecap I think you will have to add these environments "manually", in ERTs.

After adding \usepackage{sidecap}, you can do the following where you want to add a figure:

  1. Add an ERT with Ctrl + L, and type \begin{SCfigure}.
  2. Move the cursor outside the ERT, and add the image as you normally would, e.g. via the button on the toolbar.
  3. Add a second ERT after the image, and type

    \caption{<Your caption here>}
    \end{SCfigure}
    

An example of how it may look inside LyX:

enter image description here

Cross referencing

If you want to add a cross reference to such a figure you have two options I think:

  1. In the second ERT, write \label{yourlabel} after the \caption{}. The problem with this option, is that the label doesn't show up in the LyX's GUI, so you'll have to write in in manually.
  2. Write \end{SCfigure} in a separate ERT, and in between this one and the one with \caption{}, add a label with the button on the toolbar or Insert --> Label. enter image description here

For both cases, instead of writing the caption in an ERT, you could also add it using Insert --> Caption.

Related Question