3

How can I change my document to being A4 instead of B5 and still keep the same relative margins? I really like the current look, but need it to be A4.

Below is an attempt on a MWE (I don't quite know what relates to the margins).

\documentclass[10pt,twoside,b5paper,showtrims]{memoir}

% Stock and paper layout
\showtrimsoff
\pagebv
\setlrmarginsandblock{26mm}{20mm}{*}
\setulmarginsandblock{35mm}{30mm}{*}
\setheadfoot{8mm}{10mm}
\setlength{\headsep}{7mm}
\setlength{\marginparwidth}{18mm}
\setlength{\marginparsep}{2mm}


\checkandfixthelayout                 % Check if errors!
\sideparmargin{outer}                 % Put sidemargins in outer position


% Chapterstyle
\makeatletter
\makechapterstyle{mychapterstyle}{
    \chapterstyle{default}
    \def\format{\normalfont\sffamily}

    \setlength\beforechapskip{0mm}

    \renewcommand*{\chapnamefont}{\format\LARGE}
    \renewcommand*{\chapnumfont}{\format\fontsize{40}{40}\selectfont}
    \renewcommand*{\chaptitlefont}{\format\fontsize{32}{32}\selectfont}




    \setlength\midchapskip{1ex}

    \renewcommand*{\printchaptertitle}[1]{\raggedleft \chaptitlefont ##1}
    \renewcommand*{\afterchaptertitle}{\vskip0.5\onelineskip \hrule \vskip1.3\onelineskip}

}
\makeatother
\chapterstyle{mychapterstyle}

% Header and footer
\def\hffont{\sffamily\small}
\makepagestyle{myruled}
\makeheadrule{myruled}{\textwidth}{\normalrulethickness}
\makeevenhead{myruled}{\hffont\thepage}{}{\hffont\leftmark}
\makeoddhead{myruled}{\hffont\rightmark}{}{\hffont\thepage}
\makeevenfoot{myruled}{}{}{}
\makeoddfoot{myruled}{}{}{}
\makepsmarks{myruled}{
    \nouppercaseheads
    \createmark{chapter}{both}{shownumber}{}{\space}
    \createmark{section}{right}{shownumber}{}{\space}
    \createplainmark{toc}{both}{\contentsname}
    \createplainmark{lof}{both}{\listfigurename}
    \createplainmark{lot}{both}{\listtablename}
    \createplainmark{bib}{both}{\bibname}
    \createplainmark{index}{both}{\indexname}
    \createplainmark{glossary}{both}{\glossaryname}
}
\pagestyle{myruled}
\copypagestyle{cleared}{myruled}      % When \cleardoublepage, use myruled instead of empty
\makeevenhead{cleared}{\hffont\thepage}{}{} % Remove leftmark on cleared pages

\makeevenfoot{plain}{}{}{}            % No page number on plain even pages (chapter begin)
\makeoddfoot{plain}{}{}{}             % No page number on plain odd pages (chapter begin)

%

\begin{document}
%
\chapter{Discussion}
\chapter{Modelling}

\end{document}
  • What about \documentclass[10pt,twoside,a4paper,showtrims]{memoir} – Dox Jun 17 '14 at 12:24
  • The will change the document making it look weird seeing as the relative margins do not stay the same. For instance, the line beneath the title at each chapter will not go across the page, but stop somewhat midway. – pir Jun 17 '14 at 12:31
  • 1
    Definitely both \setulmarginsandblock and \setlrmarginsandblock are margin-related (section 2.4 of the memoir manual. So I'd start by scaling those up by 19% (the difference between A4 and B5 sizes), and working from there. For further advice, you may want to edit your question with a second MWE showing what you've tried with A4 and what's not working for you visually. – Mike Renfro Jun 17 '14 at 13:41
1

I recently did this in a package I wrote to ensure that a title page formatting was the same no matter what paper size you chose. I did it by calculating my margins as a function of the paper height, so it should work in your case.

I calculated the constants (with which I multiply the \paperheight) based off what I needed my margins to be. If you know your margins and the height of the paper you can figure out you constants and substitute them into the expression below, before \paperheight.

\newlength{\innersidemargin}
     \setlength{\innersidemargin}{0.135\paperheight} 
% for A4 paper this is approximately 40 mm.

\newlength{\outersidemargin}
    \setlength{\outersidemargin}{0.068\paperheight} 
% for A4 paper this is approximately 20 mm.

\newlength{\topsidemargin}
    \setlength{\topsidemargin}{0.10\paperheight} 
% for A4 paper this is approximately 29 mm.

\newlength{\bottomsidemargin}
    \setlength{\bottomsidemargin}{\outersidemargin} 
% for A4 paper this is approximately 20 mm.

Then use the geometry package to set your margins

\usepackage{geometry}
\geometry{inner=\innersidemargin,%
             outer=\outersidemargin,%
             top=\topsidemargin,%
             bottom=\bottomsidemargin}%

Hope that helps.

  • That was perfect. My layout is more or less perfect now. The only thing is, how do I get the same margins for odd and even pages? – pir Jun 18 '14 at 8:56
  • Just use left and right instead of inner and outer when you define your geometry. \geometry{left=\innersidemargin,right=\outersidemargin,top=\topsidemargin,bottom=\bottomsidemargin} – tmgriffiths Jun 18 '14 at 9:10
  • In your comment the left and right is different. Shouldn't they be identical? Either way, I still get different margins for odd and even pages. I've tried: \geometry{left=20mm, right=20mm, top=\topsidemargin, bottom=\bottomsidemargin} – pir Jun 18 '14 at 11:38
  • When I use \usepackage{geometry} \geometry{left=\innersidemargin,right=\innersidemargin,top=\topsidemargin,bottom=\bottomsidemargin} in a minimal document with the lengths I specified above and your document settings (\documentclass[10pt,twoside,a4paper,showtrims]{memoir}) from your MWE I get the same size margin on the left and right. Is there something else you're defining in you doument? Is one of the packages defining a set of margins? Perhaps a title page package for an institution or something. – tmgriffiths Jun 18 '14 at 11:54
  • Yes, I solved the issue now although I don't quite understand how. After my report I think I will try and actually understand LaTeX better :) Thanks! – pir Jun 18 '14 at 12:19

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.