tikz mdframed 环境:lemma/excursus 跳过页面

tikz mdframed 环境:lemma/excursus 跳过页面

我使用了此链接下的示例代码[TikZ mdframed 环境:关闭页面末尾的框并继续下一步在 A4 单面环境中成功创建漂亮的附录部分。但是,在尝试双面打印时,有些页面会留空。请参阅下面插入的示例。任何帮助都将不胜感激。

菲利普

\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

好的,找到问题了。显然,每页的文本量超出了可用空间。我猜这可能是由于 \widowpenalty 和 \clubpenalty 设置造成的,但也可能是由于其他原因。我应用了一个热修复,通过在某些点插入 \newpage\noindent 将框向上移动一页。

相关内容