-1

With this code:

    \section{Consideraciones generales}
    \subsection{}Autoridad reguladora y fiscalizadora
    \subsubsection{}El Ministerio de Salud fungirá como órgano regulador vigilante del cumplimiento de lo dispuesto en el ordenamiento jurídico en esta materia.
    \subsubsection{}El Ministerio de Salud velará por la adecuada aplicación y cumplimiento de esta norma técnica en los servicios de salud.
    \subsubsection{}El Ministerio de Salud estará facultado para realizar las acciones de inspección y control, reguladas en la Ley General de Salud, Ley número 5395 del 30 de octubre de 1973, relacionadas con la aplicación de la presente norma técnica.

I get this:

enter image description here

But I want the text formatted this way:

enter image description here

I know it's weird but it is part of the format to publish laws in my country. It is not just me. Must yo be this way.

1 Section Title (this is just a title)

1.1 Subsection with all the text (not a title)

1.2 Subsection with more text, not just the title

1.2.1 Another Subsubsection with more text

2 Section Title (this is just a title)

2.1 The Text of the section

And so on...

Don't want to use \list because need to be in the Table Content, but have no idea to do this, in this format. Only the Section title will be in the Table Content

  • 4
    Please post an MWE, i.e. a full (yet minimal) self contained example … – Ingmar May 20 '22 at 07:02
  • Welcome to TeX.SX! I am not quite sure how I should understand this. Could you maybe clarify what is meant to be a section and what is meant to be the text that belongs to this (sub)section title and what is not? For example, while "Autoridad reguladora y fiscalizadora" seems more like a (sub)section to me, the other (sub)entries seem to be rather a list of paragraphs. But I might be wrong. – Jasper Habicht May 20 '22 at 07:02
  • Well I know it is weird but the text need that format. Because it part of the law, and some people give this weird format. – Elbert Villarreal May 20 '22 at 08:30
  • Hey @JasperHabicht check my edit. – Elbert Villarreal May 20 '22 at 08:39
  • It seems to me that what is wanted, instead of \section{}text the text needs to be within the braces: \section{text}. Similarly for subsections. If the text is too long for one line, that is a different problem. – barbara beeton May 20 '22 at 13:07
  • Which documentclass are you using? There may be a more appropriate one for the type of document you wish to set up, see some discussion and links at https://tex.stackexchange.com/q/782/15925 – Andrew Swann May 20 '22 at 16:44

2 Answers2

2

If only the sections need to be in the ToC, and only they have titles, then you should only use a sectioning command for them, and use lists for the lower levels.

The enumitem package then makes it easy to add the section numbers to the numbers for the lists.

Example:

\documentclass[12pt]{article}

\usepackage{enumitem} \setenumerate{leftmargin=,nolistsep} \setenumerate[1]{label={\textbf{\thesection.\arabic}},ref={\thesection.\arabic}} \setenumerate[2]{label={\textbf{\theenumi.\arabic}},ref={\theenumi.\arabic}} \setenumerate[3]{label={\textbf{\theenumii.\arabic}},ref={\theenumii.\arabic*}} \begin{document} \setcounter{section}{5}

\section{Consideraciones generales} \begin{enumerate} \item Autoridad reguladora y fiscalizadora \begin{enumerate} \item El Ministerio de Salud fungirá como órgano regulador vigilante del cumplimiento de lo dispuesto en el ordenamiento jurídico en esta materia.\label{this} \item El Ministerio de Salud velará por la adecuada aplicación y cumplimiento de esta norma técnica en los servicios de salud. \begin{enumerate} \item El Ministerio de Salud estará facultado para realizar las acciones de inspección y control, reguladas en la Ley General de Salud, Ley número 5395 del 30 de octubre de 1973, relacionadas con la aplicación de la presente norma técnica.\label{that} \end{enumerate} \item Etc. \end{enumerate} \item Etc. \end{enumerate}

\end{document}

Enumerate hierarchy output

frabjous
  • 41,473
0

You wrote that you want to keep the \section-\subsection-\subsubsection structure (or at least that is how I understood you, maybe I'm wrong though), so you could make real (sub)subsection titles out of your text snippets as suggested in the comments and maybe also make use of the titlesec package to format everything, like this:

\documentclass{article}

\usepackage{titlesec} \titleformat{\subsection}{\normalfont}{\hspace{1em}\textbf{\thesubsection}}{1em}{} \titleformat{\subsubsection}{\normalfont}{\hspace{2em}\textbf{\thesubsubsection}}{1em}{}

\begin{document}

\section{Consideraciones generales}
\subsection{Autoridad reguladora y fiscalizadora}
\subsubsection{El Ministerio de Salud fungirá como órgano regulador vigilante del cumplimiento de lo dispuesto en el ordenamiento jurídico en esta materia.}
\subsubsection{El Ministerio de Salud velará por la adecuada aplicación y cumplimiento de esta norma técnica en los servicios de salud.}
\subsubsection{El Ministerio de Salud estará facultado para realizar las acciones de inspección y control, reguladas en la Ley General de Salud, Ley número 5395 del 30 de octubre de 1973, relacionadas con la aplicación de la presente norma técnica.}

\end{document}

enter image description here