| 1 |
%% |
| 2 |
%% This is file `chickenize.tex', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% chickenize.dtx (with options: `tex') |
| 8 |
%% |
| 9 |
%% EXPERIMENTAL CODE |
| 10 |
%% |
| 11 |
%% This package is copyright © 2021 Arno L. Trautmann. It may be distributed and/or |
| 12 |
%% modified under the conditions of the LaTeX Project Public License, either version 1.3c |
| 13 |
%% of this license or (at your option) any later version. This work has the LPPL mainten- |
| 14 |
%% ance status ‘maintained’. |
| 15 |
\directlua{dofile(kpse.find_file("chickenize.lua"))} |
| 16 |
|
| 17 |
\def\ALT{% |
| 18 |
\bgroup% |
| 19 |
\fontspec{Latin Modern Sans}% |
| 20 |
A% |
| 21 |
\kern-.375em \raisebox{.65ex}{\scalebox{0.3}{L}}% |
| 22 |
\kern.03em \raisebox{-.99ex}{T}% |
| 23 |
\egroup% |
| 24 |
} |
| 25 |
\def\allownumberincommands{ |
| 26 |
\catcode`\0=11 |
| 27 |
\catcode`\1=11 |
| 28 |
\catcode`\2=11 |
| 29 |
\catcode`\3=11 |
| 30 |
\catcode`\4=11 |
| 31 |
\catcode`\5=11 |
| 32 |
\catcode`\6=11 |
| 33 |
\catcode`\7=11 |
| 34 |
\catcode`\8=11 |
| 35 |
\catcode`\9=11 |
| 36 |
} |
| 37 |
|
| 38 |
\def\BEClerize{ |
| 39 |
\chickenize |
| 40 |
\directlua{ |
| 41 |
chickenstring[1] = "noise noise" |
| 42 |
chickenstring[2] = "atom noise" |
| 43 |
chickenstring[3] = "shot noise" |
| 44 |
chickenstring[4] = "photon noise" |
| 45 |
chickenstring[5] = "camera noise" |
| 46 |
chickenstring[6] = "noising noise" |
| 47 |
chickenstring[7] = "thermal noise" |
| 48 |
chickenstring[8] = "electronic noise" |
| 49 |
chickenstring[9] = "spin noise" |
| 50 |
chickenstring[10] = "electron noise" |
| 51 |
chickenstring[11] = "Bogoliubov noise" |
| 52 |
chickenstring[12] = "white noise" |
| 53 |
chickenstring[13] = "brown noise" |
| 54 |
chickenstring[14] = "pink noise" |
| 55 |
chickenstring[15] = "bloch sphere" |
| 56 |
chickenstring[16] = "atom shot noise" |
| 57 |
chickenstring[17] = "nature physics" |
| 58 |
} |
| 59 |
} |
| 60 |
|
| 61 |
\def\boustrophedon{ |
| 62 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",boustrophedon,"boustrophedon")}} |
| 63 |
\def\unboustrophedon{ |
| 64 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","boustrophedon")}} |
| 65 |
|
| 66 |
\def\boustrophedonglyphs{ |
| 67 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",boustrophedon_glyphs,"boustrophedon_glyphs")}} |
| 68 |
\def\unboustrophedonglyphs{ |
| 69 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","boustrophedon_glyphs")}} |
| 70 |
|
| 71 |
\def\boustrophedoninverse{ |
| 72 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",boustrophedon_inverse,"boustrophedon_inverse")}} |
| 73 |
\def\unboustrophedoninverse{ |
| 74 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","boustrophedon_inverse")}} |
| 75 |
|
| 76 |
\def\bubblesort{ |
| 77 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",bubblesort,"bubblesort")}} |
| 78 |
\def\unbubblesort{ |
| 79 |
\directlua{luatexbase.remove_from_callback("bubblesort","bubblesort")}} |
| 80 |
|
| 81 |
\def\chickenize{ |
| 82 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",chickenize,"chickenize") |
| 83 |
luatexbase.add_to_callback("start_page_number", |
| 84 |
function() texio.write("["..status.total_pages) end ,"cstartpage") |
| 85 |
luatexbase.add_to_callback("stop_page_number", |
| 86 |
function() texio.write(" chickens]") end,"cstoppage") |
| 87 |
luatexbase.add_to_callback("stop_run",nicetext,"a nice text") |
| 88 |
} |
| 89 |
} |
| 90 |
\def\unchickenize{ |
| 91 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","chickenize") |
| 92 |
luatexbase.remove_from_callback("start_page_number","cstartpage") |
| 93 |
luatexbase.remove_from_callback("stop_page_number","cstoppage")}} |
| 94 |
|
| 95 |
\def\coffeestainize{ %% to be implemented. |
| 96 |
\directlua{}} |
| 97 |
\def\uncoffeestainize{ |
| 98 |
\directlua{}} |
| 99 |
|
| 100 |
\def\colorstretch{ |
| 101 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",colorstretch,"stretch_expansion")}} |
| 102 |
\def\uncolorstretch{ |
| 103 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","stretch_expansion")}} |
| 104 |
|
| 105 |
\def\countglyphs{ |
| 106 |
\directlua{ |
| 107 |
counted_glyphs_by_code = {} |
| 108 |
for i = 1,10000 do |
| 109 |
counted_glyphs_by_code[i] = 0 |
| 110 |
end |
| 111 |
glyphnumber = 0 spacenumber = 0 |
| 112 |
luatexbase.add_to_callback("post_linebreak_filter",countglyphs,"countglyphs") |
| 113 |
luatexbase.add_to_callback("stop_run",printglyphnumber,"printglyphnumber") |
| 114 |
} |
| 115 |
} |
| 116 |
|
| 117 |
\def\countwords{ |
| 118 |
\directlua{wordnumber = 0 |
| 119 |
luatexbase.add_to_callback("pre_linebreak_filter",countwords,"countwords") |
| 120 |
luatexbase.add_to_callback("stop_run",printwordnumber,"printwordnumber") |
| 121 |
} |
| 122 |
} |
| 123 |
|
| 124 |
\def\detectdoublewords{ |
| 125 |
\directlua{ |
| 126 |
luatexbase.add_to_callback("post_linebreak_filter",detectdoublewords,"detectdoublewords") |
| 127 |
luatexbase.add_to_callback("stop_run",printdoublewords,"printdoublewords") |
| 128 |
} |
| 129 |
} |
| 130 |
|
| 131 |
\def\dosomethingfunny{ |
| 132 |
%% 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? |
| 133 |
} |
| 134 |
|
| 135 |
\def\dubstepenize{ |
| 136 |
\chickenize |
| 137 |
\directlua{ |
| 138 |
chickenstring[1] = "WOB" |
| 139 |
chickenstring[2] = "WOB" |
| 140 |
chickenstring[3] = "WOB" |
| 141 |
chickenstring[4] = "BROOOAR" |
| 142 |
chickenstring[5] = "WHEE" |
| 143 |
chickenstring[6] = "WOB WOB WOB" |
| 144 |
chickenstring[7] = "WAAAAAAAAH" |
| 145 |
chickenstring[8] = "duhduh duhduh duh" |
| 146 |
chickenstring[9] = "BEEEEEEEEEW" |
| 147 |
chickenstring[10] = "DDEEEEEEEW" |
| 148 |
chickenstring[11] = "EEEEEW" |
| 149 |
chickenstring[12] = "boop" |
| 150 |
chickenstring[13] = "buhdee" |
| 151 |
chickenstring[14] = "bee bee" |
| 152 |
chickenstring[15] = "BZZZRRRRRRROOOOOOAAAAA" |
| 153 |
|
| 154 |
chickenizefraction = 1 |
| 155 |
} |
| 156 |
} |
| 157 |
\let\dubstepize\dubstepenize |
| 158 |
|
| 159 |
\def\explainbackslashes{ %% inspired by xkcd #1638 |
| 160 |
{\tt\noindent |
| 161 |
\textbackslash escape character\\ |
| 162 |
\textbackslash\textbackslash line end or escaped escape character in tex.print("")\\ |
| 163 |
\textbackslash\textbackslash\textbackslash real, real backslash\\ |
| 164 |
\textbackslash\textbackslash\textbackslash\textbackslash line end in tex.print("")\\ |
| 165 |
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash elder backslash \\ |
| 166 |
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash which escapes the screen and enters your brain\\ |
| 167 |
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash so real it transcends time and space \\ |
| 168 |
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash backslash to end all other text\\ |
| 169 |
\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash\textbackslash... the true name of Ba'al, the soul-eater} |
| 170 |
} |
| 171 |
|
| 172 |
\def\francize{ |
| 173 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",francize,"francize")}} |
| 174 |
|
| 175 |
\def\unfrancize{ |
| 176 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter",francize)}} |
| 177 |
|
| 178 |
\def\gameoflife{ |
| 179 |
Your Life Is Tetris. Stop Playing It Like Chess. |
| 180 |
} |
| 181 |
\def\gameofchicken#1{\directlua{ |
| 182 |
GOCrule_live = {2,3} |
| 183 |
GOCrule_spawn = {3} |
| 184 |
GOCrule_antilive = {2,3} |
| 185 |
GOCrule_antispawn = {3} |
| 186 |
GOCcellcode = "\\scalebox{0.03}{\\drawchicken}" |
| 187 |
GOCcellcode = "\\scalebox{0.03}{\\drawcov}" |
| 188 |
GOCx = 100 |
| 189 |
GOCy = 100 |
| 190 |
GOCiter = 150 |
| 191 |
GOC_console = false |
| 192 |
GOC_pdf = true |
| 193 |
GOCsleep = 0 |
| 194 |
GOCdensity = 100 |
| 195 |
#1 |
| 196 |
gameofchicken() |
| 197 |
|
| 198 |
if (GOCmakegif == true) then |
| 199 |
luatexbase.add_to_callback("wrapup_run",make_a_gif,"makeagif") |
| 200 |
end |
| 201 |
}} |
| 202 |
\let\gameofchimken\gameofchicken % yeah, that had to be. |
| 203 |
|
| 204 |
\def\guttenbergenize{ %% makes only sense when using LaTeX |
| 205 |
\AtBeginDocument{ |
| 206 |
\let\grqq\relax\let\glqq\relax |
| 207 |
\let\frqq\relax\let\flqq\relax |
| 208 |
\let\grq\relax\let\glq\relax |
| 209 |
\let\frq\relax\let\flq\relax |
| 210 |
\gdef\footnote##1{} |
| 211 |
\gdef\cite##1{}\gdef\parencite##1{} |
| 212 |
\gdef\Cite##1{}\gdef\Parencite##1{} |
| 213 |
\gdef\cites##1{}\gdef\parencites##1{} |
| 214 |
\gdef\Cites##1{}\gdef\Parencites##1{} |
| 215 |
\gdef\footcite##1{}\gdef\footcitetext##1{} |
| 216 |
\gdef\footcites##1{}\gdef\footcitetexts##1{} |
| 217 |
\gdef\textcite##1{}\gdef\Textcite##1{} |
| 218 |
\gdef\textcites##1{}\gdef\Textcites##1{} |
| 219 |
\gdef\smartcites##1{}\gdef\Smartcites##1{} |
| 220 |
\gdef\supercite##1{}\gdef\supercites##1{} |
| 221 |
\gdef\autocite##1{}\gdef\Autocite##1{} |
| 222 |
\gdef\autocites##1{}\gdef\Autocites##1{} |
| 223 |
%% many, many missing … maybe we need to tackle the underlying mechanism? |
| 224 |
} |
| 225 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",guttenbergenize_rq,"guttenbergenize_rq")} |
| 226 |
} |
| 227 |
|
| 228 |
\def\hammertime{ |
| 229 |
\global\let\n\relax |
| 230 |
\directlua{hammerfirst = true |
| 231 |
luatexbase.add_to_callback("pre_linebreak_filter",hammertime,"hammertime")}} |
| 232 |
\def\unhammertime{ |
| 233 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","hammertime")}} |
| 234 |
|
| 235 |
\let\hendlnize\chickenize % homage to Hendl/Chicken |
| 236 |
\let\unhendlnize\unchickenize % may the soldering strength always be with him |
| 237 |
|
| 238 |
\def\italianizerandwords{ |
| 239 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",italianizerandwords,"italianizerandwords")}} |
| 240 |
\def\unitalianizerandwords{ |
| 241 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","italianizerandwords")}} |
| 242 |
|
| 243 |
\def\italianize{ |
| 244 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",italianize,"italianize")}} |
| 245 |
\def\unitalianize{ |
| 246 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","italianize")}} |
| 247 |
|
| 248 |
|
| 249 |
\def\kernmanipulate{ |
| 250 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",kernmanipulate,"kernmanipulate")}} |
| 251 |
\def\unkernmanipulate{ |
| 252 |
\directlua{lutaexbase.remove_from_callback("pre_linebreak_filter",kernmanipulate)}} |
| 253 |
|
| 254 |
\def\leetspeak{ |
| 255 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",leet,"1337")}} |
| 256 |
\def\unleetspeak{ |
| 257 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","1337")}} |
| 258 |
|
| 259 |
\def\leftsideright#1{ |
| 260 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",leftsideright,"leftsideright")} |
| 261 |
\directlua{ |
| 262 |
leftsiderightindex = {#1} |
| 263 |
leftsiderightarray = {} |
| 264 |
for _,i in pairs(leftsiderightindex) do |
| 265 |
leftsiderightarray[i] = true |
| 266 |
end |
| 267 |
} |
| 268 |
} |
| 269 |
\def\unleftsideright{ |
| 270 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","leftsideright")}} |
| 271 |
|
| 272 |
\def\letterspaceadjust{ |
| 273 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",letterspaceadjust,"letterspaceadjust")}} |
| 274 |
\def\unletterspaceadjust{ |
| 275 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","letterspaceadjust")}} |
| 276 |
|
| 277 |
\def\listallcommands{ |
| 278 |
\directlua{ |
| 279 |
for name in pairs(tex.hashtokens()) do |
| 280 |
print(name) |
| 281 |
end} |
| 282 |
} |
| 283 |
|
| 284 |
\let\stealsheep\letterspaceadjust %% synonym in honor of Paul |
| 285 |
\let\unstealsheep\unletterspaceadjust |
| 286 |
\let\returnsheep\unletterspaceadjust |
| 287 |
|
| 288 |
\def\matrixize{ |
| 289 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",matrixize,"matrixize")}} |
| 290 |
\def\unmatrixize{ |
| 291 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","matrixize")}} |
| 292 |
|
| 293 |
\def\milkcow{ %% FIXME %% to be implemented |
| 294 |
\directlua{}} |
| 295 |
\def\unmilkcow{ |
| 296 |
\directlua{}} |
| 297 |
|
| 298 |
\def\medievalumlaut{ |
| 299 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",medievalumlaut,"medievalumlaut")}} |
| 300 |
\def\unmedievalumlaut{ |
| 301 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","medievalumlaut")}} |
| 302 |
|
| 303 |
\def\pancakenize{ |
| 304 |
\directlua{luatexbase.add_to_callback("stop_run",pancaketext,"pancaketext")}} |
| 305 |
|
| 306 |
\def\rainbowcolor{ |
| 307 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",randomcolor,"rainbowcolor") |
| 308 |
rainbowcolor = true}} |
| 309 |
\def\unrainbowcolor{ |
| 310 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","rainbowcolor") |
| 311 |
rainbowcolor = false}} |
| 312 |
\let\nyanize\rainbowcolor |
| 313 |
\let\unnyanize\unrainbowcolor |
| 314 |
|
| 315 |
\def\randomchars{ |
| 316 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",randomchars,"randomchars")}} |
| 317 |
\def\unrandomchars{ |
| 318 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomchars")}} |
| 319 |
|
| 320 |
\def\randomcolor{ |
| 321 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",randomcolor,"randomcolor")}} |
| 322 |
\def\unrandomcolor{ |
| 323 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomcolor")}} |
| 324 |
|
| 325 |
\def\randomerror{ %% FIXME |
| 326 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",randomerror,"randomerror")}} |
| 327 |
\def\unrandomerror{ %% FIXME |
| 328 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomerror")}} |
| 329 |
|
| 330 |
\def\randomfonts{ |
| 331 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",randomfonts,"randomfonts")}} |
| 332 |
\def\unrandomfonts{ |
| 333 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","randomfonts")}} |
| 334 |
|
| 335 |
\def\randomuclc{ |
| 336 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",randomuclc,"randomuclc")}} |
| 337 |
\def\unrandomuclc{ |
| 338 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","randomuclc")}} |
| 339 |
|
| 340 |
\def\relationship{% |
| 341 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",cutparagraph,"cut paragraph") |
| 342 |
luatexbase.add_to_callback("stop_run",missingcharstext,"charsmissing") |
| 343 |
relationship() |
| 344 |
} |
| 345 |
} |
| 346 |
|
| 347 |
\let\rongorongonize\boustrophedoninverse |
| 348 |
\let\unrongorongonize\unboustrophedoninverse |
| 349 |
|
| 350 |
\def\scorpionize{ |
| 351 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",scorpionize_color,"scorpionize_color")}} |
| 352 |
\def\unscorpionize{ |
| 353 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","scorpionize_color")}} |
| 354 |
|
| 355 |
\def\spankmonkey{ %% to be implemented |
| 356 |
\directlua{}} |
| 357 |
\def\unspankmonkey{ |
| 358 |
\directlua{}} |
| 359 |
|
| 360 |
\def\substitutewords{ |
| 361 |
\directlua{luatexbase.add_to_callback("process_input_buffer",substitutewords,"substitutewords")}} |
| 362 |
\def\unsubstitutewords{ |
| 363 |
\directlua{luatexbase.remove_from_callback("process_input_buffer","substitutewords")}} |
| 364 |
|
| 365 |
\def\addtosubstitutions#1#2{ |
| 366 |
\directlua{addtosubstitutions("#1","#2")} |
| 367 |
} |
| 368 |
|
| 369 |
\def\suppressonecharbreak{ |
| 370 |
\directlua{luatexbase.add_to_callback("pre_linebreak_filter",suppressonecharbreak,"suppressonecharbreak")}} |
| 371 |
\def\unsuppressonecharbreak{ |
| 372 |
\directlua{luatexbase.remove_from_callback("pre_linebreak_filter","suppressonecharbreak")}} |
| 373 |
|
| 374 |
\def\tabularasa{ |
| 375 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",tabularasa,"tabularasa")}} |
| 376 |
\def\untabularasa{ |
| 377 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","tabularasa")}} |
| 378 |
|
| 379 |
\def\tanjanize{ |
| 380 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",tanjanize,"tanjanize")}} |
| 381 |
\def\untanjanize{ |
| 382 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","tanjanize")}} |
| 383 |
|
| 384 |
\def\uppercasecolor{ |
| 385 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",uppercasecolor,"uppercasecolor")}} |
| 386 |
\def\unuppercasecolor{ |
| 387 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","uppercasecolor")}} |
| 388 |
|
| 389 |
\def\upsidedown#1{ |
| 390 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",upsidedown,"upsidedown")} |
| 391 |
\directlua{ |
| 392 |
upsidedownindex = {#1} |
| 393 |
upsidedownarray = {} |
| 394 |
for _,i in pairs(upsidedownindex) do |
| 395 |
upsidedownarray[i] = true |
| 396 |
end |
| 397 |
} |
| 398 |
} |
| 399 |
\def\unupsidedown{ |
| 400 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","upsidedown")}} |
| 401 |
|
| 402 |
\def\variantjustification{ |
| 403 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",variantjustification,"variantjustification")}} |
| 404 |
\def\unvariantjustification{ |
| 405 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","variantjustification")}} |
| 406 |
|
| 407 |
\def\zebranize{ |
| 408 |
\directlua{luatexbase.add_to_callback("post_linebreak_filter",zebranize,"zebranize")}} |
| 409 |
\def\unzebranize{ |
| 410 |
\directlua{luatexbase.remove_from_callback("post_linebreak_filter","zebranize")}} |
| 411 |
\newattribute\leetattr |
| 412 |
\newattribute\letterspaceadjustattr |
| 413 |
\newattribute\randcolorattr |
| 414 |
\newattribute\randfontsattr |
| 415 |
\newattribute\randuclcattr |
| 416 |
\newattribute\tabularasaattr |
| 417 |
\newattribute\uppercasecolorattr |
| 418 |
|
| 419 |
\long\def\textleetspeak#1% |
| 420 |
{\setluatexattribute\leetattr{42}#1\unsetluatexattribute\leetattr} |
| 421 |
|
| 422 |
\long\def\textletterspaceadjust#1{ |
| 423 |
\setluatexattribute\letterspaceadjustattr{42}#1\unsetluatexattribute\letterspaceadjustattr |
| 424 |
\directlua{ |
| 425 |
if (textletterspaceadjustactive) then else % -- if already active, do nothing |
| 426 |
luatexbase.add_to_callback("pre_linebreak_filter",textletterspaceadjust,"textletterspaceadjust") |
| 427 |
end |
| 428 |
textletterspaceadjustactive = true % -- set to active |
| 429 |
} |
| 430 |
} |
| 431 |
\let\textlsa\textletterspaceadjust |
| 432 |
|
| 433 |
\long\def\textrandomcolor#1% |
| 434 |
{\setluatexattribute\randcolorattr{42}#1\unsetluatexattribute\randcolorattr} |
| 435 |
\long\def\textrandomfonts#1% |
| 436 |
{\setluatexattribute\randfontsattr{42}#1\unsetluatexattribute\randfontsattr} |
| 437 |
\long\def\textrandomfonts#1% |
| 438 |
{\setluatexattribute\randfontsattr{42}#1\unsetluatexattribute\randfontsattr} |
| 439 |
\long\def\textrandomuclc#1% |
| 440 |
{\setluatexattribute\randuclcattr{42}#1\unsetluatexattribute\randuclcattr} |
| 441 |
\long\def\texttabularasa#1% |
| 442 |
{\setluatexattribute\tabularasaattr{42}#1\unsetluatexattribute\tabularasaattr} |
| 443 |
\long\def\textuppercasecolor#1% |
| 444 |
{\setluatexattribute\uppercasecolorattr{42}#1\unsetluatexattribute\uppercasecolorattr} |
| 445 |
\def\chickenizesetup#1{\directlua{#1}} |
| 446 |
\long\def\luadraw#1#2{% |
| 447 |
\vbox to #1bp{% |
| 448 |
\vfil |
| 449 |
\latelua{pdf_print("q") #2 pdf_print("Q")}% |
| 450 |
}% |
| 451 |
} |
| 452 |
\long\def\drawchicken{ |
| 453 |
\luadraw{90}{ |
| 454 |
chickenhead = {200,50} % chicken head center |
| 455 |
chickenhead_rad = 20 |
| 456 |
|
| 457 |
neckstart = {215,35} % neck |
| 458 |
neckstop = {230,10} % |
| 459 |
|
| 460 |
chickenbody = {260,-10} |
| 461 |
chickenbody_rad = 40 |
| 462 |
chickenleg = { |
| 463 |
{{260,-50},{250,-70},{235,-70}}, |
| 464 |
{{270,-50},{260,-75},{245,-75}} |
| 465 |
} |
| 466 |
|
| 467 |
beak_top = {185,55} |
| 468 |
beak_front = {165,45} |
| 469 |
beak_bottom = {185,35} |
| 470 |
|
| 471 |
wing_front = {260,-10} |
| 472 |
wing_bottom = {280,-40} |
| 473 |
wing_back = {275,-15} |
| 474 |
|
| 475 |
sloppycircle(chickenhead,chickenhead_rad) sloppyline(neckstart,neckstop) |
| 476 |
sloppycircle(chickenbody,chickenbody_rad) |
| 477 |
sloppyline(chickenleg[1][1],chickenleg[1][2]) sloppyline(chickenleg[1][2],chickenleg[1][3]) |
| 478 |
sloppyline(chickenleg[2][1],chickenleg[2][2]) sloppyline(chickenleg[2][2],chickenleg[2][3]) |
| 479 |
sloppyline(beak_front,beak_top) sloppyline(beak_front,beak_bottom) |
| 480 |
sloppyline(wing_front,wing_bottom) sloppyline(wing_back,wing_bottom) |
| 481 |
} |
| 482 |
} |
| 483 |
\long\def\drawcov{ |
| 484 |
\luadraw{90}{ |
| 485 |
covbody = {200,50} |
| 486 |
covbody_rad = 50 |
| 487 |
|
| 488 |
covcrown_rad = 5 |
| 489 |
crownno = 13 |
| 490 |
for i=1,crownno do |
| 491 |
crownpos = {covbody[1]+1.4*covbody_rad*math.sin(2*math.pi/crownno*i),covbody[2]+1.4*covbody_rad*math.cos(2*math.pi/crownno*i)} |
| 492 |
crownconnect = {covbody[1]+covbody_rad*math.sin(2*math.pi/crownno*i),covbody[2]+covbody_rad*math.cos(2*math.pi/crownno*i)} |
| 493 |
sloppycircle(crownpos,covcrown_rad) |
| 494 |
sloppyline(crownpos,crownconnect) |
| 495 |
end |
| 496 |
|
| 497 |
covcrown_rad = 6 |
| 498 |
crownno = 8 |
| 499 |
for i=1,crownno do |
| 500 |
crownpos = {covbody[1]+0.8*covbody_rad*math.sin(2*math.pi/crownno*i),covbody[2]+0.8*covbody_rad*math.cos(2*math.pi/crownno*i)} |
| 501 |
crownconnect = {covbody[1]+0.5*covbody_rad*math.sin(2*math.pi/crownno*i),covbody[2]+0.5*covbody_rad*math.cos(2*math.pi/crownno*i)} |
| 502 |
sloppycircle(crownpos,covcrown_rad) |
| 503 |
sloppyline(crownpos,crownconnect) |
| 504 |
end |
| 505 |
|
| 506 |
covcrown_rad = 8 |
| 507 |
sloppycircle(covbody,covcrown_rad) |
| 508 |
sloppycircle(covbody,covbody_rad) |
| 509 |
sloppyline(covbody,covbody) |
| 510 |
} |
| 511 |
} |
| 512 |
\long\def\drawhorse{ |
| 513 |
\luadraw{90}{ |
| 514 |
horsebod = {100,-40} |
| 515 |
sloppyellipsis(horsebod,50,20) |
| 516 |
horsehead = {20,0} |
| 517 |
sloppyellipsis(horsehead,25,15) |
| 518 |
sloppyline({35,-10},{50,-40}) |
| 519 |
sloppyline({45,5},{80,-25}) |
| 520 |
sloppyline({60,-50},{60,-90}) |
| 521 |
sloppyline({70,-50},{70,-90}) |
| 522 |
sloppyline({130,-50},{130,-90}) |
| 523 |
sloppyline({140,-50},{140,-90}) |
| 524 |
sloppyline({150,-40},{160,-60}) |
| 525 |
sloppyline({150,-38},{160,-58}) |
| 526 |
sloppyline({150,-42},{160,-62}) |
| 527 |
sloppyline({-5,-10},{10,-5}) |
| 528 |
sloppyellipsis({30,5},5,2) %% it's an eye, aye? |
| 529 |
sloppyline({27,15},{34,25}) |
| 530 |
sloppyline({34,25},{37,13}) |
| 531 |
} |
| 532 |
} |
| 533 |
\long\def\drawfathorse{ |
| 534 |
\luadraw{90}{ |
| 535 |
horsebod = {100,-40} |
| 536 |
sloppyellipsis(horsebod,50,40) |
| 537 |
horsehead = {20,0} |
| 538 |
sloppyellipsis(horsehead,25,15) |
| 539 |
sloppyline({35,-10},{50,-40}) |
| 540 |
sloppyline({45,5},{70,-15}) |
| 541 |
sloppyline({60,-70},{60,-90}) |
| 542 |
sloppyline({70,-70},{70,-90}) |
| 543 |
sloppyline({130,-70},{130,-90}) |
| 544 |
sloppyline({140,-70},{140,-90}) |
| 545 |
sloppyline({150,-40},{160,-60}) |
| 546 |
sloppyline({150,-38},{160,-58}) |
| 547 |
sloppyline({150,-42},{160,-62}) |
| 548 |
sloppyline({-5,-10},{10,-5}) |
| 549 |
sloppyellipsis({30,5},5,2) %% it's an eye, aye? |
| 550 |
sloppyline({27,15},{34,25}) |
| 551 |
sloppyline({34,25},{37,13}) |
| 552 |
} |
| 553 |
} |
| 554 |
\long\def\drawunicorn{ |
| 555 |
\color{pink!90!black} |
| 556 |
\drawhorse |
| 557 |
\luadraw{0}{ |
| 558 |
sloppyline({15,20},{15,50}) |
| 559 |
sloppyline({15,50},{25,20}) |
| 560 |
} |
| 561 |
} |
| 562 |
\long\def\drawfatunicorn{ |
| 563 |
\color{pink!90!black} |
| 564 |
\drawfathorse |
| 565 |
\luadraw{0}{ |
| 566 |
sloppyline({15,20},{15,50}) |
| 567 |
sloppyline({15,50},{25,20}) |
| 568 |
} |
| 569 |
} |
| 570 |
%% |
| 571 |
%% |
| 572 |
%% End of file `chickenize.tex'. |