# Memoir Page Layout doesn't work as expected: Text shifted right

I'm trying to setup the layout as a one-sided A4 page, with 2.5 cm equal left & right margins. Since the width of A4 is 21cm, then I'm trying to do this with the following 2 steps:

1. Set the typeblock size to 16cm (using \settypeblocksize{20cm}{16cm}{*})
2. Set equal L & R margins (using \setlrmargins{*}{*}{*})

I tried several other combination, but it doesn't work as expected; I'm getting very narrow right margin with most of the margin at the left.

So why doesn't the text get centered between 2 equal left & right margin?

Here is the full code, the output screenshot is attached:

% Preview source code

%% Do not edit unless you really know what you are doing.
\documentclass[a4paper,oneside,english,oldfontcommands,article]{memoir}
\usepackage{mathptmx}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.

\newcommand{\code}[1]{\texttt{#1}}

\special{papersize=\the\paperwidth,\the\paperheight}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\settypeblocksize{20cm}{16cm}{*}
%Memoir: Set L & R margins around the type block:
%\setlrmargins{0cm}{0cm}{*}
%\settrims{0pt}{0pt}

\setlrmargins{*}{*}{*} %equal L & R margins ( = 2.5cm)

\makeatother

\usepackage{babel}

\begin{document}

\chapter{Page Dimentions}
\begin{description}
\item [{\code{\textbackslash{}stockheight}}] \the\stockheight
\item [{\code{\textbackslash{}stockwidth}}] \the\stockwidth
\item [{\code{\textbackslash{}paperheight}}] \the\paperheight
\item [{\code{\textbackslash{}paperwidth}}] \the\paperwidth
\item [{\code{\textbackslash{}textheight}}] \the\textheight
\item [{\code{\textbackslash{}textwidth}}] \the\textwidth
\item [{\code{\textbackslash{}trimtop }}] \the\trimtop
\item [{\code{\textbackslash{}trimedge}}] \the\trimedge
\item [{\code{\textbackslash{}spinemargin}}] \the\spinemargin
\item [{\code{\textbackslash{}marginparsep}}] \the\marginparsep
\item [{\code{\textbackslash{}marginparwidth}}] \the\marginparwidth
\end{description}

\chapter{Example Paragraph}

This is an example paragraph. This is an example paragraph. This is
an example paragraph. This is an example paragraph. This is an example
paragraph. This is an example paragraph. This is an example paragraph.
This is an example paragraph. This is an example paragraph. This is
an example paragraph. This is an example paragraph. This is an example
paragraph. This is an example paragraph. This is an example paragraph.
This is an example paragraph.
\end{document}


-

\checkandfixthelayout

and I also assume the OP mean \setlrmargins{*}{*}{1} –  daleif Aug 1 '11 at 7:36
@Alan Munn Thanks, it works. I found \checkandfixthelayout mentioned in chapter 2 of the Memoir manual, but a little bit late in that chapter. I guess it's better to have it earlier in that chapter because the reader might start experimenting before finishing the chapter, and will loose some time in hair pulling :) –  John Kirollos Aug 1 '11 at 12:45
I completely agree with you @JohnKirollos , I just spend almost a day trying to handle my margins, and I also checked the manual but kind of oversaw the \checkandfixthelayout. –  Zwähnia Jun 24 at 14:48