mirror of
https://github.com/benjaminion/upgrading-ethereum-book.git
synced 2026-01-09 22:47:55 -05:00
PDF: Simplify summary box handling
This commit is contained in:
@@ -2,18 +2,9 @@
|
|||||||
--
|
--
|
||||||
-- Find summary boxes in the text and wrap them in a `summarybox` environment.
|
-- Find summary boxes in the text and wrap them in a `summarybox` environment.
|
||||||
|
|
||||||
local function is_summary(div)
|
|
||||||
for _, class in pairs(div.classes) do
|
|
||||||
if class == 'summary' then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
function Div (div)
|
function Div (div)
|
||||||
|
|
||||||
if is_summary(div) then
|
if div.classes:includes('summary') then
|
||||||
return {
|
return {
|
||||||
pandoc.RawInline('latex', '\\begin{summarybox}'),
|
pandoc.RawInline('latex', '\\begin{summarybox}'),
|
||||||
div,
|
div,
|
||||||
|
|||||||
Reference in New Issue
Block a user