Remove dot from custom defined section title

fancyhdrformattingsectioning

I've just defines a new type of section title following this page. The used code is shown below:

\newcommand{\ssection}[1]{%
  \section[#1]{\centering\Large \\ #1}}

If I type \ssection{This is a test} I get the following result:

enter image description here

What I want to do is:

  1. (Mandatory) Remove the dot after the section number.
  2. (Optional) Make some fancy thing with the number, like put it inside a circle maybe.

Thanks you very much in advance.

EDIT:

I add a MWE:

\documentclass[a4paper, 12pt, oneside]{article}

\usepackage[spanish,es-tabla]{babel}

\newcommand{\ssection}[1]{%
  \section[#1]{\centering\Large \\ #1}}
  
  \begin{document}
  \ssection{This is a test}
  \end{document}

I've just realized that removing \usepackage[spanish,es-tabla]{babel} the problem is solved, but I need that dot in subsections, subsubsections and so on.

Best Answer

I have this idea to achieve that. But it end up with shifting the star version section heading down as well (As I labeled in figure with red rectangle). You can always add local titleformat to avoid it (e.g. add another titleformat define before \tableofcontents). But this seems to be a little complicated. Maybe somebody have better solution.

\documentclass[a4paper, 12pt, oneside]{article}
\usepackage{showframe}
\usepackage{tikz}
\usepackage[spanish,es-tabla]{babel}
\usepackage{titlesec}
\titleformat{\section}%
{\centering\normalfont\Large\bfseries}%
{\tikz\node[line width=2pt,circle,draw=red,fill=red!20]{\thesection};}%
{0pt}%
{\mbox{}\\}%
{}

\begin{document}
\tableofcontents
\clearpage
\section{This is a test}
\subsection{this is test}
\subsubsection{this is test}
\end{document}

enter image description here enter image description here

Related Question