노래 가사를 쓰고 있어요. 가능하다면 단락 내부의 페이지 나누기보다 부분적으로 빈 페이지를 선호해야 합니다. 사용 \widowpenalties 1 10000
하고 \raggedbottom
작동하지 않았습니다.
\filbreak
지금까지는 각 단락(= 스탠자) 뒤에 넣어야 원하는 동작을 얻을 수 있었습니다 .
\documentclass[12pt]{article}
\usepackage[paperwidth=16cm, paperheight=9cm]{geometry}
\usepackage{nopageno}
\setlength\parindent{0pt}
\setlength\parskip{1em}
% Manually adding \filbreak at the end of stanza. This works as expected:
\begin{document}
\raggedright
Roads go ever ever on,\\
Over rock and under tree,\\
By caves where never sun has shone,\\
By streams that never find the sea;\\
Over snow by winter sown,\\
And through the merry flowers of June,\\
Over grass and over stone,\\
And under mountains in the moon.\filbreak
Roads go ever ever on\\
Under cloud and under star,\\
Yet feet that wandering have gone\\
Turn at last to home afar.\\
Eyes that fire and sword have seen\\
And horror in the halls of stone\\
Look at last on meadows green\\
And trees and hills they long have known.\filbreak
\end{document}
그러나 나는 모든 문단 뒤에 이것을 수동으로 입력하고 싶지 않습니다. 나는 의 방법을 사용해 보았습니다.이것답변. 문제는 \\
구절 사이에 올바른 줄 바꿈을 달성하기 위해 사용해야 한다는 것입니다 . 앞서 언급한 답변의 방법을 사용하면 \filbreak
매번 얻을 수 있으므로 \\
작동하지 않습니다.
\documentclass[12pt]{article}
\usepackage[paperwidth=16cm, paperheight=9cm]{geometry}
\usepackage{nopageno}
\setlength\parindent{0pt}
\setlength\parskip{1em}
% Trying to add \filbreak after each paragraph automatically. Not working:
\makeatletter
\def\filbreak{!\@@par\vfil\penalty-200\vfilneg}
% Exclamation mark is there just to show, that \\ is also treated like \par.
\makeatother
\begin{document}
\raggedright
\let\par\filbreak
Roads go ever ever on,\\
Over rock and under tree,\\
By caves where never sun has shone,\\
By streams that never find the sea;\\
Over snow by winter sown,\\
And through the merry flowers of June,\\
Over grass and over stone,\\
And under mountains in the moon.
Roads go ever ever on\\
Under cloud and under star,\\
Yet feet that wandering have gone\\
Turn at last to home afar.\\
Eyes that fire and sword have seen\\
And horror in the halls of stone\\
Look at last on meadows green\\
And trees and hills they long have known.
\end{document}
어떻게든 사용자 정의 명령( \filbreak
)을 모든 단락 뒤에 넣을 수 있지만 모든 단락 뒤에는 넣을 수 없습니까 \\
? \par
실제로 어떻게 \\
연결되어 있나요? 나는 이 질문과 관련이 없는 다른 특정 동작으로 나만의 시를 쓰고 있기 때문에 다른 시 패키지를 사용하지 않는 것을 선호합니다.
답변1
을 설정한 환경으로 변경하는 것이 좋습니다. 따라서 \\
페이지 나누기 는 단락 사이에만 허용됩니다.\newline
poem
\interlinepenalty=10000
\documentclass[12pt]{article}
\usepackage[paperwidth=16cm, paperheight=9cm]{geometry}
\usepackage{nopageno}
\setlength\parindent{0pt}
\setlength\parskip{1em}
\newenvironment{poem}{%
\begin{flushleft}\let\\\newline
\interlinepenalty=10000
}{\end{flushleft}}
\begin{document}
\begin{poem}
Roads go ever ever on,\\
Over rock and under tree,\\
By caves where never sun has shone,\\
By streams that never find the sea;\\
Over snow by winter sown,\\
And through the merry flowers of June,\\
Over grass and over stone,\\
And under mountains in the moon.
Roads go ever ever on\\
Under cloud and under star,\\
Yet feet that wandering have gone\\
Turn at last to home afar.\\
Eyes that fire and sword have seen\\
And horror in the halls of stone\\
Look at last on meadows green\\
And trees and hills they long have known.
\end{poem}
\end{document}
답변2
후크를 사용하여 스탠자 내에서 페이지 나누기를 para
추가 하고 억제할 수 있습니다.\filbreak
\interlinepenalty
\documentclass[12pt]{article}
\usepackage[paperwidth=16cm, paperheight=9cm]{geometry}
\usepackage{nopageno}
\setlength\parindent{0pt}
\setlength\parskip{1em}
\AddToHook{para/after}{\filbreak}
\showoutput
% Manually adding \filbreak at the end of stanza. This works as expected:
\begin{document}
\interlinepenalty=9000
Roads go ever ever on,\\
Over rock and under tree,\\
By caves where never sun has shone,\\
By streams that never find the sea;\\
Over snow by winter sown,\\
And through the merry flowers of June,\\
Over grass and over stone,\\
And under mountains in the moon.
Roads go ever ever on\\
Under cloud and under star,\\
Yet feet that wandering have gone\\
Turn at last to home afar.\\
Eyes that fire and sword have seen\\
And horror in the halls of stone\\
Look at last on meadows green\\
And trees and hills they long have known.
\end{document}