Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SILE's output is non-deterministic (in at least one case) #972

Closed
ctrlcctrlv opened this issue Jul 22, 2020 · 3 comments
Closed

SILE's output is non-deterministic (in at least one case) #972

ctrlcctrlv opened this issue Jul 22, 2020 · 3 comments
Labels
bug Software bug issue duplicate Rejected as duplicate
Milestone

Comments

@ctrlcctrlv
Copy link
Member

Finally I found a somewhat short MWE that doesn't require any of my modules.

Consider:

(The text is a nonsensical pseudo-injoke devoid of context.)

nondet.sil

\begin{document}
\script[src=packages/rebox]
\script[src=packages/raiselower]
\script{
local inputfilter = SILE.require("packages/inputfilter").exports
-- not done elsewhere so it doesn't mess up arguments to other commands
local function dblquotes(input, content) 
    return input:gsub('%"', '”')
end -- "Handle double quotes"
SILE.registerCommand("texmode", function(options, content)
local output = [[\rebox[height=0,width=0,depth=0]{\lower[height=72pt]{{Tinatawag nilá akón͠g ``magandá'' dahil ang akin͠g }{\em{ĉapelo}}{ ay nasa taman͠g lugár.}}}
\rebox[height=0,width=0,depth=0]{\lower[height=72pt - 1.25em]{Sa totoó lang, pan͠g{}unahin͠g kagandahan͠g{-}ásal sa m͠ga titik magsuót n͠g \em{ĉapelaĵoj} ganitó.}}
\rebox[height=0,width=0,depth=0]{\lower[height=72pt - 2.50em]{An͠g m͠ga titik na hindi, sila'y hindi edukado lan͠g pô kasí.}}]]
local tree = SILE.inputs.TeXlike.docToTree('\\begin{document}'..output..'\\end{document}')
SILE.process(inputfilter.transformContent(tree, dblquotes))
end)
local newline = function(_, content)
  SILE.settings.temporarily(function()
    SILE.settings.set("typesetter.parseppattern", "\n")
    SILE.doTexlike(" \n\\skip[height=0em]")
  end)
end

SILE.registerCommand("newline", newline)
SILE.registerCommand("\\", newline)
}
\font[family=Gentium Plus]
ĥ:
\texmode
\end{document}

Sometimes the output is:
image

Other times:
image

Notice how the word ''ĉapelaĵoj" moves about. Nothing changes in the document between invocations.

I do not know how to debug this. Help would be appreciated.

@alerque alerque added the bug Software bug issue label Jul 22, 2020
@alerque
Copy link
Member

alerque commented Jul 22, 2020

Wow that's a weird one.

I am able to replicate this on v0.10.7.r47-gc1b1c2b. It comes up out of order at least 1/3 of the time, and I don't see any pattern as to when.

@alerque
Copy link
Member

alerque commented Jul 22, 2020

Here is a pared down MWE:

\begin{document}
\script[src=packages/rebox]
\begin{script}
  local inputfilter = require("packages/inputfilter").exports
  local noop = function (input, _) return input end
  SILE.registerCommand("nondet", function(_, content)
    SILE.process(inputfilter.transformContent(content, noop))
  end)
\end{script}
\nondet{\rebox{foo \em{bar} baz}}
\end{document}

@alerque alerque added the duplicate Rejected as duplicate label Jul 22, 2020
@alerque
Copy link
Member

alerque commented Jul 22, 2020

This (whatever it is) seems to be the same as #532.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Software bug issue duplicate Rejected as duplicate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants