I was working with pdfLaTeX, and I set the size of the A4 paper; but for some reasons I have to change to XeLaTeX. And I realize that it isn't the same size of the paper, because the header and foot aren't in the correct place. Can you explain or help me to fix it?

My code is:

\documentclass[10pt, a4paper]{article}




 \parbox[c]{12.6cm}{\footnotesize{TEXT\newline Text}}\parbox[t]{2cm}{\footnotesize{Text}}
 \parbox[c]{7.35cm}{\footnotesize{Text \newline Text}}\parbox[c]{5.4cm}    {\footnotesize{\thepage}}\parbox[t]{4cm}{\footnotesize{Text}}




\begin{huge} \textbf{TEXT}\end{huge}\\
\begin{Large} \textbf{TEXT}\end{Large}\\
\begin{LARGE} \textbf{TEXT}\end{LARGE}\\




\draw(2.6,.3)node[color=bucv][font=\fontsize{20}{20}\sffamily\bfseries]{T\Large{EXT} \huge{T}\Large{EXT}};



\begin{LARGE} \textbf{"TEXT}\end{LARGE}\\
\begin{LARGE} \textbf{
\begin{large} TEXT:\end{large}\\
\begin{LARGE} \textbf{TEXT}\end{LARGE}\\
\begin{large}Elaborado por:\end{large}\\
\begin{Large} \textbf{Text}\end{Large}\\
\begin{Large} \textbf{TEXT}\end{Large}\\
\begin{Large} \textbf{2013}\end{Large}\\


& Title
& Title
&& Subtitle
&&& Title
& Title




  • \setlength{\headsep}{0pt} looks a little odd. – Heiko Oberdiek Jun 26 '13 at 0:14

\headheight/package fancyhdr

\headheight is set to 0.46cm = 13.08846pt. But the header set in page style fancy needs 14.96666pt. See the warning of package fancyhdr:

Package Fancyhdr Warning: \headheight is too small (13.08846pt): 
 Make it at least 14.96666pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.

As an emergency measure, package fancyhdr changes \headheight and "distroys" your page layout in the process. Therefore increase the \headheight to 15pt (or 14.96666pt) and correct the layout (smaller height of the text body to get room for the header, ...), e.g.:

\addtolength{\textheight}{0.46cm}% old \headheight
\addtolength{\textheight}{-15pt}% new \headheight

Paper size for the output driver

LaTeX holds the paper size in the dimen registers \paperwidth and \paperheight. It can be set by a document class option or packages like geometry. Since the default for the standard classes (article, report, book) is letterpaper, specifying a4paper is correct.

However, the LaTeX kernel does not tell the paper size to the output driver, it does not deal with output drivers at all. :-(

Then it depends on the default of the output driver (pdfTeX, XeTeX, ...), which paper size is choosen.

Some packages like geometry, typearea, hyperref, pdftex.def fill the gap that the LaTeX kernel leaves and tell the paper size to the output driver.

The minimal example sets the layout manually without any of the packages above. For example package geometry, which can also be used for the page layout, can be used after the layout assignments at the end of the preamble:


Option pass prevents that package geometry does change the page layout. But it tells the output driver the paper size. Thus you should also get A4 with XeTeX.

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.