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 to include an indented, underlined, upper- and lowercase paragraph heading ending with a period in my document instead of using \subsubsection. Anyone who knows how I can define the command for this in LaTeX?

share|improve this question
1  
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  doncherry Aug 15 '12 at 22:47

1 Answer 1

up vote 7 down vote accepted

You can use the titlesec package; the ulem package was used for the underlining:

\documentclass{article}
\usepackage[explicit]{titlesec}
\usepackage{ulem}
\usepackage{lipsum}% just to generate text for the example

\setcounter{secnumdepth}{4}
\titleformat{\paragraph}[runin]
  {\normalfont\normalsize\bfseries}{}{15pt}{\uline{\theparagraph\hspace*{1em}#1.}}
\titleformat{name=\paragraph,numberless}[runin]
  {\normalfont\normalsize\bfseries}{}{15pt}{\uline{#1.}}

\begin{document}

\section{A Section}
\subsection{A Subsection}
\subsubsection{A Subsubection}
\paragraph{A Numbered Paragraph}
\lipsum[2]
\paragraph*{An Unnumbered Paragraph}
\lipsum[2]

\end{document}

enter image description here

share|improve this answer
    
I just noted that when I include the 'explicit' in titlesec package the section/subsection disappears and I end up with something like this 1 or 1.1 instead of '1 A Section' or '1.1 A Subsection' –  Thembi Aug 16 '12 at 6:36
1  
@Thembi when the explicit option is used you need to use explicitly pass the title as #1 in the last mandatory argument, so, for example, instead of just saying \titleformat{\section} {\normalfont\Large\bfseries}{\thesection}{1em}{} you need to use \titleformat{\section} {\normalfont\Large\bfseries}{\thesection}{1em}{#1}. If you experience any problems, please add to your question a minimal, complete example illustrating your problems. –  Gonzalo Medina Aug 16 '12 at 11:58

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.