%% %% This is file `countwords.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% countwords.dtx (with options: `package') %% %% This is a generated file. %% %% Copyright (C) 2026 by Hugo Heagren hugo@heagren.com %% %% This file may be distributed and/or modified under the conditions of %% the LaTeX Project Public License, either version 1.3c of this license %% or (at your option) any later version. The latest version of this %% license is in: %% %% http://www.latex-project.org/lppl.txt %% %% and version 1.3c or later is part of all distributions of LaTeX %% version 2008-05-04 or later. %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{countwords} [2026/04/14 1.0.1 Exact word counts] \RequirePackage{luatexbase} \RequirePackage{luapackageloader} \directlua{countwords = require("countwords")} \DeclareKeys { threshold.code = \directlua{ countwords.set_threshold(\number#1) }, } \SetKeys{threshold=1} \DeclareUnknownKeyHandler{\PackageWarning{countwords}{Unknown option `#1'}} \ProcessKeyOptions \directlua{ luatexbase.add_to_callback( "pre_linebreak_filter", countwords.callback, "wordcount" ) }% \def\countwordsstart#1{% \directlua{ countwords.enable_counter("#1") } } \def\countwordsstop#1{% \directlua{ countwords.disable_counter("#1") } } \endinput %% %% End of file `countwords.sty'.