Skip to content

Commit f7c7929

Browse files
authored
A few PDF improvements (#1527)
Ref: #1342 1. Use the `oneside` option of the memoir class, which is better for reading on a screen and anything that isn't a bound book. 2. For now hardcode ToC depth to section. 3. Clear page after the title.
2 parents 6ad949c + 7ce10f2 commit f7c7929

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
* ![Enhancement][badge-enhancement] `doctest()` no longer throws an error if cleaning up the temporary directory fails for some reason. ([#1513][github-1513], [#1526][github-1526])
1212

13+
* ![Enhancement][badge-enhancement] Cosmetic improvements to the PDF output. ([#1342][github-1342], [#1527][github-1527])
14+
1315
* ![Bugfix][badge-bugfix] Script-type doctests that have an empty output section no longer crash Documenter. ([#1510][github-1510])
1416

1517
* ![Bugfix][badge-bugfix] When checking for authentication keys when deploying, Documenter now more appropriately checks if the environment variables are non-empty, rather than just whether they are defined. ([#1511][github-1511])
@@ -700,6 +702,7 @@
700702
[github-1337]: https://github.com/JuliaDocs/Documenter.jl/issues/1337
701703
[github-1338]: https://github.com/JuliaDocs/Documenter.jl/issues/1338
702704
[github-1339]: https://github.com/JuliaDocs/Documenter.jl/pull/1339
705+
[github-1342]: https://github.com/JuliaDocs/Documenter.jl/issues/1342
703706
[github-1344]: https://github.com/JuliaDocs/Documenter.jl/issues/1344
704707
[github-1345]: https://github.com/JuliaDocs/Documenter.jl/pull/1345
705708
[github-1349]: https://github.com/JuliaDocs/Documenter.jl/pull/1349
@@ -749,6 +752,7 @@
749752
[github-1519]: https://github.com/JuliaDocs/Documenter.jl/pull/1519
750753
[github-1520]: https://github.com/JuliaDocs/Documenter.jl/pull/1520
751754
[github-1526]: https://github.com/JuliaDocs/Documenter.jl/pull/1526
755+
[github-1527]: https://github.com/JuliaDocs/Documenter.jl/pull/1527
752756

753757
[julia-38079]: https://github.com/JuliaLang/julia/issues/38079
754758

src/Writers/LaTeXWriter.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,13 @@ function writeheader(io::IO, doc::Documents.Document)
214214
isfile(custom) ? cp(custom, "custom.sty"; force = true) : touch("custom.sty")
215215
preamble =
216216
"""
217-
\\documentclass{memoir}
217+
\\documentclass[oneside]{memoir}
218218
219219
\\usepackage{./documenter}
220220
\\usepackage{./custom}
221221
222+
\\settocdepth{section}
223+
222224
\\title{
223225
{\\HUGE $(doc.user.sitename)}\\\\
224226
{\\Large $(get(ENV, "TRAVIS_TAG", ""))}
@@ -229,6 +231,7 @@ function writeheader(io::IO, doc::Documents.Document)
229231
230232
\\frontmatter
231233
\\maketitle
234+
\\clearpage
232235
\\tableofcontents
233236
234237
\\mainmatter

0 commit comments

Comments
 (0)