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.

Is it possible to create a frame, using the framed package, with rounded corners? I know for a fact that there are other packages such as the mdframed package but what I am looking for is an application only using the framed package.

EDIT


After looking at the answer below, I created the following environment:

\documentclass{article}
\usepackage{fancybox,framed}
\usepackage{lipsum}
\newenvironment{test}{%
\def\FrameCommand{\fboxsep=\FrameSep\ovalbox}
\MakeFramed{\advance\hsize-\width\FrameRestore}}
{\endMakeFramed}
\begin{document}
\begin{test}
\lipsum[1-2]
\end{test}
\end{document}

The only problem is that it shouts out a warning:

\oval, \circle, or \line size unavailable

Why?

PS. I did not want to post another question so just edited this one.

share|improve this question
    
Just out of curiosity, why not mdframed? –  cmhughes Dec 29 '12 at 0:57
    
@cmhughes That is a good question! I already know how to do it using the mdframed package. Its a challenge I have not overcomed. –  azetina Dec 29 '12 at 17:45
add comment

1 Answer

I am afraid that framed package cannot do that alone. But you can redefine \fbox or \FrameCommand to obtain this results with the usual command \fbox or the framed environment.

This need some complex TeX definitions that are already included in fancybox.sty. So, the most simple solution in to load also fancybox package and then make a very simple definitions including \ovalbox or \Ovalbox. Example:

\documentclass{article}
\usepackage{fancybox,framed}
\renewcommand\fbox[1]{\Ovalbox{#1}}
\renewcommand*\FrameCommand{\ovalbox}
\begin{document}
Some text 
\begin{framed}
A framed environment example ...
\end{framed}
Some text
\vspace{2cm}
Some text 
\fbox{Simple framed box} 
Some text 
\end{document}

But I think that is more clear, more intuitive and less problematic use \Ovalbox or \ovalbox directly and left \fbox for rentangular boxes.


About colors asked in azetina comment, as far I now fancybox do not have color options, but is not difficult to obtain a colored border. See Enumerate over two columns in tabular environment for a example. A colored background seem more complicated (for me), so my advise is left definitively \fbox and fancybox and use the tcolorbox or mdframed packages, both excellent alternatives with many interesting options. There are a lot examples here, just some are in:

share|improve this answer
    
Can you add color to the rule and the inside of the oval box? –  azetina Jan 10 '13 at 16:40
    
@azetina, I updated the answer –  Fran Jan 10 '13 at 18: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.