1

I'm new here, but I've been using LaTeX for some years already.

Recently I had to define new chapter- and section-like levels in my document, and I created them using the titlesec package, with the titleclass command. For a correct formatting in the TOC I used titletoc (titlecontents command).

\titleclass{\fase}{straight}[\chapter]
\newcounter{fase}
\titleformat{\fase}{\centering\sffamily\huge\bfseries}{}{0em}{FASE \thefase\\ }
\titlespacing*{\fase}{0pt}{3.25ex plus 1ex minus .2ex}{1cm}
\titlecontents{fase}[0pt]{\vspace{1em}}{\bfseries Fase\ \thecontentslabel : }{}{\bfseries\hfill\contentspage}


\titleclass{\tarea}{straight}[\fase]
\newcounter{tarea}[fase]
\titleformat{\tarea}{\sffamily\LARGE\bfseries}{TAREA \thefase.\thetarea: }{0em}{}
\titlespacing*{\tarea}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
\titlecontents{tarea}[1.5em]{}{Tarea\ \thecontentslabel : }{}{\ \hfill\contentspage}

The thing is that it does not respect the levels in the pdf bookmarks. In Overleaf, hyperref throws a warning saying that the level is unknown for tarea and it sets it to 0, so I guess there must be a way to set the level for this section-like command. But nothing appears in my local distribution (texlive for windows)

To show what I mean, here's a screenshot:

enter image description here

So 'Introducción' was created with \chapter, 'Objetivos', 'Herramientas a utilizar' y 'Zona de trabajo' with \section.

Now, 'Sistema de separación' and 'Sistema ARQUIMEA' are \fase, and the rest are \tarea (fase = phase, tarea = task)

I looked online, but none of the solutions that I found deal with exactly the same problem, so their solutions didn't work.

Any idea?

closed as unclear what you're asking by Mensch, siracusa, Henri Menke, Phelype Oleinik, Zarko Jul 17 at 3:27

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • Can you explain your issue better, for example with adding a short compilable tex code resulting in your issue? – Mensch Jul 1 at 23:18