@@ -452,7 +452,25 @@ blockToLaTeX (Div (identifier,classes,kvs) bs) = do
452452 _ -> linkAnchor'
453453 let align dir txt = inCmd "begin" dir $$ txt $$ inCmd "end" dir
454454 lang <- toLang $ lookup "lang" kvs
455− let wrapDir = case lookup "dir" kvs of
455+ let wrapColumns = if "columns" `elem` classes
456+ then \contents ->
457+ inCmd "begin" "columns" <> brackets "T"
458+ $$ contents
459+ $$ inCmd "end" "columns"
460+ else id
461+ wrapColumn = if "column" `elem` classes
462+ then \contents ->
463+ let fromPct xs =
464+ case reverse xs of
465+ '%':ds -> '0':'.': reverse ds
466+ _ -> xs
467+ w = maybe "0.48" fromPct (lookup "width" kvs)
468+ in inCmd "begin" "column" <>
469+ braces (text w <> "\\textwidth")
470+ $$ contents
471+ $$ inCmd "end" "column"
472+ else id
473+ wrapDir = case lookup "dir" kvs of
456474 Just "rtl" -> align "RTL"
457475 Just "ltr" -> align "LTR"
458476 _ -> id
@@ -468,7 +486,8 @@ blockToLaTeX (Div (identifier,classes,kvs) bs) = do
468486 wrapNotes txt = if beamer && "notes" `elem` classes
469487 then "\\note" <> braces txt -- speaker notes
470488 else linkAnchor $$ txt
471− fmap (wrapDir . wrapLang . wrapNotes) $ blockListToLaTeX bs
489+ fmap (wrapColumns . wrapColumn . wrapDir . wrapLang . wrapNotes)
490+ $ blockListToLaTeX bs
472491blockToLaTeX (Plain lst) =
473492 inlineListToLaTeX $ dropWhile isLineBreakOrSpace lst
474493-- title beginning with fig: indicates that the image is a figure