I have found solutions for them to be done in normal TeX, but how do I do this in LyX? What I wish to obtain is something like that shown in Table and Figure side-by-side with Table caption above, Figure caption below
I have tried doing this by creating a mini-page and putting two boxes inside, but the table keeps getting captioned as a sub-figure instead of a table.
Best Answer
You can use
minipage
s as you first tried, if you add thecapt-of
(orcaption
) package and write the caption in an ERT usingcaptionof
command, which has the syntaxSo, in LyX:
Document --> Settings --> LaTeX preamble, add either
(or
\usepackage{caption}
)minipage
s with Insert --> Boxes --> Frameless. Add the second one immediately after the first one, do not hit enter after the first one.In the minipage where you want the table, add an ERT with Ctrl + L or Insert --> TeX Code, and write
Add the table below the caption as you normally would.
Optionally, you could write
in the ERT, and add the caption outside the ERT with Insert --> Caption. Make sure the ERT is placed before the caption. Note that this will not change the caption type in the LyX GUI, there you'll still have two figure captions, but in the PDF it will be correct. This also makes it easier to add cross references or citations in the caption, as you can use the GUI for that.
You may have to change the vertical alignment of the minipages as well, which you can do in the settings for the Inset. In the image below, the right minipage has the vertical alignment for the Box set to Middle, all other vertical alignments are set to Top.