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

sile-typesetter / sile / 6915746301

18 Nov 2023 07:02PM UTC coverage: 56.433% (-12.3%) from 68.751%
6915746301

push

github

web-flow
Merge 8b3fdc301 into f64e235fa

8729 of 15468 relevant lines covered (56.43%)

932.75 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")
2✔
2

3
local package = pl.class(base)
2✔
4
package._name = "raiselower"
2✔
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 ()
2✔
24

25
  self:registerCommand("raise", function (options, content)
4✔
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")
3✔
29

30
  self:registerCommand("lower", function (options, content)
4✔
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")
2✔
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

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

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

47
The previous paragraph was generated by:
48

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

55
return package
2✔
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

© 2025 Coveralls, Inc