1

I am trying to format titles using titlesec. Here is what I want to do:

  • \subsubsection:

    enter image description here

  • \paragraph:

    enter image description here

And this is my code:

\setcounter{secnumdepth}{4}

\renewcommand{\thesubsubsection}{\arabic{subsubsection}}
\titleformat{\subsubsection}[block] {\fontsize{14}{12} \selectfont}{\fontsize{10}{12} \selectfont \textsc{Section}\ \thesubsubsection}{1em}{}[\vspace{1mm}\titlerule]

\renewcommand{\theparagraph}{\Roman{paragraph}}
\titleformat{\paragraph}[block] {\textbf \fontsize{14}{12} \selectfont}{\fontsize{14}{12} 
%\titleformat{\paragraph}[block] {\fontsize{14}{12} \selectfont}{\fontsize{14}{12} \selectfont \theparagraph\ \textsc{.}}{1em}{}

For this result: enter image description here enter image description here

With the commented \titleformat:

enter image description here

As you can see, I have some issue having a bold text.

Does anyone know how to format titlesec command accordingly?

  • 1
    \textbf requires an argument. If the whole title has to be in boldface, replace it with \bfseries. – Bernard Apr 6 at 11:14
  • Great thank you ! – Guliup Apr 6 at 11:50
1

Here is a simplified code, which reproduces the initial image (probably not with the same font):

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern} 
\usepackage{lipsum}

\usepackage{titlesec}

\setcounter{secnumdepth}{4}

\renewcommand{\thesubsubsection}{\arabic{subsubsection}}
\titleformat{\subsubsection}[block] {\sffamily}{SECTION\ \thesubsubsection}{0.3em}{\bfseries\fontsize{14}{12} \selectfont}[\vskip 0.5ex \titlerule]

\titlespacing*{\subsubsection}{0pt}{*4}{*4}

\renewcommand{\theparagraph}{\Roman{paragraph}}
\titleformat{\paragraph}[block] {\bfseries\LARGE}{\theparagraph.}{1em}{}

\begin{document}

\lipsum[11]
\subsubsection{Prohibition}
 \lipsum[11]

 \paragraph{Restriction de concurrence}

\end{document} 

enter image description here

| improve this answer | |
  • Thank you very much, it works perfectly ! – Guliup Apr 6 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.