O pacote de poesia altera o espaço vertical em torno dos títulos das seções de maneiras estranhas

O pacote de poesia altera o espaço vertical em torno dos títulos das seções de maneiras estranhas

Usando o poetrypacote, estou tendo problemas para obter um espaço consistente em torno dos títulos das minhas seções. Todos os meus poemas começam com um título, dado como \section. Às vezes, dois poemas são colocados na mesma página. Às vezes, um poema ocupa mais de uma página (o poemambiente atual é então pausado com \\*, um pdf com uma imagem é incluído e o poema é reiniciado \*no início da primeira linha). Isso, porém, provoca uma mudança no espaço antes do título. Ou seja, a distância entre o “texto excedente” e um título é menor do que entre um poema que começa e termina na mesma página e o título da seção abaixo.

O texto simples não causa isso. Ou seja, se uma página começa com texto comum, então uma nova seção, o espaço antes do título da seção é o mesmo que se a página começasse com uma nova seção.

O espaçodepoiso título de uma seção muda dependendo se o título é seguido por um poema ou por um texto comum, mas pelo menos isso é consistente, não muda dependendo do estouro ou não. Mas algo faz com que o poemambiente ocupe um espaço pequeno, mas perceptível, antes do próximo título, se ele estiver dividido em duas páginas, em comparação com quando está contido em uma página.

O MWE é meio longo, porque eu queria mostrar todas as combinações diferentes. A diferença de espaço em torno das seções 2 e 3 é o principal problema – as outras seções existem para contrastar. Observe que o poetrypacote parece colidir com outro pacote quando baixado no MikTeX, então ele pode não ser compilado se você executá-lo localmente. Exemplo visível no verso aqui:https://www.overleaf.com/read/qggmxspxsxms

MWE:

\documentclass{article}
\usepackage{poetry}\poemlinenumsfalse
\setlength{\parindent}{0pt}

\begin{document}
\section{The very first, -/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\*

\newpage
\* Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\section{First, P/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\section{Following, P/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}


\newpage
Type-setting is a nightmare

This is plain text

\section{First, T/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\section{Following, P/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\newpage
Type-setting is a nightmare

This is plain text

\section{First, T/T}
Text Text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text


\section{Following, T/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text


\section{Following, T/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text

\newpage
\section{Top of page, T/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\*

\newpage

\* Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\section{First, P/T}
Type-setting is a nightmare

This is plain text

\section{Following, T/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}


\section{Following, P/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is a poem

\end{document}

Responder1

Não consegui descobrir qual era o seu problema de espaçamento. Nunca usei o poetrypacote. Não sei se isso vai ajudar em alguma coisa. Alterei seu código para usar o versepacote (aviso que o desenvolvi) em vez do poetrypacote e usei o verse \poemtitle{...}em vez de \section{...}para os títulos dos poemas.

% poemprob.tex  SE 640836

\documentclass{article}

\usepackage{verse}

%\usepackage{poetry}\poemlinenumsfalse
\setlength{\parindent}{0pt}

\begin{document}

\tableofcontents

\poemtitle{The very first, -/P}
\begin{verse}
Poem poem, please behave\\
So my peace of mind you save\\*

\newpage
\* Type-setting is a nightmare\\
This is a poem\\-
\end{verse}

\poemtitle{First, P/P}
\begin{verse}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{verse}

\poemtitle{Following, P/P}
\begin{verse}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{verse}


\newpage
Type-setting is a nightmare

This is plain text

\poemtitle{First, T/P}
\begin{verse}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{verse}

\poemtitle{Following, P/P}
\begin{verse}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{verse}

\newpage
Type-setting is a nightmare

This is plain text

\section{First, T/T}
Text Text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text


\section{Following, T/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text


\section{Following, T/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text

\newpage
\poemtitle{Top of page, T/P}
\begin{verse}
Poem poem, please behave\\
So my peace of mind you save\\*

\newpage

\* Type-setting is a nightmare\\
This is a poem\\-
\end{verse}

\section{First, P/T}
Type-setting is a nightmare

This is plain text

\poemtitle{Following, T/P}
\begin{verse}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{verse}

\section{Following, P/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is a poem

\end{document}

%%%%%% ORIGINAL MWE FOLLOWS %%%%%%%%%%%%%%

\documentclass{article}

{poetry}\poemlinenumsfalse
\setlength{\parindent}{0pt}

\begin{document}
\section{The very first, -/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\*

\newpage
\* Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\section{First, P/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\section{Following, P/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}


\newpage
Type-setting is a nightmare

This is plain text

\section{First, T/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\section{Following, P/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\newpage
Type-setting is a nightmare

This is plain text

\section{First, T/T}
Text Text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text


\section{Following, T/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text


\section{Following, T/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is plain text

\newpage
\section{Top of page, T/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\*

\newpage

\* Type-setting is a nightmare\\
This is a poem\\-
\end{poem}

\section{First, P/T}
Type-setting is a nightmare

This is plain text

\section{Following, T/P}
\begin{poem}
Poem poem, please behave\\
So my peace of mind you save\\
Type-setting is a nightmare\\
This is a poem\\-
\end{poem}


\section{Following, P/T}
Text text, please behave

So my peace of mind you save

Type-setting is a nightmare

This is a poem

\end{document}

Responder2

Não tenho certeza se entendi o problema. Na documentação da poesia, existem \poemtopskip e \poembotskip que gerenciam espaços antes e depois do ambiente.

    \documentclass{article}
    %https://tex.stackexchange.com/questions/640836/poetry-package-changes-vertical-space-around-section-headings-in-strange-ways/640918#640918
    \usepackage{poetry}\poemlinenumsfalse
    \setlength{\parindent}{0pt}

    \usepackage{paracol}
    \usepackage[margin=2cm]{geometry}
    \begin{document}
    Default
    \begin{paracol}{2}
        \section{With the environment poem}
        \begin{poem}
            Poem poem, please behave\\
            So my peace of mind you save\\
            Type-setting is a nightmare\\
            This is a poem\\-
        \end{poem}
        \textbf{Some text}
        \switchcolumn
        \section{Without the environment poem}
        Poem poem, please behave

        So my peace of mind you save

        Type-setting is a nightmare

        This is a poem

        \textbf{Some text}
    \end{paracol}

    \rule{\linewidth}{0.4pt}
    Modified

    \begin{paracol}{2}
        \section{With the environment poem}
        \poemtopskip=0pt%<---- modif 1em by default
        \poembotskip=0pt%<---- modif 1em by default
        %\setlength{\poemindent}{1in}%<---- for the indent 0pt by default
        \begin{poem}
            Poem poem, please behave\\
            So my peace of mind you save\\
            Type-setting is a nightmare\\
            This is a poem\\-
        \end{poem}
        \textbf{Some text}
        \switchcolumn
        \section{Without the environment poem}
        Poem poem, please behave

        So my peace of mind you save

        Type-setting is a nightmare

        This is a poem

        \textbf{Some text}
    \end{paracol}
    \end{document}

insira a descrição da imagem aqui

informação relacionada