git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: Avoid extra space at start/end of table cell.

Thanks to Nick Bart for the suggestion of using @{}.

commit229c22582f46986953bdeb70af8f4baa8272de29 authorJohn MacFarlane <fiddlosopher@gmail.com> dateMon 28 Jan 2013, 10:21 (14 years ago) parentc50af73
1 file changed+3−1
src/Text/Pandoc/Writers/LaTeX.hs+3−1
src/Text/Pandoc/Writers/LaTeX.hs+3−1
@@ -422,7 +422,9 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
422422 let notes = vcat $ map toNote tableNotes
423423 let colDescriptors = text $ concat $ map toColDescriptor aligns
424424 modify $ \s -> s{ stTable = True, stInTable = False, stTableNotes = [] }
425− return $ "\\begin{longtable}[c]" <> braces colDescriptors
425+ return $ "\\begin{longtable}[c]" <>
426+ braces ("@{}" <> colDescriptors <> "@{}")
427+ -- the @{} removes extra space at beginning and end
426428 $$ "\\hline\\noalign{\\medskip}"
427429 $$ headers
428430 $$ vcat rows'