Skip to content

Commit 8a2fbca

Browse files
committed
Code cleaning
1 parent 816295e commit 8a2fbca

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tables-vrules/tables-vrules.lua

+4-9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
tables-vrules - adds vertical rules to tables for latex output
33
44
Copyright: © 2021 Christophe Agathon <[email protected]>
5+
56
License: MIT – see LICENSE file for details
67
78
Credits: marijnschraagen for the original Latex hack
@@ -23,10 +24,9 @@ function Table(table)
2324

2425
if FORMAT:match 'latex' then
2526

26-
--print(pandoc.utils.stringify(table.caption))
27-
2827
latex_code = pandoc.write ( pandoc.Pandoc({table}),'latex' )
29-
envdef, begdef, coldef, enddef = latex_code:match("((\\begin{longtable}%[[^%]]*%]{@{})(.*)(@{}}))")
28+
envdef, begdef, coldef, enddef =
29+
latex_code:match("((\\begin{longtable}%[[^%]]*%]{@{})(.*)(@{}}))")
3030

3131
if not coldef then return nil end
3232

@@ -37,11 +37,6 @@ function Table(table)
3737
-- asuming new style
3838
new_coldef = coldef:gsub('(>)','|%1') .. '|'
3939
end
40-
--print ('>', coldef)
41-
--print ('>', new_coldef)
42-
--print ('>', envdef)
43-
--print ('>', begdef .. new_coldef .. enddef ..
44-
-- latex_code:sub(envdef:len() + 1))
4540
returned_list = List:new{pandoc.RawBlock('tex',
4641
begdef .. new_coldef .. enddef ..
4742
latex_code:sub(envdef:len() + 1))}
@@ -52,7 +47,7 @@ end
5247
function Meta(meta)
5348
-- We have to add this since Pandoc doesn't do it when a filter is
5449
-- processing tables (is it a bug or a feature ???)
55-
--
50+
5651
includes = [[%begin tables-vrules.lua
5752
\usepackage{longtable,booktabs,array}
5853
\usepackage{calc} % for calculating minipage widths

0 commit comments

Comments
 (0)