2

I would like to place two text (with math expressions) columns and frame one of them, preferably right column; I'm trying to do that with minipage environment but I don't know how to frame it.

MWE:

\documentclass{article}
\usepackage{lipsum}% for macro "\lipsum"
\usepackage{amsmath}% for environment "equation*"
\begin{document}
\noindent
\lipsum[2]

{\vspace{0.5cm}\hfill}
\begin{minipage}[t]{0.45\textwidth}
    \lipsum[1]
    \lipsum[3]
\end{minipage}%
{\hspace*{1cm}}
\begin{minipage}[t]{0.45\textwidth}
    \lipsum[1]
    \begin{equation*}
        \hbar = 2\pi h
    \end{equation*}
    \\
    \lipsum[2]
\end{minipage}%
{\hfill\vspace{0.5cm}}

\noindent
\lipsum[1]
\end{document}

Which produces that

enter image description here

Now I would like to frame right column. Thank you.

3
  • Please post the code you've written that you don't like if the answer below (currently) is not what you are looking for. What may be clear to you from your description may not be clear to many others. – jon Nov 5 '16 at 19:50
  • Well I haven't got any written code because I'm not pretty sure what should I use, multicol package, minipage environment, and how could I frame the column. – jfernandz Nov 5 '16 at 19:52
  • The code doesn't have to work, but if the table (clearly and obviously to you) doesn't work, we need a better hint. It seems like the content of what will be framed matters, but you have not made it clear how or why that matters. Another idea is to draw the desired output and post that. – jon Nov 5 '16 at 20:04
2

Just use \fbox around the box on the right:

\documentclass{article}
\usepackage{lipsum,amsmath}
\begin{document}

\lipsum[2]

\bigskip

\noindent
\begin{minipage}[t]{0.45\textwidth}
    \lipsum[2]
    \lipsum[3]
\end{minipage}\hfill
\fbox{\begin{minipage}[t]{0.45\textwidth}
    \lipsum*[2]
    \begin{equation*}
        \hbar = 2\pi h
    \end{equation*}
    \lipsum[2]
\end{minipage}}

\bigskip

\lipsum[1]
\end{document}

Note that {\vspace{0.5}\hfill} makes little sense; better using something like \bigskip. Also there's no point in doing {\hspace{1cm}} (the outer braces are useless, by the way) when \hfill will do.

enter image description here

2
  • Thank you, what about % when minipage environment finish? – jfernandz Nov 5 '16 at 21:14
  • 1
    @JFernan You need it only when you don't want a space to creep in; in this case there's none that can make trouble. – egreg Nov 5 '16 at 21:23
2

This is an answer for the question in version 1 and 2. Version 3 might be solved using \fbox{...} around the minipage. But the details (horizontal/vertical spacing, support for page breaks, ...) elude me.

Two columns, the right column is framed:

\documentclass{article}
\begin{document}
  \begin{tabular}{l|l|}
    \cline{2-2}
    abc & def \\
    $\displaystyle\sum_{i=1}^n f(n)$ & $\displaystyle\frac{\pi}{4} e^{-\sin\alpha}$ \\
    mno & pqr \\
    \cline{2-2}
  \end{tabular}
\end{document}

Result

3
  • I was referring to text (with math expressions) columns. – jfernandz Nov 5 '16 at 19:40
  • @JFernan Text is present, math expressions added. – Heiko Oberdiek Nov 5 '16 at 20:24
  • Check out my MWE :) – jfernandz Nov 5 '16 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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