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

sile-typesetter / sile / 6713098919

31 Oct 2023 10:21PM UTC coverage: 52.831% (-21.8%) from 74.636%
6713098919

push

github

web-flow
Merge d0a2a1ee9 into b185d4972

45 of 45 new or added lines in 3 files covered. (100.0%)

8173 of 15470 relevant lines covered (52.83%)

6562.28 hits per line

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

0.0
/packages/raiselower/init.lua
1
local base = require("packages.base")
×
2

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

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

23
function package:registerCommands ()
×
24

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

30
  self:registerCommand("lower", function (options, content)
×
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")
×
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
]]
×
54

55
return package
×
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