Document ClassesCan we change the size of framed box (framed.sty)?

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
fractal.generator
Posts: 66
Joined: Tue Oct 07, 2008 9:39 am

Can we change the size of framed box (framed.sty)?

Post by fractal.generator »

Dear all,

Since the framed environment can be split across page, I prefer to use it instead of the minipage environment.
However, I don't know whether the size of the framed environment can be adjusted or not.

If there are any idea how to do this, please let me know.

Thank you in advance.


Hayashi

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Can we change the size of framed box (framed.sty)?

Post by Stefan Kottwitz »

Hi Hayashi,

framed is using the complete width of the line. If you want to change that you could redefine this environment:

Code: Select all

\renewenvironment{framed}[1][\hsize]
  {\MakeFramed{\hsize#1\advance\hsize-\width \FrameRestore}}%
  {\endMakeFramed}
...
\begin{framed}[.5\textwidth]
text 
\end{framed}
Stefan
LaTeX.org admin
fractal.generator
Posts: 66
Joined: Tue Oct 07, 2008 9:39 am

Re: Can we change the size of framed box (framed.sty)?

Post by fractal.generator »

Hi Mr. Stefan_K,

Thanks for the code, it works.


:o


regards,

Hayashi
Post Reply