The overlap of footnotes and text only appears in each even page(image 1). How to solve this problem?
Image 1(even page): Image 2(odd page): Codes:
Code: Select all
\documentclass[10pt,a4paper]{book}
\usepackage[%
left=2cm,
right=7cm,
top=2cm,
bottom=2cm,
textheight=25cm,
textwidth=11cm,
marginparsep=1cm,
marginparwidth=5cm
]{geometry}
\usepackage{fancyhdr}
\pagestyle{plain}
\renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt}
\usepackage[german,french]{babel}
\usepackage{xltxtra}
\usepackage{morefloats}
\usepackage{titlesec}%[rubberchapters]%%{\upshape}[small]
\titleformat{\chapter}[block]
{\large\upshape}{\thechapter}{1pc}{}
\titleformat*{\section}{\normalsize\upshape}
\titleformat*{\subsection}{\normalsize\upshape}
\titleformat*{\subsubsection}{\normalsize\upshape}
\titlespacing*{\chapter} {0pt}{11pt}{5pt}
\titlespacing*{\section} {0pt}{11pt}{5pt}
\titlespacing*{\subsection} {0pt}{11pt}{5pt}
\titlespacing*{\subsubsection}{0pt}{11pt}{5pt}
\usepackage[outsidefoot]{pageno}
\usepackage{graphicx}
\graphicspath{{fig/}}
\usepackage{caption}
\captionsetup[figure]{name={Fig.}}
\usepackage{array,color}
\usepackage{fontspec}
\usepackage{ctex}
\usepackage{forarray,etoolbox,xifthen,,graphicx,picture,calc,atbegshi,lipsum,color}
\newlength{\vincrement}
\newlength{\fmvorigin}
\newlength{\fmhorigin}
\newlength{\fmvoffset}
\newlength{\nextfmvoffset}
\newlength{\fmvskip}
\setlength{\fmvorigin}{-1in-\voffset-\topmargin-\headheight-\headsep-\textheight}
\makeatletter
\ifthenelse{\isundefined{\Gm@lmargin}}%
{\setlength{\fmhorigin}{1in+\hoffset+\oddsidemargin+\textwidth+\marginparsep}}%
{\setlength{\fmhorigin}{\Gm@lmargin+\textwidth+\marginparsep}}
\makeatother
\setlength{\fmvoffset}{0pt}
\setlength{\fmvskip}{0.8ex}
\newlength{\tmvorigin}
\newlength{\tmhorigin}
\newlength{\tmvoffset}
\newlength{\nexttmvoffset}
\newlength{\tmvskip}
\newlength{\maxtmnheight}
\setlength{\tmvorigin}{-1in-\voffset-\topmargin-\headheight-\headsep-\baselineskip}
\setlength{\tmhorigin}{\fmhorigin}
\setlength{\tmvoffset}{0pt}
\setlength{\tmvskip}{6ex}
\newcounter{fmn}
\newcounter{tmn}
\newboolean{marginisfull}
\newcommand{\fmnbuffer}{}
\newcommand{\currentfmnqueue}{}
\newcommand{\nextfmnqueue}{}
\newcommand{\tmnbuffer}{}
\newcommand{\currenttmnqueue}{}
\newcommand{\nexttmnqueue}{}
\newcommand{\append}[2]{%
\ifdefempty{#1}{}{\eappto{#1}{,}}%
\eappto{#1}{#2}%
}
\newcommand{\prepend}[2]{%
\ifdefempty{#1}{}{\epreto{#1}{,}}%
\epreto{#1}{#2}%
}
\newcommand{\footmarginnote}[1]{%
\addtocounter{fmn}{1}%
\expandafter\newsavebox\csname fmnbox\roman{fmn}\endcsname%
\expandafter\savebox\csname fmnbox\roman{fmn}\endcsname{\parbox[b]{\marginparwidth}{#1}}%
\append{\currentfmnqueue}{\roman{fmn}}%
}
\newcommand{\topmarginnote}[1]{%
\addtocounter{tmn}{1}%
\expandafter\newsavebox\csname tmnbox\roman{tmn}\endcsname%
\expandafter\savebox\csname tmnbox\roman{tmn}\endcsname{\parbox[t]{\marginparwidth}{\vskip-0.75\baselineskip#1}}%
\append{\currenttmnqueue}{\roman{tmn}}%
}
\newcommand{\printfmn}{%
\setlength{\fmvoffset}{0pt}%
\setboolean{marginisfull}{false}%
\ifdefempty{\currentfmnqueue}{}{%
\gdef\nextfmnqueue{}%
\gdef\fmnbuffer{}%
\ForEachX{,}{%
\ifthenelse{\boolean{marginisfull}}%
{\append{\nextfmnqueue}{\thislevelitem}}%
{%
\setlength{\vincrement}%
{\fmvskip+\expandafter\ht\csname fmnbox\thislevelitem\endcsname+\dp\csname fmnbox\thislevelitem\endcsname}%
\setlength{\nextfmvoffset}{\fmvoffset+\vincrement}%
\ifthenelse{\lengthtest{\nextfmvoffset>\textheight}}{%
\setboolean{marginisfull}{true}%
\append{\nextfmnqueue}{\thislevelitem}%
}{%
\prepend{\fmnbuffer}{\thislevelitem}%
\addtolength{\fmvoffset}{\vincrement}%
}%
}%
}%
{\currentfmnqueue}%
\setlength{\fmvoffset}{0pt}%
\ForEachX{,}{%
\put(\fmhorigin,\fmvorigin+\fmvoffset){\expandafter\usebox\csname fmnbox\thislevelitem\endcsname}%
\setlength{\vincrement}%
{\fmvskip+\expandafter\ht\csname fmnbox\thislevelitem\endcsname+\dp\csname fmnbox\thislevelitem\endcsname}%
\addtolength{\fmvoffset}{\vincrement}%
}%
{\fmnbuffer}%
\global\let\currentfmnqueue\nextfmnqueue%
}%
}
\newcommand{\printtmn}{%
\setlength{\maxtmnheight}{\textheight-\fmvoffset}%
\setlength{\tmvoffset}{0pt}%
\setboolean{marginisfull}{false}%
\ifdefempty{\currenttmnqueue}{}{%
\gdef\nexttmnqueue{}%
\gdef\tmnbuffer{}%
\ForEachX{,}{%
\ifthenelse{\boolean{marginisfull}}%
{\append{\nexttmnqueue}{\thislevelitem}}%
{%
\setlength{\vincrement}%
{\tmvskip+\expandafter\ht\csname tmnbox\thislevelitem\endcsname+\dp\csname tmnbox\thislevelitem\endcsname}%
\setlength{\nexttmvoffset}{\tmvoffset+\vincrement}%
\ifthenelse{\lengthtest{\nexttmvoffset>\maxtmnheight}}{%
\setboolean{marginisfull}{true}%
\append{\nexttmnqueue}{\thislevelitem}%
}{%
\append{\tmnbuffer}{\thislevelitem}%
\addtolength{\tmvoffset}{\vincrement}%
}%
}%
}%
{\currenttmnqueue}%
\setlength{\tmvoffset}{0pt}%
\ifdefempty{\tmnbuffer}{}{%
\ForEachX{,}{%
\put(\tmhorigin,\tmvorigin-\tmvoffset){\expandafter\usebox\csname tmnbox\thislevelitem\endcsname}%
\setlength{\vincrement}%
{\tmvskip+\expandafter\ht\csname tmnbox\thislevelitem\endcsname+\dp\csname tmnbox\thislevelitem\endcsname}%
\addtolength{\tmvoffset}{\vincrement}%
}%
{\tmnbuffer}%
}%
\global\let\currenttmnqueue\nexttmnqueue%
}%
}
\AtBeginShipout{\AtBeginShipoutUpperLeft{\printfmn\printtmn}}
\makeatletter
\renewcommand{\footnote}[1]{\footnotemark\footmarginnote{\textsuperscript{\@thefnmark}\,#1}}
\makeatother
\begin{document}
\frontmatter
\begin{flushleft}
\parindent=19pt
\linespread{1}
\edef\marginnotetextwidth{\the\textwidth}
\title{\emph{Summary}}
\author{Vera}
\date{}
\thispagestyle{empty}
\pagenumbering{Roman}
\maketitle
\fontspec{Calibri-Light}
\tableofcontents
\mainmatter
\renewcommand\thepage{{\scriptsize\arabic{page}}}
Text\footnote{This is the first footnote.} \lipsum[1]
Text\footnote{This is the second and somewhat longer footnote.} \lipsum[1]
Text\footnote{This is the third footnote.} \lipsum[1]
Text\footnote{This is the fourth footnote.} \lipsum[1]
Text\footnote{This is the second and somewhat longer footnote.} \lipsum[1]
Text\footnote{This is the third footnote.} \lipsum[1]
Text\footnote{This is the fourth footnote.} \lipsum[1]Text\footnote{This is the second and somewhat longer footnote.} \lipsum[1]
Text\footnote{This is the third footnote.} \lipsum[1]
Text\footnote{This is the fourth footnote.} \lipsum[1]
Text\footnote{This is the second and somewhat longer footnote.} \lipsum[1]
Text\footnote{This is the third footnote.} \lipsum[1]
Text\footnote{This is the fourth footnote.} \lipsum[1]
\backmatter
\begin{thebibliography}
\normalsize
\bibitem{cra} H.,1966.
\end{thebibliography}
\end{flushleft}
\end{document}