All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] conf.py: Improve TOC and Outline depth in PDF output
@ 2020-11-13  9:54 Paul Barker
  2020-11-13 10:14 ` Nicolas Dechesne
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Barker @ 2020-11-13  9:54 UTC (permalink / raw)
  To: docs, Nicolas Dechesne; +Cc: Paul Barker

The default PDF output shows only chapter headings in the table of
contents and in the outline (aka PDF bookmarks). We should override
these defaults to set something more suitable.

With a depth of 2 for the TOC we see both section and subsection
headings which is enough to get the list of classes in the reference
manual and the list of topics under "Common Tasks" in the development
manual. Going to a deeper level would make the TOC unwieldy but we do
want to make sure we can navigate more precisely using the outline
(commonly shown in a left tab in PDF viewers) so we set the depth to 5
for the outline.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
---
 documentation/conf.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/documentation/conf.py b/documentation/conf.py
index 9a0186f35..a8df6e8f8 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -124,3 +124,8 @@ html_last_updated_fmt = '%b %d, %Y'
 
 # Remove the trailing 'dot' in section numbers
 html_secnumber_suffix = " "
+
+latex_elements = {
+    'passoptionstopackages': '\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
+    'preamble': '\setcounter{tocdepth}{2}',
+}
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] conf.py: Improve TOC and Outline depth in PDF output
  2020-11-13  9:54 [PATCH] conf.py: Improve TOC and Outline depth in PDF output Paul Barker
@ 2020-11-13 10:14 ` Nicolas Dechesne
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Dechesne @ 2020-11-13 10:14 UTC (permalink / raw)
  To: Paul Barker; +Cc: YP docs mailing list

On Fri, Nov 13, 2020 at 10:54 AM Paul Barker <pbarker@konsulko.com> wrote:
>
> The default PDF output shows only chapter headings in the table of
> contents and in the outline (aka PDF bookmarks). We should override
> these defaults to set something more suitable.
>
> With a depth of 2 for the TOC we see both section and subsection
> headings which is enough to get the list of classes in the reference
> manual and the list of topics under "Common Tasks" in the development
> manual. Going to a deeper level would make the TOC unwieldy but we do
> want to make sure we can navigate more precisely using the outline
> (commonly shown in a left tab in PDF viewers) so we set the depth to 5
> for the outline.

thanks, it is indeed much better! I updated the file here so that
everyone can check it:
https://people.linaro.org/~nicolas.dechesne/theyoctoproject.pdf

>
> Signed-off-by: Paul Barker <pbarker@konsulko.com>
> ---
>  documentation/conf.py | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/documentation/conf.py b/documentation/conf.py
> index 9a0186f35..a8df6e8f8 100644
> --- a/documentation/conf.py
> +++ b/documentation/conf.py
> @@ -124,3 +124,8 @@ html_last_updated_fmt = '%b %d, %Y'
>
>  # Remove the trailing 'dot' in section numbers
>  html_secnumber_suffix = " "
> +
> +latex_elements = {
> +    'passoptionstopackages': '\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
> +    'preamble': '\setcounter{tocdepth}{2}',
> +}
> --
> 2.20.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-13 10:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  9:54 [PATCH] conf.py: Improve TOC and Outline depth in PDF output Paul Barker
2020-11-13 10:14 ` Nicolas Dechesne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.