I am adding a section with the bibliography references by using \addcontentsline in order to add a link to the table of contents. Unfortunately the link in the table of contents links to a wrong page, previous to the page with the bibliography.

\printbibliography[heading=offline,filter=offline]

• How do you define the online heading? – egreg Jan 21 '12 at 14:35
• It's also important to know the document class. – Marco Daniel Jan 21 '12 at 15:27

The \printbibliography command indicates that you're using biblatex. To add bibliographies to the ToC with biblatex (without numbering them), normally one should add the heading=bibintoc option to \printbibliography. See section 3.6.7 of the biblatex manual for details.

As you seem to have defined a custom online heading, you may have to change its definition so that it resembles that of bibintoc (which is tailored to the document class and may be found in biblatex.def).

The following comments can be used more in general.

## The main minimal example

The following example is the basis of the next steps.

\documentclass[]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{biblatex}
\defbibfilter{online}{ type=online }
\defbibfilter{offline}{ not type=online }
\begin{document}
\tableofcontents

\noindent\hrulefill

\section{foo}
\cite{companion} \& \cite{ctan}

\noindent\hrulefill

\printbibliography[filter=offline]

\noindent\hrulefill

\printbibliography[filter=online]

\end{document}


The next image shows the result.

# Suppose you are using a standard class

## First approach -- working with biblatex options

The first approach based on the idea that we only use the option provided by the package biblatex for the command \printbibliograpy.

First of all we want a special name for your heading. This can be done be the option title. So we simple set:

\printbibliography[filter=offline,title=Offline,]

\printbibliography[filter=online,title=Online,]


With this modification we doesn't have an entry in the toc. To provide an entry in the toc we can use the option heading. biblatexoffers different values for this option. Here a small range:

• bibliography:
• unnumbered -- no entry in toc -- chapter level (section for articles)
• subbibliography:
• unnumbered -- no entry in toc -- section level (subsection for articles)
• bibintoc:
• unnumbered -- entry in toc -- chapter level (section for articles)
• subbibintoc:
• unnumbered -- entry in toc -- section level (subsection for articles)
• bibnumbered:
• numbered -- entry in toc -- chapter level (section for articles)
• subbibnumbered:
• numbered -- entry in toc -- section level (subsection for articles)

Based on this information we can expand your examples as follows:

\printbibliography[filter=offline,title=Offline,heading=subbibintoc]

\printbibliography[filter=online,title=Online,subbibintoc]


The example demonstrate the first apprach:

\documentclass[varwidth]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{biblatex}
\defbibfilter{online}{ type=online }
\defbibfilter{offline}{ not type=online }
\begin{document}
\tableofcontents

\noindent\hrulefill

\section{foo}
\cite{companion} \& \cite{ctan}

\noindent\hrulefill
\section{References}

\noindent\hrulefill

\end{document}


In normal cases the standard option should be enough. However you can define your own special heading with the command \defbibheading. The standard syntax is

\defbibheading{⟨name⟩}[⟨title⟩]{⟨code⟩}


The defined heading can be used by the optional argument heading (see above).

We take an example. The heading should be unnumbered but with an entry in the toc:

\defbibheading{myheading}[\bibname]{%
\begin{center}
\hrulefill#1\markboth{#1}{#1}\hrulefill%
\end{center}%
}


Based on these heading in combination with the option title we can create the following example:

\documentclass[varwidth]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{biblatex}
\defbibfilter{online}{ type=online }
\defbibfilter{offline}{ not type=online }
\begin{center}
\hrulefill#1\markboth{#1}{#1}\hrulefill%
\end{center}%
}
\begin{document}
\tableofcontents

\noindent\hrulefill

\section{foo}
\cite{companion} \& \cite{ctan}

\noindent\hrulefill
\section{References}

\end{document}


# Suppose you are using a KOMA class

KOMA provides additional document class options to manipulate the heading of a bibliography. The benefit of this method you can set the option global. All options provided by KOMA are compatible with biblatex. The key of the document class is bibliography. A range of possibilities are listed below. Of course all listed approaches in the above section can be used in combination with KOMA.

• notoc:
• unnumbered -- no entry in toc -- chapter level (section for articles)
• totoc:
• unnumbered -- entry in toc -- chapter level (section for articles)
• totocnumbered:
• numbered -- entry in toc -- chapter level (section for articles)

Based of your main MWE here the modification:

\documentclass[bibliography=totoc]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{csquotes}
\usepackage{biblatex}
\defbibfilter{online}{ type=online }
\defbibfilter{offline}{ not type=online }

\begin{document}
\tableofcontents

\noindent\hrulefill

\section{foo}
\cite{companion} \& \cite{ctan}

\noindent\hrulefill

\printbibliography[filter=offline,title=Offline]

\printbibliography[filter=online,title=Online]

\end{document}


# Suppose you are using memoir

This is really simple. memoir creates an entry in the toc as default.

• This is a great answer and should be the accepted one! Also, +1 for the KOMA class section! Helped me a lot! – Christoph90 Apr 22 '16 at 16:11