1

I write a paper with the LaTeX LNCS template. The paper should have specified number of pages. So, I need to put the bibliography section on the same page as the table of contents. I searched and trid different ways, but I can not figure out how to make this happen.

The biblography part looks like

\renewcommand\bibname{References}
\begin{thebibliography}{5}
 %
 \bibitem{t1}
 \end{thebibliography}
 \end{document}

Here are the packages I use:

\usepackage{makeidx}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{amssymb} 
\usepackage[T1]{fontenc}
\usepackage{float}
\usepackage[nottoc,notlof,notlot]{tocbibind} 
8
  • 2
    Please show us an MWE of how your document looks like. You may also want to show us where you got the template from.
    – moewe
    Jan 21, 2017 at 16:03
  • 1
    Welcome to TeX.SX! Can you please add a minimal example of the code you have?
    – egreg
    Jan 21, 2017 at 16:03
  • I added the bibliography part. Jan 21, 2017 at 16:07
  • I use sharelatex site and using this site LNCS template Jan 21, 2017 at 16:08
  • 1
    Unfortunately, this is not really a full MWE, have a look at the link in my first comment to see how to create a helpful MWE for us. I have retagged your question, since the code you showed us suggests you are not using the package biblatex.
    – moewe
    Jan 21, 2017 at 16:11

1 Answer 1

1

In the template that ShareLaTeX offers the bibliography section is done by hand in the end. I think this isn't really necessary here. Unless you are not bound to it you could use the canonical \bibliographystyle-\bibliography pair and define a custom toc macro which temporarilly disables clearpage:

\newcommand\TOCwithBibliography[2][plain]{%
  \begingroup
    \let\clearpage\relax
    \tableofcontents
    \vspace{2em}
    \bibliographystyle{#1}
    \bibliography{#2}
  \endgroup
  \clearpage
}

Then use \TOCwithBibliography[<bib style>]{<bib file>} at the point your contents+bibliography page should be printed. Of course you could also hard-code the bib style and the bib file information like

...
    \vspace{2em}
    \bibliographystyle{plain}% or whatever style
    \bibliography{testbib}% name of your .bib file
  \endgroup
...

But I don't think this is necessarily better.

Complete Example

using llncs.cls v2.6

% arara: pdflatex
% arara: bibtex
% arara: pdflatex
% arara: pdflatex
\RequirePackage{filecontents}
\begin{filecontents}{testbib.bib}
  @article{test123,
    author  = {Rufus Dufus},
    title   = {Some article},
    journal = {Some journal},
    year    = {2017}
 }
\end{filecontents}

\documentclass{llncs}

\usepackage{makeidx}
\usepackage{natbib}
\usepackage{graphicx}
\usepackage{amssymb} 
\usepackage[T1]{fontenc}
\usepackage{float}
%\usepackage[nottoc,notlof,notlot]{tocbibind} 

\newcommand\TOCwithBibliography[2][plain]{%
  \begingroup
    \let\clearpage\relax
    \tableofcontents
    \vspace{2em}
    \bibliographystyle{#1}
    \bibliography{#2}
  \endgroup
  \clearpage
}

\begin{document}
\frontmatter
\TOCwithBibliography{testbib}
\nocite{*}
\pagestyle{headings}
\chapter{foo}
\chapter{bar}
\chapter{baz}
\end{document}

Output

example_rendered

Addendum

Note that in the complete example I commented out the tocbibind package as it is quite strange to force the bibliography into the TOC when it is on the same page.

Moreover the alternative approach I showed above may come in handy if you want to redefine \tableofcontents (if you want to keep the markup untouched):

\let\oldtoc\tableofcontents
\renewcommand\tableofcontents{%
  \begingroup
    \let\clearpage\relax
    \oldtoc
    \vspace{2em}
    \bibliographystyle{plain}
    \bibliography{yourbibfile}
  \endgroup
  \clearpage
}

Lastly you might want to be aware of this question which deals with forcing the TOC onto one page.

1
  • @JachobTailor -- wow, I would have been fine if I just saved your document. :)
    – Ruben
    Jan 21, 2017 at 20:21

You must log in to answer this question.

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