%%
%% This is file `testhyphens.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% testhyphens.dtx  (with options: `package')
%% Copyright 2025 Claudio Beccari All rights reserved.
%% 
%%  This system is distributed in the hope that it will
%%  be useful, but WITHOUT ANY WARRANTY; without even
%%  the implied warranty of MERCHANTABILITY or FITNESS
%%  FOR A PARTICULAR PURPOSE.
%% 
%% This file is distributed under the LPPL licence,
%% version 1.3c dated 2008-05-04 or later as it appears
%% in CTAN/macros/latex/base/lppl.tex.
%% See the end of this file.
%% 

\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{testhyphens}[%
2025/01/16 v.1.0
Prints list of hyphenated words]

\def\t@sthyphens{%
  \everypar{\setbox0\lastbox
  \setbox1\hbox{\strut}\vbox\bgroup
  \offinterlineskip
  \everypar{\setbox0\lastbox \nobreak\hskip\z@}\dimen0=\hsize
  \hsize=\z@ \hfuzz\maxdimen \def\par{\endgraf \hsize=\dimen0\getlastline
  \egroup\endgraf}}\breakafterword
}

\def\breakafterword{%
\catcode`\^^M=13 \catcode`\ =13
}

{\breakafterword\gdef^^M{\par}\global\let ^^M}

\def\getlastline{\setbox0\lastbox
\ifvoid0
  \let\next\nomorelines
\else
  \unskip\unpenalty
  \setbox1\hbox{\unhbox0\strut\discretionary{}{}{}%
  \unhbox1}\let\next\getlastline
\fi
\next}

\def\nomorelines{\unhbox1}
\newenvironment{checkhyphens}[1][\lefthyphenmin-\righthyphenmin]{%
\@tempcnta=\lefthyphenmin
\@tempcntb=\righthyphenmin
\s@thyphenpars[#1]\par
\bgroup\t@sthyphens
}{%
\egroup\par
}

\def\s@thyphenpars[#1-#2]{%
\@tempcnta=#1\relax
\@tempcntb=#2\relax
\unless\ifnum\@tempcnta=\lefthyphenmin \lefthyphenmin=\@tempcnta\fi
\unless\ifnum\@tempcntb=\righthyphenmin \righthyphenmin=\@tempcntb\fi
}
\endinput
%%
%% End of file `testhyphens.sty'.
