diff --git a/doc/lib/BackRestDoc/Latex/DocLatexSection.pm b/doc/lib/BackRestDoc/Latex/DocLatexSection.pm index b3a3ebe76..5c4d9fcad 100644 --- a/doc/lib/BackRestDoc/Latex/DocLatexSection.pm +++ b/doc/lib/BackRestDoc/Latex/DocLatexSection.pm @@ -115,12 +115,22 @@ sub sectionProcess &log(INFO, (' ' x ($iDepth + 1)) . 'process section: ' . $oSection->paramGet('path')); } - # Create the section + # Create section type my $strSectionTitle = $self->processText($oSection->nodeGet('title')->textGet()); $strSection .= (defined($strSection) ? ', ' : '') . "'${strSectionTitle}' " . ('Sub' x ($iDepth - 1)) . "Section"; + # Create section comment my $strLatex = - "% ${strSection}\n% " . ('-' x 130) . "\n\\"; + "% ${strSection}\n% " . ('-' x 130) . "\n"; + + # Exclude from table of contents if requested + if ($iDepth <= 3 && $oSection->paramTest('toc', 'n')) + { + $strLatex .= '\\addtocontents{toc}{\\protect\\setcounter{tocdepth}{' . ($iDepth - 1) . "}}\n"; + } + + # Create section name + $strLatex .= '\\'; if ($iDepth <= 3) { @@ -137,6 +147,12 @@ sub sectionProcess $strLatex .= "\{${strSectionTitle}\}\\label{" . $oSection->paramGet('path', false) . "}\n"; + # Reset table of contents numbering if the section was excluded + if ($iDepth <= 3 && $oSection->paramTest('toc', 'n')) + { + $strLatex .= '\\addtocontents{toc}{\\protect\\setcounter{tocdepth}{' . $iDepth . "}}\n"; + } + foreach my $oChild ($oSection->nodeList()) { &log(DEBUG, (' ' x ($iDepth + 2)) . 'process child ' . $oChild->nameGet()); diff --git a/doc/xml/dtd/doc.dtd b/doc/xml/dtd/doc.dtd index 78a2da09a..08e1ca009 100644 --- a/doc/xml/dtd/doc.dtd +++ b/doc/xml/dtd/doc.dtd @@ -118,6 +118,7 @@ + diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 971695582..d69608df0 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -170,7 +170,7 @@ -

PDF rendering improvements. Check both doc-path and bin-path for logo. Allow PDF to be output to a location other than the output directory. Use PDF-specific version variable for more flexible formatting.

+

PDF rendering improvements. Check both doc-path and bin-path for logo. Allow PDF to be output to a location other than the output directory. Use PDF-specific version variable for more flexible formatting. Allow sections to be excluded from table of contents.