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

How to add chapter to Table of Contents? #1764

Closed
CatholicPenguin opened this issue Apr 7, 2023 · 9 comments
Closed

How to add chapter to Table of Contents? #1764

CatholicPenguin opened this issue Apr 7, 2023 · 9 comments
Labels
duplicate Rejected as duplicate
Milestone

Comments

@CatholicPenguin
Copy link

I noticed the Table of Contents only specifies sections and subsections. I've tried adjusting the depth, but that didn't work. How do I add the chapters to the Table of Contents?

@Omikhleia
Copy link
Member

Greetings,
I'm pretty sure chapters are added to the ToC...
... unless they are marked as unnumbered, in which case issue #1707 occurs - issue is fixed on master and is planned for 0.14.9.
Are you in that case or can you provide a MWE?

@CatholicPenguin
Copy link
Author

That is exactly my situation! Is there a way to fix it in the meantime?

@Omikhleia
Copy link
Member

That is exactly my situation!

Thanks for confirming, and let's all be glad it's not something else popping up:)

I'm closing this issue as duplicate of #1707 then.

Is there a way to fix it in the meantime?

Copying the impacted files from your installation into your project folder under the same folder hierarchy and applying the sames changes as in #1751 should work (...and you'll just have to remember removing these files when the release upgrade is available).

@Omikhleia Omikhleia closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2023
@Omikhleia Omikhleia added the duplicate Rejected as duplicate label Apr 7, 2023
@alerque alerque added this to the v0.14.9 milestone Apr 7, 2023
@alerque
Copy link
Member

alerque commented Apr 7, 2023

For the most part, functions can just be redefined. You can copy the new source for the \book:sectioning command out of the HEAD and into your document to get this bug fix in an old version of SILE:

\begin{lua}
  SILE.registerCommand("book:sectioning", function (options, content)
    local level = SU.required(options, "level", "book:sectioning")
    local number
    if SU.boolean(options.numbering, true) then
      SILE.call("increment-multilevel-counter", { id = "sectioning", level = level })
      number = self.packages.counters:formatMultilevelCounter(self:getMultilevelCounter("sectioning"))
    end
    if SU.boolean(options.toc, true) then
      SILE.call("tocentry", { level = level, number = number }, SU.subContent(content))
    end
    if SU.boolean(options.numbering, true) then
      if options.msg then
        SILE.call("fluent", { number = number }, { options.msg })
      else
        SILE.call("show-multilevel-counter", { id = "sectioning" })
      end
    else
      -- https://github.com/sile-typesetter/sile/issues/1707
      -- https://github.com/sile-typesetter/sile/issues/1751
      SILE.call("hbox")
    end
  end)
\end{lua}

But possibly better than that why not just run HEAD? Almost every platform we have packages for has an easy way to run a development package (e.g. Nix, Arch Linux, Homebrew, Docker). A few that don't (like Ubuntu) you could build from source. What platform are you on?

@CatholicPenguin
Copy link
Author

CatholicPenguin commented Apr 7, 2023

What's HEAD? I'm running Mac OS (homebrew). For perspective, I'm coming from LaTeX. I can work with some programming stuff if I need to, but I don't know Lua at all.

@alerque
Copy link
Member

alerque commented Apr 8, 2023

HEAD is the Git terminology for the currently commit, usually the most recent in a branch. You can use Homebrew to install some software from either the last stable version or the HEAD commit of repository (default branch). SILE's formula supports this feature.

# For the latest stable version
$ brew install sile

# For the latest bleeding edge
$ brew install --HEAD sile

The --HEAD option in Homebrew will take a bit longer because instead of downloading a prebuilt binary from Homebrew's archive it will compile a fresh version for you on the spot, but there shouldn't be anything else you have to do yourself. That should be a pretty easy way to try out the latest development work before we tag it in a release.

@CatholicPenguin
Copy link
Author

So, I tried that. However, it seems to have messed with my dropcaps, pushing them into the text itself).

@alerque
Copy link
Member

alerque commented Apr 8, 2023

Hm, is there any way you can post an MWE to a new issue for that? It's possible we have a regression since the last release, in which case it would be nice to get it fixed before a new release goes out (which should be soonish) and a test case ind hand so it doesn't happen again.

@alerque
Copy link
Member

alerque commented Apr 10, 2023

@CatholicPenguin You can run your --HEAD installation again, both the ToC and dropcaps issues should be fixed there now.

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

No branches or pull requests

3 participants