The longfbox package is proving very useful as a way to break long verses across pages, something I have been searching for for years. With 3 out of 4 of the longfbox configurations, however, text that is longer than the width of the page does not wrap properly. Even with this limitation, the single longfbox configuration that does wrap properly will prove a valuable addition within my LaTeX project and document.
Before I make wholesale changes to my LaTeX project and document across the board to implement the longfbox package, I have two questions:
- Am I missing something with the
longfboxLaTeX code that is preventing the text from wrapping in 3 out of the 4 configurations? (See MWE below.) - On Nov 17, 2020, a LaTeX bug within the
longfboxpackage was documented on SE at Error with longfbox package. The bug has not been corrected within thelongfboxpackage itself. Given the hiatus since the original 2015-12-05 release of the package in 2015 (7 years), and the lack of an update for the known bug, I am wondering if thelongfboxpackage is still being maintained? If not, should I hold off before I incorporate thelongfboxpackage throughout my LaTeX project wholesale to see if there is a more current, replacement package that is being maintained?
\documentclass{article}
\usepackage{longfbox}
% See 'Error with longfbox package' at \url{https://tex.stackexchange.com/questions/571207/error-with-longfbox-package}
\makeatletter
\newdimen@tempdimd
\makeatother
% The longfbox \newfboxstyle+\lfbox macro combination does not wrap the text as it should.
\newfboxstyle{textfbox}{
breakable=true,
border-width=0.4pt,
border-top-color=blue,
border-bottom-color=blue,
border-style={solid,none,solid,none},
padding={2pt,5pt},
margin={3pt,3pt,1cm,3pt},
width={\dimexpr\textwidth-14pt},
baseline-skip=true
}
% And this \mylbox+\lfbox macro combination doesn't seem to wrap the text as it should either.
\newcommand*{\mylbox}[1]{%
\lfbox[
breakable=true,
border-width=0.4pt,
border-top-color=blue,
border-bottom-color=blue,
border-style={solid,none,solid,none},
padding={2pt,5pt},
margin={3pt,3pt,1cm,3pt},
width={\dimexpr\textwidth-14pt},
baseline-skip=true
]
{#1}
}
\begin{document}
\noindent\lfbox[textfbox]{An \textbf{initial} \textsf{longfbox} configuration using \textbf{newfboxstyle}+\textbf{lfbox}. A longfbox can contain much longer content and will by default be as wide as the current line width.}
\noindent\mylbox{A \textbf{second} \textsf{longfbox} configuration using \textbf{mylbox}+\textbf{lfbox}. A longfbox can contain much longer content and will by default be as wide as the current line width.}
\fboxset{
breakable=true,
border-width=0.4pt,
border-top-color=blue,
border-bottom-color=blue,
border-style={solid,none,solid,none},
padding={2pt,5pt},
margin={3pt,3pt,1cm,3pt},
width={\dimexpr\textwidth-14pt},
baseline-skip=true
}
\noindent\lfbox{A \textbf{third} \textsf{longfbox} configuration using \textbf{fboxset}+\textbf{lfbox}. A longfbox can contain much longer content and will by default be as wide as the current line width.}
% But when using the \longfbox macro directly (without the \newfboxstyle+\lfbox or \mylbox+\lfbox combination macros), the text wraps as it should.
\begin{longfbox}[
breakable=true,
border-width=0.4pt,
border-top-color=blue,
border-bottom-color=blue,
border-style={solid,none,solid,none},
padding={2pt,5pt},
margin={3pt,3pt,1cm,3pt},
width={\dimexpr\textwidth-14pt},
baseline-skip=true
]
{A \textbf{final} \textsf{longfbox} configuration using just \textbf{longfbox} alone. A longfbox can contain much longer content and will by default be as wide as the current line width.}
\end{longfbox}
\end{document}
