0

This is not exactly a problem I'm having, is more about how it works because I don't understand why LaTeX is behaving like this.

I have the following code:

\section{Ejercicios}
    \newpage
    \subsection{Creación guión del shell para obtener UID y GID de un usuario dado}
    \begin{normalsize}
        El lenguaje de programación que usaremos será bash, que a su vez es la aplicación de consola. Para este caso necesitaremos instrucciones simples como imprimir por pantalla o pedir una entrada al usuario.
    \end{normalsize}
\subsection{Creación guión del shell para obtener logins de todos los usuarios dado un GID}

The output from the previous example is the following: enter image description here

And the next section starts in the next page, which is what I don't understand.

If I put a shorter text, like in the next example, the next section starts right behind the previous one. enter image description here

Is there any specific reason why this happens? Or am I doing something wrong? Thanks in advance

arba
  • 1
  • 1
    Can you add the longer text version? To replicate your issue. Also please add a complete MWE, including documentclass – Mane32 Feb 11 '24 at 17:35
  • It could depend on the content of subsection 2.5 (e.g. in case it were a big table...). – Iacobus1983 Feb 11 '24 at 18:16
  • \@afterheading is fighting \newpage. First, starting a section at the bottom of a page is not pretty. Second, put an invisible line (\null or \rule{\linewidth}{0pt})) between the two. – John Kormylo Feb 11 '24 at 19:55
  • Looks like the problem is related with the amount of subsections I had. When the total amount of subsections behind the current subsection I'm working in takes more than 1 page of space while being behind the last one with text, TeX moves all of them into a new page and fits them in one page. When I put less subsections it doesn't happen. – arba Feb 11 '24 at 23:17

0 Answers0