summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua')
-rw-r--r--Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua61
1 files changed, 52 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua b/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua
index 09bade82a27..c39a964f648 100644
--- a/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua
+++ b/Master/texmf-dist/tex/lualatex/ideavault/ideavault-lua.lua
@@ -15,6 +15,29 @@
--
-- This work consists of the files ideavault.sty and ideavault-lua.lua
+
+logErrorEnabled = true
+logWarnEnabled = true
+logDebugEnabled = false
+
+function logError(message)
+ if (logErrorEnabled) then
+ texio.write_nl("[ERROR] " .. message)
+ end
+end
+
+function logWarn(message)
+ if (logWarnEnabled) then
+ texio.write_nl("[WARN] " .. message)
+ end
+end
+
+function logDebug(message)
+ if (logDebugEnabled) then
+ texio.write_nl("[DEBUG] " .. message)
+ end
+end
+
IdeaVaultClass = {}
IdeaVaultClass.__index = IdeaVaultClass
@@ -186,12 +209,15 @@ bookmark_counter = 0
function IdeaClass:printSelf(style)
style = style or ""
- texio.write("Printing idea. Title: '" .. self:getTitle() .. "', style: '" .. style .. "'.\n")
+ logDebug("Printing idea. Title: '" .. self:getTitle() .. "', style: '" .. style .. "'.\n")
local frame = false
local center = false
local bookmark = false
local large = false
+ local Large = false
+ local huge = false
+ local Huge = false
local needSpace = false
local emph = false
local quiet = false
@@ -206,7 +232,13 @@ function IdeaClass:printSelf(style)
elseif (c == "b") then
bookmark = true
elseif (c == "l") then
- large = true
+ large = true
+ elseif (c == "L") then
+ Large = true
+ elseif (c == "h") then
+ huge = true
+ elseif (c == "H") then
+ Huge = true
elseif (c == "s") then
needSpace = true
elseif (c == "e") then
@@ -247,23 +279,34 @@ function IdeaClass:printSelf(style)
end
if (not quiet)
then
+ tex.sprint("{%")
if (large)
then
- tex.sprint("{\\Large%")
+ tex.sprint("\\Large%")
+ end
+ if (Large)
+ then
+ tex.sprint("\\LARGE%")
+ end
+ if (huge)
+ then
+ tex.sprint("\\huge%")
+ end
+ if (Huge)
+ then
+ tex.sprint("\\Huge%")
end
if (emph)
then
tex.sprint("\\emph{,,")
end
tex.sprint(self:getTitle())
+ tex.sprint("\\nopagebreak%")
if (emph)
then
tex.sprint("''}%")
end
- if (large)
- then
- tex.sprint("}%")
- end
+ tex.sprint("}%")
end
if (center)
then
@@ -344,7 +387,7 @@ function createIdea(prefix, key, content, dependencies, tags, value)
t = t .. a .. ", "
end
t = t .. "]"
- texio.write("Creating idea. Title: '" .. key .. "'. Prefix: '" .. prefix .. "', tags: " .. t .. ".\n")
+ logDebug("Creating idea. Title: '" .. key .. "'. Prefix: '" .. prefix .. "', tags: " .. t .. ".\n")
deps = {}
for _, val in pairs(dependencies)
do
@@ -360,7 +403,7 @@ end
function die(reason)
reason = reason or "nil"
- texio.write_nl("Critical error: " .. reason)
+ logError("Critical error: " .. reason)
tex.error("Critical error: " .. reason)
end