3

I am trying to use the first bit of code in this answer to use paragraph like a subsubsubsection.

The problem is that there is a conflict with sectsty - without this the output is exactly as in @GonzaloMedina's answer. When I add sectsty the line break between the paragraph title and the following text disappears, as in the image below. How can I reinsert the line break?

sectsty issue

\documentclass{article}

%Sectioning and headings
%------------------------

\usepackage{titlesec}

\usepackage{sectsty}          % put section headings in sans-serif font
\setcounter{secnumdepth}{4}

\titleformat{\paragraph}{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\begin{document}

some text
\section{Section}
some text
\subsection{Subsection}
some text
\subsubsection{Subsubsection}
some text
\paragraph{Paragraph}
some text

\end{document}
4
  • Could provide a link to GonzaloMedina's answer?
    – 1010011010
    Commented Oct 9, 2014 at 12:33
  • @1010011010 I did! In the first line of my question.
    – FionaSmith
    Commented Oct 9, 2014 at 12:35
  • What is my answer missing? I could give you an in-depth expansion process for your macros, but since titlesecs macros are absurdly complicated it will probably not contribute to your understanding...
    – 1010011010
    Commented Oct 11, 2014 at 8:30
  • @1010011010 your answer isn't missing anything - I was just away from the office for a few days doing things in the real world!
    – FionaSmith
    Commented Oct 13, 2014 at 8:23

1 Answer 1

2

With titlesec being the package with the more complicated macros (thus more fail safe switches to determine whether or not a package is loaded), as a rule of thumb I always load these packages at the latest.

The following produces the correct indentation and a line break:

http://i.imgur.com/qy2M339.png?1

\documentclass{article}

%Sectioning and headings
%------------------------

\usepackage{sectsty}          % put section headings in sans-serif font
\setcounter{secnumdepth}{4}

\usepackage{titlesec}

\titleformat{\paragraph}{\normalfont\normalsize\bfseries}{\theparagraph}{1em}{}
\titlespacing*{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}

\begin{document}

some text
\section{Section}
some text
\subsection{Subsection}
some text
\subsubsection{Subsubsection}
some text
\paragraph{Paragraph}
some text
%

\end{document}
3
  • Thanks - should have thought of swapping things around really... that sort of thing often catches me out. It would be great if there was some kind of package checker built into latex processors that warned you of common conflicts, but I suspect there would be so many that it would be hard to keep it up to date!
    – FionaSmith
    Commented Oct 13, 2014 at 8:26
  • PS the comment now seems to have gone but if it was you asking about the sans-serif font, presumably you realised I had just removed that line to create a MWE but failed to remove the comment on reason for package load
    – FionaSmith
    Commented Oct 13, 2014 at 8:32
  • @FionaSmith Yeah, I guessed so. If this ends up causing trouble (somehow), just update your code and I'll take a look again. ;-)
    – 1010011010
    Commented Oct 13, 2014 at 8:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .