diff options
Diffstat (limited to 'rst_context.lua')
-rw-r--r-- | rst_context.lua | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/rst_context.lua b/rst_context.lua index 9010bb8..00a8881 100644 --- a/rst_context.lua +++ b/rst_context.lua @@ -479,7 +479,8 @@ function rst_context.paragraph (data) if not data then return "" elseif type(data) == "table" then - str = #data > 1 and helpers.string.wrapat(inline_parser:match(table.concat(data, " ")), 65) or inline_parser:match(data[1]) + str = #data > 1 and helpers.string.wrapat(inline_parser:match(table.concat(data, " ")), 65) + or inline_parser:match(data[1]) else str = data end @@ -1144,6 +1145,8 @@ end function optional_setups.references () local refs = rst_context.collected_references local crefs = rst_context.context_references + local arefs = rst_context.anonymous_set + local function resolve_indirect (r) if r and r:match(".*_$") then -- pointing elsewhere local look_me_up = r:match("^`?([^`]*)`?_$") @@ -1169,7 +1172,6 @@ function optional_setups.references () ]] local references = {} local ref_keys = {} - local arefs = rst_context.anonymous_set for ref, target in next, refs do ref_keys[#ref_keys+1] = [[__target_]] .. rst_context.whitespace_to_underscore(ref) target = resolve_indirect(target) @@ -1590,13 +1592,18 @@ function optional_setups.caution () \usemodule[lettrine] -\setbox0=\hbox{\symbol[dbend]\hbox to 1em{}} +\setbox0=\hbox{\symbol[dbend]} \newskip\RSTbendskip \RSTbendskip=\wd0 +\advance\RSTbendskip by 1em % These two lines should add +\advance\RSTbendskip by 1pt % 13.4pt in mkiv and 13.14983pt in mkii + % to make the indent equal to the indent + % of the “danger” directive. + % (2*(width)dbend + (kern)1pt + 1em \def\startRSTcaution{% \startparagraph -\dontleavehmode\lettrine[Lines=2,Raise=.5,Findent=\RSTbendskip,Nindent=0pt]{\symbol[dbend]}{}% +\dontleavehmode\lettrine[Lines=2,Raise=.6,Findent=\RSTbendskip,Nindent=0pt]{\symbol[dbend]}{}% } \let\stopRSTcaution\stopparagraph @@ -1619,7 +1626,7 @@ function optional_setups.danger () \def\startRSTdanger{% \startparagraph -\lettrine[Lines=2,Raise=.5,Findent=1em,Nindent=0pt]{\symbol[dbend]\kern 1pt\symbol[dbend]}{}% +\lettrine[Lines=2,Raise=.6,Findent=1em,Nindent=0pt]{\symbol[dbend]\kern 1pt\symbol[dbend]}{}% } \let\stopRSTdanger\stopparagraph |