Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.
\begin{figure}
    %\centering
        \begin{minipage}[h]{0.58\textwidth}
        \centering
        \includegraphics[scale=0.4,trim=12mm 15mm 12mm 15mm]{fig1}
        \end{minipage}
        \begin{minipage}[h]{0.38\textwidth}
        \centering
        \include{fig2}
        \end{minipage}
\end{figure}

I get the fig1 nicely placed in the center of the left side BUT fig2 'sank' at the bottom of the right side. I dont really know what's wrong with the code. Actually fig2 is a table which i store as a tex file with codes only, something like:

\begin{tabular}{|c|c|}
    \hline
    aa  & bb  \\ \hline
    0 & 10 \\ \hline
    1 & 2 \\ \hline
\end{tabular}

Hope someone will help me fix this. Thanks in advance.

share|improve this question
    
A tip: If you indent lines by 4 spaces, then they are marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  lockstep Jul 19 '11 at 18:01
    
@lockstep thanks for the tip. i was about to do it. too rush to post the question. –  hotaru Jul 19 '11 at 18:05
    
Sorry - I wasn't sure if you knew this feature, but I should have waited 5 minutes nevertheless. –  lockstep Jul 19 '11 at 18:08
    
@lockstep dont worry about that.. the more important thing is to get the right answer. –  hotaru Jul 19 '11 at 18:22

3 Answers 3

May I suggest that you use

\RequirePackage[demo]{graphicx} % So the demo works!
\documentclass{beamer}
\begin{document}
\begin{frame}
  \begin{columns}
    \begin{column}{0.5\textwidth}
      \centering
      \includegraphics[width = 2 cm]{demo}
    \end{column}
    \begin{column}{0.5\textwidth}
      \centering
      \includegraphics[width = 2 cm]{demo}
    \end{column}
  \end{columns}
\end{frame}
\end{document}

instead?

share|improve this answer
    
i tried this (of course after you suggest). ehm... it doesnt work. actually fig2 is a table which i store in a tex file, with a code sth like in the questions (sorry, just add this) –  hotaru Jul 19 '11 at 18:24
1  
@hotaru: then, please edit your question and include a minimal working example (MWE) illustrating the problem. I ask you for this MWE since I used a solution similar to the one by 5gon12eder and everything worked as expected. –  Gonzalo Medina Jul 19 '11 at 19:02

You want the optional argument to the column environment:

\RequirePackage[demo]{graphicx}
\documentclass{beamer}
\begin{document}
\begin{frame}
  \begin{columns}[T]
    \begin{column}{0.5\textwidth}
      \centering
      \includegraphics[height = 2 cm]{demo}
    \end{column}
    \begin{column}{0.5\textwidth}
      \centering
      \includegraphics[height = 1 cm]{demo}
    \end{column}
  \end{columns}
\end{frame}
\end{document}

(beamer manual, section 12.7)

share|improve this answer

The subfig package is excellent for side-by-side figures and tables.

There is a nice example here: https://secure.wikimedia.org/wikibooks/en/wiki/LaTeX/Floats,_Figures_and_Captions#Subfloats

share|improve this answer
1  
if you mean that advice as an answer, it would be great if you would rephrase it, since this question to the OP looks like a comment. It would be good to elaborate it, besides posting a link. –  Stefan Kottwitz Sep 3 '11 at 18:56
    
Sorry, unfortunately I don't have the required reputation to comment under the question yet. Also, the example link does go straight to a relevant code snippet, so copy-and-pasting it seemed unnecessary - I did not realize this violated etiquette. –  Dan Sep 3 '11 at 20:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.