Das Poesiepaket ändert den vertikalen Abstand um Abschnittsüberschriften auf seltsame Weise

Das Poesiepaket ändert den vertikalen Abstand um Abschnittsüberschriften auf seltsame Weise

Mit dem poetryPaket habe ich Probleme, einen einheitlichen Abstand um meine Abschnittstitel zu erhalten. Alle meine Gedichte beginnen mit einem Titel, der als angegeben wird \section. Manchmal sind zwei Gedichte auf derselben Seite angeordnet. Manchmal erstreckt sich ein Gedicht über mehr als eine Seite (die aktuelle poem-Umgebung wird dann mit angehalten \\*, ein PDF mit einem Bild eingefügt und das Gedicht wird am Anfang der ersten Zeile mit neu gestartet \*). Dies führt jedoch zu einer Änderung des Abstands vor dem Titel. Das heißt, der Abstand zwischen „Überlauftext“ und einem Titel ist kleiner als zwischen einem Gedicht, das auf derselben Seite beginnt und endet, und dem Abschnittstitel darunter.

Reiner Text verursacht dies nicht. Das heißt, wenn eine Seite mit normalem Text beginnt und dann ein neuer Abschnitt, ist der Abstand vor dem Abschnittstitel derselbe, als ob die Seite mit einem neuen Abschnitt beginnen würde.

Die UnterkunftnachEin Abschnittstitel ändert sich, je nachdem, ob auf den Titel ein Gedicht oder ein normaler Text folgt, aber das ist zumindest konsistent, es ändert sich nicht, je nachdem, ob Überlauf vorhanden ist oder nicht. Aber etwas führt dazu, dass die poemUmgebung vor dem nächsten Titel ein kleines, aber merkliches Stück Platz verschlingt, wenn er auf zwei Seiten aufgeteilt ist, im Vergleich dazu, wenn er auf einer Seite enthalten ist.

Das MWE ist ziemlich lang, weil ich alle verschiedenen Kombinationen zeigen wollte. Der Unterschied im Platz um die Abschnitte 2 und 3 ist das Hauptproblem – die anderen Abschnitte dienen dem Kontrast. Bitte beachten Sie, dass das poetryPaket beim Herunterladen auf MikTeX mit einem anderen Paket zu kollidieren scheint, sodass es möglicherweise nicht kompiliert wird, wenn Sie es lokal ausführen. Anschauliches Overleaf-Beispiel hier: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}

Antwort1

Ich habe nicht herausgefunden, was genau Ihr Abstandsproblem war. Ich habe das poetryPaket nie verwendet. Ich weiß nicht, ob das hilfreich ist. Ich habe Ihren Code geändert, um das versePaket (Achtung, ich habe es entwickelt) anstelle des poetryPakets zu verwenden, und habe für die Titel der Gedichte das verse \poemtitle{...}anstelle von verwendet.\section{...}

% 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}

Antwort2

Ich bin mir nicht sicher, ob ich das Problem verstehe. In der Dokumentation von poetry gibt es \poemtopskip und \poembotskip, die Leerzeichen vor und nach der Umgebung verwalten.

    \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}

Bildbeschreibung hier eingeben

verwandte Informationen