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.

How to arrange mdframed side by side, like

mdframed1 mdframe2

\begin{mdframed}[roundcorner=10pt]
 table 1
\end{mdframed}
\leavevmode
\hspace{2cm}
\begin{mdframed}[roundcorner=10pt]
 table 2
\end{mdframed}
share|improve this question
add comment

1 Answer

up vote 8 down vote accepted

Placing each mdframed environment inside a minipage of specific width works:

\documentclass{article}
\usepackage{mdframed}% http://ctan.org/pkg/mdframed
\begin{document}
\noindent
\null\hfill%
\begin{minipage}{.4\linewidth}
  \begin{mdframed}[roundcorner=10pt]
    table 1
  \end{mdframed}
\end{minipage}
\hspace{2cm}
\begin{minipage}{.4\linewidth}
  \begin{mdframed}[roundcorner=10pt]
    table 2
  \end{mdframed}
\end{minipage}%
\hfill\null
\end{document}

Change .4\linewidth to your liking. The use of \null\hfill ... \hfill\null is to centre the mdframes within the text block without having to wrap it inside a group. \centering with a group would also work.

share|improve this answer
    
Great it works. –  manish Apr 3 '12 at 1:51
    
@Werner: as far as I tested, your solution does not manage correctly a mdframe spanning over multiple pages. I guess that the initial reason to use a mdframe would be to support multi-pages. I did not find any solution yet. –  user25100 Jan 28 '13 at 0:47
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.