Re: Problem with figures side by side
Then do not use minipages, use package varwidth. The only, but important problem is, that LyX doesn't support this package. -> ERT Thanks Herbert.. will try this out soon.. On the other hand you can put the image into a box and then set the minipage exactly to the width of this box (image). To make life harder, my first image's height > width so I've set the scaling using the height and asked for the aspect ratio to be maintained. The second image's width > height so it's the other way around. Hence, for the first figure, I'm not sure what the bounding box's width should be... Or -> trial and error ... I'll have to go with this for now as I'm a little short on time (submission in 2 days).. :-) Thanks, nirmal
Re: Problem with figures side by side
Nirmal Govind wrote: Thank you Herbert and Paul for the file.. I used the last option with the minipages and captions within the minipages so that the two captions will show up beside one another. Also aligned the minipage to the bottom so the captions are on the same line. Now, only one problem - the block of figures isn't centered with respect to the paragraph (text) beneath it.. I tried deleting the \hfill before the first figure and that made it a little better but it's still not centered. is this cos the widths of the two figures are different? In Herbert's third example, the widths of the figures are set to 80% and 30% of col. and the corresponding minipages are set to 60% and 35% of line respectively. So my question - is trial and error the only way to have these unequal-width figures side by side so that the entire block is centered? Then do not use minipages, use package varwidth. The only, but important problem is, that LyX doesn't support this package. -> ERT On the other hand you can put the image into a box and then set the minipage exactly to the width of this box (image). Or -> trial and error ... Herbert
Re: Problem with figures side by side
Thank you Herbert and Paul for the file.. I used the last option with the minipages and captions within the minipages so that the two captions will show up beside one another. Also aligned the minipage to the bottom so the captions are on the same line. Now, only one problem - the block of figures isn't centered with respect to the paragraph (text) beneath it.. I tried deleting the \hfill before the first figure and that made it a little better but it's still not centered. is this cos the widths of the two figures are different? In Herbert's third example, the widths of the figures are set to 80% and 30% of col. and the corresponding minipages are set to 60% and 35% of line respectively. So my question - is trial and error the only way to have these unequal-width figures side by side so that the entire block is centered? Thanks, nirmal
Re: Problem with figures side by side
Thanks Herbert... I think the one I was looking for was named FigSideBySide.lyx but assuming that it uses the same minipages-based solution as MultiImages.lyx, I am unable to vertically align the captions of the two figures that are side-by-side... I have two figures that do not have the same height/width but I'd like to have the captions on the same line, i.e. the figures will have a constant base... any way to do this? (I also have labels for the figures within a figure float) Nirmal, It is attached the file that Herbert sent me and that you are looking for. Paul #LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass article \begin_preamble \usepackage{capt-of} \end_preamble \language german \inputencoding latin1 \fontscheme default \graphics default \paperfontsize 10 \spacing single \papersize a4paper \paperpackage a4 \use_geometry 1 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 5 \tocdepth 5 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle headings \layout Standard Two figures side by side in a float environment. Have a look at the \begin_inset ERT status Collapsed \layout Standard \backslash verb/ layout->paragraph->more/ \end_inset For the the captions in the float (red line on the left side marks a minipage!). Between the two figures are three \begin_inset ERT status Collapsed \layout Standard \backslash verb/ \backslash hfill/ \end_inset -commands ( \begin_inset ERT status Collapsed \layout Standard \backslash verb/insert->special character->hfill/ \end_inset ). Otherwise the images are not centered. \layout Standard \begin_inset Float figure wide false collapsed true \layout Standard \hfill \begin_inset Graphics filename /home/voss/LyX/lyx1.jpg display color width 50col% \end_inset \hfill \begin_inset Graphics filename /home/voss/LyX/lyx2.jpg display color width 30col% \end_inset \hfill \layout Caption side by side figure (Caption No. 1) \layout Caption Caption No. 2 \end_inset \layout Standard The same figures side by side by both aligned to their top. The solution with \begin_inset ERT status Collapsed \layout Standard \backslash verb/ \backslash raisbox{- \backslash height}{}/ \end_inset is the easiest, but there maybe a problem when you have the captions above, then one images is one line too high. \layout Standard \begin_inset Float figure wide false collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash hrulefill \backslash vspace{-2ex} \end_inset \layout Standard \hfill \begin_inset ERT status Collapsed \layout Standard \backslash raisebox{- \backslash height}{ \end_inset \begin_inset Graphics filename /home/voss/LyX/lyx1.jpg display color width 50col% \end_inset \begin_inset ERT status Collapsed \layout Standard } \end_inset \hfill \begin_inset ERT status Collapsed \layout Standard \backslash raisebox{- \backslash height}{ \end_inset \begin_inset Graphics filename /home/voss/LyX/lyx2.jpg display color width 30col% \end_inset \begin_inset ERT status Collapsed \layout Standard } \end_inset \hfill \layout Caption side by side figure (Caption No. 1) \layout Caption Caption No. 2 \end_inset \layout Standard With a parbox which is aligned to the top and an additional line with a zero height it's possible to get top aligned images \layout Standard \begin_inset Float figure wide false collapsed false \layout Standard \begin_inset Minipage position 0 inner_position 0 height "0pt" width "60line%" collapsed true \layout Standard \align center \begin_inset Graphics filename /home/voss/LyX/lyx1.jpg display color width 80col% \end_inset \layout Caption side by side figure (Caption No. 1) \end_inset \begin_inset Minipage position 0 inner_position 0 height "0pt" width "35line%" collapsed true \layout Standard \align center \begin_inset Graphics filename /home/voss/LyX/lyx2.jpg display color width 30col% \end_inset \layout Caption Caption No. 2 \end_inset \end_inset \the_end
Re: Problem with figures side by side
Nirmal Govind wrote: Thanks Herbert... I think the one I was looking for was named FigSideBySide.lyx but assuming that it uses the same minipages-based attached the other demo file Herbert #LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass article \begin_preamble \usepackage{capt-of} \end_preamble \language german \inputencoding latin1 \fontscheme default \graphics default \paperfontsize 10 \spacing single \papersize a4paper \paperpackage a4 \use_geometry 1 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 5 \tocdepth 5 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle headings \layout Standard Two figures side by side in a float environment. Have a look at the \begin_inset ERT status Collapsed \layout Standard \backslash verb/ layout->paragraph->more/ \end_inset
Re: Problem with figures side by side
attached Herbert Thanks Herbert... I think the one I was looking for was named FigSideBySide.lyx but assuming that it uses the same minipages-based solution as MultiImages.lyx, I am unable to vertically align the captions of the two figures that are side-by-side... I have two figures that do not have the same height/width but I'd like to have the captions on the same line, i.e. the figures will have a constant base... any way to do this? (I also have labels for the figures within a figure float) Thanks, nirmal
Re: Problem with figures side by side
Nirmal Govind wrote: Can you please resend the file that you attached with this post? I get an error while opening the file: "Maybe the document is truncated". attached Herbert #LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass report \begin_preamble \usepackage{graphicx} \end_preamble \language ngerman \inputencoding latin1 \fontscheme default \graphics default \paperfontsize 10 \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \paperwidth 17cm \paperheight 22cm \leftmargin 1.2cm \topmargin 1.4cm \rightmargin 1.7cm \bottommargin 1.4cm \headsep 1cm \secnumdepth 4 \tocdepth 4 \paragraph_separation indent \defskip medskip \quotes_language german \quotes_times 1 \papercolumns 1 \papersides 2 \paperpagestyle default \layout Standard \begin_inset ERT status Open \layout Standard \backslash renewcommand \backslash includegraphics[2][]{ \backslash rule{2cm}{2cm}} \end_inset \layout Standard This TeX is only for demonstration here and can be replaced when inserting real images. \layout Standard \added_space_top bigskip \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset Graphics filename any file \end_inset \end_inset \hfill \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset Graphics filename any file \end_inset \end_inset \hfill \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset Graphics filename any file \end_inset \end_inset \newline \begin_inset ERT status Collapsed \layout Standard [0.25cm] \end_inset \layout Standard \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset Graphics filename any file \end_inset \newline \begin_inset ERT status Collapsed \layout Standard [0.25cm] \end_inset \begin_inset Graphics filename any file \end_inset \end_inset \hfill \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed false \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash rule{3cm}{5cm} \end_inset \end_inset \hfill \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset Graphics filename any file \end_inset \newline \begin_inset ERT status Collapsed \layout Standard [0.25cm] \end_inset \begin_inset Graphics filename any file \end_inset \end_inset \newline \begin_inset ERT status Collapsed \layout Standard [0.25cm] \end_inset \layout Standard \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset Graphics filename any file \end_inset \end_inset \hfill \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset Graphics filename any file \end_inset \end_inset \hfill \begin_inset Minipage position 1 inner_position 0 height "0" width "30col%" collapsed true \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash centering \end_inset \layout Standard \begin_inset Graphics filename any file \end_inset \end_inset \the_end
Re: Problem with figures side by side
Herbert Voss wrote: it is not easy to understand that they are vertically centered. Attached a solution which I prepared long time ago. Replace the images with any other. Or let me know, then I sent you these demo images. Herbert Herbert, Can you please resend the file that you attached with this post? I get an error while opening the file: "Maybe the document is truncated". Thanks, nirmal
Re: Problem with figures side by side
On Wed, 14 Jan 2004, Paul Smith wrote: > > it is not easy to understand that they are vertically centered. > > Attached a solution which I prepared long time ago. Replace > > the images with any other. Or let me know, then I sent you > > these demo images. > > I can only say that your solution is perfect, Herbert! Thank you very > much indeed! The links on the FAQ-page were broken, and I've fixed them now. I also added a reference to this thread and Herbert's example. See here: http://wiki.lyx.org/pmwiki.php/Examples/FiguresSideBySide /Christian -- Christian Ridderström http://www.md.kth.se/~chr
Re: Problem with figures side by side
it is not easy to understand that they are vertically centered. Attached a solution which I prepared long time ago. Replace the images with any other. Or let me know, then I sent you these demo images. I can only say that your solution is perfect, Herbert! Thank you very much indeed! Paul
Re: Problem with figures side by side
Paul Smith wrote: I am trying to insert two figures side by side in a document and I have followed the instructions indicated on: http://wiki.lyx.org/pmwiki.php/FAQ/FiguresSideBySide it is not easy to understand that they are vertically centered. Attached a solution which I prepared long time ago. Replace the images with any other. Or let me know, then I sent you these demo images. Herbert #LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass article \begin_preamble \usepackage{capt-of} \end_preamble \language german \inputencoding latin1 \fontscheme default \graphics default \paperfontsize 10 \spacing single \papersize a4paper \paperpackage a4 \use_geometry 1 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 5 \tocdepth 5 \paragraph_separation indent \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 1 \papersides 1 \paperpagestyle headings \layout Standard Two figures side by side in a float environment. Have a look at the \begin_inset ERT status Collapsed \layout Standard \backslash verb/ layout->paragraph->more/ \end_inset
Problem with figures side by side
Dear All I am trying to insert two figures side by side in a document and I have followed the instructions indicated on: http://wiki.lyx.org/pmwiki.php/FAQ/FiguresSideBySide Unfortunately, the figures, although appearing side by side, are not vertically aligned with each other, I mean, the one on the right is placed bellow the other one. Is it possible to eliminate that vertical misalignment? Could somebody here please help me? Thank you a lot in advance! Paul