如何隐藏自定义章节和段落中的数字

如何隐藏自定义章节和段落中的数字

我正在尝试自定义自己的部分,但我不知道如何隐藏每个部分的数字。这是我的代码:

\documentclass[12pt]{article}
\usepackage{titlesec}

\titleformat{\section}{\fontsize{18pt}{21.6}\selectfont}{\thesection}{1em}{}

\titleformat{\subsection}{\fontsize{14pt}{16.8}\selectfont\bfseries}{\thesubsection}{1em}{}

\titleformat{\subsubsection}{\fontsize{14pt}{16.8}\selectfont}{\thesubsubsection}{1em}{}

\titleformat{\paragraph}{\fontsize{12pt}{14.4}\bfseries}{\theparagraph}{1em}{}

\titleformat{\subparagraph}{\fontsize{12pt}{14.4}\itshape\flushleft}{\thesubparagraph}{1em}{}

\begin{document}    
    
    \section{section}
    words words words words words words words words words words words words words 
    
    \subsection{subsection}
    words words words words words words words words words words words words words 
    
    \subsubsection{subsubsection}
    words words words words words words words words words words words words words \
    
    \paragraph{paragraph}
    words words words words words words words words words words words words words 
    
    \subparagraph{subparagraph}
    words words words words words words words words words words words words words 
    
    
\end{document}

答案1


\titleformat{\subsection}{\fontsize{14pt}{16.8}\selectfont\bfseries}{}{1em}{}

\titleformat{\subsubsection}{\fontsize{14pt}{16.8}\selectfont}{}{1em}{}

\titleformat{\paragraph}{\fontsize{12pt}{14.4}\bfseries}{\theparagraph}{1em}{}

\titleformat{\subparagraph}{\fontsize{12pt}{14.4}\itshape\flushleft}{\thesubparagraph}{1em}{}```

相关内容