22tables-vrules - adds vertical rules to tables for latex output
33
44Copyright: © 2021 Christophe Agathon <christophe.agathon@gmail.com>
5+
56License: MIT – see LICENSE file for details
67
78Credits: 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 ))}
5247function 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