diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/chickenize/chickenize.tex')
-rw-r--r-- | Master/texmf-dist/tex/luatex/chickenize/chickenize.tex | 65 |
1 files changed, 62 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex b/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex index d47e345380c..0e6da86fedb 100644 --- a/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex +++ b/Master/texmf-dist/tex/luatex/chickenize/chickenize.tex @@ -11,10 +11,33 @@ %% This package is copyright © 20012 Arno L. Trautmann. It 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. This work has the LPPL mainten- -%% ance status ‘author-maintained’. +%% ance status ‘maintained’. \input{luatexbase.sty} \directlua{dofile(kpse.find_file("chickenize.lua"))} +\def\BEClerize{ + \chickenize + \directlua{ + chickenstring[1] = "noise noise" + chickenstring[2] = "atom noise" + chickenstring[3] = "shot noise" + chickenstring[4] = "photon noise" + chickenstring[5] = "camera noise" + chickenstring[6] = "noising noise" + chickenstring[7] = "thermal noise" + chickenstring[8] = "electronic noise" + chickenstring[9] = "spin noise" + chickenstring[10] = "electron noise" + chickenstring[11] = "Bogoliubov noise" + chickenstring[12] = "white noise" + chickenstring[13] = "brown noise" + chickenstring[14] = "pink noise" + chickenstring[15] = "bloch sphere" + chickenstring[16] = "atom shot noise" + chickenstring[17] = "nature physics" + } +} + \def\chickenize{ \directlua{luatexbase.add_to_callback("pre_linebreak_filter",chickenize,"chickenize") luatexbase.add_to_callback("start_page_number", @@ -39,6 +62,13 @@ \def\uncolorstretch{ \directlua{luatexbase.remove_from_callback("post_linebreak_filter","stretch_expansion")}} +\def\countglyphs{ + \directlua{glyphnumber = 0 + luatexbase.add_to_callback("post_linebreak_filter",countglyphs,"countglyphs") + luatexbase.add_to_callback("stop_run",printglyphnumber,"printglyphnumber") + } +} + \def\dosomethingfunny{ %% should execute one of the “funny” commands, but randomly. So every compilation is completely different. Maybe a list of commands could be specified to exclude total nonesense-functions. Maybe also on a per-paragraph-basis? } @@ -114,6 +144,13 @@ \def\unletterspaceadjust{ \directlua{luatexbase.remove_from_callback("pre_linebreak_filter","letterspaceadjust")}} +\def\listallcommands{ + \directlua{ + for name in pairs(tex.hashtokens()) do + print(name) + end} +} + \let\stealsheep\letterspaceadjust %% synonym in honor of Paul \let\unstealsheep\unletterspaceadjust \let\returnsheep\unletterspaceadjust @@ -146,9 +183,9 @@ \directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomcolor")}} \def\randomerror{ %% FIXME - \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomcolor,"randomcolor")}} + \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomerror,"randomerror")}} \def\unrandomerror{ %% FIXME - \directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomcolor")}} + \directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomerror")}} \def\randomfonts{ \directlua{luatexbase.add_to_callback("post_linebreak_filter",randomfonts,"randomfonts")}} @@ -170,6 +207,15 @@ \def\unspankmonkey{ \directlua{}} +\def\substitutewords{ + \directlua{luatexbase.add_to_callback("process_input_buffer",substitutewords,"substitutewords")}} +\def\unsubstitutewords{ + \directlua{luatexbase.remove_from_callback("process_input_buffer","substitutewords")}} + +\def\addtosubstitutions#1#2{ + \directlua{addtosubstitutions("#1","#2")} +} + \def\tabularasa{ \directlua{luatexbase.add_to_callback("post_linebreak_filter",tabularasa,"tabularasa")}} \def\untabularasa{ @@ -185,6 +231,7 @@ \def\unzebranize{ \directlua{luatexbase.remove_from_callback("post_linebreak_filter","zebranize")}} \newluatexattribute\leetattr +\newluatexattribute\letterspaceadjustattr \newluatexattribute\randcolorattr \newluatexattribute\randfontsattr \newluatexattribute\randuclcattr @@ -193,6 +240,18 @@ \long\def\textleetspeak#1% {\setluatexattribute\leetattr{42}#1\unsetluatexattribute\leetattr} + +\long\def\textletterspaceadjust#1{ + \setluatexattribute\letterspaceadjustattr{42}#1\unsetluatexattribute\letterspaceadjustattr + \directlua{ + if (textletterspaceadjustactive) then else % -- if already active, do nothing + luatexbase.add_to_callback("pre_linebreak_filter",textletterspaceadjust,"textletterspaceadjust") + end + textletterspaceadjustactive = true % -- set to active + } +} +\let\textlsa\textletterspaceadjust + \long\def\textrandomcolor#1% {\setluatexattribute\randcolorattr{42}#1\unsetluatexattribute\randcolorattr} \long\def\textrandomfonts#1% |