1

For my book i use memoir document class with asymmetric page layout (spinner margin is half of outer margin). For index i change text width with adjmulticol to have a place for index in three column formatted by idxlayout. This almost work fine ... except that all items are on one page! When the page is full, i.e. page is not going to break on as expected (see example below) and as is done when in adjmulticol is other (non index) text.

What cause this behavior? Is there some better approach to achieve desired result?

Edit:

In my original question I unfortunately strip out three lines:

\usepackage{calc}

immediately after document class and

\setlength{\marginwidth}{\marginparsep+\marginparwidth}
\setlength{\headwidth}{\textwidth+\marginwidth}

before \usepackage{adjmulticol}, which shows, why I actually nested a adjmulticol and idxlayout.

The length \marginwidth I use for calculation of \headwidth and other items in my real case (like chapter title layout, new environments which are extended into outer margin). I hope that my questions is more clear.

Wider text width i need for placing longer indices in index that they are not broken unnecessary into two lines.

        \documentclass[twoside,openright]{memoir}
        \usepackage{calc}% added in eddit
    \setstocksize{297mm}{210mm}                                 % A4
        \settrimmedsize{\stockheight}{\stockwidth}{*}           % A4
    \newlength{\marginwidth}
        \settypeblocksize{247mm}{120mm}{*}
        \setulmargins{25mm}{*}{1}           % upper, lower margin, ratio
        \setlrmarginsandblock{30mm}{60mm}{*}% spinner, outer margin, ratio
    \checkandfixthelayout
        \setlength{\marginparwidth}{45mm}
        \setlength{\marginparsep}{5mm}
    \setlength{\marginwidth}{\marginparsep+\marginparwidth}% added in edit
    \setlength{\headwidth}{\textwidth+\marginwidth}% added in edit
    %---------------------------------------------------------------%
