0

i would like to omit the bibliography page number from the TOC, i am using memoirclass and biblatexpackage for bibliography. why i want that, because i uncounted the page numbers and now it shows a wrong page number. Thanks

    \documentclass[french,12pt,oneside,openright]{memoir}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[a4paper]{geometry}
\usepackage[french]{babel} %langue francaise
\usepackage{graphicx,xcolor}%insertion d'images
\usepackage{titlesec}
\graphicspath{{Annexes/images/}} %directory of the images
\usepackage{lipsum} %paragraphes prédéfinis
%\usepackage{fancyhdr} %decoration des en tetes
\usepackage[sonny]{fncychap}
\usepackage{verbatim}
\usepackage{usnomencl}%pour la nomenclature
\usepackage{nomencl}
\usepackage{pgfplots}
\usepackage{titlesec, blindtext, color}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}
\usepackage{multirow,array}
%\usepackage{longtable}%pour la liste des symbole en format tableau
%\usepackage{SIstyle} %Pour les unités dans la liste des symboles
%\usepackage{SIunits}
\usepackage{tabu}
\usepackage{siunitx}
\usepackage{tocloft} %costumize the list of...
\usepackage{amssymb}
\usepackage{amsmath} %add mathematic symbols
\usepackage{caption}  %for tables andfigures
\usepackage{subcaption} %add many sub (tables/figures) with the same caption
%\usepackage{biblatex}
%\addbibresource{references.bib}
\usepackage{chemfig}
\renewcommand*\printatom[1]{\ensuremath{\mathsf{#1}}}
\usepackage{tikz}
\usepackage{hyperref} %add a hyperlink to the contents
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{setspace}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepgfplotslibrary{groupplots}
\usetikzlibrary{matrix,positioning}
\usepgfplotslibrary{dateplot}
\pgfplotsset{compat=newest}
\usepackage{datetime}
\newdate{date}{00}{06}{2015}
\date{}
%\linespread{1.5}
\usepackage[backend=bibtex,style=numeric]{biblatex}
\addbibresource{WALID.bib}
\usepackage{vmargin}
\setmarginsrb           { 1.5in}  % left margin
                        { 0.6in}  % top margin
                        { 1.0in}  % right margin
                        { 0.8in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep
\raggedbottom
\aliaspagestyle{part}{empty}
\renewcommand{\printpartname}{}
\renewcommand{\partnamenum}{}
\renewcommand{\printpartnum}{}
\usepackage{booktabs}
\usepackage{chemmacros}
\usepackage{chemformula}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% PART PART PART%
%\setlength\epigraphwidth{\textwidth}
%\titleformat{\part}[display]
 % {\normalfont\huge\filcenter\bfseries\thispagestyle{epigraph}}{Partie\ \thepart}{20pt}{\Huge}
%\titlespacing*{\part} 
 % {0pt}{0pt}{40pt}
\renewcommand\partnumberlinebox[2]{#2\hspace{1em}}
 \makenomenclature

and to print the bibliography i use this

    \addtocontents{toc}{\protect\contentsline{chapter}{\protect\hyperlink{bibtoc}{\bibname}}{}{}}
\renewcommand{\bibsetup}{\thispagestyle{empty}\pagestyle{empty}}
\printbibliography
  • Is hyperref important or do you not use that package? Fiddling around with the page numbering is always dangerous – user31729 Jun 6 '15 at 16:53
  • Sorry, this preamble is a mess. hyperref should be the last package in almost any case. And if I use your preamble, and my answer below, I just get one ToC entry for the bibliography, not two of them – user31729 Jun 6 '15 at 21:18
1

The memoir class has the switch macros bibintoc and \nobibintoc. Default is to add the bibliography to the ToC. Using \nobibintoc will prevent this completely, so one has to add it manually, dropping the page number with a \addtocontents{\contentsline{...} (see code

If hyperref is involved, the manual addition will suppress the automatic hyperlinking, so this has to shifted too.

\documentclass{memoir}
\usepackage[backend=biber]{biblatex}

\usepackage{hyperref}


\begin{filecontents}{mybiblo.bib}
  @article{MBBL2014,
    author = {Ministeriet for by Bolig og Landdistrikter},
    title = {{Matriklens Udvidelse}},
    url = {http://grunddata-ejendom-adresse.dk/matriklens\_udvidelse},
    urldate = {2015-04-20},
    year = {2014} 
  }
\end{filecontents}


\addbibresource{mybiblo.bib}

\usepackage{blindtext}



\begin{document}
\tableofcontents
\blinddocument

\cite{MBBL2014}


\nobibintoc
\clearpage
\hypertarget{bibtoc}{}%
\addtocontents{toc}{\protect\contentsline{chapter}{\protect\hyperlink{bibtoc}{\bibname}}{}{}}
\printbibliography


\end{document}
  • I'll try to provide a solution with \bibsection command. – user31729 Jun 6 '15 at 16:57
  • thanks now i have the bibliography without the page number but now i have two bibliographies ( W and W/O page number). What about bibsection? – Hamza.w Jun 6 '15 at 17:13
  • 1
    @Hamza.w: Why do yo have two bibs there? Please show your preamble, otherwise I can't say anything – user31729 Jun 6 '15 at 17:19
  • When i add your code, indeed i have a bibliography without the page number, but when i put \printbibliography it adds the second bibliography with page number, i am confused – Hamza.w Jun 7 '15 at 18:38
  • Do you have \nobibintoc as I in my code? – user31729 Jun 7 '15 at 18:44

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.