[texhax] newb question - line after section heading

Uwe Lueck uwe.lueck at web.de
Thu Feb 10 16:28:21 CET 2011


"Joe P King" <jp at joepking.com>, 10.02.2011 08:58:54:
> So I want to have on line between a section heading

It seems you want to have "no line" after a section heading ...

> Instead of
>
>    Section
> 
>    Text
>  
> I want
> 
>    Section
>    Text
>
> \documentclass[letterpaper,12pt]{article} % this must go first, there are many different classes
> \usepackage[american]{babel}
> \usepackage{csquotes}
> \usepackage[style=apa]{biblatex}
> \usepackage{fancyhdr} %Used for headers and footers.
> \usepackage{amsmath} %Must have for writing equations
> \usepackage{setspace}
> \usepackage{parskip}
> \usepackage{graphicx} % accepts png and pdf graphics
> \usepackage{color, soul} % I use this for highlighting. \hl{}
> \usepackage{array}
> \usepackage{dcolumn} % Used to align tables to decimal points. A little complicated
> \usepackage{longtable} % for tables that go beyond a page
> \usepackage{verbatim} %Used for commenting out as well as putting in verbatim notes
> \usepackage{listings} %Similar to Verbatim, can import R code with this package
> %\usepackage{cite} %Used for bibtexB
> \usepackage{wrapfig} % Wrapping text around pictures
> \usepackage[lmargin=1.0in, rmargin=1.0in,tmargin=1.0in,bmargin=1.0in]{geometry}
> \usepackage[small,compact]{titlesec}
> %\bibliography{C:/Users/Joe/Misc/library}
> \usepackage{titlesec}

The previous line is redundant after two lines before.

> %appear.
> %\headheight{15pt}
> \renewcommand\headrulewidth{0pt}
> %\tolerance = 1500 %
> \hyphenpenalty=10000
> \parindent = 0 cm %can adjust this to indent all paragraphs to a certain specification
> \linespread{1}
> \voffset=-.75in
> \pagestyle{fancy} % Determines basic page format; often refers to headers and footers
> %\titleformat{\section}{\normalfont\bfseries\centering}{}{0em}{}
> \titlespacing{\section}{0pt}{-1pt}{0pt}

The titlesec documentation sec. 3.2 suggests to use "smaller", "more negative" values 
in the last argument to make up for \parskip. Your impression that there is "a line"
between section title and the text may arise from the "big" \parskip value coming 
from parskip.sty. The titlesec documentation does address this situation.

> \titleformat{\section}{\normalfont\large\bfseries}{}{1em}{}
> %\titlecontents{chapter}[0pt]
> \DeclareLanguageMapping{american}{american-apa}
> \begin{document}
> \section{Abstract}
> \begin{center}
> stuff
> \end{center}
> stuff
> \newpage
> \end{document}

[redundant:]

You already have \usepackage{titlesec}, even redundantly 
(first with options, then without), so look at the titlesec documentation 
(sorry, I have never used it.) Alternatives to titlesec

    http://ctan.org/pkg/titlesec

I know of are 

    http://ctan.org/pkg/sectsty
    http://ctan.org/pkg/nccsect

HTH -- Uwe.





More information about the texhax mailing list