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

sile-typesetter / sile / 9304060604

30 May 2024 02:07PM UTC coverage: 74.124% (-0.6%) from 74.707%
9304060604

push

github

alerque
style: Reformat Lua with stylua

8104 of 11995 new or added lines in 184 files covered. (67.56%)

15 existing lines in 11 files now uncovered.

12444 of 16788 relevant lines covered (74.12%)

7175.1 hits per line

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

94.74
/packages/rebox/init.lua
1
local base = require("packages.base")
11✔
2

3
local package = pl.class(base)
11✔
4
package._name = "rebox"
11✔
5

6
function package:registerCommands ()
11✔
7
   self:registerCommand("rebox", function (options, content)
22✔
8
      local hbox, hlist = SILE.typesetter:makeHbox(content)
10✔
9
      if options.width then
10✔
10
         hbox.width = SILE.length(options.width)
18✔
11
      end
12
      if options.height then
10✔
13
         hbox.height = SILE.length(options.height)
20✔
14
      end
15
      if options.depth then
10✔
16
         hbox.depth = SILE.length(options.depth)
16✔
17
      end
18
      if options.phantom then
10✔
19
         hbox.outputYourself = function (node, typesetter, line)
NEW
20
            typesetter.frame:advanceWritingDirection(node:scaledWidth(line))
×
21
         end
22
      end
23
      SILE.typesetter:pushHbox(hbox)
10✔
24
      SILE.typesetter:pushHlist(hlist)
10✔
25
   end, "Place the output within a hbox of specified width, height, depth and visibility")
21✔
26
end
27

28
package.documentation = [[
29
\begin{document}
30
This package provides the \autodoc:command{\rebox} command, which allows you to lie to SILE about the size of content.
31
You can change the \autodoc:parameter{width}, \autodoc:parameter{height}, or \autodoc:parameter{depth} of your content with the respective parameters, or make it invisible by setting the \autodoc:parameter{phantom} parameter to \code{true}.
32

33
For example:
34

35
\begin[type=autodoc:codeblock]{raw}
36
Hello \rebox[width=0pt]{world}overprint.
37

38
Look I’m not \rebox[phantom=true]{here}!
39
\end{raw}
40

41
\begin{autodoc:example}
42
Hello \rebox[width=0pt]{world}overprint.
43

44
Look I’m not \rebox[phantom=true]{here}!
45
\end{autodoc:example}
46
\end{document}
47
]]
11✔
48

49
return package
11✔
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