mirror of
https://github.com/benjaminion/upgrading-ethereum-book.git
synced 2026-01-09 22:47:55 -05:00
Introduce spans for wrapping long strings
This commit is contained in:
@@ -15,3 +15,17 @@ function RawInline (el)
|
|||||||
end
|
end
|
||||||
return el
|
return el
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- We now support <span class="wrap">...</span>
|
||||||
|
-- These spans must contain only raw text (or backquoted code), with no nested elements
|
||||||
|
function Span (span)
|
||||||
|
if span.classes:includes('wrap') then
|
||||||
|
if (span.content[1].t == 'Str') then
|
||||||
|
return pandoc.RawInline('latex', '\\seqsplit{' .. span.content[1].text .. '}')
|
||||||
|
end
|
||||||
|
if (span.content[1].t == 'Code') then
|
||||||
|
return pandoc.RawInline('latex', '\\texttt{\\seqsplit{' .. span.content[1].text .. '}}')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return span
|
||||||
|
end
|
||||||
|
|||||||
@@ -154,3 +154,8 @@
|
|||||||
\let\prevsubparagraph\subparagraph
|
\let\prevsubparagraph\subparagraph
|
||||||
\renewcommand{\subparagraph}[1]{\prevsubparagraph{#1}\nopagebreak}
|
\renewcommand{\subparagraph}[1]{\prevsubparagraph{#1}\nopagebreak}
|
||||||
\fi
|
\fi
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
% Used by linebreaks.lua to split long hexadecimal strings
|
||||||
|
|
||||||
|
\usepackage{seqsplit}
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ code {
|
|||||||
font-size: 95%;
|
font-size: 95%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*** Wrapping long lines of hex ***/
|
||||||
|
span.wrap {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
|
||||||
/*** Constant line heights ***/
|
/*** Constant line heights ***/
|
||||||
|
|
||||||
sup, sub {
|
sup, sub {
|
||||||
|
|||||||
Reference in New Issue
Block a user