@@ -22,6 +22,10 @@ Note: You need to include multicol latex package to get balanced columns
22
22
in latex or pdf
23
23
I tried to use well known html or latex parameter.
24
24
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
25
29
--]]
26
30
local List = require ' pandoc.List'
27
31
@@ -40,22 +44,8 @@ function Div(div)
40
44
-- effect.
41
45
if not div .classes or # div .classes == 0 then return nil end
42
46
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
-
57
47
-- if the format is latex then do minipage and others (like multicol)
58
- elseif FORMAT :match ' latex' then
48
+ if FORMAT :match ' latex' then
59
49
-- build the returned list of blocks
60
50
if div .classes :includes (' column' ) then
61
51
env = ' column'
@@ -111,6 +101,7 @@ function Div(div)
111
101
-- process supported options
112
102
opt = div .attributes [' column-count' ]
113
103
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
114
105
else
115
106
-- Latex skilled users can use arbitrary environments passed as
116
107
-- the first (and only signifiant) class name.
@@ -119,6 +110,7 @@ function Div(div)
119
110
if options == '' and div.attributes['data-latex'] then
120
111
options = div.attributes['data-latex']
121
112
end
113
+ --]]
122
114
end
123
115
124
116
begin_env = List :new {pandoc .RawBlock (' tex' ,
@@ -139,7 +131,7 @@ function Div(div)
139
131
-- column-count is "consumed" by the filter otherwise it would appear as
140
132
-- data-column-count="…" in the resulting document
141
133
end
142
- -- add support for color TODO: latex counterpart
134
+ -- add support for color
143
135
opt = div .attributes .color
144
136
if opt then
145
137
-- add color to style
@@ -156,6 +148,7 @@ function Div(div)
156
148
if style then
157
149
div .attributes .style = style .. (div .attributes .style or ' ' )
158
150
returned_list = List :new {pandoc .Div (div .content , div .attr )}
151
+ -- returned_list = List:new{pandoc.Div(div.content)}
159
152
end
160
153
end
161
154
return returned_list
0 commit comments