Alex Rivera | Logout

Latex minipage to align groups of text

Asked 2009-10-16T14:00:20.140
9

I am trying to get two minipage sections to show up next to each other. They always show up one underneath the other currently below is an example of my .tex

Example:

\begin{minipage}[b]{1in}
   Hello World akdjfasljdfkjasjdfjsadkflkjksadflkaskjdfsadlflkjsafdalkjsfd
\end{minipage}
\begin{minipage}[b]{1in}
   Hello World akdjfasljdfkjasjdfjsadkflkjksadflkaskjdfsadlflkjsafdalkjsfd
\end{minipage}
Edit
Report

1 Answer

3

You can use the \textwidth command to make them fit:

\documentclass{article}
\begin{document}
\begin{minipage}[b]{0.5\textwidth}
Hello World akdjfasljdfkjasjdfjsadkflkjksadflkaskjdfsadlflkjsafdalkjsfd
\end{minipage}
\begin{minipage}[b]{0.5\textwidth}
Hello World akdjfasljdfkjasjdfjsadkflkjksadflkaskjdfsadlflkjsafdalkjsfd
\end{minipage}
\end{document}

(learnt this trick here)

Do make sure there aren't any blank lines between the end of one minipage and the start of another. And you may want to use \noindent before the first \begin{minipage} to get the columns to be aligned the same as the text with respect to the left margin.

answered 2012-03-25T14:57:09.110

Your Answer