LyXLet Bibliography appear in ToC

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
light-blue
Posts: 1
Joined: Wed Aug 08, 2012 10:46 pm

Let Bibliography appear in ToC

Post by light-blue »

Hello all,

I'm a newbie of LaTeX and LyX. I love LyX, but recently I've faced a problem and couldn't have found a working solution for that.

I have to add my bibliography to table of content, but no solution has worked for me. Here is the official page of LyX about that:

http://wiki.lyx.org/FAQ/TOC#bibtotoc

I don't understand this:
If you use a KOMA class: use the document option liststotoc
Else: use the package tocbibind from CTAN:/, i.e. \usepackage{tocbibind}
If you use \usepackage[nottoc]{tocbibind} instead, the toc will not show up in the toc.
I don't know many idioms and expressions about LyX and LaTeX. Could anybody please help me on how can I add the bibliography to the ToC in a very easy step?

(PS: I've added my bibliography by the drop-down menu, top left of LyX IDE.)

thanks in advance

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Boersma
Posts: 21
Joined: Mon Nov 22, 2010 9:29 pm

Let Bibliography appear in ToC

Post by Boersma »

You can fix this by the command: \addcontentsline{toc}{<depth>}{<name>}
where the <depth> is the depth of the entry, like section, chapter, subsubsection, etc.
<name> should be in your case something like "Bibliography"

This will do the job.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10321
Joined: Mon Mar 10, 2008 9:44 pm

Let Bibliography appear in ToC

Post by Stefan Kottwitz »

Hi Boersma,

it's great that you post answers to still open questions, thanks!

Perhaps the poster doesn't know much about ERT (LaTeX in LyX) yet, so I guess tocbibind would be the easiest option. He just doesn't need to know how to add the package:
  • In the LyX main menu, open Document and the sub menu Settings.
  • A dialog windows opens. On the left side, choode "LaTeX Preamble".
  • In the edit field on the right side, add

    Code: Select all

    \usepackage{tocbibind}
preamble.png
preamble.png (43.99 KiB) Viewed 9838 times
Whenever you read that you may need to add a LaTeX package, this is a way. In this LaTeX preamble, further document wide settings can be specified, so it's good to know this way in LyX.

Stefan
LaTeX.org admin
Post Reply