2
2
tables-vrules - adds vertical rules to tables for latex output
3
3
4
4
Copyright: © 2021 Christophe Agathon <[email protected] >
5
+
5
6
License: MIT – see LICENSE file for details
6
7
7
8
Credits: marijnschraagen for the original Latex hack
@@ -23,10 +24,9 @@ function Table(table)
23
24
24
25
if FORMAT :match ' latex' then
25
26
26
- -- print(pandoc.utils.stringify(table.caption))
27
-
28
27
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}%[[^%]]*%]{@{})(.*)(@{}}))" )
30
30
31
31
if not coldef then return nil end
32
32
@@ -37,11 +37,6 @@ function Table(table)
37
37
-- asuming new style
38
38
new_coldef = coldef :gsub (' (>)' ,' |%1' ) .. ' |'
39
39
end
40
- -- print ('>', coldef)
41
- -- print ('>', new_coldef)
42
- -- print ('>', envdef)
43
- -- print ('>', begdef .. new_coldef .. enddef ..
44
- -- latex_code:sub(envdef:len() + 1))
45
40
returned_list = List :new {pandoc .RawBlock (' tex' ,
46
41
begdef .. new_coldef .. enddef ..
47
42
latex_code :sub (envdef :len () + 1 ))}
52
47
function Meta (meta )
53
48
-- We have to add this since Pandoc doesn't do it when a filter is
54
49
-- processing tables (is it a bug or a feature ???)
55
- --
50
+
56
51
includes = [[ %begin tables-vrules.lua
57
52
\usepackage{longtable,booktabs,array}
58
53
\usepackage{calc} % for calculating minipage widths
0 commit comments