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.

I am using mdframed to create big boxes that span more than one page, but they just leave an unframed side at the top and down of the page. Is there a way to solve this?

\documentclass{article}
\usepackage[demo]{graphicx}% demo option just for the example
\usepackage{blindtext}% demo option just for the example
\usepackage{amsmath}
\usepackage{amssymb} 
\usepackage{natbib}
\usepackage{float}
\usepackage[small]{caption}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[xcolor,framemethod=tikz]{mdframed}

\begin{document}
\global\mdfdefinestyle{tag}{%
    roundcorner=5pt,innerlinewidth=2pt,innerlinecolor=RubineRed,%
    middlelinewidth=3pt,middlelinecolor=white,%
    outerlinewidth=2pt,outerlinecolor=Melon,%
    backgroundcolor=Melon!20,%
}
\begin{mdframed}[style=tag]     
\begin{center}
    \blindtext
    \includegraphics[width=\textwidth]{foo}
         \captionof{figure}{This is foo.}
        \label{fig:foo}
    \blindtext
    \includegraphics[width=\textwidth]{foo}
         \captionof{figure}{This is foo2.}
        \label{fig:foo}
    \blindtext
    \blindtext
    \blindtext
\end{center}
Lots of text
\blindtext
\blindtext
\blindtext
\includegraphics[width=\textwidth]{foo}
         \captionof{figure}{This is foo3.}
        \label{fig:foo}
\end{mdframed}

\end{document}
share|improve this question
    
Welcome to TeX.SE. It is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill May 24 '12 at 5:22
    
Do post an image and remove the preceding !. Those with editing privileges will re-insert it to embed the image in your post. –  Werner May 24 '12 at 5:25
    
So you want the frame to be closed on top and bottom whenever there is a page break? I think that that is a feature so that it is clear that this frame continues on to the next page, or is being continued from the previous page. –  Peter Grill May 24 '12 at 6:31
1  
Use the option everyline=true. The global is useless. It is only needed in my example files. –  Marco Daniel May 24 '12 at 6:50
add comment

1 Answer

up vote 3 down vote accepted

I want to answer this question with some hints to your preamble.

  • The command \global in front of \mdfdefinestyle isn't needed. I used it in the documentation do define the style out of the group provided by showexpl
  • You load the package xcolor. As recommend it's the best way to do this. If the package xcolor is loaded mdframed will ignore the option xcolor.
  • To draw also a top and bottom line at splitted frames you can use the option everyline=true. However in my opinion it doesn't look well with such borders.

Use the following definition for tag:

\mdfdefinestyle{tag}{%
    roundcorner=5pt,innerlinewidth=2pt,innerlinecolor=RubineRed,%
    middlelinewidth=3pt,middlelinecolor=white,%
    outerlinewidth=2pt,outerlinecolor=Melon,%
    backgroundcolor=Melon!20,everyline=true%
}

share|improve this answer
    
I replace above code but still same pblm. i am getting following error message. ! Package keyval Error: everyline undefined. See the keyval package documentation for explanation. Type H <return> for immediate help. –  manish Jun 28 '12 at 4:03
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.