Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.52 KB | None | 0 0
  1. if __INCLUDES__TeXCache ~= nil then
  2. else
  3. __INCLUDES__TeXCache = true
  4. if __DEBUG == true then
  5. print("Including TeXCache.lua")
  6. end
  7.  
  8. require "md5"
  9. require "lfs"
  10. require "persist"
  11.  
  12.  
  13. ------------------------------------------ Utility functions
  14. if not file then file = {} end
  15. function file.Exists(name) local f = io.open(name, "r") if f ~= nil then io.close(f) return true end return false end
  16. function FileExists(name) local f = io.open(name, "r") if f ~= nil then io.close(f) return true end return false end
  17. function FileSize(name) local f = io.open(name, "r") if f == nil then return -1 end local current = f:seek() local size = f:seek("end") f:seek("set", current) io.close(f) return size end
  18.  
  19. function split(str, pat) local t = {} local fpat = "(.-)" .. pat local last_end = 1 local s, e, cap = str:find(fpat, 1) while s do if s ~= 1 or cap ~= "" then table.insert(t,cap) end last_end = e+1 s, e, cap = str:find(fpat, last_end) end if last_end <= #str then cap = str:sub(last_end) table.insert(t, cap) end return t end
  20. function string.trim(s, c) if not c then c = " t" end return s:match('^['..c..']*(.-)['..c..']*$') end
  21. function string.split(str, sep, n)
  22. local sep, fields = sep or ":", {}
  23. --local pattern = string.format("([^%s]+)", sep)
  24. local pattern = '[^'..sep..']'
  25. if n == 0 or n == nil then pattern = '('..pattern..'+)' end
  26. if n > 0 then pattern = '^'..(pattern..'+'):rep(n)..'('..pattern..'+)' end
  27. str:gsub(pattern, function(c) fields[#fields + 1] = c end)
  28. return fields
  29. end
  30.  
  31. function DeepCopyTable(orig)
  32. local orig_type = type(orig)
  33. local copy
  34. if orig_type == 'table' then
  35. copy = {}
  36. for orig_key, orig_value in next, orig, nil do
  37. copy[DeepCopyTable(orig_key)] = DeepCopyTable(orig_value)
  38. end
  39. setmetatable(copy, DeepCopyTable(getmetatable(orig)))
  40. else -- number, string, boolean, etc
  41. copy = orig
  42. end
  43. return copy
  44. end
  45.  
  46.  
  47. function CopyFile(source, dest)
  48. local infile = io.open(source, "rb")
  49. instr = infile:read("*a")
  50. infile:close()
  51. local outfile = io.open(dest, "wb")
  52. outfile:write(instr)
  53. outfile:close()
  54. end
  55.  
  56. function ReadFile(source, text)
  57. if not text then text = "rb" else text = "r" end
  58. local infile = io.open(source, text)
  59. if not infile then return nil end
  60. instr = infile:read("*a")
  61. infile:close()
  62. return instr
  63. end
  64.  
  65. function WriteFile(source, data)
  66. local outfile = io.open(source, "wb")
  67. instr = infile:write(data)
  68. outfile:close()
  69. end
  70.  
  71. function DeleteFile(Filename)
  72. -- windows only. os.remove has problems!?
  73. os.execute('del /Q "'..Filename:gsub("/","\")..'" > nul')
  74. end
  75.  
  76.  
  77. --------------------------------------------- Setup
  78.  
  79.  
  80.  
  81. TeXCache = {}
  82. TeXCache.Arguments = "";
  83. TeXCache.ModeAfter = "\batchmode"
  84. TeXCache.Disabled = false
  85. TeXCache.FileExt = "_TeXCache.tex"
  86. TeXCache.CacheDir = "TeXCache/"
  87. TeXCache.HistoryFilename = "TeXCacheHistory.dat";
  88. TeXCache.Header = ""
  89. TeXCache.ForceRegenerate = false
  90. TeXCache.Count = 0
  91. TeXCache.History = {}
  92. TeXCache.Temp = {}
  93.  
  94. --------------------- Preprocessing TeX
  95. function StartProcessingTeX()
  96.  
  97. -- Load TeXCache.History and set all values to nil, If they are cached, they will be set to 1 at the end and the nil values keys/files can be removed
  98. TeXCache.History = persistence.load(TeXCache.Path..TeXCache.CacheDir..TeXCache.HistoryFilename);
  99. if TeXCache.History then
  100. if not TeXCache.History.Cached then
  101. TeXCache.History.Cached = {}
  102. end
  103. else
  104. TeXCache.History = {}
  105. TeXCache.History.Cached = {}
  106. end
  107.  
  108. local curPage = -1
  109. local line
  110.  
  111. -- Read the synctex file and attempt to match input file with pages, onces the pages that the input file spans is determined,
  112. TeXCache.Temp.ValidCache = false
  113.  
  114. TeXCache.Temp.Synctex = {}
  115. TeXCache.Temp.Synctex.Input_ShortFiles = {}
  116. TeXCache.Temp.Synctex.Input_Indexes = {}
  117. -- Read Synctex If exists, else cannot cache. Stores page relations to input file relations
  118. if FileExists(TeXCache.Path..TeXCache.JobName..".synctex") then
  119. local f = io.open(TeXCache.Path..TeXCache.JobName..".synctex", "r")
  120. if f ~= nil then
  121. while true do
  122. line = f:read()
  123. if line == nil then break end
  124.  
  125. -- Get Input files and store in three way lookup
  126. if (string.sub(line,1,6) == "Input:") then
  127. local idx = tonumber(split(line, ":")[2])
  128. line = string.sub(line,8 + #tostring(idx),-1)
  129. line = string.gsub(string.gsub(line, "\./", "\"), "/", "\")
  130. local files = split(line, "\")
  131. local file = files[#files]
  132. local file2 = split(file, "%.")
  133. -- remove tex extension as it is default(we assume that inputs must have an extension of some type, else collisions may occur)
  134. if file2[#file2] == "tex" then
  135. file2[#file2] = nil
  136. if #file2 > 1 then
  137. file2 = table.concat(file2, ".")
  138. else
  139. file2 = file2[#file2]
  140. end
  141. file = file2
  142. end
  143.  
  144. TeXCache.Temp.Synctex.Input_ShortFiles[file] = {}
  145. TeXCache.Temp.Synctex.Input_ShortFiles[file].idx = idx
  146. TeXCache.Temp.Synctex.Input_ShortFiles[file].file = file
  147. TeXCache.Temp.Synctex.Input_ShortFiles[file].min = 100000
  148. TeXCache.Temp.Synctex.Input_ShortFiles[file].max = -1
  149. TeXCache.Temp.Synctex.Input_Indexes[idx] = {}
  150. TeXCache.Temp.Synctex.Input_Indexes[idx].idx = idx
  151. TeXCache.Temp.Synctex.Input_Indexes[idx].file = file
  152. TeXCache.Temp.Synctex.Input_Indexes[idx].min = 100000
  153. TeXCache.Temp.Synctex.Input_Indexes[idx].max = -1
  154.  
  155. elseif (string.sub(line,1,1) == "{") then
  156. curPage = string.sub(line,2,-1);
  157. elseif #line > 1 then
  158. local b = string.sub(line,1,1)
  159. if b == "[" or b == "(" or b == "v" or b == "h" or b == "x" or b == "k" or b == "g" or b == "$" then
  160. local idx = tonumber(split(string.sub(line,2,-1), ",")[1])
  161. if not TeXCache.Temp.Synctex.Input_Indexes[idx] then TeXCache.Temp.Synctex.Input_Indexes[idx] = {} end
  162. local lp = math.min(TeXCache.Temp.Synctex.Input_Indexes[idx].min or 100000, curPage)
  163. local hp = math.max(TeXCache.Temp.Synctex.Input_Indexes[idx].max or -1, curPage)
  164. local file = TeXCache.Temp.Synctex.Input_Indexes[idx].file
  165. if file then
  166. TeXCache.Temp.Synctex.Input_Indexes[idx].min = lp
  167. TeXCache.Temp.Synctex.Input_Indexes[idx].max = hp
  168.  
  169. TeXCache.Temp.Synctex.Input_ShortFiles[file].min = lp
  170. TeXCache.Temp.Synctex.Input_ShortFiles[file].max = hp
  171. end
  172. end
  173. end
  174. end
  175. TeXCache.Temp.Synctex.Exists = true
  176. end
  177. f:close()
  178. end
  179.  
  180.  
  181. end
  182.  
  183. function PreBeginDocument()
  184. end
  185.  
  186. function TocWriteAux()
  187. -- Import aux file preambles headers
  188. for key, value in pairs(TeXCache.History.Cached) do
  189. local s = ReadFile(TeXCache.Path..TeXCache.CacheDir.."Cached_"..key..'.aux', 1)
  190. if s then
  191. local loc = string.find(s, "\@setckpt{")
  192. s = s:sub(1,loc-1)
  193. tex.print("\makeatletter")
  194. tex.print(s)
  195. tex.print("\makeatother")
  196. print("nnnrn\makeatletterrn"..s.."rn\makeatotherrnnnn")
  197. end
  198. end
  199. end
  200.  
  201. --------------------- End Of Processing -------------------------
  202. function DoneProcessingTeX()
  203.  
  204.  
  205. persistence.store(TeXCache.Path..TeXCache.CacheDir..TeXCache.HistoryFilename, TeXCache.History);
  206. --print("nTABLE----------------------------"); print(inspect(TeXCache.History)); print("nTABLE----------------------------------");
  207. print("n----Total Includes Cached = "..TeXCache.Count.."n")
  208.  
  209. if TeXCache.Backups then
  210. for key, value in pairs(TeXCache.Backups) do
  211. -- Create backup of pdf for later use, could optimize duplicate files away
  212. -- We must redirect the copy to a batch file asychronously because TeX people suck ass(too lame)
  213. --CopyFile(TeXCache.Path..TeXCache.JobName..".pdf", TeXCache.Path..TeXCache.CacheDir.."Cached_"..key..".pdf")
  214. if value == 1 then
  215. os.execute('Start "copy" /min '..TeXCache.Path..'CopyFile.bat "'..TeXCache.Path..TeXCache.JobName..".pdf"..'" "'..TeXCache.Path..TeXCache.CacheDir.."Cached_"..key..'.pdf"')
  216. os.execute('Start "copy" /min '..TeXCache.Path..'CopyFile.bat "'..TeXCache.Path..key..".aux"..'" "'..TeXCache.Path..TeXCache.CacheDir.."Cached_"..key..'.aux"')
  217. end
  218. end
  219. end
  220.  
  221. -- Another hoop to jump through because of the ignorant TeX people. syntex(busy) won't be renamed when using os.execute above for some ignorant reason
  222. os.execute('Start "copy" /min '..string.gsub('CopyFile "'..TeXCache.Path..TeXCache.JobName..'.synctex(busy)" "'..TeXCache.Path..TeXCache.JobName..'.synctex"', "/", "\"))
  223. end
  224.  
  225.  
  226. -- Function callbacks must be above
  227. luatexbase.add_to_callback("stop_run", DoneProcessingTeX, "pdfextract3")
  228.  
  229. -------------------------------------- Caching code
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236. function TeXCache.Initialize(JobName, path)
  237. -- To write aux files without getting strange write error one must set MIKTEX_ALLOWUNSAFEOUTPUTFILES=1 in environment for miktex.
  238. -- Get base_dir using dos if necessary
  239. if not path then local p = io.popen("echo %cd%") if p then path = p:read("*l"):trim("\").."\" p:close() end end
  240. if path == nil or path == "" then path = lfs.currentdir() end
  241. path = (path or ""):trim('"' \/').."/"
  242. JobName = JobName:trim('"' /') or "temp"
  243. TeXCache.JobName = JobName
  244. TeXCache.Path = path
  245. print('Path = '..TeXCache.Path)
  246.  
  247. StartProcessingTeX()
  248. end tex.print("\directlua{TeXCache.Initialize('\jobname', '\BasePath')}")
  249.  
  250.  
  251.  
  252.  
  253.  
  254. function TeXCache.Include(code)
  255.  
  256. -- compare hash of included file with previously stored hash, if the same, then use cache
  257. -- could use filesize/date comparision for quicker tests
  258. local codefilename = TeXCache.Path..code..".tex"
  259. local fs = -1
  260. local hash = -1
  261. local curIdx = -1
  262. local lp = -1
  263. local hp = -1
  264.  
  265. if FileExists(codefilename) then
  266. fs = FileSize(codefilename)
  267. if TeXCache.History.Cached[code] and TeXCache.History.Cached[code].FileSize == fs then
  268. hash = md5.sumhexa(ReadFile(codefilename))
  269. if TeXCache.History.Cached[code].Hash == hash then
  270. local idx = -1
  271. if TeXCache.Temp.Synctex.Input_ShortFiles[code] then
  272. curIdx = TeXCache.Temp.Synctex.Input_ShortFiles[code].idx
  273. lp = math.max(TeXCache.Temp.Synctex.Input_ShortFiles[code].min, TeXCache.History.Cached[code].LowPage)
  274. hp = math.max(TeXCache.Temp.Synctex.Input_ShortFiles[code].max, TeXCache.History.Cached[code].HighPage)
  275. else
  276. lp = TeXCache.History.Cached[code].LowPage
  277. hp = TeXCache.History.Cached[code].HighPage
  278. end
  279. if lp < 0 or hp < 0 or lp >= 99999 then
  280. TeXCache.Temp.ValidCache = false
  281. else
  282. TeXCache.Temp.ValidCache = true
  283. end
  284. else
  285. TeXCache.Temp.ValidCache = false
  286. end
  287. else
  288. TeXCache.Temp.ValidCache = false
  289. end
  290. else
  291. TeXCache.Temp.ValidCache = false
  292. end
  293.  
  294.  
  295. if TeXCache.Temp.ValidCache == false then
  296. tex.print("\include{"..code.."}")
  297. if TeXCache.Backups == nil then
  298. TeXCache.Backups = {}
  299. end
  300. TeXCache.Backups[code] = 1
  301. -- Store Cached information
  302. if FileExists(codefilename) then
  303. fs = FileSize(codefilename)
  304. hash = md5.sumhexa(ReadFile(codefilename))
  305. end
  306. if TeXCache.History.Cached[code] then
  307. fs = fs
  308. hash = hash
  309. curIdx = curIdx
  310. lp = math.max(lp, TeXCache.History.Cached[code].LowPage or -1);
  311. hp = math.max(hp, TeXCache.History.Cached[code].HighPage or -1);
  312. end
  313. TeXCache.History.Cached[code] = {}
  314. TeXCache.History.Cached[code].FileSize = fs
  315. TeXCache.History.Cached[code].Hash = hash
  316. TeXCache.History.Cached[code].LowPage = lp
  317. TeXCache.History.Cached[code].HighPage = hp
  318. return
  319. end
  320.  
  321. for key, value in pairs(TeXCache.History.Cached) do
  322. if code == key then
  323. print("nUsing cached `"..code..".tex!n")
  324. local filename = TeXCache.Path..TeXCache.CacheDir.."Cached_"..code
  325. tex.print("\includepdf[pages={"..lp.."-"..hp.."}]{"..filename.."}")
  326.  
  327. -- Import aux file counters
  328. local s = ReadFile(TeXCache.Path..TeXCache.CacheDir.."Cached_"..key..'.aux')
  329. if s then
  330. local _, loc = string.find(s, "\@setckpt{"..code.."}{")
  331. s = s:sub(loc+1, -1)
  332. for i=#s, 1, -1 do
  333. if s:sub(i,i) == "}" then
  334. s = string.sub(s,1,i-1)
  335. break;
  336. end
  337. end
  338.  
  339. s = "rn\makeatletterrn"..s.."rn\makeatotherrn"
  340. tex.print(s)
  341. print("rnrnrn"..s.."rnrnrn")
  342. end
  343.  
  344. -- Store cached info for use on next run
  345. TeXCache.History.Cached[code].FileSize = fs
  346. TeXCache.History.Cached[code].Hash = hash
  347. TeXCache.History.Cached[code].LowPage = lp
  348. TeXCache.History.Cached[code].HighPage = hp
  349. TeXCache.Count = TeXCache.Count + 1
  350. break
  351. end
  352. end
  353.  
  354.  
  355.  
  356. end
  357.  
  358.  
  359. end -- __INCLUDE__
  360.  
  361. @echo off
  362. @REM use asynchronously to copy a file after a process as exited(set timeout to be long enough for process to end).
  363. @REM Call with Start "copy file" <path to this batch file> <source> <dest>
  364.  
  365. TIMEOUT 3 /NOBREAK
  366. copy /B /Y %1 %2
  367. exit
  368.  
  369. @echo off
  370. del test.synctex(busy)
  371. del test.synctex
  372. del test.pdf
  373. del test.toc
  374. del test.log
  375. del test.aux
  376. del TeXCacheTeXCacheHistory.dat
  377. del TeXCacheCached_testinput.pdf
  378. del TeXCacheCached_testinput.aux
  379.  
  380. --t_original = {1, 2, ["a"] = "string", b = "test", {"subtable", [4] = 2}};
  381. --persistence.store("storage.lua", t_original);
  382. --t_restored = persistence.load("storage.lua");
  383.  
  384. local write, writeIndent, writers, refCount;
  385.  
  386. persistence =
  387. {
  388. store = function (path, ...)
  389. local file, e = io.open(path, "w");
  390. if not file then
  391. return error(e);
  392. end
  393. local n = select("#", ...);
  394. -- Count references
  395. local objRefCount = {}; -- Stores reference that will be exported
  396. for i = 1, n do
  397. refCount(objRefCount, (select(i,...)));
  398. end;
  399. -- Export Objects with more than one ref and assign name
  400. -- First, create empty tables for each
  401. local objRefNames = {};
  402. local objRefIdx = 0;
  403. file:write("-- Persistent Datan");
  404. file:write("local multiRefObjects = {n");
  405. for obj, count in pairs(objRefCount) do
  406. if count > 1 then
  407. objRefIdx = objRefIdx + 1;
  408. objRefNames[obj] = objRefIdx;
  409. file:write("{};"); -- table objRefIdx
  410. end;
  411. end;
  412. file:write("n} -- multiRefObjectsn");
  413. -- Then fill them (this requires all empty multiRefObjects to exist)
  414. for obj, idx in pairs(objRefNames) do
  415. for k, v in pairs(obj) do
  416. file:write("multiRefObjects["..idx.."][");
  417. write(file, k, 0, objRefNames);
  418. file:write("] = ");
  419. write(file, v, 0, objRefNames);
  420. file:write(";n");
  421. end;
  422. end;
  423. -- Create the remaining objects
  424. for i = 1, n do
  425. file:write("local ".."obj"..i.." = ");
  426. write(file, (select(i,...)), 0, objRefNames);
  427. file:write("n");
  428. end
  429. -- Return them
  430. if n > 0 then
  431. file:write("return obj1");
  432. for i = 2, n do
  433. file:write(" ,obj"..i);
  434. end;
  435. file:write("n");
  436. else
  437. file:write("returnn");
  438. end;
  439. if type(path) == "string" then
  440. file:close();
  441. end;
  442. end;
  443.  
  444. load = function (path)
  445. local f, e;
  446. if type(path) == "string" then
  447. f, e = loadfile(path);
  448. else
  449. f, e = path:read('*a')
  450. end
  451. if f then
  452. return f();
  453. else
  454. return nil, e;
  455. end;
  456. end;
  457. }
  458.  
  459. -- Private methods
  460.  
  461. -- write thing (dispatcher)
  462. write = function (file, item, level, objRefNames)
  463. writers[type(item)](file, item, level, objRefNames);
  464. end;
  465.  
  466. -- write indent
  467. writeIndent = function (file, level)
  468. for i = 1, level do
  469. file:write("t");
  470. end;
  471. end;
  472.  
  473. -- recursively count references
  474. refCount = function (objRefCount, item)
  475. -- only count reference types (tables)
  476. if type(item) == "table" then
  477. -- Increase ref count
  478. if objRefCount[item] then
  479. objRefCount[item] = objRefCount[item] + 1;
  480. else
  481. objRefCount[item] = 1;
  482. -- If first encounter, traverse
  483. for k, v in pairs(item) do
  484. refCount(objRefCount, k);
  485. refCount(objRefCount, v);
  486. end;
  487. end;
  488. end;
  489. end;
  490.  
  491. -- Format items for the purpose of restoring
  492. writers = {
  493. ["nil"] = function (file, item)
  494. file:write("nil");
  495. end;
  496. ["number"] = function (file, item)
  497. file:write(tostring(item));
  498. end;
  499. ["string"] = function (file, item)
  500. file:write(string.format("%q", item));
  501. end;
  502. ["boolean"] = function (file, item)
  503. if item then
  504. file:write("true");
  505. else
  506. file:write("false");
  507. end
  508. end;
  509. ["table"] = function (file, item, level, objRefNames)
  510. local refIdx = objRefNames[item];
  511. if refIdx then
  512. -- Table with multiple references
  513. file:write("multiRefObjects["..refIdx.."]");
  514. else
  515. -- Single use table
  516. file:write("{n");
  517. for k, v in pairs(item) do
  518. writeIndent(file, level+1);
  519. file:write("[");
  520. write(file, k, level+1, objRefNames);
  521. file:write("] = ");
  522. write(file, v, level+1, objRefNames);
  523. file:write(";n");
  524. end
  525. writeIndent(file, level);
  526. file:write("}");
  527. end;
  528. end;
  529. ["function"] = function (file, item)
  530. -- Does only work for "normal" functions, not those
  531. -- with upvalues or c functions
  532. local dInfo = debug.getinfo(item, "uS");
  533. if dInfo.nups > 0 then
  534. file:write("nil --[[functions with upvalue not supported]]");
  535. elseif dInfo.what ~= "Lua" then
  536. file:write("nil --[[non-lua function not supported]]");
  537. else
  538. local r, s = pcall(string.dump,item);
  539. if r then
  540. file:write(string.format("loadstring(%q)", s));
  541. else
  542. file:write("nil --[[function could not be dumped]]");
  543. end
  544. end
  545. end;
  546. ["thread"] = function (file, item)
  547. file:write("nil --[[thread]]n");
  548. end;
  549. ["userdata"] = function (file, item)
  550. file:write("nil --[[userdata]]n");
  551. end;
  552. }
  553.  
  554. documentclass[12pt,oneside]{book}
  555. %batchmode
  556.  
  557. directlua{
  558. require("debugger")()
  559. }
  560.  
  561. directlua{
  562. % Must be ran first, sets up paths
  563. __DEBUG = true
  564. local path = BasePath
  565. local p = io.popen('echo '..string.char(37)..'cd'..string.char(37)) if p and (path == nil or path == "") then path = p:read("*l") p:close() end
  566. if path == nil or path == "" then path = lfs.currentdir() end
  567. if path == nil or path == "" then else BasePath = path end
  568. path = string.gsub(path, string.char(92), "/");
  569. BasePath = string.gsub(BasePath, string.char(92), "/")
  570. tex.print(-1, string.char(92).."def"..string.char(92).."BasePath"..string.char(123)..BasePath..string.char(125))
  571. }
  572.  
  573. directlua{
  574. dofile('TeXCache.lua')
  575. }
  576.  
  577. usepackage{luatex}
  578. usepackage{xcolor}
  579. usepackage{everypage}
  580. usepackage{afterpage}
  581. usepackage{pdfpages}
  582. usepackage{everyhook}
  583. usepackage{ifthen}
  584. usepackage{letltxmacro}
  585. usepackage{atbegshi}
  586. usepackage{lipsum}
  587.  
  588. directlua{tex.enableprimitives('',tex.extraprimitives())}
  589.  
  590.  
  591.  
  592.  
  593. newcommand{tableofcontentsEx}{tableofcontentsdirectlua{TocWriteAux()}}
  594. newcommand{cachedInput}[1]{clearpagedirectlua{TeXCache.Include("luaescapestring{#1}"); }clearpage}
  595.  
  596. title{Sections and Chapters}
  597. author{Test Author}
  598. date{ }
  599.  
  600.  
  601.  
  602.  
  603. directlua{if PreBeginDocument then PreBeginDocument() end}
  604. begin{document}
  605.  
  606.  
  607.  
  608.  
  609.  
  610. maketitle
  611. tableofcontentsEx
  612. clearpage
  613.  
  614.  
  615. lipsum
  616.  
  617. %This either includes or includespdf when cached.
  618. cachedInput{testinput}
  619.  
  620.  
  621.  
  622.  
  623.  
  624. slfkljasfasfjllasfjas;df
  625.  
  626. 234214214892784
  627. chapter{HELP!!!}
  628. asdfjhajsdfkljasjdf
  629. a
  630. asdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
  631.  
  632.  
  633. end{document}
  634.  
  635. chapter{AMAZING!}
  636.  
  637. {{{}}}{}{}{}{}{}{}
  638. $$x =
  639. y + z + z^2 + z^{311}
  640. $$
  641.  
  642. begin{tabular}{|c|c|}
  643. hline
  644. % after \: hline or cline{col1-col2} cline{col3-col4} ...
  645. 1 & 1 \
  646. 2 & 2 \
  647. hline
  648.  
  649.  
  650.  
  651. end{tabular}
  652.  
  653.  
  654. $$x =
  655. y
  656. $$
  657.  
  658. $z =
  659. x
  660. $
  661.  
  662. Alipsum
  663.  
  664.  
  665.  
  666. {
  667.  
  668. textcolor{red}{
  669. This is a test cache1
  670. Blipsum
  671. textcolor{green}{Clipsum}
  672. }
  673.  
  674.  
  675.  
  676. $$x =
  677. y + z + z^2 + z^43434
  678. $$
  679. lipsum
  680. lipsum
  681. lipsum
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.  
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705. $z =
  706. x
  707. $
  708.  
  709.  
  710.  
  711.  
  712. Dlipsum
  713. test
  714. xxxxxxxxxxxxxxxx
  715.  
  716. tex.print("\input{"..filename..".aux}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement