\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.:
\setlength{\headheight}{15pt}
\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:
\usepackage[pass]{geometry}
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.
Best Answer
From the command line, you can call
tlmgr
with thepaper
option to see what the default setting is, and change it if you supply an argument. So useFrom the
tlmgr
documentation onpaper
: