1

I used the example code under this link [TikZ mdframed environment: close box at end of page and continue on next to successfully create a nice excursus section in an a4 onesided environment. However, when trying this twosided some pages are left empty. See the example inserted below. Any help with this is highly appreciated.

Philipp

\documentclass[12pt,twoside]{report}
\usepackage {graphicx, fancyhdr, rotating, url, soul, titlesec, varioref, framed, changepage,setspace, caption, subcaption, varioref,xspace, hyphenat, amsmath}%, geometry}
\usepackage{float}
\usepackage{wrapfig}
\usepackage[english]{babel}
\usepackage[vflt]{floatflt} 
\usepackage[round, sort, semicolon] {natbib}
\usepackage[format=default, justification=raggedright, font={scriptsize, bf}]{caption} 
\usepackage[authoryear]{natbib}
%\marginpar{%
 % \includegraphics[width=\marginparwidth]{myfile}
 % \captionof{figure}{The caption}
%} 
%\newlength{\bibhang}
\usepackage{pdfpages}
\usepackage{xcolor}
\usepackage[usenames,dvipsnames]{color}

\usepackage{chngcntr}
\counterwithout{figure}{chapter}
\usepackage{hyperref}

\usepackage[nottoc,numbib]{tocbibind}
\usepackage{tocloft}

