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 want my text to appear right after the call to \subsection{Name} but I can't find how to do it. I'm using the article class.

An example of command:

\subsection{a)} Blah blah bla...

produces:

a)

Blah blah bla...

instead of what I want:

a) Blah blah bla...

Anything I could do?

share|improve this question

migrated from stackoverflow.com Jan 31 '12 at 16:15

This question came from our site for professional and enthusiast programmers.

    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Jan 31 '12 at 16:42

3 Answers 3

up vote 13 down vote accepted

Your specific example can be solved by using the enumerate environment (as mentioned by elcelista), but your general question can be answered by using the titlesec package. The titlesec package defines the \titleformat command which allows any sectioning command to be easily redefined. The syntax of the \titleformat command is

\titleformat{command}[shape]{format}{label}{sep}{before}[after]

To eliminate the newline after a subsection heading, put the following in the preamble for your document:

\titleformat{\subsection}[runin]{}{}{}{}[]

Here is an example document and its output:

\documentclass{article}
\usepackage{titlesec}
\titleformat{\subsection}[runin]{}{}{}{}[]

\begin{document}
\subsection*{a)}
Blah blah bla...
\end{document}

Output of titlesec example

share|improve this answer
    
Thanx a lot, this is exactly what I was looking for :) I formated the subsection's name to bold with: \titleformat{\subsection}[runin]{\bfseries}{}{}{}[] –  big_gie Sep 25 '09 at 14:41

I don't know of any way to do that with (sub)section headings, but have you considered the enumerate environment? If you're trying to make an ordered list, you can do:

\renewcommand{\labelenumi}{\alph{enumi})}
\begin{enumerate}
  \item Blah blah bla...
  \item Next one
  \item etc.
\end{enumerate}

and you would get something like

a) Blah blah bla...

b) Next one

c) etc.

share|improve this answer
    
I did and I was using this before, but I needed a TOC entry, so wanted to keep (sub)subsections. –  big_gie Sep 25 '09 at 14:42
    
You can also add a TOC entry anywhere you want with something like \addcontentsline{toc}{subsection}{Name} –  elcelista Sep 25 '09 at 20:59

I'm not entirely sure that I understand you problem. I am assuming that your a) is meant to be the subsection numbering, and that "Blah blah blah" is mean to be the title, and that you have not exhibited the text of the subsection at all.

Subsection are numbered (lettered?) automatically, the argument is the title:

 \subsection{Blah blah blah}
 Then the text of the subsection...

will generate something like:

3.1 Blah blah blah

Then the text of the subsection...

where the c)

To change the formatting of the subsection header, you either hack the class definition or choose a more flexible class (like memoir).

share|improve this answer

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.