# mdframed margins

I'm new using mdframed package and I stumbled upon with \mdtheorem so I created a definition and I want to use it at the beginning of the page, but the problem is that there is a space in blank between the page and the definition, I've tried with all the optional margins maybe I skip some option.

\documentclass[12pt,a4paper,twoside]{book}

\usepackage{fancyhdr}

\pagestyle{fancy}

\usepackage[framemethod=TikZ]{mdframed}

\mdfdefinestyle{Ejercicio}{
linecolor=FireBrick,
linewidth=2pt,
innerlinewidth =2pt,
frametitlebackgroundcolor=DarkSalmon!20,
leftline=false,
rightline=false,
bottomline=false,
splitbottomskip=13pt,
everyline=true,
}
\mdtheorem[style=Ejercicio]{ejercicio}{Ejercicio}[section]


The result is the next and I don't want that big white space between

• Welcome to TeX.SE. It would be helpful if turned your code snippet a fully compilable MWE including \documentclass and the appropriate packages that reproduces the problem. While solving problems can be fun, setting them up is not. Then, those trying to help can simply cut and paste your MWE and get started on solving the problem. – Peter Grill Oct 1 '14 at 4:15
• I think if you add \usepackage{showframe} you will see that it is at the very top of the page. The space between the header is the normal margin spacing. I think Remove vertical space at start of latex document is what you are looking for. – Peter Grill Oct 1 '14 at 4:37

The text is already at the very top of the page as can be seen with the addition of the showframe package:

If you really want to reduce that further the space between the header and the top of the page is controlled via \headsep. So with \setlength{\headsep}{5pt} you get:

## Code:

\documentclass[12pt,a4paper,twoside]{book}

\usepackage[svgnames]{xcolor}
\usepackage[framemethod=TikZ]{mdframed}

\usepackage{fancyhdr}
\pagestyle{fancy}

\usepackage{lipsum}
\usepackage{showframe}

\mdfdefinestyle{Ejercicio}{
linecolor=FireBrick,
linewidth=2pt,
innerlinewidth =2pt,
frametitlebackgroundcolor=DarkSalmon!20,
leftline=false,
rightline=false,
bottomline=false,
splitbottomskip=13pt,
everyline=true,
}
\mdtheorem[style=Ejercicio]{ejercicio}{Ejercicio}[section]