\usepackage{adjmulticol}
    \usepackage[columns=3]{idxlayout}
    \makeindex

    \begin{document}
        \mainmatter
    \chapter{Test of indexing}
        \index{Alpha}
    alpha(a)    \index{Alpha!alpha}
        alpha(a)    \index{Alpha!alpha!a}   alpha(b)    \index{Alpha!alpha!b}
        alpha(c)    \index{Alpha!alpha!c}   alpha(d)    \index{Alpha!alpha!d}
    beta(a)     \index{Alpha!beta}
                \index{Alpha!beta!a}
        beta(b)     \index{Alpha!beta!b}    beta(c)     \index{Alpha!beta!c}

    \section{Beta, Delta, Epsilon, Eta}
        \index{Beta}
    alpha(a)    \index{Beta!alpha}
        alpha(a)    \index{Beta!alpha!a}    alpha(b)    \index{Beta!alpha!b}
        alpha(c)    \index{Beta!alpha!c}    alpha(d)    \index{Beta!alpha!d}
    beta(a)     \index{Beta!beta}
                \index{Beta!beta!a}
        beta(b)     \index{Beta!beta!b}     beta(c)     \index{Beta!beta!c}

        \index{Delta}
    alpha(a)    \index{Delta!alpha}
        alpha(a)    \index{Delta!alpha!a}   alpha(b)    \index{Delta!alpha!b}
        alpha(c)    \index{Delta!alpha!c}   alpha(d)    \index{Delta!alpha!d}
    beta(a)     \index{Delta!beta}
                \index{Delta!beta!a}
        beta(b)     \index{Delta!beta!b}    beta(c)     \index{Delta!beta!c}

        \index{Epsilon}
    alpha(a)    \index{Epsilon!alpha}
        alpha(a)    \index{Epsilon!alpha!a} alpha(b)    \index{Epsilon!alpha!b}
        alpha(c)    \index{Epsilon!alpha!c} alpha(d)    \index{Epsilon!alpha!d}
    beta(a)     \index{Epsilon!beta}
                \index{Epsilon!beta!a}
        beta(b)     \index{Epsilon!beta!b}  beta(c)     \index{Epsilon!beta!c}

        \index{Eta}
    alpha(a)    \index{Eta!alpha}
        alpha(a)    \index{Eta!alpha!a}     alpha(b)    \index{Eta!alpha!b}
        alpha(c)    \index{Eta!alpha!c}     alpha(d)    \index{Eta!alpha!d}
    beta(a)     \index{Eta!beta}
                \index{Eta!beta!a}
        beta(b)     \index{Eta!beta!b}      beta(c)     \index{Eta!beta!c}

    \section{Gamma, Kappa, Lambda, Omega}
        \index{Gama}
    alpha(a)    \index{Gamma!alpha}
        alpha(a)    \index{Gamma!alpha!a}   alpha(b)    \index{Gamma!alpha!b}
        alpha(c)    \index{Gamma!alpha!c}   alpha(d)    \index{Gamma!alpha!d}
    beta(a)     \index{Gamma!beta}
                \index{Gamma!beta!a}
        beta(b)     \index{Gamma!beta!b}    beta(c)     \index{Gamma!beta!c}

        \index{Kappa}
    alpha(a)    \index{Kappa!alpha}
        alpha(a)    \index{Kappa!alpha!a}   alpha(b)    \index{Kappa!alpha!b}
        alpha(c)    \index{Kappa!alpha!c}   alpha(d)    \index{Kappa!alpha!d}
    beta(a)     \index{Kappa!beta}
                \index{Kappa!beta!a}
        beta(b)     \index{Kappa!beta!b}    beta(c)     \index{Kappa!beta!c}

        \index{Lambda}
    alpha(a)    \index{Lambda!alpha}
        alpha(a)    \index{Lambda!alpha!a}  alpha(b)    \index{Lambda!alpha!b}
        alpha(c)    \index{Lambda!alpha!c}  alpha(d)    \index{Lambda!alpha!d}
    beta(a)     \index{Lambda!beta}
                \index{Lambda!beta!a}
        beta(b)     \index{Lambda!beta!b}   beta(c)     \index{Lambda!beta!c}

        \index{Omega}
    alpha(a)    \index{Omega!alpha}
        alpha(a)    \index{Omega!alpha!a}   alpha(b)    \index{Omega!alpha!b}
        alpha(c)    \index{Omega!alpha!c}   alpha(d)    \index{Omega!alpha!d}
    beta(a)     \index{Omega!beta}
                \index{Omega!beta!a}
        beta(b)     \index{Omega!beta!b}    beta(c)     \index{Omega!beta!c}

    \section{Pi, Phi, Psi, Rho}
        \index{Pi}
    alpha(a)    \index{Pi!alpha}
        alpha(a)    \index{Pi!alpha!a}      alpha(b)    \index{Pi!alpha!b}
        alpha(c)    \index{Pi!alpha!c}      alpha(d)    \index{Pi!alpha!d}
    beta(a)     \index{Pi!beta}
                \index{Pi!beta!a}
        beta(b)     \index{Pi!beta!b}       beta(c)     \index{Pi!beta!c}

        \index{Phi}
    alpha(a)    \index{Phi!alpha}
        alpha(a)    \index{Phi!alpha!a}     alpha(b)    \index{Phi!alpha!b}
        alpha(c)    \index{Phi!alpha!c}     alpha(d)    \index{Phi!alpha!d}
    beta(a)     \index{Phi!beta}
                \index{Phi!beta!a}
        beta(b)     \index{Phi!beta!b}      beta(c)     \index{Phi!beta!c}

        \index{Psi}
    alpha(a)    \index{Psi!alpha}
        alpha(a)    \index{Psi!alpha!a}     alpha(b)    \index{Psi!alpha!b}
        alpha(c)    \index{Psi!alpha!c}     alpha(d)    \index{Psi!alpha!d}
    beta(a)     \index{Psi!beta}
                \index{Psi!beta!a}
        beta(b)     \index{Psi!beta!b}      beta(c)     \index{Psi!beta!c}

        \index{Rho}
    alpha(a)    \index{Rho!alpha}
        alpha(a)    \index{Rho!alpha!a}     alpha(b)    \index{Rho!alpha!b}
        alpha(c)    \index{Rho!alpha!c}     alpha(d)    \index{Rho!alpha!d}
    beta(a)     \index{Rho!beta}
                \index{Rho!beta!a}
        beta(b)     \index{Rho!beta!b}      beta(c)     \index{Rho!beta!c}

    \section{Sigma, Theta, Xi}
        \index{Sigma}
    alpha(a)    \index{Sigma!alpha}
        alpha(a)    \index{Sigma!alpha!a}   alpha(b)    \index{Sigma!alpha!b}
        alpha(c)    \index{Sigma!alpha!c}   alpha(d)    \index{Sigma!alpha!d}
    beta(a)     \index{Sigma!beta}
                \index{Sigma!beta!a}
        beta(b)     \index{Sigma!beta!b}    beta(c)     \index{Sigma!beta!c}

    \index{Theta}
    alpha(a)    \index{Theta!alpha}
        alpha(a)    \index{Theta!alpha!a}   alpha(b)    \index{Theta!alpha!b}
        alpha(c)    \index{Theta!alpha!c}   alpha(d)    \index{Theta!alpha!d}
    beta(a)     \index{Theta!beta}
                \index{Theta!beta!a}
        beta(b)     \index{Theta!beta!b}    beta(c)     \index{Theta!beta!c}

    \index{Xi}
    alpha(a)    \index{Xi!alpha}
        alpha(a)    \index{Xi!alpha!a}      alpha(b)    \index{Xi!alpha!b}
        alpha(c)    \index{Xi!alpha!c}      alpha(d)    \index{Xi!alpha!d}
    beta(a)     \index{Xi!beta}
                \index{Xi!beta!a}
        beta(b)     \index{Xi!beta!b}       beta(c)     \index{Xi!beta!c}


    \backmatter
    \begin{adjmulticols}{1}{0mm}{-\marginwidth}\Large
        \printindex
    \end{adjmulticols}
    \end{document}
  • No idea, but you also get into problems just using book it will not even compile, so I'm guessing that the two packages really do not like each other. On the other hand, I do not quite understand what you are trying to do. – daleif Jan 10 '14 at 14:45
  • @daleif I like to have index in three columns. For it i need wider text width as it is defined for main text in book, consequently i select adjmulticol and idxlayout to do this. Since I'm new to make an index, I don't know for other possibilities (after reading SE as well manuals for memoir and MakeIndex. Any idea how to achieve this on anothe way, is welcome – Zarko Jan 10 '14 at 15:20
2

My idxlayout package redefines the theindex environment so that it uses a multicols environment. You enclose \printindex within an adjmulticols environment (as I understand, a modified multicols), which results in nested (adj)multicols environments. The missing page break seems to indicate that nesting these environments is not supported.

I'm not sure what exactly you want to achieve -- you define a new length \marginwidth, but never change it from its default value of 0pt. I also suspect that changing the margins mid-document (immediately before \printindex) is the proper solution for whatever you want and also possible with memoir-specific means. However, here's a somewhat hacky solution: We can patch the theindex environment (as redefined by idxlayout) so that multicols is replaced with adjmulticols (plus the parameters required by the latter environment).

    \documentclass[twoside,openright]{memoir}
\setstocksize{297mm}{210mm}                                 % A4
    \settrimmedsize{\stockheight}{\stockwidth}{*}           % A4
\newlength{\marginwidth}
    \settypeblocksize{247mm}{120mm}{*}
    \setulmargins{25mm}{*}{1}           % upper, lower margin, ratio
    \setlrmarginsandblock{30mm}{60mm}{*}% spinner, outer margin, ratio
\checkandfixthelayout
    \setlength{\marginparwidth}{45mm}
    \setlength{\marginparsep}{5mm}
\usepackage{adjmulticol}
\usepackage[columns=3]{idxlayout}
\renewcommand*{\indexfont}{\Large}% \indexfont is defined by idxlayout
\makeindex

% \usepackage{etoolbox}% already loaded by idxlayout
\makeatletter
\patchcmd{\theindex}{%
  \begin{multicols}{\theidxcols}%
}{%
  \begin{adjmulticols}{\theidxcols}{0mm}{-\marginwidth}%
}{}{}
\patchcmd{\endtheindex}{%
  \end{multicols}%
}{%
  \end{adjmulticols}%
}{}{}
\makeatother

\begin{document}
    \mainmatter
\chapter{Test of indexing}   
    \index{Alpha}
alpha(a)    \index{Alpha!alpha}
    alpha(a)    \index{Alpha!alpha!a}   alpha(b)    \index{Alpha!alpha!b}
    alpha(c)    \index{Alpha!alpha!c}   alpha(d)    \index{Alpha!alpha!d}
beta(a)     \index{Alpha!beta}
            \index{Alpha!beta!a}
    beta(b)     \index{Alpha!beta!b}    beta(c)     \index{Alpha!beta!c}

\section{Beta, Delta, Epsilon, Eta}
    \index{Beta}
alpha(a)    \index{Beta!alpha}
    alpha(a)    \index{Beta!alpha!a}    alpha(b)    \index{Beta!alpha!b}
    alpha(c)    \index{Beta!alpha!c}    alpha(d)    \index{Beta!alpha!d}
beta(a)     \index{Beta!beta}
            \index{Beta!beta!a}
    beta(b)     \index{Beta!beta!b}     beta(c)     \index{Beta!beta!c}

    \index{Delta}
alpha(a)    \index{Delta!alpha}
    alpha(a)    \index{Delta!alpha!a}   alpha(b)    \index{Delta!alpha!b}
    alpha(c)    \index{Delta!alpha!c}   alpha(d)    \index{Delta!alpha!d}
beta(a)     \index{Delta!beta}
            \index{Delta!beta!a}
    beta(b)     \index{Delta!beta!b}    beta(c)     \index{Delta!beta!c}

    \index{Epsilon}
alpha(a)    \index{Epsilon!alpha}
    alpha(a)    \index{Epsilon!alpha!a} alpha(b)    \index{Epsilon!alpha!b}
    alpha(c)    \index{Epsilon!alpha!c} alpha(d)    \index{Epsilon!alpha!d}
beta(a)     \index{Epsilon!beta}
            \index{Epsilon!beta!a}
    beta(b)     \index{Epsilon!beta!b}  beta(c)     \index{Epsilon!beta!c}

    \index{Eta}
alpha(a)    \index{Eta!alpha}
    alpha(a)    \index{Eta!alpha!a}     alpha(b)    \index{Eta!alpha!b}
    alpha(c)    \index{Eta!alpha!c}     alpha(d)    \index{Eta!alpha!d}
beta(a)     \index{Eta!beta}
            \index{Eta!beta!a}
    beta(b)     \index{Eta!beta!b}      beta(c)     \index{Eta!beta!c}

\section{Gamma, Kappa, Lambda, Omega}
    \index{Gama}
alpha(a)    \index{Gamma!alpha}
    alpha(a)    \index{Gamma!alpha!a}   alpha(b)    \index{Gamma!alpha!b}
    alpha(c)    \index{Gamma!alpha!c}   alpha(d)    \index{Gamma!alpha!d}
beta(a)     \index{Gamma!beta}
            \index{Gamma!beta!a}
    beta(b)     \index{Gamma!beta!b}    beta(c)     \index{Gamma!beta!c}

    \index{Kappa}
alpha(a)    \index{Kappa!alpha}
    alpha(a)    \index{Kappa!alpha!a}   alpha(b)    \index{Kappa!alpha!b}
    alpha(c)    \index{Kappa!alpha!c}   alpha(d)    \index{Kappa!alpha!d}
beta(a)     \index{Kappa!beta}
            \index{Kappa!beta!a}
    beta(b)     \index{Kappa!beta!b}    beta(c)     \index{Kappa!beta!c}

    \index{Lambda}
alpha(a)    \index{Lambda!alpha}
    alpha(a)    \index{Lambda!alpha!a}  alpha(b)    \index{Lambda!alpha!b}
    alpha(c)    \index{Lambda!alpha!c}  alpha(d)    \index{Lambda!alpha!d}
beta(a)     \index{Lambda!beta}
            \index{Lambda!beta!a}
    beta(b)     \index{Lambda!beta!b}   beta(c)     \index{Lambda!beta!c}

    \index{Omega}
alpha(a)    \index{Omega!alpha}
    alpha(a)    \index{Omega!alpha!a}   alpha(b)    \index{Omega!alpha!b}
    alpha(c)    \index{Omega!alpha!c}   alpha(d)    \index{Omega!alpha!d}
beta(a)     \index{Omega!beta}
            \index{Omega!beta!a}
    beta(b)     \index{Omega!beta!b}    beta(c)     \index{Omega!beta!c}

\section{Pi, Phi, Psi, Rho}
    \index{Pi}
alpha(a)    \index{Pi!alpha}
    alpha(a)    \index{Pi!alpha!a}      alpha(b)    \index{Pi!alpha!b}
    alpha(c)    \index{Pi!alpha!c}      alpha(d)    \index{Pi!alpha!d}
beta(a)     \index{Pi!beta}
            \index{Pi!beta!a}
    beta(b)     \index{Pi!beta!b}       beta(c)     \index{Pi!beta!c}

    \index{Phi}
alpha(a)    \index{Phi!alpha}
    alpha(a)    \index{Phi!alpha!a}     alpha(b)    \index{Phi!alpha!b}
    alpha(c)    \index{Phi!alpha!c}     alpha(d)    \index{Phi!alpha!d}
beta(a)     \index{Phi!beta}
            \index{Phi!beta!a}
    beta(b)     \index{Phi!beta!b}      beta(c)     \index{Phi!beta!c}

    \index{Psi}
alpha(a)    \index{Psi!alpha}
    alpha(a)    \index{Psi!alpha!a}     alpha(b)    \index{Psi!alpha!b}
    alpha(c)    \index{Psi!alpha!c}     alpha(d)    \index{Psi!alpha!d}
beta(a)     \index{Psi!beta}
            \index{Psi!beta!a}
    beta(b)     \index{Psi!beta!b}      beta(c)     \index{Psi!beta!c}

    \index{Rho}
alpha(a)    \index{Rho!alpha}
    alpha(a)    \index{Rho!alpha!a}     alpha(b)    \index{Rho!alpha!b}
    alpha(c)    \index{Rho!alpha!c}     alpha(d)    \index{Rho!alpha!d}
beta(a)     \index{Rho!beta}
            \index{Rho!beta!a}
    beta(b)     \index{Rho!beta!b}      beta(c)     \index{Rho!beta!c}

\section{Sigma, Theta, Xi}
    \index{Sigma}
alpha(a)    \index{Sigma!alpha}
    alpha(a)    \index{Sigma!alpha!a}   alpha(b)    \index{Sigma!alpha!b}
    alpha(c)    \index{Sigma!alpha!c}   alpha(d)    \index{Sigma!alpha!d}
beta(a)     \index{Sigma!beta}
            \index{Sigma!beta!a}
    beta(b)     \index{Sigma!beta!b}    beta(c)     \index{Sigma!beta!c}

\index{Theta}
alpha(a)    \index{Theta!alpha}
    alpha(a)    \index{Theta!alpha!a}   alpha(b)    \index{Theta!alpha!b}
    alpha(c)    \index{Theta!alpha!c}   alpha(d)    \index{Theta!alpha!d}
beta(a)     \index{Theta!beta}
            \index{Theta!beta!a}
    beta(b)     \index{Theta!beta!b}    beta(c)     \index{Theta!beta!c}

\index{Xi}
alpha(a)    \index{Xi!alpha}
    alpha(a)    \index{Xi!alpha!a}      alpha(b)    \index{Xi!alpha!b}
    alpha(c)    \index{Xi!alpha!c}      alpha(d)    \index{Xi!alpha!d}
beta(a)     \index{Xi!beta}
            \index{Xi!beta!a}
    beta(b)     \index{Xi!beta!b}       beta(c)     \index{Xi!beta!c}

\backmatter

\printindex

\end{document}
  • this works! Now I see, that when i extract given mwe from my real case, I unfortunately skip three lines which use \marginwidth for calculation of \headwidth and other items in my real case, and why i actually tray to solve my index with nesting of adjmulticol and idxlayout. i edit my question, where i added missing lines an i also add this lines to your answer. Your solution works as i expected also with those added lines! – Zarko Jan 10 '14 at 19:20

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.