Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am working with the book document class and want to create something like this. Moreover, in the Table of Contents I want the "Part" to be under- and over-lined and not to be numbered. I think of using the \part command but don't know how to do this. Any help will be highly appreciated.

Part I

  1. Introduction.......... 1
  2. Main results ......... 15
share|improve this question
    
Could you elaborate a bit more as I'm not quite sure what your question is about. Is it a technical question about how to achieve the example TOC you give or is it more a design question? –  Benedikt Bauer Feb 22 '13 at 19:23
    
Welcome to TeX.sx! Have a look at the tocloft package to design your Table of Contents. –  mafp Feb 22 '13 at 19:26
    
I apologize. Basically, it is about making the \part to have no numbering in the contents page and be over and underlined –  john Feb 22 '13 at 19:26

1 Answer 1

up vote 0 down vote accepted

Hey this should get the job done. I would like to work on one thing, however.

  1. Distance between upper line on part entry and lower entry should be exactly equal and easily changed.

I will update this code when I find a better solution.

\documentclass{book}
\usepackage{fontspec}
\usepackage{tocloft}

\renewcommand{\cftpartfont}{\bfseries\Large\hrule}%add line above part
\renewcommand{\cftpartpagefont}{\bfseries}
\renewcommand{\thepart}{}%removes part roman numerals
\renewcommand{\cftbeforepartskip}{5mm}
\renewcommand{\cftpartafterpnum}{\\\hrule}%add line below part
\cftpagenumbersoff{part}%get rid of part page numbers
\renewcommand{\cftpartaftersnumb}{}%disable part number
\renewcommand{\thesection}{\arabic{part}}%add number to section without subnum
\renewcommand{\cftsecaftersnum}{.}%add . after sec #
\renewcommand{\cftsecindent}{8mm}%control spacing between number and sec title
\renewcommand{\cftsecnumwidth}{4mm}%section indent
\renewcommand{\cftparskip}{4mm}%control line spacing

\begin{document}
\tableofcontents
\chapter{Elephants Eating (Chapter)}
\part{Peanuts}
\section{With Shells}
\part{Grass}
\section{Fresh}
\part{Leaves}
\section{From Oak Trees}

\end{document}

Example of Parts with Underlines and Overlines

share|improve this answer
    
nice idea but it creates many errors. Is there any solution combined with the \input{chapter} command ? –  john Feb 24 '13 at 12:28
    
Could you be more specific? What errors? By \input{chapter}, I assume you mean \input{filename}. Whether your files are separate or together, it should not affect the typesetting. Everything gets parsed as one file. Also, I vote up wouldn't hurt for my efforts :) I just gave away 200 points :( –  macmadness86 Feb 24 '13 at 12:59
    
ok, the mistake was mine. I got it working as you suggested. Thanks :P –  john Feb 24 '13 at 13:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.