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 have been trying to use mini-pages to produce the equivalent of Office text-boxes. The idea is to have panels of different sizes on a page such as 4 equal sized or one wide followed by two long boxes.

I have one fairly clunky solution below. Is there a better way of doing this so I can be more flexible. For example is there any way I can specify the height of a mini-page in inches, cm or pts?

Thanks

\documentclass[landscape]{article}             
\usepackage{microtype}
\geometry{letterpaper}
\usepackage{wallpaper} 
\ULCornerWallPaper{1.0}{/Users/tahnoon/Dropbox/Projects/ai_ppt.pdf} \topmargin=0.25in \headheight=1in \headsep=0.1in 
\usepackage{lipsum}

\begin{document}
\null
\vspace{-3cm}
\setlength{\tabcolsep}{0.4cm}
\begin{tabular}{p{0.35\paperwidth} p{0.35\paperwidth}}
\fbox{
\begin{minipage}[t][0.35\paperheight]{0.35\paperwidth}
\lipsum[1]
\end{minipage}}
&
\fbox{\begin{minipage}[t][0.35\paperheight]{0.35\paperwidth}
\lipsum[4]
\end{minipage}}  \\
&\\
\fbox{\begin{minipage}[t][0.35\paperheight]{0.35\paperwidth}
\lipsum[2]
\end{minipage}} &
\fbox{\begin{minipage}[t][0.35\paperheight]{0.35\paperwidth}
\lipsum[3]
\end{minipage} }\\
\end{tabular}

\end{document}
share|improve this question
add comment

2 Answers

up vote 3 down vote accepted
\documentclass[10pt,landscape]{article}
%\usepackage{geometry} %
\usepackage[letterpaper,top=0.75in, bottom=0.75in, left=2.2in, right=0.75in,showframe]{geometry}
\usepackage{microtype}
\usepackage{wallpaper}
\ULCornerWallPaper{1.1}{ai_ppt}
\usepackage{lipsum}

\begin{document}
\noindent
\fbox{%
\begin{minipage}[c][\dimexpr 0.495\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
    \lipsum[1]
\end{minipage}%
}%
\vfill
\noindent
\fbox{%
\begin{minipage}[l][\dimexpr 0.495\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr 0.495\textwidth-2\fboxsep-2\fboxrule\relax}%
    \lipsum[2]
\end{minipage}%
}%
\hfill
\fbox{%
\begin{minipage}[r][\dimexpr 0.495\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr 0.495\textwidth-2\fboxsep-2\fboxrule\relax}%
    \lipsum[4]
\end{minipage}%
}%
%
\newpage
%
\noindent
\fbox{%
\begin{minipage}[l][\dimexpr\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr .495\textwidth-2\fboxsep-2\fboxrule\relax}
    \lipsum[1]
\end{minipage}%
}%
\hfill
\begin{minipage}[r][\textheight][t]{.495\textwidth}
    \noindent\fbox{%
    \begin{minipage}[c][\dimexpr 0.49\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr \textwidth-2\fboxsep-2\fboxsep\relax}%
        \lipsum[2]
    \end{minipage}
    }
    \vfill
    \fbox{%
    \begin{minipage}[c][\dimexpr 0.49\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr \textwidth-2\fboxsep-2\fboxsep\relax}%
        \lipsum[2]
    \end{minipage}
    }
\end{minipage}%
%
\newpage
%
\noindent
\fbox{%
\begin{minipage}[l][\dimexpr.495\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr .495\textwidth-2\fboxsep-2\fboxrule\relax}
    \lipsum[1]
\end{minipage}%
}%
\hfill
\fbox{%
\begin{minipage}[r][\dimexpr 0.495\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr .495\textwidth-2\fboxsep-2\fboxrule\relax}%
    \lipsum[2]
\end{minipage}%
}%
\vfill
\noindent
\fbox{%
\begin{minipage}[l][\dimexpr 0.495\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr .495\textwidth-2\fboxsep-2\fboxrule\relax}%
    \lipsum[4]
\end{minipage}%
}%
\hfill
\fbox{%
\begin{minipage}[r][\dimexpr 0.495\textheight-2\fboxsep-2\fboxrule\relax][t]{\dimexpr .495\textwidth-2\fboxsep-2\fboxrule\relax}%
    \lipsum[2]
\end{minipage}%
}%
\end{document}

enter image description here

share|improve this answer
    
That's perfect @Harish. Would you mind explaining what the code is doing? It would really help me replicate it. I'm especially curious about the \dimexpr and the \vfil & \hfill commands. Thanks –  Tahnoon Pasha Aug 31 '12 at 15:29
    
@TahnoonPasha: \dimexpr allows you to do arithmatic on dimensions. \vfill and \vfil are hard and soft ways to push things to the bottom of the page and same for \hfill and \hfil but to the right end (horizontally). I have specified both the width and height for the minipages along with their positions and text position inside the minipages. –  Harish Kumar Aug 31 '12 at 15:42
add comment

You can do all that is in Harish Kumar's solution more compactly in a loop.

\documentclass[landscape]{article}
\usepackage[top=0.75in,bottom=0.75in,left=2in,right=0.75in]{geometry}
\usepackage{pgffor}
\usepackage{lipsum}
\begin{document}
\foreach \x/\y/\z/\p/\q in {.48/.937/l/1/\vfil, .48/.45/l/1/\hfil,
  .48/.45/r/1/\newpage, 1/.45/l/1/\hfill,1/.5/r/1/\newpage}{%
  \noindent\fbox{%
    \begin{minipage}[\z][\dimexpr\x\textheight-2\fboxsep\relax]
      [t]{\dimexpr\y\textwidth\relax}%
    \lipsum[\p]
    \end{minipage}%
  }\q
}
\end{document}
share|improve this answer
add comment

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.