i am using lyx to write my thesis.
I use LyX Version 2.2.2 and AdobeAcrobat. Document class is memoir and page format is A4.
However, when i compile it the pdf is always a US letter, regardless that i put A4 or US letter in teh Page Format.
Only the margins seem to be different in the two cases...
Has anyone experienced this problem? how can i fix it?
If of any use, below is the preamble of the source code.
Thanks in advance

Code: Select all
% Preview source code
%% LyX 2.2.2 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,english]{memoir}
\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[a4paper]{geometry}
\geometry{verbose,lmargin=3.5cm,rmargin=4cm}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{color}
\usepackage{babel}
\usepackage{array}
\usepackage{longtable}
\usepackage{textcomp}
\usepackage{pdfpages}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage[unicode=true,
bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
breaklinks=false,pdfborder={0 0 0},pdfborderstyle={},backref=false,colorlinks=true]
{hyperref}
\hypersetup{pdftitle={MasterThesis},
pdfauthor={Federico\_Bava},
pdftex,pdffitwindow=true, linkcolor=black, urlcolor=blue, citecolor=black, pdfstartview={FitH}, hyperfootnotes=false, unicode=true}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\newcommand{\noun}[1]{\textsc{#1}}
\newcommand{\lyxmathsym}[1]{\ifmmode\begingroup\def\b@ld{bold}
\text{\ifx\math@version\b@ld\bfseries\fi#1}\endgroup\else#1\fi}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\numberwithin{equation}{section}
\numberwithin{figure}{section}
\newenvironment{lyxlist}[1]
{\begin{list}{}
{\settowidth{\labelwidth}{#1}
\setlength{\leftmargin}{\labelwidth}
\addtolength{\leftmargin}{\labelsep}
\renewcommand{\makelabel}[1]{##1\hfil}}}
{\end{list}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
%\usepackage{palatino}%font name, other
\usepackage[numbered,autolinebreaks]{mcode}% allows to add matlab code to the LaTeX
\usepackage{textcomp} %necessary for Matlab code
\usepackage{xcolor} %necessary for Matlab code
\definecolor{green}{RGB}{34, 139, 34} % to define the same green as Matlab
\usepackage{geometry} %to change single pages margins
\usepackage{booktabs}
\usepackage{array}
\usepackage{url} % to have url address in the references
\usepackage{hyperref}
\setlength\tabcolsep{0pt} % space between table columns
\setlength{\extrarowheight}{4pt} % space between table rows
%\makeatletter
\g@addto@macro{\UrlBreaks}{\UrlOrds} % to break URL in bibliography
%\makeatother
\usepackage{scrpage2}
\pagestyle{scrheadings}
\ofoot{\pagemark} % \ofoot{\arabic{page}}
\ohead{}
\aliaspagestyle{part}{empty} % to hide page number in Part page