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've got an issue related to table of contents. I want a horizontal line before each section, so I put

    \renewcommand{\cftsecfont}{
\hline
%other stuff that I need
}

This is perfect in terms of what I see, but I get a warning because (I guess) the compiler expects to find \hline within a table. So I replaced it with

line(1,0){length}

The problem now is that if length is long enough (I need the line to arrive on top of the page number), I get an overfull hbox.

Any idea? I already searched related problems with no luck.

share|improve this question
    
Welcome to TeX.sx! –  Papiro Jul 3 '13 at 12:49
    
Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  mafp Jul 3 '13 at 13:07

1 Answer 1

You are providing only spare information. However I guess you are looking for \hrulefill. So you modification can be:

\documentclass{article} 
\usepackage{tocloft}
\usepackage{blindtext} 
\renewcommand{\cftsecfont}{\hrulefill\par\nobreak\hskip -\leftskip\bfseries}
\begin{document} 
\tableofcontents
\Blinddocument
\end{document}

enter image description here

share|improve this answer
    
+1 for a really minimum MWE :) –  Harish Kumar Jul 4 '13 at 0:10
    
Thank you that is what I was looking for (I had tried with \hrulefill only without success) –  ALPI Jul 4 '13 at 9:34

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.