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

sile-typesetter / sile / 9324025270

31 May 2024 08:35PM UTC coverage: 66.168% (-8.0%) from 74.124%
9324025270

push

github

web-flow
Merge 235329972 into 70ff5c335

1753 of 2583 new or added lines in 108 files covered. (67.87%)

1498 existing lines in 74 files now uncovered.

11404 of 17235 relevant lines covered (66.17%)

2956.13 hits per line

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

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

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

6
function package:registerCommands ()
×
7
   self:registerCommand("alt", function (_, _)
×
8
      SU.deprecated("\\alt", "\\alternative", "0.10.0", "0.14.0")
×
9
   end, "Deprecated")
×
10

11
   self:registerCommand("alternative", function (_, content)
×
12
      local alts = {}
×
13
      for _, fragment in ipairs(content) do
×
14
         local hbox, hlist = SILE.typesetter:makeHbox({ fragment })
×
15
         if #hlist > 0 then
×
16
            SU.error("Forbidden migrating content in alternative")
×
17
         end
18
         table.insert(alts, hbox)
×
19
      end
NEW
20
      local alternative = SILE.types.node.alternative({
×
21
         options = alts,
22
         selected = 1,
23
      })
24
      alternative.width = nil
×
25
      SILE.typesetter.state.nodes[#SILE.typesetter.state.nodes + 1] = alternative
×
26
   end)
27
end
28

29
package.documentation = [[
30
\begin{document}
31
Johann Gutenberg’s 42-line Bible is considered a masterpiece of early printing in part due to the quality of justification of every line.
32
To achieve perfect justification color, Gutenberg used a number of ligatures, abbreviations, substitutions, and so on.
33

34
As an experiment in extending SILE’s justification engine, the \autodoc:package{gutenberg} package allows SILE to choose between a number of different options for a particular piece of text, depending on what would improve the line fitting.
35

36
For instance, issuing the command \autodoc:command{\alternative{\{and\}\{&\}}} would insert either the text \autodoc:example{and} or an ampersand, depending on what best fits the current line.
37
\end{document}
38
]]
×
39

40
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

© 2026 Coveralls, Inc