| 1 |
%% parstat.opm |
| 2 |
%% Copyright 2025 Petr Krajník |
| 3 |
%% |
| 4 |
%% This work may be distributed and/or modified under the |
| 5 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 6 |
%% of this license or (at your option) any later version. |
| 7 |
%% The latest version of this license is in |
| 8 |
%% https://www.latex-project.org/lppl.txt |
| 9 |
%% and version 1.3c or later is part of all distributions of LaTeX |
| 10 |
%% version 2008 or later. |
| 11 |
%% |
| 12 |
%% This work has the LPPL maintenance status 'author-maintained'. |
| 13 |
%% |
| 14 |
%% The Current Maintainer of this work is Petr Krajník. |
| 15 |
%% |
| 16 |
%% This work consists of the files parstat.opm and parstat.lua. |
| 17 |
%% |
| 18 |
|
| 19 |
\_codedecl \parstat {Paragraph statistic macro <v1.0>} |
| 20 |
|
| 21 |
\_namespace{parstat} |
| 22 |
|
| 23 |
\_newcount\.enabled |
| 24 |
\.enabled=0 %% Parstat is disabled at default |
| 25 |
|
| 26 |
\_directlua{% |
| 27 |
require("parstat") |
| 28 |
callback.add_to_callback("post_linebreak_filter", parstat.run, "parstat") |
| 29 |
} |
| 30 |
|
| 31 |
\_def\.parstatenable{\.enabled=1\_relax} |
| 32 |
|
| 33 |
\_def\.parstatdisable{\.enabled=0\_relax} |
| 34 |
|
| 35 |
\_def\.parstat{\_directlua{parstat.print_summary()}} |
| 36 |
|
| 37 |
\_def\.parstatreset{\_directlua{parstat.reset()}} |
| 38 |
|
| 39 |
\_nspublic \parstatenable \parstatdisable \parstat \parstatreset ; |
| 40 |
|
| 41 |
\_newcount\.fskip |
| 42 |
\.fskip=1 %% Skipped lines at par front |
| 43 |
|
| 44 |
\_newcount\.bskip |
| 45 |
\.bskip=1 %% Skipped lines at par back |
| 46 |
|
| 47 |
\_endcode |
| 48 |
|
| 49 |
For more infornation, see the project repository: |
| 50 |
https://github.com/petrk23/parstat |