
Hier sind zwei Seiten desselben Dokuments. Bild 1 zeigt die zweite Seite, bei der \section{Tareas realizadas}
sich die Texthöhe oben überlappt, während Bild 2 die dritte Seite zeigt (korrektes Verhalten).
Warum \section
überlappt der erste den oberen Rand?
Hier ist der Code (Tabellendaten werden spontan von einem externen Python-Programm generiert):
% use article styling for this document
\documentclass[11pt,a4paper]{article}
% enable system font access
\usepackage{fontspec}
\usepackage{lastpage}
\usepackage{fancyhdr}
\usepackage[spanish]{babel}
% agregar showframe para ver los márgenes
\usepackage[showframe, top=3cm, bottom=3cm, left=2cm, right=2cm]{geometry}
\usepackage{tocloft}
\usepackage{xcolor,colortbl}
\usepackage{longtable}
\usepackage{titlesec}
\definecolor{Gray}{gray}{0.85}
\definecolor{LightCyan}{RGB}{60,179,113}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\fancypagestyle{myheader}{%
\fancyhf{}% Clear all headers/footers
\fancyhead[C]{Informe Semanal - \input{fecha.dat}}% Header Centred
\fancyfoot[R]{\thepage /\pageref{LastPage}}% Footer Centred
\renewcommand{\headrulewidth}{2pt}% 2pt header rule
\renewcommand{\headrule}{\hbox to\headwidth{%
\color{LightCyan}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrulewidth}{0pt}% No footer rule
}
% styling: Palatino (main text), Helvetica (stress)
\setmainfont{OptimaLTStd}
\newfontfamily{\maintext}{OptimaLTStd}
\newfontfamily{\stressed}{HelveticaLTStd-Roman}
% start of actual document
\renewcommand{\abstractname}{Sumario}
\begin{document}
\pagestyle{myheader}
\begin{titlepage}
\setcounter{page}{0}
\title{Informe semanal}
\author{Leonardo M. Ramé\\ Medical I.T.}
\immediate\write18{./get_date.sh > fecha.dat}
\date{\input{fecha.dat}}
\maketitle
\renewcommand\contentsname{Tabla de contenidos}
\tableofcontents
\section*{Resumen}
\immediate\write18{./get_agregados.sh > temp.dat}
\input{temp.dat}
\thispagestyle{empty}
\end{titlepage}
%\titleformat{name=\section}[block]
% {}
% {}
% {0pt}
% {\colorsection}
%\titlespacing{\section}{0pt}{\baselineskip}{\baselineskip}
%\newcommand{\colorsection}[1]{%
% \colorbox{Gray}{\parbox{\dimexpr\textwidth-2\fboxsep}{\thesection\ #1}}}
\newpage
\section{Tareas realizadas}
% generamos el listado y lo guardamos en temp.dat
\immediate\write18{./get_reports.sh closed|python parser.py CLOSED > temp.dat}
\input{temp.dat}
\newpage
\section{Tareas pendientes}
% generamos el listado y lo guardamos en temp.dat
\immediate\write18{./get_reports.sh open|python parser.py OPEN > temp.dat}
\input{temp.dat}
\end{document}
Bearbeiten: Hier ist die Warnung von Fancyhdr
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 23.11996pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
Ich habe meinen Fancypagestyle wie folgt geändert:
\fancypagestyle{myheader}{%
\fancyhf{}% Clear all headers/footers
\setlength{\headheight}{40pt}
\setlength{\textheight}{620pt}
\fancyhead[C]{Informe Semanal - \input{fecha.dat}}% Header Centred
\fancyfoot[R]{\thepage /\pageref{LastPage}}% Footer Centred
\renewcommand{\headrulewidth}{2pt}% 2pt header rule
\renewcommand{\headrule}{\hbox to\headwidth{%
\color{LightCyan}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrulewidth}{0pt}% No footer rule
}
Und es hat wie erwartet funktioniert!
Antwort1
Hier ist die Warnung von Fancyhdr
Package Fancyhdr Warning: \headheight is too small (12.0pt):
Make it at least 23.11996pt.
We now make it that large for the rest of the document.
This may cause the page layout to be inconsistent, however.
Ich habe meinen Fancypagestyle wie folgt geändert:
\fancypagestyle{myheader}{%
\fancyhf{}% Clear all headers/footers
\setlength{\headheight}{40pt}
\setlength{\textheight}{620pt}
\fancyhead[C]{Informe Semanal - \input{fecha.dat}}% Header Centred
\fancyfoot[R]{\thepage /\pageref{LastPage}}% Footer Centred
\renewcommand{\headrulewidth}{2pt}% 2pt header rule
\renewcommand{\headrule}{\hbox to\headwidth{%
\color{LightCyan}\leaders\hrule height \headrulewidth\hfill}}
\renewcommand{\footrulewidth}{0pt}% No footer rule
}
Und es hat wie erwartet funktioniert!