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.

I would like to split a frame into 2 parts side by side by minipage. But it seems that the following code puts one on top of the other:

\begin{minipage}[t]{0.48\linewidth}
left part
\end{minipage}\hfill
\begin{minipage}[t]{0.48\linewidth}
right part
\end{minipage}

Could anyone tell me how to do that, and if it is correct to set 0.48\linewidth?

share|improve this question
3  
The fact that you say "frame" and have tagged this "beamer" makes me think that this is part of a presentation. Since many things are set up slightly differently for presentations than for ordinary articles, a minimum working example is really important here. Please add a full example including preamble. –  Loop Space Aug 29 '11 at 10:04

2 Answers 2

up vote 19 down vote accepted

A minipage or a parbox or a box in general need a \noindent to prevent the indention at the beginning of a paragraph.

\documentclass{article}
\begin{document}
\fboxsep=0pt
\noindent\fbox{%
\begin{minipage}[t]{0.48\linewidth}
left part
\end{minipage}}%
\hfill%
\fbox{%
\begin{minipage}[t]{0.48\linewidth}
right part
\end{minipage}
}

\end{document} 

I am sure that Raphink knows the answer but you don't provide a minimal example to show the problem.

I used the command \frame to demonstrate the left and right part.

enter image description here

EDIT: How Andrew Stacey commented here the solution with beamer. beamer provides additional features / environments like columns which is used in the minimal example. For more details have a look at the documentation.

\documentclass{beamer}
\begin{document}
\begin{frame}
\begin{columns}[T] % align columns
\begin{column}{.48\textwidth}
\color{red}\rule{\linewidth}{4pt}

Left Part
\end{column}%
\hfill%
\begin{column}{.48\textwidth}
\color{blue}\rule{\linewidth}{4pt}

Right Part
\end{column}%
\end{columns}
\end{frame}
\end{document}

enter image description here

share|improve this answer

You should add a \hfill between the two minipages.

Using 0.48\textwidth is indeed a correct way of splitting the page.

share|improve this answer
    
it still does not work... –  SoftTimur Aug 29 '11 at 9:47
    
It works for me. Can you post a MWE? –  ℝaphink Aug 29 '11 at 9:48
    
Note that editing your question to add \hfill makes my answer moot while it doesn't help as long as you don't provide a MWE demonstrating the problem. –  ℝaphink Aug 29 '11 at 9:57
    
That is true... –  SoftTimur Aug 29 '11 at 10:36

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.