\newcommand{\listlemmaname}{List of Excursus}
\newlistof{lemma}{lem}{\listlemmaname}
\newcommand{\lemma}[1]{%
  \refstepcounter{lemma}
  \par\noindent\textbf{Excursus \thelemma:\ #1}
  \addcontentsline{lem}{lemma}
  {\protect\numberline{\thelemma}#1}\par
}

\newcommand{\gen}{\textbf{P1}\xspace}
\newcommand{\rcu}{\textbf{P2}\xspace}
\newcommand{\pro}{\textbf{P3}\xspace}
\newcommand{\pan}{\textbf{M1}\xspace}
\newcommand{\bil}{\textbf{M2}\xspace}
\newcommand{\rna}{\textbf{M3}\xspace}

%\newcounter{Excursus}

%\usepackage[cm]{fullpage}

%\usepackage{showframe}
%\geometry[a4paper]{oneside}

\widowpenalty=300
\clubpenalty=300

\newenvironment{bottompar}{\par\vspace*{\fill}}{\clearpage}

\usepackage[a4paper, top=1in, bottom=1in, left=.8in, right=1in, footskip=.5cm]{geometry}
\setlength{\bibhang}{2em}
\rmfamily

\usepackage[style=1,leftmargin=0pt,rightmargin=0pt,framemethod=TikZ]{mdframed}
\newenvironment{boxtype1}{%
\begin{mdframed}%
[linewidth=.5,margin=8.5,backgroundcolor=gray!2,linecolor=red,fontcolor=black,roundcorner=10pt, middlelinewidth=2pt]%

\fontsize{12}{14}\sffamily\selectfont%
}{\end{mdframed}}

\usepackage[style=1,leftmargin=0pt,rightmargin=0pt,framemethod=TikZ]{mdframed}
\newenvironment{boxtype2}{%
\begin{mdframed}%
[linewidth=.5,margin=8.5,backgroundcolor=red,linecolor=black,fontcolor=black,roundcorner=10pt, middlelinewidth=2pt]%

\fontsize{14}{20}\sffamily\selectfont%
}{\end{mdframed}}


\newenvironment{boxtype3}
  {%
  \begin{mdframed}[
    linewidth=.5,
    everyline=true,
    %margin=8.5,
    backgroundcolor=gray!2,
    linecolor=red,
    fontcolor=black,
    roundcorner=10pt,
    %innerbottommaring=60pt,
    middlelinewidth=2pt,
    splitbottomskip=10pt,
    splittopskip=25pt,
    secondextra={
      \node[
        overlay,
        fill=white,
        anchor=west,
        font=\sffamily\bf,%\large,
        inner xsep=10pt
      ] at ([xshift=10pt]O|-P) {Excursus 1 (Cont.)};
      },
    middleextra={
      \node[
        overlay,
        fill=white,
        anchor=west,
        font=\sffamily\bf,%\large,
        inner xsep=10pt
      ] at ([xshift=10pt]O|-P) {Excursus 1 (Cont.)};
      }
  ]%
  \fontsize{12}{14}\sffamily\selectfont%
  }
  {\end{mdframed}}

\newenvironment{boxtype4}
  {%
  \begin{mdframed}[
    linewidth=.5,
    everyline=true,
    %margin=8.5,
    backgroundcolor=gray!2,
    linecolor=red,
    fontcolor=black,
    roundcorner=10pt,
    %innerbottommaring=60pt,
    middlelinewidth=2pt,
    splitbottomskip=10pt,
    splittopskip=25pt,
    secondextra={
      \node[
        overlay,
        fill=white,
        anchor=west,
        font=\sffamily\bf,%\large,
        inner xsep=10pt
      ] at ([xshift=10pt]O|-P) {Excursus 2 (Cont.)};
      },
    middleextra={
      \node[
        overlay,
        fill=white,
        anchor=west,
        font=\sffamily\bf,%\large,
        inner xsep=10pt
      ] at ([xshift=10pt]O|-P) {Excursus 2 (Cont.)};
      }
  ]%
  \fontsize{12}{14}\sffamily\selectfont%
  }
  {\end{mdframed}}





%\usepackage[bottom=1in]{geometry}






\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist 

\renewcommand{\excursus}{Excursus} 

%\includepdf[pages={1}]{myfile.pdf}


%\def\mytitle{}
%\def\myauthor{}
%\def\latexmode{memoir}
%\input{mmd-memoir-begin-doc}


\pagestyle{fancy}
\fancyhf{}
%\fancyhead[EL]{\thepage}% gerade Seiten, links
\fancyhead[ER]{\leftmark}% gerade Seiten, rechts
%\fancyhead[L]{\thepage}% gerade Seiten, links
\fancyhead[OL]{\rightmark}% ungerade Seiten, links
%\fancyhead[OR]{\thepage}% ungerade Seiten, rechts
%\renewcommand{\chaptername}{Lecture}
%\addto\captionsenglish{\renewcommand{\chaptername}{\thechapter}}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
%\rfoot[]{\thepage}
\headheight=15pt
\footskip = 25pt
%\footskip = 0pt
%\cfoot{\thepage}
\fancyfoot{}
\fancyfoot[CE,CO]{\thepage}
\usepackage{blindtext}

%\addtolength{\headwidth}{\marginparsep}

%\addtolength{\headwidth}{\marginparwidth}


\title{A genomic perspective\\ on variations in the molecular toolkit for development\\ and\\ on the evolution of parthenogenesis in Nematoda}
\author{Philipp H. Schiffer}

\begin{document}
%\pagenumbering{gobble}
\pagenumbering{roman}
\thispagestyle{empty}
\begin{center}
\large
\vspace*{\fill}
\underline{A genomic perspective}\\[0.2cm]
\underline{on variations in the molecular toolkit for development}\\[0.2cm] 
\underline{and}\\[0.2cm]
\underline{on the evolution of parthenogenesis in Nematoda}\\[0.2cm]
%\textit{(Titel der Dissertation)}

\vspace{30pt}
Inaugural-Dissertation\\


\end{center}

\newpage
\thispagestyle{empty}


 \pagebreak   


\subsection*{Danksagung}
\thispagestyle{empty}
blub
\pagebreak




\newpage
\maketitle

\tableofcontents
\listoflemma
\listoffigures

%\listoftables

\newpage


\onehalfspacing
\chapter{Introduction}
\label{introduction}
\pagenumbering{arabic}
\section[Model systems to understand the genetic and molecular underpinnings of life]{Model systems to understand the genetic and \\ molecular underpinnings of life}
\label{sec:metazoa}

In their quest to order life into units of kinship taxonomist have traditionally relied on a hierarchical top-down system based on Linnaeus' ``Systema Naturae".

\begin{boxtype4} 

\lemma{Mutation Rates in parthenogenetic nematodes}
\label{sec:excursus2}

\Blinddocument




\end{boxtype4}
  \vspace{+10pt}

\end{document}
1

OK, found the problem. Apparently is the amount of text per page somehow exceeding what is available in space. I guess this could be due through the \widowpenalty and \clubpenalty settings, but maybe also something else. I applied a hot fix, by inserting \newpage\noindent at some points to move the boxes up one page.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.