Getting subsection to list in table of contents in LaTeX - latex

I made a table of contents using \tableofcontents Each section is made using \section yet when I do \subsection it is not listed in the table. How do I get it to list there? Thanks.

Which document class are you using? I just tested it for article, and it works fine. In any case, try using this in the preamble:
\setcounter{tocdepth}{2}
Increase 2 if you want to list subsubsection, etc.

Add:
\setcounter{tocdepth}{5}
to the preamble.
See: http://www.devdaily.com/blog/post/linux-unix/latex-setting-table-of-contents-toc-depth

#WhirlWind and #Steve_Tjoa got it and helped me too! One thing though, whatever you set the tocdepth counter to, you may also want to set the secnumdepth.
so i used
\setcounter{tocdepth}{5}
as suggested by #Whirlwind but then the subsubsection in my Table of Contents wasn't numbered. so I added the following to get it to work (thanks to the following link where i found the answer http://www.latex-community.org/viewtopic.php?f=5&t=2351#p9197 )
\setcounter{secnumdepth}{5}

Related

no automatically word wrap with bibliography

I have a problem with my biblatex. My booktitles don't automaticly break lines in my bibliography. Has someone got a hint how to solve this? Is it possible to get an automatic break or do I have to set them manually? And if I so, how do I do that?
Here my biblatex code snippets:
\usepackage[backend=biber,style=authoryear,sorting=nyt,citestyle=authoryear]{biblatex}
\printbibliography[type=book,title={Books}]
See this example at IEEE: after Metrics is a linebreak is missing.
EDIT: I found the solution here
I was curious about the \emph{} style (mine was always underlining). I put a single \normalem in front of the \printbibliography command and it works fine :)
\normalem
\printbibliography[type=book,title={Books}]
Your book titles are underlined, which is preventing line breaks (underlined text doesn't break). I don't think this is a standard behavior, book titles are usually displayed in italics. Perhaps you are using \underline{} inside your bibliography items definitions?

Why Bibliography and References appears in Latex TOC?

I am using these commands for including references:
\addcontentsline{toc}{chapter}{References}
\bibliographystyle{agsm}
\bibliography{dissrefs}
The problem is that in the table of contents both References and Bibliography appear, while I just want one to appear. Why is this happening? Can I customise the table of contents entry to be just one of them?
I am using MikTex 2.8 and TexMaker 2.1.
I dont think that you need to use \addcontentsline{toc} bibtex should do it automatically. At least I don't recall ever needing it...
Have you tried commenting out that line?
Edit regarding OPs comment on changing the title of the bibliography:
The bibliography's title can be changed by (to for instance "New Title") using \renewcommand\refname{New Title} for articles and \renewcommand\bibname{New Title} for books.
Instructions are read and processed in the order they appear, I think your problem is related to that order. Try moving things around (I believe that all settings should be put before \tableofcontents, but I'm not sure about that, I'v not used latex for a long time)

LaTeX: Cite, but don't reference

I'm producing a set of documents in LaTeX, and I would like to provide a single, global bibliography page for the whole set. This is because each document is page-limited: I don't want to take up space with references at the bottom of each one.
This means in each case, I would like to cite in the text, but not produce a reference at the end. I am using bibtex/natbib to handle the referencing.
Simplest example:
\documentclass[]{article}
\bibliographystyle{/usr/share/texmf/bibtex/bst/natbib/plainnat.bst}
\usepackage{natbib}
\begin{document}
In \citet*{MEF2010} I described the method.
\bibliography{bibliography.bib}
\end{document}
How can I do this? Essentially I just want it to cite correctly:
In Bloggs, Blagg and Blog (2010) I described the method.
But not add a references section at the end. Any ideas?
Thanks,
David
Instead of using \bibliography{bibliography.bib} you can try \nobibliography{bibliography.bib}.
You still need to enter the path so it can make the cross-references.
It happens due to missing packages. If you want to resolve the problem then enable the automatic installation packet. After that,First, you run the BibTeX file and generate the Pdf file (instead of pdfLatex file) and then pdfLatex to Pdf

Change "List of Listings" text

I tried to change the "List of Listings" text with the command
\renewcommand*{\lstlistlistingname}{List of XYZ}
before my \begin{document}. What's wrong with this?
By the way
\renewcommand*{\lstlistingname}{NewListing}
worked like a charm.
Edit: No error occurred, just no change in the text. It's still "List of Listings".
By the way this is how I included it:
\pagestyle{scrheadings}
\pagenumbering{Roman}
\pdfbookmark[0]{\contentsname}{Contents}
\tableofcontents
\listoftables
\listoffigures
\listoflistings
\pagestyle{scrheadings}
\pagenumbering{arabic}
I've seen that on the "List of Listings" page the numbering starts with "1" but it should be a "V". Some hints?
Thank you
Use \lstlistoflistings
\listoflistings is from the listing package. \lstlistoflistings is from listings package (Notice the plural). You should not use both at the same time.
If you are using the listing package, use
\renewcommand*{\listlistingname}{List of XYZ}
to change the heading.
EDIT: From the fact that \lstlistingname works I conclude that you use the listings package. I suggest to remove the line \usepackage{listing} from your tex file. If you use both packages: Just use the right commands. Listings from both package appear in both put the entries into the same lol file.
Just tried to change it myself. There is a separate command that provides the name. E.g.:
\renewcommand{\lstlistlistingname}{My listungs}
so both \lstlistingname and \lstlistlistingname need to be changed.
For answering your page numbering question:
Insert a \cleardoublepage just before \pagenumbering{arabic}. That should fix the roman numbering on your List of listings.
Non of above answers worked for me. The commands that solved my issue were:
\renewcommand{\listingscaption}{Code}
\renewcommand{\listoflistingscaption}{List of source code examples}
Note: the commands above are for the Listing package, not for the Listings package!

Annotated Table of Contents in LaTeX

I'd like to use LaTeX's \tableofcontents command (or some equivalent) to automatically generate a table of contents, but I'd also like to add a sentence or two to each line in the table of contents that describes what the referenced section is about. How can I do this?
The tocloft package and its \cftchapterprecistoc command solved my problem.
Try
\addcontentsline{toc}{section}{sample text}
Follwoing Oliver and simon's advice:
You could redefine the sectioning commands to take a second (possibly optional) argument, and use that to build your argument to \addtocontentsline, and then involk the cooresponding section* command.
I expect you can brute force and ignorance something using addcontentsline.
eg:
\addcontentsline{toc}{section}{text}
however, this will conflict with automagically generated lines if you don't use the starred versions of sections it refers to.
Anything more clean will require messing about with the relevant macros....unless I'm missing something.
I would change the {section} part to {subsection}.
\addcontentsline{toc}{subsection}{sample text}

Resources