Skip to content

Commit f3ede85

Browse files
committed
Remove beamer support and arbitrary latex environment
1 parent cfc9479 commit f3ede85

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

column-div/column-div.lua

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ Note: You need to include multicol latex package to get balanced columns
2222
in latex or pdf
2323
I tried to use well known html or latex parameter.
2424
Even if lua doen't like hyphens like in column-count.
25+
26+
Bugs: * html rendering throws a warning [WARNING] Ignoring duplicate attribute style="width:60%;".
27+
when widht AND color are set and totally ignore the width
28+
attribute. Don't know if this bug is mine
2529
--]]
2630
local List = require 'pandoc.List'
2731

@@ -40,22 +44,8 @@ function Div(div)
4044
-- effect.
4145
if not div.classes or #div.classes == 0 then return nil end
4246

43-
-- if the output is beamer do columns
44-
if FORMAT:match 'beamer' then
45-
-- only arbitrary environment support in beamer for now. Environment has to
46-
-- be the firs class name.
47-
env = div.classes[1]
48-
if options == '' and div.attributes['data-latex'] then
49-
options = div.attributes['data-latex']
50-
end
51-
-- build the returned list of blocks
52-
begin_env = List:new{pandoc.RawBlock('tex',
53-
'\\begin{' .. env .. '}' .. options)}
54-
end_env = List:new{pandoc.RawBlock('tex', '\\end{' .. env .. '}')}
55-
returned_list = begin_env .. div.content .. end_env
56-
5747
-- if the format is latex then do minipage and others (like multicol)
58-
elseif FORMAT:match 'latex' then
48+
if FORMAT:match 'latex' then
5949
-- build the returned list of blocks
6050
if div.classes:includes('column') then
6151
env = 'column'
@@ -111,6 +101,7 @@ function Div(div)
111101
-- process supported options
112102
opt = div.attributes['column-count']
113103
if opt then options = '{' .. opt .. '}' end
104+
--[[ This functionality will be moved in another filter since it can't be consistent with the positionless classname requirement
114105
else
115106
-- Latex skilled users can use arbitrary environments passed as
116107
-- the first (and only signifiant) class name.
@@ -119,6 +110,7 @@ function Div(div)
119110
if options == '' and div.attributes['data-latex'] then
120111
options = div.attributes['data-latex']
121112
end
113+
--]]
122114
end
123115

124116
begin_env = List:new{pandoc.RawBlock('tex',
@@ -139,7 +131,7 @@ function Div(div)
139131
-- column-count is "consumed" by the filter otherwise it would appear as
140132
-- data-column-count="…" in the resulting document
141133
end
142-
-- add support for color TODO: latex counterpart
134+
-- add support for color
143135
opt = div.attributes.color
144136
if opt then
145137
-- add color to style
@@ -156,6 +148,7 @@ function Div(div)
156148
if style then
157149
div.attributes.style = style .. (div.attributes.style or '')
158150
returned_list = List:new{pandoc.Div(div.content, div.attr)}
151+
--returned_list = List:new{pandoc.Div(div.content)}
159152
end
160153
end
161154
return returned_list

0 commit comments

Comments
 (0)