Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
samirandam
Posts: 7
Joined: Sat Oct 10, 2015 7:47 pm

Dear All,

I want to enclose the "Part" in Table of Contents of a book type document by under and over lines. However, the other texts (such as, chapters, sections, subsections etc.) should remain as it is with default formatting). I am pasting the minimal working code in this post. Could anybody please help me to achieve what I am looking for?

\documentclass{book} \begin{document} \author{Author A and Author B}\title{Book Title}\maketitle \tableofcontents \part{First Part}\chapter{Chapter 1} \end{document}

Tags:

Johannes_B
Site Moderator
Posts: 3644
Joined: Thu Nov 01, 2012 4:08 pm
Hi and welcome,

you can do something like the following:
\documentclass{book} \newcommand{\tocline}{\addtocontents{toc}{\protect\begingroup%	\protect\centering\protect\huge\protect\rule{.8\textwidth}{.6pt}\protect\par\protect\endgroup}}\begin{document}  \tableofcontents \tocline\part{First Part}\tocline\chapter{Chapter 1}\part{Second Part}\chapter{Chapter 2}\part{Third Part}\chapter{Chapter 3} \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

samirandam
Posts: 7
Joined: Sat Oct 10, 2015 7:47 pm
Hi Johannes_B,

Thank you. The solution you provided is working fine with minor modification according to my requirement. I changed \huge to \small to reduce the gap.

Thank you once again.

Thanks
Samiran
Last edited by Stefan Kottwitz on Sun Oct 11, 2015 11:29 am, edited 1 time in total.
Reason: typo, code marked

Stefan Kottwitz
Posts: 8708
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi Samiran,

welcome to the forum!

Nice to see that Johannes could provide a solution. By the way, I prefer the scrbook class over book, as it is much more flexible. We can even make headings with a colored background there.

Let us know if there would be further challenges with writing such a larger book like document. I'm always interested in how good or hard is LaTeX for us users.

Stefan

samirandam
Posts: 7
Joined: Sat Oct 10, 2015 7:47 pm
Hi Stefan,

It is very nice to be greeted into the group and thanks for your thoughtful suggestion.

Actually, I am writing a book based on Springer's svmono (http://resource-cms.springer.com/spring ... monographs) document class. So, according to your suggestion, it is not possible for me to use standard class like scrbook.

Ever since I started preparing my academic documents in LaTeX, I have been using BibTeX to produce bibliographies for all of my documents (thesis, papers, technical documents, etc.). And this way it used to generate the bibliography at the end of the document either in form of a chapter (in case of Thesis) or in form of a section (in case of paper). However, with my current assignment, I need to include the Reference section at the end of each chapter. I have a single ref.bib file which contains all of the references. Now I want to use that ref.bib and Springer's bibliography style file (spmpsci.bst) to generate separate reference section at the end of each chapter. Could you please help me out?

Thanks
SAMIRAN.

P.S. If required I shall create a different thread for this question.

Johannes_B
Site Moderator
Posts: 3644
Joined: Thu Nov 01, 2012 4:08 pm
A new thread will indeed be good, it is easier for others to find solutions using google.

A little remark: Springer has a quite strict layout, i think you are not allowed to add lines to the toc.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

Stefan Kottwitz
Posts: 8708
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi Samiran,

sounds like chapterbib or bibunits would be good for that case.

Stefan

samirandam
Posts: 7
Joined: Sat Oct 10, 2015 7:47 pm
Hi Stefan,

I have created a separate thread (viewtopic.php?f=44&t=26793). Could you please provide me a step-by-step guide. Actually I am not sure about the series of commands that have to executed in order to generate the PDF having chapter-wise reference list.

Hi Johannes,

Thank you for your suggestion. I didn't know it. I saw one of the books from Springer which has this type formatting in TOC which provide a very clear segregation between the different parts in ToC. So I thought of implementing the same in my write-up.

Thanks
Samiran.