\usepackage[explicit]{titlesec}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\providecommand{\DUdocumentsubtitle}[1]{%
  %\begin{nthcolumn}{1}
  \color{black}
  \em
  \GaramondSwsh\selectfont
  \Large
  #1
  %\end{nthcolumn}
}

\makeatletter

\def\@maketitle{%
  \vspace*{0.5cm}
  \textcolor{altColor}{%
    \Garamond\selectfont
    \huge \@title
  }
  \vspace*{1.0cm}
}
\makeatother

\newcommand\SecTitle[1]{%
\begin{tikzpicture}

  \node (A) at (0,0)
      {\Large{\textit{#1 }}};
  \node (B) at (5,0) {};
  \node (C) at (-5,0) {};

  % Change the color for the lines and apply the ornament
  \draw [altColor, line width=0.2mm] (C) to (A.west);
  \draw [altColor, line width=0.2mm] (A.east) to (B);
\end{tikzpicture}}

% Titre de niveau 1
% On affiche le Swash sur les initiales ici
\titleformat{\section}
  {\centering}
  {\thesection}
  {}
  {\SecTitle{\GaramondSwsh\selectfont{#1 }}}

% Titre de niveau 2
\titleformat{\subsection}
  {\bf\centering}
  {\thesubsection}
  {}
  {#1}

% Titre de niveau 3
\titleformat{\subsubsection}
  {\bfseries\normalsize}
  {\thesubsubsection}
  {2em}
  {}
  {}
