summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/chickenize/chickenize.lua')
-rw-r--r--Master/texmf-dist/tex/luatex/chickenize/chickenize.lua36
1 files changed, 24 insertions, 12 deletions
diff --git a/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua b/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua
index a331b6536f8..670ec02b2e5 100644
--- a/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua
+++ b/Master/texmf-dist/tex/luatex/chickenize/chickenize.lua
@@ -8,11 +8,6 @@
--
-- EXPERIMENTAL CODE
--
--- Do not distribute this file without also distributing the
--- source files specified above.
---
--- Do not distribute a modified version of this file under the same name.
---
-- 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-
@@ -118,7 +113,7 @@ chickenize = function(head)
return head
end
-local separator = string.rep("=", 28)
+local separator = string.rep("=", 28)
local texiowrite_nl = texio.write_nl
nicetext = function()
texiowrite_nl("Output written on "..tex.jobname..".pdf ("..status.total_pages.." chicken,".." eggs).")
@@ -292,6 +287,19 @@ matrixize = function(head)
end
return head
end
+local separator = string.rep("=", 28)
+local texiowrite_nl = texio.write_nl
+pancaketext = function()
+ texiowrite_nl("Output written on "..tex.jobname..".pdf ("..status.total_pages.." chicken,".." eggs).")
+ texiowrite_nl(" ")
+ texiowrite_nl(separator)
+ texiowrite_nl("Soo ... you decided to use \\pancakenize.")
+ texiowrite_nl("That means you owe me a pancake!")
+ texiowrite_nl(" ")
+ texiowrite_nl("(This goes by document, not compilation.)")
+ texiowrite_nl(separator.."\n\n")
+ texiowrite_nl("Looking forward for my pancake! :)")
+end
local randomfontslower = 1
local randomfontsupper = 0
randomfonts = function(head)
@@ -397,7 +405,7 @@ tabularasa_onlytext = false
tabularasa = function(head)
local s = nodenew(nodeid"kern")
for line in nodetraverseid(nodeid"hlist",head) do
- for n in nodetraverseid(nodeid"glyph",line.list) do
+ for n in nodetraverseid(nodeid"glyph",line.head) do
if not(tabularasa_onlytext) or node.has_attribute(n,luatexbase.attributes.tabularasaattr) then
s.kern = n.width
nodeinsertafter(line.list,n,nodecopy(s))
@@ -407,14 +415,18 @@ tabularasa = function(head)
end
return head
end
+uppercasecolor_onlytext = false
+
uppercasecolor = function (head)
for line in nodetraverseid(Hhead,head) do
for upper in nodetraverseid(GLYPH,line.head) do
- if (((upper.char > 64) and (upper.char < 91)) or
- ((upper.char > 57424) and (upper.char < 57451))) then -- for small caps! nice ☺
- color_push.data = randomcolorstring() -- color or grey string
- line.head = nodeinsertbefore(line.head,upper,nodecopy(color_push))
- nodeinsertafter(line.head,upper,nodecopy(color_pop))
+ if not(uppercasecolor_onlytext) or node.has_attribute(upper,luatexbase.attributes.uppercasecolorattr) then
+ if (((upper.char > 64) and (upper.char < 91)) or
+ ((upper.char > 57424) and (upper.char < 57451))) then -- for small caps! nice ☺
+ color_push.data = randomcolorstring() -- color or grey string
+ line.head = nodeinsertbefore(line.head,upper,nodecopy(color_push))
+ nodeinsertafter(line.head,upper,nodecopy(color_pop))
+ end
end
end
end