|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- This file:
-- https://anggtwu.net/LATEX/2026logica-para-pessoas.lua.html
-- https://anggtwu.net/LATEX/2026logica-para-pessoas.lua
-- (find-angg "LATEX/2026logica-para-pessoas.lua")
-- Author: Eduardo Ochs <eduardoochs@gmail.com>
--
-- (defun e () (interactive) (find-LATEX "2025-2-C2-example-6.tex"))
-- (defun e () (interactive) (find-LATEX "2026logica-para-pessoas.tex"))
-- (defun l () (interactive) (find-LATEX "2026logica-para-pessoas.lua"))
bigstr = [==[
\L {((6x^3)(7x^4))'}
\R {\L {\ddx((6x^3)(7x^4))}}
\R { (6x^3)\ddx(7x^4) + (7x^4) \L {\ddx(6x^3)} }
(6x^3)\ddx(7x^4) + (7x^4) · \R {6 · \L {\ddx x^3}}
(6x^3)\ddx(7x^4) + (7x^4) · \L {6 · \R {3 x^2}}
(6x^3) \L {\ddx(7x^4)} + (7x^4) \R{(18x^2)}
(6x^3)·\R {7 \L {\ddx x^4}} + (7x^4)(18x^2)
(6x^3)·\L {7·\R {4x^3}} + (7x^4)(18x^2)
(6x^3) \R{(28x^3)} + \L {(7x^4)(18x^2)}
\L {(6x^3)(28x^3)} + \R {126x^6}
\L {\R {168x^6} + 126x^6}
\R {294x^6}
]==]
n = 0
substL = function (str)
local f = function (body) return format("\\luastandout {L%s} %s", n, body) end
return (str:gsub("\\L%s*(%b{})", f))
end
substR = function (str)
local f = function (body) return format("\\luastandout {R%s} %s", n-1, body) end
return (str:gsub("\\R%s*(%b{})", f))
end
defE = function (str)
return format("\\sa {E%d} {\\luastandout {E%d} {%s}}", n, n, str)
end
--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile "2026logica-para-pessoas.lua"
lines = VTable(splitlines(bigstr))
for i,line in ipairs(lines) do
n = i
print(defE(substR(substL(bitrim(line)))))
end
--]]
-- Local Variables:
-- coding: utf-8-unix
-- End: