• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sile-typesetter / sile / 5017842917

pending completion
5017842917

push

github

GitHub
Merge pull request #1738 from alerque/multi-inputs

16 of 16 new or added lines in 2 files covered. (100.0%)

9954 of 15641 relevant lines covered (63.64%)

6575.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/packages/raiselower/init.lua
1
local base = require("packages.base")
7✔
2

3
local package = pl.class(base)
7✔
4
package._name = "raiselower"
7✔
5

6
local function raise (height, content)
7
  SILE.typesetter:pushHbox({
2✔
8
    outputYourself = function (_, typesetter, _)
9
      typesetter.frame:advancePageDirection(-height)
2✔
10
    end
11
  })
12
  SILE.process(content)
1✔
13
  SILE.typesetter:pushHbox({
2✔
14
    outputYourself = function (_, typesetter, _)
15
      if (type(typesetter.state.cursorY)) == "table" then
1✔
16
        typesetter.state.cursorY = typesetter.state.cursorY.length
×
17
      end
18
      typesetter.frame:advancePageDirection(height)
1✔
19
    end
20
  })
21
end
22

23
function package:registerCommands ()
7✔
24

25
  self:registerCommand("raise", function (options, content)
14✔
26
    local height = SU.cast("measurement", options.height)
1✔
27
    raise(height:absolute(), content)
2✔
28
  end, "Raises the contents of the command by the amount specified in the <height> option")
8✔
29

30
  self:registerCommand("lower", function (options, content)
14✔
31
    local height = SU.cast("measurement", options.height)
×
32
    raise(-height:absolute(), content)
×
33
  end, "Lowers the contents of the command by the amount specified in the <height> option")
7✔
34

35
end
36

37
package.documentation = [[
38
\begin{document}
39
If you don’t want your images, rules, or text to be placed along the baseline, you can use the \autodoc:package{raiselower} package to move them up and down.
40
(The \autodoc:package{footnote} package uses this to superscript the footnote reference numbers.)
41

42
It provides two simple commands, \autodoc:command{\raise} and \autodoc:command{\lower}, which both take a \autodoc:parameter{height=<dimension>} parameter.
43
They will respectively raise or lower their argument by the given height.
44
The raised or lowered content will not alter the height or depth of the line.
45

46
Here is some text raised by \raise[height=3pt]{three points}; here is some text lowered by \lower[height=4pt]{four points}.
47

48
The previous paragraph was generated by:
49

50
\begin[type=autodoc:codeblock]{raw}
51
Here is some text raised by \raise[height=3pt]{three points}; here is some text lowered by \lower[height=4pt]{four points}.
52
\end{raw}
53
\end{document}
54
]]
7✔
55

56
return package
7✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc