You can use the predefined boxes from the fancybox
package, which you can wrap around equations via the empheq
package:
\documentclass[letterpaper]{article}
\usepackage{kpfonts,amssymb,empheq,fancybox}
\newsavebox{\mybox}
\newcommand{\raisedshadowbox}[1]{%
\sbox\mybox{\shadowbox{#1}}%
\raisebox{-0.5\ht\mybox-0.5\shadowsize+0.6ex}{\usebox\mybox}%
}
\begin{document}
A double box
\begin{empheq}[box=\doublebox]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
An oval box (cheesy)
\begin{empheq}[box=\ovalbox]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
A shadowbox, which has some vertical alignment problems \ldots
\begin{empheq}[box=\shadowbox]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
\ldots which apparently can be fixed by sticking it into a raisebox.
\begin{empheq}[box=\raisedshadowbox]{align}
a&=b\\
E&=mc^2 + \int_a^a x\, dx
\end{empheq}
\end{document}
This gives
Note that the definition of \raisedshadowbox
contains a fudge factor of 0.6ex for the vertical offset correction. I don't know what this compensates for, but it does seem to work across different font sizes, line heights as well as \shadowbox
, \fboxsep
and \fboxrule
settings.
Maybe you can give the tasks
package (used to be part of the exsheets
bundle) a try:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{tasks}[2013/04/07]
% renew the {tasks} environment to use bold labels
% and use two columns as default settings:
\RenewTasks[counter-format= tsk.,label-format=\bfseries]{tasks}(2)
\begin{document}
\begin{multicols}{2}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
\begin{tasks}
\task foo
\task bar
\task baz
\task foobar
\task foo
\task bar
\task baz
\task foobar
\end{tasks}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
\begin{tasks}
\task foo
\task bar
\task baz
\task foobar
\task foo
\task bar
\task baz
\task foobar
\end{tasks}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
\begin{tasks}
\task foo
\task bar
\task baz
\task foobar
\task foo
\task bar
\task baz
\task foobar
\end{tasks}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr
\begin{tasks}
\task foo
\task bar
\task baz
\task foobar
\task foo
\task bar
\task baz
\task foobar
\end{tasks}
\end{multicols}
\end{document}
Here's an example of how the appearance could be further customized (thanks to g.kov for doing the typing!). Edit: the updated version needs v0.10 (2014/07/20) for the \task!
syntax.
The items that should span a complete line (items 31. and 32. in the picture below) can be achieved by one of the following methods:
\task!
– this will force the specific item to start in a new line using the whole line.
\task*
– this will force the specific item to use the remaining space of the line. In this case this means it uses the whole line if it happens to be an item in the first column.
\task*(<num>)
– this means the item will span <num>
columns provided there are enough columns left in the current line. Otherwise it will use as much columns as it can.
\documentclass{article}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{multicol}
\usepackage{amsmath}
% use tasks v0.10 2014/07/20:
\usepackage{tasks}[2014/07/20]
% declare custom tasks instance that has no stretchable space between
% rows of items:
\DeclareInstance{tasks}{custom}{default}{
counter-format = tsk. ,
label-format = \bfseries ,
label-width = 1.5em ,
label-offset = .3333em ,
after-item-skip = 0pt
}
% renew {tasks} environment to use the new instance and resume the
% item counting:
\RenewTasks[resume,style=custom,label-align=right]{tasks}(2)
\begin{document}
\begin{multicols}{2}
Derivative calculations\par
In Exercises \ref{tsk:st1}--\ref{tsk:end1}, given $y=f(u)$ and $u=g(x)$, find
$dy/dx=f^\prime(g(x))g^\prime(x)$
\begin{tasks}
\task $y=6u-9,\ u=1/2 x^4$ \label{tsk:st1}
\task $y=2u^3,\ u=8x-1$
\task $y=\sin u,\ u=3x+1$
\task $y=\cos u,\ u=-x/3$
\task $y=\cos u,\ u=\sin x$
\task $y=\sin u,\ u=x-\cos x$
\task $y = \tan u,\ u=10x-5$
\task $y=-\sec u,\ u=x^2+7x $ \label{tsk:end1}
\end{tasks}
In Exersises \ref{tsk:st2}--\ref{tsk:end2}, write the function in the form
$y=f(u)$ and $u=g(x)$. Then find $dy/dx$ as a function of $x$.
\begin{tasks}
\task $y=\left( 2x+1 \right)^5$ \label{tsk:st2}
\task $y=\left( 4-3x \right)^9$
\task $y=\left( 1-\dfrac{x}7 \right)^{-7}$
\task $y=\left( \dfrac{x}2 -1 \right)^{-10}$
\task $y=\left( \dfrac{x^2}8 +x -\dfrac1{x} \right)^{4}$
\task $y=\sqrt{2x^2-4x+6}$
\task $y=\sec(\tan x)$
\task $y=\cot\left( \pi -\dfrac1{x} \right)$
\task $y=\sin^3 x$
\task $y=5\cos^{-4} x$
\task $y=e^{-5x}$
\task $y=e^{2x/3}$
\task $y=e^{5-7x}$
\task $y=e^{4\sqrt{x}-x^2}$ \label{tsk:end2}
\end{tasks}
Find the derivatives of the functions in Exercises \ref{eq:st3}--\ref{eq:end3}:
\begin{tasks}
\task $p=\sqrt{3-t}$ \label{eq:st3}
\task $q=\sqrt[3]{2r-r^2}$
\task $s=\dfrac{4}{3\pi}\sin{3t}+\dfrac{4}{5\pi}\cos{5t}$
\task $s=\sin\dfrac{3\pi t}{2}+\cos\dfrac{3\pi t}{2}$
\task $r=\left( \csc\theta +\cot\theta \right)^{-1}$
\task $r=6\left( \sec\theta -\tan\theta \right)^{3/2}$
\task $y=x^2\sin4x+x\cos^{-2}x$
\task $y=\dfrac1{x}\sin^{-5}x-\dfrac{x}{3}\cos^{3}x$
\task! $y=\dfrac1{21}(3x-2)^7+\left( 4-\dfrac1{2x^2} \right)^{-1}$
\task! $y=(5-2x)^{-3}+\dfrac1{8}\left( \dfrac2{x}+1 \right)^{4}$
\task $y=(4x+3)^4(x+1)^{-3}$
\task $y=(2x-5)^{-1}(x^2-5x)^{6}$
\task $y=x e^{-x}+e^{3x}$
\task $y=(1+2x)e^{-2x}$
\task $y=(x^2-2x+2)e^{5x/2}$
\task $y=(9x^2-6x+2)e^{x^3}$
\task $h(x)=x\tan\left( 2\sqrt{x} \right)+7$
\task $k(x)=x^2\sec\left( \dfrac1x \right)$ \label{eq:end3}
\end{tasks}
\end{multicols}
\end{document}
Best Answer
Just use
\fbox
around the box on the right: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.