mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-24 09:16:43 +00:00
+25
@@ -161,4 +161,29 @@ of the citations by specifying an appropriate CSL bibliography
|
||||
style using `--csl`
|
||||
(see [the manual](https://pandoc.org/MANUAL.html#specifying-a-citation-style)).
|
||||
|
||||
### Pandoc adds column widths to pipe tables when any line is wider than the setting for `--columns`. How can I prevent this?
|
||||
|
||||
Save this filter as `nowidths.lua` and then pass `--lua-filter
|
||||
nowidths.lua` as an additional option to pandoc.
|
||||
(See <https://github.com/jgm/pandoc/issues/8139>.)
|
||||
|
||||
``` lua
|
||||
-- Unset the width attribute of HTML colspecs in tables
|
||||
-- See https://github.com/jgm/pandoc/issues/8139
|
||||
function Table (tbl)
|
||||
if PANDOC_VERSION[1] >= 2 and PANDOC_VERSION[2] >= 10 then
|
||||
tbl.colspecs = tbl.colspecs:map(function (colspec)
|
||||
local align = colspec[1]
|
||||
local width = nil -- default width
|
||||
return {align, width}
|
||||
end)
|
||||
else
|
||||
for i, w in ipairs(tbl.widths) do
|
||||
tbl.widths[i] = 0
|
||||
end
|
||||
end
|
||||
return tbl
|
||||
end
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
Reference in New Issue
Block a user