1

dear texperts (peter?):

I am still struggling with memoir lengths. I decided I need to understand the basic accounting identities here. So I wrote a simple tabular display helper --- not very elegant but workable:


%% should require memoir

\usepackage{calc}
\usepackage{lengthconvert}

\newcommand{\topt}[1]{\Convert[unit=pt,precision=1]{#1}}
\newcommand{\tomm}[1]{\Convert[unit=mm,precision=2]{#1}}
\newcommand{\toin}[1]{\Convert[unit=in,precision=3]{#1}}

%% below is very inelegant.  this should instead have a definition like
% \newcommand{\allfour}[3][]{#1 & \topt{#2} & \tomm{#2} & \toin{#2} & #3}

%% should also have a column for what is set for and what is calculated by memoir

\newcommand{\tablemylengths}{
  \newlength{\fullwidth}
  \setlength{\fullwidth}{\trimedge+\marginparwidth+\marginparsep+\textwidth+\spinemargin}

  \section{Horizontal Widths (Verso)}

  \begin{tabular}{l l l l >{\footnotesize}l}
    \toprule
    paperwidth     & \topt\paperwidth     & \tomm\paperwidth     & \toin\paperwidth                                             \\
    pagewidth      & \topt\pagewidth      & \tomm\pagewidth      & \toin\pagewidth                                              \\
    stockwidth     & \topt\stockwidth     & \tomm\stockwidth     & \toin\stockwidth                                             \\
    \addlinespace
    trimedge       & \topt\trimedge       & \tomm\trimedge       & \toin\trimedge       & from stock to paper                   \\
    marginparsep   & \topt\marginparsep   & \tomm\marginparsep   & \toin\marginparsep   & between bodytext and marginnote       \\
    marginparwidth & \topt\marginparwidth & \tomm\marginparwidth & \toin\marginparwidth & marginnote                            \\

    \addlinespace
    spinemargin    & \topt\spinemargin    & \tomm\spinemargin    & \toin\spinemargin    & from paper to text (body)             \\
    oddsidemargin  & \topt\oddsidemargin  & \tomm\oddsidemargin  & \toin\oddsidemargin  & not used in memoir, but set?          \\
    evensidemargin & \topt\evensidemargin & \tomm\evensidemargin & \toin\evensidemargin & not used in memoir, but set?          \\
    \addlinespace
    foremargin     & \topt\foremargin     & \tomm\foremargin     & \toin\foremargin     & unknown                               \\
    columnsep      & \topt\columnsep      & \tomm\columnsep      & \toin\columnsep      & unknown                               \\
    columnseprule  & \topt\columnseprule  & \tomm\columnseprule  & \toin\columnseprule  & unknown                               \\

    \midrule
    \multicolumn5r{trimedge + marginparwidth + marginparsep + textwidth + spinemargin}                                          \\
    fullwidth      & \topt\fullwidth      & \tomm{\fullwidth}    & \toin{\fullwidth}    & missing: to paperwidth to stockheight \\
    \bottomrule
  \end{tabular}


  \section{Vertical Heights}

  \newlength{\fullheight}
  \setlength{\fullheight}{\trimtop+\uppermargin+\textheight+\footskip}

  \begin{tabular}{l l l l >{\footnotesize}l}
    \toprule
    paperheight   & \topt\paperheight   & \tomm\paperheight   & \toin\paperheight                                                   \\
    pageheight    & \topt\pageheight    & \tomm\pageheight    & \toin\pageheight                                                    \\
    stockheight   & \topt\stockheight   & \tomm\stockheight   & \toin\stockheight                                                   \\
    \addlinespace
    trimtop       & \topt\trimtop       & \tomm\trimtop       & \toin\trimtop       & from stock to paper                           \\
    uppermargin   & \topt\uppermargin   & \tomm\uppermargin   & \toin\uppermargin   & overlaps with headheight/headsep              \\
    topskip       & \topt\topskip       & \tomm\topskip       & \toin\topskip       & not sure how used in memoir                   \\
    topmargin     & \topt\topmargin     & \tomm\topmargin     & \toin\topmargin     & not used in memoir?                           \\
%    headmargin    &\topt\headmargin      & \tomm\headmargin     & \toin\headmargin     & unknown                                       \\
    headheight    & \topt\headheight    & \tomm\headheight    & \toin\headheight    & header height itself                          \\
    headsep       & \topt\headsep       & \tomm\headsep       & \toin\headsep       & from header to bodytext (page\#?)             \\
    \addlinespace
    footskip      & \topt\footskip      & \tomm\footskip      & \toin\footskip      & text to footer (page number?)                 \\
    \addlinespace
    marginparpush & \topt\marginparpush & \tomm\marginparpush & \toin\marginparpush & between consecutive margin notes              \\
    \midrule
    \multicolumn5r{trimtop + uppermargin + textheight + footskip}                                                                   \\
    fullheight    & \topt\fullheight    & \tomm{\fullheight}  & \toin{\fullheight}  & missing: footer to paperheight to stockheight \\
    \bottomrule
  \end{tabular}
}

and (following Peter's suggestion) here is the main file:

\documentclass[12pt]{memoir}

\usepackage{tablemylengths}

\begin{document}

\tablemylengths

\medskip

See Section~2 of memoir docs.  What is set, what is calculated?

\end{document}

Invoking this on a vanilla memoir yields

latex widths and heights

my first question is simply what I omitted to make my widths and heights add up to the page widths and heights.

my second question is what memoir wants the user to set and what it calculates from the user values.

once I understand these, I will hopefully be able to wrangle this a little better. (Peter --- the memoir doc table 2.9 would be better if it printed the default settings, too...or if you had something like what I am trying to construct here. oh, and thanks for making such a great class for us. I couldn't have written my textbook without it.)

/iaw

2
  • 1
    I could not compile your MWE. I added \documentclass{memoir} and \end{document} but it complained about a missing ....aux file. Please provide a compilabl MWE Commented Jun 5, 2022 at 18:17
  • hi peter --- does this make it compilable? I appreciate your making so many defaults for so many paper sizes. I just wanted to display the very basic default version (on a US system, where it is US letter). I also tried to make a nicer macro with \csname \endcsname, so that I don't have to repeat the name, but somehow this failed. I am a TeX amateur.
    – ivo Welch
    Commented Jun 5, 2022 at 23:07

1 Answer 1

2

Please look at the code for memoir.cls (on my computer in /usr/local/texlive/2021/texmf-dist/tex/latex/memoir/memoir.cls) to see what lengths are set by the class papersize option and which can be changed via user macros. The default values are the same as the LaTeX book class.

** BEGIN EDIT I tried to provide settings that would result in a reasonable layout for each of the 33 class papersize options. ** END EDIT

Looking at Figures 2.2 and 2.3 in the manual there is nothing about \fullheight but there is no fixing of the space below a footer --- that depends on what has gone before, so it is a flexible space. Your definition of \fullheight is incorrect (it's missing the undefined space after the footer (which is \paperheight - (\trimtop + \uppermargin +\textheight + \footskip)

Regarding table 2.9, the default settings depend on the class papersize options.of which there are 33. I don't think that it would be useful to print 33 possible values for the settings.

However I do appreciate your macros for converting to pts, mm, and inches. That code could be useful in a package.

6
  • thanks, peter. [1] I am not sure where in the 12,000 lines source of memoir I am supposed to look at (for what the user can define and what is derived). [2] it looks like I have \fullheight what I wanted it to be --- everything from the top, except final bottom. my bad macro name, though. [3] what, if anything, is missing on \fullwidth? I am missing about 0.415". [4] perhaps you could add one macro to memoir that does a table like what I have and then replicates your manual's Fig 2.1-2.3 (with specific values).
    – ivo Welch
    Commented Jun 6, 2022 at 1:49
  • I found the fgruler package with showframe helpful, too.
    – ivo Welch
    Commented Jun 6, 2022 at 17:38
  • What is \foremargin?? The page drawing in Figs 2.1-2.3 does not show it, but it rears its head in an error that I exceeded a sum. I tried to guess a summing relationship to the other lengths in my little table, but failed. I also tried to read the source, but this did not clarify it for me.
    – ivo Welch
    Commented Jun 6, 2022 at 18:28
  • @ivoWelch I still can't compile your revised version of your MWE --- it says it can't find an .aux file. Where is the package tablemylengths that you call for? I no longer maintain memoir so will not be making any changes to it. The current maintainer is Lars Madsen email [email protected]. In any case I'm not sure that your suggestions are helpful; you are the first in 21 years to have the problem with lengths that you have. Commented Jun 6, 2022 at 18:34
  • @ivoWelch I still can't compile your MWE even though I have tried commenting out portions of it; I won't waste any more of my time tyrying to fix your MWE. There is \spinemargin, \textwidth and \paperwidth. I thought that you might be able to deduce that \foremargin might be the other margin on the page, opposite to the \spinemargin. \foremargin = \paperwidth - \spinemargin - \textwidth. Perhaps you would deign to provide a compilable MWE that showed your problem with \foremargin. I assume that you set it not according to the statement above but who knows? Commented Jun 8, 2022 at 18:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .