Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a weird problem to describe. Please consider the following code:

\documentclass[a4paper,twoside,oldfontcommands,12pt]{memoir}
% \documentclass[a4paper,twoside,oldfontcommands,12pt]{memoir}
%%% A Hack to use amsrefs
\let\bibsection\relax

%%% INCLUDE THE PACKAGES
\usepackage[utf8x]{inputenc}
\usepackage[compact]{titlesec}
\usepackage{a4wide}
\usepackage{graphicx}
\usepackage{amssymb,amsmath,amsthm,amsfonts,amscd,amsrefs}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{calc,graphicx,soul}
\usepackage{enumitem}
 \usepackage[bookmarks=true]{hyperref}
\usepackage{bookmark}

\definecolor{nicered}{rgb}{.0588,.0941,.333}
\setsecheadstyle{\color{nicered}\Large\bfseries\sffamily\raggedright}
\setsubsecheadstyle{\large\bfseries\sffamily\raggedright}
\setsubsubsecheadstyle{\normalsize\bfseries\sffamily\raggedright}

%%%FORMATING FOR CHAPTER
\makeatletter
\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
\sbox\feline@chapter{%
\resizebox{!}{#1}{\fboxsep=1pt%
\colorbox{nicered}{\color{white}\bfseries\sffamily\thechapter}%
}}%
\rotatebox{90}{%
\resizebox{%
\heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
{!}{\scshape\so\@chapapp}}\quad%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][l]{% aka \rlap
\makebox[1cm][r]{\usebox\feline@chapter}%
}}
\makechapterstyle{daleif1}{
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
\renewcommand\chaptitlefont{\normalfont\huge\bfseries\scshape\color{nicered}}
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}
\renewcommand\afterchapternum{\par\vskip\midchapskip}
\renewcommand\printchaptertitle[1]{\chaptitlefont\raggedleft ##1\par}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother
\chapterstyle{daleif1}
%===================================================
\setcounter{secnumdepth}{5}
\captionnamefont{\small\sffamily\bfseries}
\captiontitlefont{\small\sffamily}

\makepagestyle{myruled}
\makeheadrule {myruled}{\textwidth}{2pt}
\makefootrule {myruled}{\textwidth}{2pt}{\footruleskip}
\makeevenhead {myruled}{}{\small\sffamily\leftmark}{}
\makeoddhead {myruled}{}{\small\sffamily\rightmark}{}
\makeevenfoot {myruled}{\small\thepage}{}{}
\makeoddfoot {myruled}{}{}{\small\thepage}
\makeatletter % because of \@chapapp
\makepsmarks{myruled}{
  \nouppercaseheads\createmark{chapter}{both}{shownumber}{
  \@chapapp\ }{.\ }
  \createmark{section}{right}{shownumber}{}{. \ }
  \createmark{subsection}{right}{shownumber}{}{. \ }
  \createmark{subsubsection}{right}{shownumber}{}{. \ }
  \createplainmark {toc}{both} {\contentsname}
  \createplainmark {lof}{both} {\listfigurename}
  \createplainmark {lot}{both} {\listtablename}
  \createplainmark {bib}{both} {\bibname}
  \createplainmark {index}{both} {\indexname}
  \createplainmark {glossary}{both} {\glossaryname}
}
\makeatother
\setsecnumdepth{subsubsection}

\linespread{1.5}
\renewcommand{\arraystretch}{1.0}

%==================================================================================================================

\newcommand{\mar}[1]{\marginpar{\small \it #1}}
\marginparwidth 1 in

\newcounter{cnt1}
\newcounter{cnt2}
\newcommand{\blr}{\begin{list}{$($\roman{cnt1}$)$}
 {\usecounter{cnt1} \setlength{\topsep}{0pt}
 \setlength{\itemsep}{0pt}}}
\newcommand{\bla}{\begin{list}{$(\alph{cnt2})$}
 {\usecounter{cnt2} \setlength{\topsep}{0pt}
 \setlength{\itemsep}{0pt}}}
\newcommand{\el}{\end{list}}


\renewcommand{\biblistfont}{%
  \normalfont
  \normalsize
}

\begin{document}
\pagenumbering{gobble}
\include{cover(mem)}
\cleardoublepage
\include{title(mem)}
\cleardoublepage
\include{dedication(mem)}
\cleardoublepage
% \include{acknowledgement}
% \cleardoublepage
\setcounter{tocdepth}{2}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}
\pagestyle{myruled}
\chapter{Introduction}
\lipsum[1-11]
% \createmark{chapter}{both}{nonumber}{}{}
% \pagenumbering{gobble}
 \chapter*[Bibliography]{}
\begin{bibdiv}
% \pdfbookmark{\bibname}{Bibliography}{}
% \pagenumbering{arabic}
% \setcounter{page}{93}
\begin{biblist}
\bib{Darwin}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin1}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin2}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin3}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin4}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin5}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin6}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin7}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin8}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin9}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin10}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin11}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin12}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin13}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin14}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin15}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }

\end{biblist}
\end{bibdiv}
\end{document}

I realise that this is perhaps not the right way to do it. The problem is

(1) In the code, there is a new chapter (\chapter*) which clears a double page.

(2) Suppose on the contrary, if I get rid of that, I get into trouble in the header and footer.

And, the bookmark for Bibliography is not being created. I solved the problem by using [openany] option and using \cleartorecto as the need may be at the end of chapters (and this solution is manual and does not work if the last non-empty page before Bibliography is an even-numbered page); see the commented out bits of code.

I'd be glad if someone can point me to the right way of doing it.

share|improve this question
1  
not being a user of memoir, this is just a guess. amsrefs provides an environment bibchapter that may be useful, rather than having an explicit call for \chapter*{Bibliography}. not related to this problem, but just a matter of general housekeeping, you're calling for graphicx twice among your \usepackage entries, and if i remember correctly, epsfig is either redundant or obsolete. –  barbara beeton Aug 20 '13 at 18:22
    
now is the time to confess: the code is not mine. I am trying to help someone, although I created the MWE. Anyway, I'll try your suggestion. –  kan Aug 20 '13 at 18:53
    
@barbarabeeton OK! The double page issue disappears! However, the other issues (viz bookmark, header issues) remain. I'd be glad if you could help me with that too! –  kan Aug 20 '13 at 18:58
    
as i said, i'm not a memoir user, so i'm not sure how a lot of things work. i'd have to do quite a bit of research to figure out how headers work, and i suspect others already know how to deal with that. regarding bookmarks, look for documentation on using \pdfbookmark; i think that's what might be involved here. –  barbara beeton Aug 20 '13 at 19:30
    
Is it possible to reproduce the same pagination error with a simple MWE trimming the packages. –  texenthusiast Aug 21 '13 at 2:21
add comment

1 Answer

up vote 2 down vote accepted

For the first problem, as barbara beeton suggested, use the bibchapter environment instead of bibdiv; to recover the proper heading, you can redefine bibchapter to use \bibmark, as in

\makeatletter
\renewenvironment{bibchapter}[1][\bibname]{%
    \begingroup
        \protected@edef\@{%
                \endgroup
            \protect\chapter*{#1}%
            \protect\bib@div@mark{#1}%
        }%
        \@\bibmark
}{\par}
\makeatother

A complete example:

\documentclass[a4paper,twoside,oldfontcommands,12pt]{memoir}
% \documentclass[a4paper,twoside,oldfontcommands,12pt]{memoir}
%%% A Hack to use amsrefs
\let\bibsection\relax

%%% INCLUDE THE PACKAGES
\usepackage[utf8x]{inputenc}
\usepackage[compact]{titlesec}
\usepackage{a4wide}
\usepackage{graphicx}
\usepackage{amssymb,amsmath,amsthm,amsfonts,amscd,amsrefs}
\usepackage{lipsum}
\usepackage{xcolor}
\usepackage{calc,graphicx,soul}
\usepackage{enumitem}
 \usepackage[bookmarks=true]{hyperref}
\usepackage{bookmark}

\definecolor{nicered}{rgb}{.0588,.0941,.333}
\setsecheadstyle{\color{nicered}\Large\bfseries\sffamily\raggedright}
\setsubsecheadstyle{\large\bfseries\sffamily\raggedright}
\setsubsubsecheadstyle{\normalsize\bfseries\sffamily\raggedright}

%%%FORMATING FOR CHAPTER
\makeatletter
\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
\sbox\feline@chapter{%
\resizebox{!}{#1}{\fboxsep=1pt%
\colorbox{nicered}{\color{white}\bfseries\sffamily\thechapter}%
}}%
\rotatebox{90}{%
\resizebox{%
\heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
{!}{\scshape\so\@chapapp}}\quad%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][l]{% aka \rlap
\makebox[1cm][r]{\usebox\feline@chapter}%
}}
\makechapterstyle{daleif1}{
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
\renewcommand\chaptitlefont{\normalfont\huge\bfseries\scshape\color{nicered}}
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}
\renewcommand\afterchapternum{\par\vskip\midchapskip}
\renewcommand\printchaptertitle[1]{\chaptitlefont\raggedleft ##1\par}
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatother
\chapterstyle{daleif1}
%===================================================
\setcounter{secnumdepth}{5}
\captionnamefont{\small\sffamily\bfseries}
\captiontitlefont{\small\sffamily}

\makepagestyle{myruled}
\makeheadrule {myruled}{\textwidth}{2pt}
\makefootrule {myruled}{\textwidth}{2pt}{\footruleskip}
\makeevenhead {myruled}{}{\small\sffamily\leftmark}{}
\makeoddhead {myruled}{}{\small\sffamily\rightmark}{}
\makeevenfoot {myruled}{\small\thepage}{}{}
\makeoddfoot {myruled}{}{}{\small\thepage}
\makeatletter % because of \@chapapp
\makepsmarks{myruled}{
  \nouppercaseheads\createmark{chapter}{both}{shownumber}{
  \@chapapp\ }{.\ }
  \createmark{section}{right}{shownumber}{}{. \ }
  \createmark{subsection}{right}{shownumber}{}{. \ }
  \createmark{subsubsection}{right}{shownumber}{}{. \ }
  \createplainmark {toc}{both} {\contentsname}
  \createplainmark {lof}{both} {\listfigurename}
  \createplainmark {lot}{both} {\listtablename}
  \createplainmark {bib}{both} {\bibname}
  \createplainmark {index}{both} {\indexname}
  \createplainmark {glossary}{both} {\glossaryname}
}
\makeatother
\setsecnumdepth{subsubsection}

\linespread{1.5}
\renewcommand{\arraystretch}{1.0}

%==================================================================================================================

\newcommand{\mar}[1]{\marginpar{\small \it #1}}
\marginparwidth 1 in

\newcounter{cnt1}
\newcounter{cnt2}
\newcommand{\blr}{\begin{list}{$($\roman{cnt1}$)$}
 {\usecounter{cnt1} \setlength{\topsep}{0pt}
 \setlength{\itemsep}{0pt}}}
\newcommand{\bla}{\begin{list}{$(\alph{cnt2})$}
 {\usecounter{cnt2} \setlength{\topsep}{0pt}
 \setlength{\itemsep}{0pt}}}
\newcommand{\el}{\end{list}}


\makeatletter
\renewenvironment{bibchapter}[1][\bibname]{%
    \begingroup
        \protected@edef\@{%
                \endgroup
            \protect\chapter*{#1}%
            \protect\bib@div@mark{#1}%
        }%
        \@\bibmark
}{\par}
\makeatother

\renewcommand{\biblistfont}{%
  \normalfont
  \normalsize
}

\begin{document}
\pagenumbering{gobble}
\include{cover(mem)}
\cleardoublepage
\include{title(mem)}
\cleardoublepage
\include{dedication(mem)}
\cleardoublepage
% \include{acknowledgement}
% \cleardoublepage
\setcounter{tocdepth}{2}
\tableofcontents
\cleardoublepage
\pagenumbering{arabic}
\pagestyle{myruled}
\chapter{Introduction}
\lipsum[1-11]
% \pagenumbering{gobble}
%\chapter*[Bibliography]{}
\begin{bibchapter}
%\begin{bibdiv}
% \pdfbookmark{\bibname}{Bibliography}{}
% \pagenumbering{arabic}
% \setcounter{page}{93}
\begin{biblist}
\bib{Darwin}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin1}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin2}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin3}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin4}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin5}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin6}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin7}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin8}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin9}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin10}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin11}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin12}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin13}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin14}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }
 \bib{Darwin15}{article}{
       author={Darwin, Charles.},   
       title={Elephants, A New Perspective},
        date={1972},
        ISSN={1234},
     journal={Nature},
      volume={90},
       pages={90\ndash 128},
 }

\end{biblist}
%\end{bibdiv}
\end{bibchapter}
\end{document}

An image of the bibliography and the previous pages:

enter image description here

share|improve this answer
    
Thank you for the answer! –  kan Aug 21 '13 at 14:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.