# Geometry parameters not working on Windows but working on Mac

I tried to get the following example working on Windows 10 (Texmaker V5.0.1); https://gist.github.com/hsanchez/3667596

I used it for a long time on Mac OS and it worked very well. But on Windows 10 the geometry parameters seam not to work. The page is DIN A4 but not in a smaller size for kindle as I expect.

What can I do?

Thank you!

P.S.: I use MikTex 2.9 (64 bit)

P.P.S.: The minimal example:

\documentclass[8pt]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[paperwidth=9cm, paperheight=11.5cm, top=0.5cm, left=0.5cm, right=0.5cm, bottom=0.5cm]{geometry}
\usepackage{graphicx}
\usepackage{tikz, blindtext}

\makechapterstyle{box}{
\renewcommand*{\printchaptername}{}
\renewcommand*{\chapnumfont}{\normalfont\sffamily\huge\bfseries}
\renewcommand*{\printchapternum}{
\flushright
\begin{tikzpicture}
\draw[fill,color=black] (0,0) rectangle (2cm,2cm);
\draw[color=white] (1cm,1cm) node { \chapnumfont\thechapter };
\end{tikzpicture}
}
\renewcommand*{\chaptitlefont}{\normalfont\sffamily\Huge\bfseries}
\renewcommand*{\printchaptertitle}[1]{\flushright\chaptitlefont##1}
}

%Begin Decorative packages
\usepackage{type1cm}
\usepackage{lettrine}
%End decorative packages

\usepackage[T1]{fontenc}
\usepackage[scaled]{helvet}
\renewcommand*\familydefault{\sfdefault}

\frenchspacing
\sloppy
\pagestyle{empty}

\chapterstyle{box}
\begin{document}

\title{Latex Template for Kindle}
\date{}
\maketitle
\newpage

\newpage
\chapter{Preface}{}

\lettrine[lines=3,slope=4pt,findent=-3pt]{O}{nce upon} a time, lala lala lalala lalalala.

\newpage
\chapter{Introduction}

\lettrine[lines=3,slope=4pt,findent=-3pt]{O}{nce upon} a time, lala lala lalala lalalala.

\end{document}

• Please make your code self-contained, i.e. by adding the code here as code, not only links. – TeXnician Aug 5 '17 at 13:17
• Can you please edit the question to show the code in a minimal but compilable form along with the output of listfiles (main document) from the log file? – Johannes_B Aug 5 '17 at 13:17
• You should say which engine you are using for the compilation and also show a log-file -- the version of geometry and some other files can matter. – Ulrike Fischer Aug 5 '17 at 13:21
• Load graphicx before geometry. – Johannes_B Aug 5 '17 at 13:30

geometry doesn't set the memoir specific length stockwidth and stockheight. The newest version of the graphic drivers set the pdfpagesize to stockwidth if the command is defined and as it is the last package it wins. Changing the package order avoid the problem but it is safer and cleaner to set the stock size correctly:

\documentclass{memoir}
\usepackage[paperwidth=4cm, paperheight=5cm]{geometry}
\setstocksize{4cm}{5cm}
\usepackage{graphicx}

\begin{document}

page content
\end{document}


Or don't use geometry but the commands of memoir to set the page layout.

• @Werner They are in no way independant: all three (the class, geometry and graphicx) try to set \pdfpageheight at begin document. – Ulrike Fischer Aug 5 '17 at 14:25