0

Many articles on StackExchange show the same problem but none of the solutions works for me. I initialize a section environment and then a multicol environment, with a subsection header as an argument. Anything you put in the square brackets next to \begin{multicols}{2} should be written as a non-multicolumn sentence, meaning it doesn't respect the "boxed" boundaries of the columns, whereas anything before \end{multicols} does. I'm using the multicol environment for the majority of my report and it always works fine.

I've tried putting the \section in the square brackets as well, but I would need a line break \\ and a multi-line sentence isn't allowed.

The matter is shown in the following pictures.

Blank page left behind the subsection title. The section header is shown.

Multicol environment compiles well, but in the next page.

The code compiling the previous pages:

\section{Definizione del momento magnetico}
\begin{multicols}{2}[\subsection{L'ipotesi dell'integrale della f.e.m.}]

...texttexttext...

Here's the introduction to my document as well. Nothing in there looks like it can cause any problems, but here it is anyways.

\documentclass{article}
 
% Packages
\usepackage{graphicx}
\graphicspath{ {./Immagini/} }
\usepackage{geometry}
\usepackage{ulem}
\usepackage{setspace}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{systeme}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{hhline}
\usepackage{float}
\usepackage{multicol}
\usepackage{blindtext}
\usepackage{physics}
\usepackage{wrapfig}
\usepackage{hyperref}
\usepackage{mathtools}

% Others
\singlespacing
\numberwithin{equation}{section}
\numberwithin{equation}{subsection}

% Omit `.0` in equation numbers for non-existent subsections.
\renewcommand*{\theequation}{%
  \ifnum\value{subsection}=0 %
    \thesection
  \else
    \thesubsection
  \fi
  .\arabic{equation}%
}

% Custom command for slanted bars ("parallel")
\newcommand{\slanted}{\mathbin{\!/\mkern-5mu/\!}}
\newcommand{\ddd}{\text{d}} % d normale in math mode
4
  • 3
    do not show only snippets and screenshots. Always make a small but complete example that can be used for a test. (I can't reproduce your problem in a MWE). Jul 31, 2023 at 9:11
  • 1
    You're missing to show the document class. I tried with article and lipsum for the text, reproducing the lengths of the various parts and I get no strange page break. Are you perhaps using [H] as the float specifier? If so, don't.
    – egreg
    Jul 31, 2023 at 9:31
  • I believe \section etc. includes \par and \vskip, so is definitely not a single line. You could put it into a \parbox or minipage, althugh you will lose the effect of \@afterheading. Jul 31, 2023 at 13:02
  • I don't know how to answer each comment individually, so here is everything and thanks in advance for your time. First of all, I couldn't show individual examples, since every time I try to do it again latex compiles everything without the blank page. It's a one-case scenario, as far as I've seen, so I'm pretty sure I'm getting something wrong one way or another. Secondly, no, I'm not using [H] or any floating specifier at all. Finally, yes, \section includes \par and everything, but it didn't seem to work with \subsection. Definitely going to experiment with that though. Aug 2, 2023 at 8:39

0

You must log in to answer this question.

Browse other questions tagged .