-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[doc/PDF] improvements to TOC style of the PDF manual #43698
[doc/PDF] improvements to TOC style of the PDF manual #43698
Conversation
@fredrikekre Does this look good to you? |
Can this be incorporated in Documenter instead? |
It is definitely possible. But I doubt that this custom style will work for all documents that use Documenter. Documenter may provide a more flexible way to customize the preamble of a document. |
@fredrikekre Is adding this to Documenter significant effort? Since we have a PR that fixes known issues, would it be ok to merge this and then try to have Documenter implement these as convenient? Perhaps a Documenter issue should be opened up for necessary features. |
Some new idea function Documenter.Writers.LaTeXWriter.writeheader(io::IO, doc::Documenter.Documents.Document)
custom = joinpath(doc.user.root, doc.user.source, "assets", "custom.sty")
isfile(custom) ? cp(custom, "custom.sty"; force = true) : touch("custom.sty")
custom = joinpath(doc.user.root, doc.user.source, "assets", "preamble.tex")
isfile(custom) ? cp(custom, "preamble.tex"; force = true) : touch("preamble.tex") # TODO: Use the default preamble
preamble =
"""
\\newcommand{\\DocMainTitle}{$(doc.user.sitename)}
\\newcommand{\\DocVersion}{$(get(ENV, "TRAVIS_TAG", ""))}
\\newcommand{\\DocAuthors}{$(doc.user.authors)}
% ---- Insert custom preamble
\\input{preamble.tex}
"""
_println(io, preamble)
end This short I'll clean up the |
@ViralBShah Do we need a CI for building PDF? Something like: docs.julialang.org/PDFs.yml Note: If we turn off code highlighting and then build the PDF, we can save about 90% of build time.
|
I mean, since this PR just overrides functions in Documenter, why not move the overrides there? |
Yes, this pr overrides the Documenter function, mainly to make some changes to TOC style. What this pr actually does is customize the TeX document style generated by Documenter. Maybe this pr can be merged into Documenter, but not all customization changes are necessary to sync upstream. The main issues here are that Documenter does not currently provide a way to customize the preamble. |
I mean, it seems like these are improvements that would be useful for everyone building pdf docs with Documenter, no? |
I'm not sure, julia manual is a little bit special. The manual has so many chapters (116) that by showing only the chapter names, the TOC is as long as any other TOC that shows both chapter and section names. I also reduced the line spacing of the TOC to further reduce the length of the TOC. For me, the only thing worth porting upstream is "Increasing the spacing between chapter numbers and chapter names". Anyway, I opened new pr JuliaDocs/Documenter.jl#1750. |
Agreed that this shouldn't go for all documents, and, for what it's worth, I prefer the old style despite the extreme length. |
Because we're starting to distribute macOS tarballs as well, let's codesign them by default, when possible.
…ng#43270) Local workers now inherit the package environment of the main process, i.e. the active project, LOAD_PATH, and DEPOT_PATH. This behavior can be overridden by passing the new `env` keyword argument, or by passing `--project` in the `exeflags` keyword argument. Fixes JuliaLang#28781, and closes JuliaLang#42089.
Co-authored-by: Mosè Giordano <giordano@users.noreply.github.com>
Co-authored-by: Gerhard Aigner <aigner@trium.de> Co-authored-by: Jameson Nash <vtjnash@gmail.com>
…et (JuliaLang#44262) We collect the relocations (i.e. the GOT slots that is used in the code) for each target in `tgt.relocs`. Needing a relocation, however, does not imply that the function is cloned for this target within the group (It does mean that at least one target in the group has it cloned). The previous version would miss the relocation in this case. This was triggerred with the following cloning situation caller: clone_1 callee: clone_1, clone_1.clone_3 Since caller.clone_1 may call either callee.clone_1 or callee.clone_1.clone_3 a relocation for callee will be used and is required to be initialized. In addition to target 1, target 2 (and in fact target 3) within group 1 will also use caller.clone_1. However, since callee isn't cloned for target 2 the previous version wouldn't have saved this slot in the relocation array.
…ng#44341) Avoids hashing the input key for empty dictionaries. Inspired by rust-lang/hashbrown#305.
add note that UpperHessenberg was introduced in 1.3
Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
* improve str macro doc help * add string macro search result
* graphemes(s, m:n) substring slicing * variable naming * whoops * consolidate tests * empty-range test * note complexity * Update stdlib/Unicode/src/Unicode.jl Co-authored-by: Sebastian Stock <42280794+sostock@users.noreply.github.com> * news fix Co-authored-by: Sebastian Stock <42280794+sostock@users.noreply.github.com>
* Add radix sort
* Stricter tests in int.jl * More tests for coverage.
Put back a few lines that were removed by PR $42703 because they are required to successfully embed Julia with MSVC.
…g#44778) Thanks to JuliaLang#38180, the removed code seems to be dead because no finalizers should be used anymore to modify dictionaries (it was dangerous). Furthermore, it may help users to detect illegal concurrent writes, since it doesn't recurse and have new error message. There should be no, or even a positive, performance effect.
Note: this is the first build of the real upstream version 1.2.12 which was released a few days ago.
…ia into doc-pdf-toc+compact-style
It looks like I'll open a new pr. |
This pr will be replace by: (Merged) JuliaDocs/Documenter.jl#1750 + (Merged) JuliaDocs/Documenter.jl#1785 + JuliaDocs/Documenter.jl#1788 |
Override latex writeheader to use our custom preamble.
Changes:
xref: #35495
Output
14p v.s. 3p
Output PDF: doc-pdf-toc+compact-style+efac0d7794.pdf
fast PDF build
These changes affect only the TOC.
So you can compile only the TOC and ignore the rest of the document, which will speed up the compilation significantly!
Clone my en-toc branch, and build.