3

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

2
  • 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. Oct 1, 2014 at 4:15
  • 4
    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. Oct 1, 2014 at 4:37

1 Answer 1

3

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

enter image description here

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:

enter image description here

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]

\setlength{\headsep}{5pt}

\begin{document}
\chapter{Chapter Title}
\newpage
\begin{ejercicio}
\lipsum[1]
\end{ejercicio}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .